ledgersmb/0000755000000000000000000000000012060044553011517 5ustar rootrootledgersmb/ps.pl0000755000000000000000000000016511577731667012530 0ustar rootroot#!/usr/bin/perl use FindBin; BEGIN { lib->import($FindBin::Bin) unless $ENV{mod_perl} } require "old-handler.pl"; ledgersmb/setup.pl0000755000000000000000000000016711647132134013226 0ustar rootroot#!/usr/bin/perl use FindBin; BEGIN { lib->import($FindBin::Bin) unless $ENV{mod_perl} } require 'lsmb-request.pl'; ledgersmb/sql/0000755000000000000000000000000012060044550012313 5ustar rootrootledgersmb/sql/upgrade/0000755000000000000000000000000012060044550013742 5ustar rootrootledgersmb/sql/upgrade/rc1-rc2.sql0000644000000000000000000000006211634752153015645 0ustar rootrootGRANT SELECT ON partsgroup_translation TO public; ledgersmb/sql/upgrade/1.2-pre-upgrade-checks.sql0000644000000000000000000000224611660006573020446 0ustar rootroot--tshvr use lsmb12 if 1.2 db public schema has already been renamed to lsmb12 SET search_path = lsmb12, public, pg_catalog; SELECT count(*), customernumber from customer GROUP BY customernumber HAVING count(*) > 1; SELECT count(*), vendornumber from vendor GROUP BY vendornumber HAVING count(*) > 1; SELECT * FROM chart where link LIKE '%CT_tax%'; SELECT * FROM employee where employeenumber IS NULL; SELECT * FROM employee WHERE employeenumber IN (SELECT employeenumber FROM employee GROUP BY employeenumber HAVING count(*) > 1); select partnumber, count(*) from parts WHERE obsolete is not true group by partnumber having count(*) > 1; SELECT invnumber, count(*) from ar group by invnumber having count(*) > 1; SELECT invnumber, count(*) from ap group by invnumber having count(*) > 1; SELECT trans_id,count(trans_id) FROM acc_trans where trans_id not in (select id from ap union select id from ar union select id from gl) group by trans_id; SELECT trans_id,count(trans_id) FROM invoice where trans_id not in (select id from ap union select id from ar union select id from gl) group by trans_id; select setting_key,value from defaults where setting_key='curr'; ledgersmb/sql/upgrade/1.2-1.3.sql0000644000000000000000000006161512047135177015306 0ustar rootroot--Setup -- When moved to an interface, these will all be specified and preprocessed. \set default_country '''''' \set ar '''''' \set ap '''''' BEGIN; -- adding mapping info for import. ALTER TABLE lsmb12.vendor ADD COLUMN entity_id int; ALTER TABLE lsmb12.vendor ADD COLUMN company_id int; ALTER TABLE lsmb12.vendor ADD COLUMN credit_id int; ALTER TABLE lsmb12.customer ADD COLUMN entity_id int; ALTER TABLE lsmb12.customer ADD COLUMN company_id int; ALTER TABLE lsmb12.customer ADD COLUMN credit_id int; --Accounts INSERT INTO account_heading(id, accno, description) SELECT id, accno, description FROM lsmb12.chart WHERE charttype = 'H'; SELECT account_save(id, accno, description, category, gifi_accno, NULL, contra, CASE WHEN link like '%tax%' THEN true ELSE false END, string_to_array(link,':')) FROM lsmb12.chart WHERE charttype = 'A'; --Entity INSERT INTO entity (name, control_code, entity_class, country_id) SELECT name, 'V-' || vendornumber, 1, (select id from country where lower(short_name) = lower(:default_country)) FROM lsmb12.vendor GROUP BY name, vendornumber; INSERT INTO entity (name, control_code, entity_class, country_id) SELECT name, 'C-' || customernumber, 2, (select id from country where lower(short_name) = lower(:default_country)) FROM lsmb12.customer GROUP BY name, customernumber; UPDATE lsmb12.vendor SET entity_id = (SELECT id FROM entity WHERE 'V-' || vendornumber = control_code); UPDATE lsmb12.customer SET entity_id = coalesce((SELECT min(id) FROM entity WHERE 'C-' || customernumber = control_code), entity_id); --Entity Credit Account INSERT INTO entity_credit_account (entity_id, meta_number, business_id, creditlimit, ar_ap_account_id, cash_account_id, startdate, enddate, threshold, entity_class) SELECT entity_id, vendornumber, business_id, creditlimit, (select id from account where accno = :ap), NULL, startdate, enddate, 0, 1 FROM lsmb12.vendor WHERE entity_id IS NOT NULL; UPDATE lsmb12.vendor SET credit_id = (SELECT id FROM entity_credit_account e WHERE e.meta_number = vendornumber and entity_class = 1 and e.entity_id = vendor.entity_id); INSERT INTO entity_credit_account (entity_id, meta_number, business_id, creditlimit, ar_ap_account_id, cash_account_id, startdate, enddate, threshold, entity_class) SELECT entity_id, customernumber, business_id, creditlimit, (select id from account where accno = :ar), NULL, startdate, enddate, 0, 2 FROM lsmb12.customer WHERE entity_id IS NOT NULL; UPDATE lsmb12.customer SET credit_id = (SELECT id FROM entity_credit_account e WHERE e.meta_number = customernumber AND customer.entity_id = e.entity_id and entity_class = 2); --Company INSERT INTO company (entity_id, legal_name, tax_id) SELECT entity_id, name, max(taxnumber) FROM lsmb12.vendor WHERE entity_id IS NOT NULL AND entity_id IN (select id from entity) GROUP BY entity_id, name; UPDATE lsmb12.vendor SET company_id = (select id from company c where entity_id = vendor.entity_id); INSERT INTO company (entity_id, legal_name, tax_id) SELECT entity_id, name, max(taxnumber) FROM lsmb12.customer WHERE entity_id IS NOT NULL AND entity_id IN (select id from entity) GROUP BY entity_id, name; UPDATE lsmb12.customer SET company_id = (select id from company c where entity_id = customer.entity_id); -- Contact insert into eca_to_contact (credit_id, contact_class_id, contact,description) select v.credit_id, 1, v.phone, 'Primary phone: '||max(v.contact) as description from lsmb12.vendor v where v.company_id is not null and v.phone is not null and v.phone ~ '[[:alnum:]_]'::text group by v.credit_id, v.phone UNION select v.credit_id, 12, v.email, 'email address: '||max(v.contact) as description from lsmb12.vendor v where v.company_id is not null and v.email is not null and v.email ~ '[[:alnum:]_]'::text group by v.credit_id, v.email UNION select v.credit_id, 13, v.cc, 'Carbon Copy email address' as description from lsmb12.vendor v where v.company_id is not null and v.cc is not null and v.cc ~ '[[:alnum:]_]'::text group by v.credit_id, v.cc UNION select v.credit_id, 14, v.bcc, 'Blind Carbon Copy email address' as description from lsmb12.vendor v where v.company_id is not null and v.bcc is not null and v.bcc ~ '[[:alnum:]_]'::text group by v.credit_id, v.bcc UNION select v.credit_id, 9, v.fax, 'Fax number' as description from lsmb12.vendor v where v.company_id is not null and v.fax is not null and v.fax ~ '[[:alnum:]_]'::text group by v.credit_id, v.fax; insert into eca_to_contact (credit_id, contact_class_id, contact,description) select v.credit_id, 1, v.phone, 'Primary phone: '||max(v.contact) as description from lsmb12.customer v where v.company_id is not null and v.phone is not null and v.phone ~ '[[:alnum:]_]'::text group by v.credit_id, v.phone UNION select v.credit_id, 12, v.email, 'email address: '||max(v.contact) as description from lsmb12.customer v where v.company_id is not null and v.email is not null and v.email ~ '[[:alnum:]_]'::text group by v.credit_id, v.email UNION select v.credit_id, 13, v.cc, 'Carbon Copy email address' as description from lsmb12.customer v where v.company_id is not null and v.cc is not null and v.cc ~ '[[:alnum:]_]'::text group by v.credit_id, v.cc UNION select v.credit_id, 14, v.bcc, 'Blind Carbon Copy email address' as description from lsmb12.customer v where v.company_id is not null and v.bcc is not null and v.bcc ~ '[[:alnum:]_]'::text group by v.credit_id, v.bcc UNION select v.credit_id, 9, v.fax, 'Fax number' as description from lsmb12.customer v where v.company_id is not null and v.fax is not null and v.fax ~ '[[:alnum:]_]'::text group by v.credit_id, v.fax; -- addresses INSERT INTO public.country (id, name, short_name) VALUES (-1, 'Invalid Country', 'XX'); INSERT INTO eca_to_location(credit_id, location_class, location_id) SELECT eca.id, 1, min(location_save(NULL, case when oa.address1 = '' then 'Null' when oa.address1 is null then 'Null' else oa.address1 end, oa.address2, NULL, case when oa.city !~ '[[:alnum:]_]' then 'Invalid' when oa.city is null then 'Null' else oa.city end, case when oa.state !~ '[[:alnum:]_]' then 'Invalid' when oa.state is null then 'Null' else oa.state end, case when oa.zipcode !~ '[[:alnum:]_]' then 'Invalid' when oa.zipcode is null then 'Null' else oa.zipcode end, coalesce(c.id, -1) )) FROM country c RIGHT OUTER JOIN lsmb12.vendor oa ON lower(trim(both ' ' from c.name)) = lower( trim(both ' ' from oa.country)) OR lower(trim(both ' ' from c.short_name)) = lower( trim(both ' ' from oa.country)) JOIN entity_credit_account eca ON (oa.credit_id = eca.id) GROUP BY eca.id; INSERT INTO eca_to_location(credit_id, location_class, location_id) SELECT eca.id, 1, min(location_save(NULL, case when oa.address1 = '' then 'Null' when oa.address1 is null then 'Null' else oa.address1 end, oa.address2, NULL, case when oa.city !~ '[[:alnum:]_]' then 'Invalid' when oa.city is null then 'Null' else oa.city end, case when oa.state !~ '[[:alnum:]_]' then 'Invalid' when oa.state is null then 'Null' else oa.state end, case when oa.zipcode !~ '[[:alnum:]_]' then 'Invalid' when oa.zipcode is null then 'Null' else oa.zipcode end, coalesce(c.id, -1) )) FROM country c RIGHT OUTER JOIN lsmb12.customer oa ON lower(trim(both ' ' from c.name)) = lower( trim(both ' ' from oa.country)) OR lower(trim(both ' ' from c.short_name)) = lower( trim(both ' ' from oa.country)) JOIN entity_credit_account eca ON (oa.credit_id = eca.id) GROUP BY eca.id; -- Shipto INSERT INTO eca_to_location(credit_id, location_class, location_id) SELECT eca.id, 2, min(location_save(NULL, case when oa.shiptoaddress1 = '' then 'Null' when oa.shiptoaddress1 is null then 'Null' else oa.shiptoaddress1 end, oa.shiptoaddress2, NULL, case when oa.shiptocity !~ '[[:alnum:]_]' then 'Invalid' when oa.shiptocity is null then 'Null' else oa.shiptocity end, case when oa.shiptostate !~ '[[:alnum:]_]' then 'Invalid' when oa.shiptostate is null then 'Null' else oa.shiptostate end, case when oa.shiptozipcode !~ '[[:alnum:]_]' then 'Invalid' when oa.shiptozipcode is null then 'Null' else oa.shiptozipcode end, coalesce(c.id, -1) )) FROM country c RIGHT OUTER JOIN lsmb12.shipto oa ON lower(trim(both ' ' from c.name)) = lower( trim(both ' ' from oa.shiptocountry)) OR lower(trim(both ' ' from c.short_name)) = lower( trim(both ' ' from oa.shiptocountry)) JOIN lsmb12.vendor ov ON (oa.trans_id = ov.id) JOIN entity_credit_account eca ON (ov.credit_id = eca.id) GROUP BY eca.id; INSERT INTO eca_to_location(credit_id, location_class, location_id) SELECT eca.id, 2, min(location_save(NULL, case when oa.shiptoaddress1 = '' then 'Null' when oa.shiptoaddress1 is null then 'Null' else oa.shiptoaddress1 end, oa.shiptoaddress2, NULL, case when oa.shiptocity !~ '[[:alnum:]_]' then 'Invalid' when oa.shiptocity is null then 'Null' else oa.shiptocity end, case when oa.shiptostate !~ '[[:alnum:]_]' then 'Invalid' when oa.shiptostate is null then 'Null' else oa.shiptostate end, case when oa.shiptozipcode !~ '[[:alnum:]_]' then 'Invalid' when oa.shiptozipcode is null then 'Null' else oa.shiptozipcode end, coalesce(c.id, -1) )) FROM country c RIGHT OUTER JOIN lsmb12.shipto oa ON lower(trim(both ' ' from c.name)) = lower( trim(both ' ' from oa.shiptocountry)) OR lower(trim(both ' ' from c.short_name)) = lower( trim(both ' ' from oa.shiptocountry)) JOIN lsmb12.customer ov ON (oa.trans_id = ov.id) JOIN entity_credit_account eca ON (ov.credit_id = eca.id) GROUP BY eca.id; INSERT INTO eca_note(note_class, ref_key, note, vector) SELECT 3, credit_id, notes, '' FROM lsmb12.vendor WHERE notes IS NOT NULL AND credit_id IS NOT NULL; INSERT INTO eca_note(note_class, ref_key, note, vector) SELECT 3, credit_id, notes, '' FROM lsmb12.customer WHERE notes IS NOT NULL AND credit_id IS NOT NULL; UPDATE entity SET country_id = (select country_id FROM location l JOIN eca_to_location e2l ON l.id = e2l.location_id AND e2l.location_class = 1 JOIN entity_credit_account eca ON e2l.credit_id = eca.id WHERE eca.entity_id = entity_id AND l.country_id > -1 LIMIT 1) WHERE id IN (select eca.entity_id FROM location l JOIN eca_to_location e2l ON l.id = e2l.location_id AND e2l.location_class = 1 JOIN entity_credit_account eca ON e2l.credit_id = eca.id WHERE eca.entity_id = entity_id aND l.country_id > -1); INSERT INTO pricegroup SELECT * FROM lsmb12.pricegroup; ALTER TABLE lsmb12.employee ADD entity_id int; INSERT INTO entity(control_code, entity_class, name, country_id) select 'E-' || employeenumber, 3, name, (select id from country where lower(short_name) = lower(:default_country)) FROM lsmb12.employee; UPDATE lsmb12.employee set entity_id = (select id from entity where 'E-'||employeenumber = control_code); INSERT INTO person (first_name, last_name, entity_id) select name, name, entity_id FROM lsmb12.employee; INSERT INTO users (entity_id, username) SELECT entity_id, login FROM lsmb12.employee em WHERE login IS NOT NULL; INSERT INTO entity_employee(entity_id, startdate, enddate, role, ssn, sales, employeenumber, dob, manager_id) SELECT entity_id, startdate, enddate, role, ssn, sales, employeenumber, dob, (select entity_id from lsmb12.employee where id = em.managerid) FROM lsmb12.employee em; -- must rebuild this table due to changes since 1.2 -- needed to handle null values UPDATE lsmb12.makemodel set model = '' where model is null; INSERT INTO makemodel SELECT * FROM lsmb12.makemodel; INSERT INTO gifi SELECT * FROM lsmb12.gifi; UPDATE defaults SET value = (select value from lsmb12.defaults src WHERE src.setting_key = defaults.setting_key) WHERE setting_key IN (select setting_key FROM lsmb12.defaults); INSERT INTO parts SELECT * FROM lsmb12.parts; INSERT INTO assembly SELECT * FROM lsmb12.assembly; ALTER TABLE gl DISABLE TRIGGER gl_audit_trail; INSERT INTO gl(id, reference, description, transdate, person_id, notes, department_id) SELECT gl.id, reference, description, transdate, p.id, gl.notes, department_id FROM lsmb12.gl LEFT JOIN lsmb12.employee em ON gl.employee_id = em.id LEFT JOIN person p ON em.entity_id = p.id; ALTER TABLE gl ENABLE TRIGGER gl_audit_trail; ALTER TABLE ar DISABLE TRIGGER ar_audit_trail; INSERT INTO ar(id, invnumber, transdate, taxincluded, amount, netamount, paid, datepaid, duedate, invoice, shippingpoint, terms, notes, curr, ordnumber, person_id, till, quonumber, intnotes, department_id, shipvia, language_code, ponumber, entity_credit_account) SELECT ar.id, invnumber, transdate, ar.taxincluded, amount, netamount, paid, datepaid, duedate, invoice, shippingpoint, ar.terms, ar.notes, ar.curr, ordnumber, em.entity_id, till, quonumber, intnotes, department_id, shipvia, ar.language_code, ponumber, credit_id FROM lsmb12.ar JOIN lsmb12.customer c ON c.id = ar.customer_id LEFT JOIN lsmb12.employee em ON em.id = ar.employee_id; ALTER TABLE ar ENABLE TRIGGER ar_audit_trail; ALTER TABLE ap DISABLE TRIGGER ap_audit_trail; INSERT INTO ap(id, invnumber, transdate, taxincluded, amount, netamount, paid, datepaid, duedate, invoice, shippingpoint, terms, notes, curr, ordnumber, person_id, till, quonumber, intnotes, department_id, shipvia, language_code, ponumber, entity_credit_account) SELECT ap.id, invnumber, transdate, ap.taxincluded, amount, netamount, paid, datepaid, duedate, invoice, shippingpoint, ap.terms, ap.notes, ap.curr, ordnumber, em.entity_id, till, quonumber, intnotes, department_id, shipvia, ap.language_code, ponumber, credit_id FROM lsmb12.ap JOIN lsmb12.vendor c ON c.id = ap.vendor_id LEFT JOIN lsmb12.employee em ON em.id = ap.employee_id; ALTER TABLE ap ENABLE TRIGGER ap_audit_trail; INSERT INTO acc_trans(trans_id, chart_id, amount, transdate, source, cleared, fx_transaction, project_id, memo, invoice_id, entry_id) SELECT trans_id, a.id, amount, transdate, source, cleared, fx_transaction, project_id, memo, invoice_id, entry_id FROM lsmb12.acc_trans JOIN lsmb12.chart ON acc_trans.chart_id = chart.id JOIN account a ON chart.accno = a.accno; INSERT INTO invoice (id, trans_id, parts_id, description, qty, allocated, sellprice, fxsellprice, discount, assemblyitem, unit, project_id, deliverydate, serialnumber, notes) SELECT id, trans_id, parts_id, description, qty, allocated, sellprice, fxsellprice, discount, assemblyitem, unit, project_id, deliverydate, serialnumber, notes FROM lsmb12.invoice; INSERT INTO partstax (parts_id, chart_id) SELECT parts_id, a.id FROM lsmb12.partstax pt JOIN lsmb12.chart ON chart.id = pt.chart_id JOIN account a ON chart.accno = a.accno; INSERT INTO tax(chart_id, rate, taxnumber, validto, pass, taxmodule_id) SELECT a.id, t.rate, t.taxnumber, coalesce(t.validto::timestamp, 'infinity'), pass, taxmodule_id FROM lsmb12.tax t JOIN lsmb12.chart c ON (t.chart_id = c.id) JOIN account a ON (a.accno = c.accno); INSERT INTO customertax (customer_id, chart_id) SELECT c.credit_id, a.id FROM lsmb12.customertax pt JOIN lsmb12.customer c ON (pt.customer_id = c.id) JOIN lsmb12.chart ON chart.id = pt.chart_id JOIN account a ON chart.accno = a.accno; INSERT INTO vendortax (vendor_id, chart_id) SELECT c.credit_id, a.id FROM lsmb12.vendortax pt JOIN lsmb12.vendor c ON (pt.vendor_id = c.id) JOIN lsmb12.chart ON chart.id = pt.chart_id JOIN account a ON chart.accno = a.accno; INSERT INTO oe(id, ordnumber, transdate, amount, netamount, reqdate, taxincluded, shippingpoint, notes, curr, person_id, closed, quotation, quonumber, intnotes, department_id, shipvia, language_code, ponumber, terms, entity_credit_account, oe_class_id) SELECT oe.id, ordnumber, transdate, amount, netamount, reqdate, oe.taxincluded, shippingpoint, oe.notes, oe.curr, p.id, closed, quotation, quonumber, intnotes, department_id, shipvia, oe.language_code, ponumber, oe.terms, coalesce(c.credit_id, v.credit_id), case when c.id is not null and quotation is not true THEN 1 WHEN v.id is not null and quotation is not true THEN 2 when c.id is not null and quotation is true THEN 3 WHEN v.id is not null and quotation is true THEN 4 end FROM lsmb12.oe LEFT JOIN lsmb12.customer c ON c.id = oe.customer_id LEFT JOIN lsmb12.vendor v ON v.id = oe.vendor_id LEFT JOIN lsmb12.employee e ON oe.employee_id = e.id LEFT JOIN person p ON e.entity_id = p.id; INSERT INTO orderitems(id, trans_id, parts_id, description, qty, sellprice, discount, unit, project_id, reqdate, ship, serialnumber, notes) SELECT id, trans_id, parts_id, description, qty, sellprice, discount, unit, project_id, reqdate, ship, serialnumber, notes FROM lsmb12.orderitems; INSERT INTO exchangerate select * from lsmb12.exchangerate; INSERT INTO project (id, projectnumber, description, startdate, enddate, parts_id, production, completed, credit_id) SELECT p.id, projectnumber, description, p.startdate, p.enddate, parts_id, production, completed, c.credit_id FROM lsmb12.project p JOIN lsmb12.customer c ON p.customer_id = c.id; INSERT INTO partsgroup SELECT * FROM lsmb12.partsgroup; INSERT INTO status SELECT * FROM lsmb12.status; INSERT INTO department SELECT * FROM lsmb12.department; INSERT INTO business SELECT * FROM lsmb12.business; INSERT INTO sic SELECT * FROM lsmb12.sic; INSERT INTO warehouse SELECT * FROM lsmb12.warehouse; INSERT INTO inventory(entity_id, warehouse_id, parts_id, trans_id, orderitems_id, qty, shippingdate, entry_id) SELECT e.entity_id, warehouse_id, parts_id, trans_id, orderitems_id, qty, shippingdate, i.entry_id FROM lsmb12.inventory i JOIN lsmb12.employee e ON i.employee_id = e.id; INSERT INTO yearend (trans_id, transdate) SELECT * FROM lsmb12.yearend; INSERT INTO partsvendor(credit_id, parts_id, partnumber, leadtime, lastcost, curr, entry_id) SELECT v.credit_id, parts_id, partnumber, leadtime, lastcost, pv.curr, entry_id FROM lsmb12.partsvendor pv JOIN lsmb12.vendor v ON v.id = pv.vendor_id; INSERT INTO partscustomer(parts_id, credit_id, pricegroup_id, pricebreak, sellprice, validfrom, validto, curr, entry_id) SELECT parts_id, credit_id, pv.pricegroup_id, pricebreak, sellprice, validfrom, validto, pv.curr, entry_id FROM lsmb12.partscustomer pv JOIN lsmb12.customer v ON v.id = pv.customer_id; INSERT INTO language SELECT * FROM lsmb12.language; INSERT INTO audittrail(trans_id, tablename, reference, formname, action, transdate, person_id, entry_id) SELECT trans_id, tablename, reference, formname, action, transdate, p.entity_id, entry_id FROM lsmb12.audittrail a JOIN lsmb12.employee e ON a.employee_id = e.id JOIN person p on e.entity_id = p.entity_id; INSERT INTO user_preference(id) SELECT id from users; INSERT INTO recurring SELECT * FROM lsmb12.recurring; INSERT INTO recurringemail SELECT * FROM lsmb12.recurringemail; INSERT INTO recurringprint SELECT * FROM lsmb12.recurringprint; INSERT INTO jcitems(id, project_id, parts_id, description, qty, allocated, sellprice, fxsellprice, serialnumber, checkedin, checkedout, person_id, notes) SELECT j.id, project_id, parts_id, description, qty, allocated, sellprice, fxsellprice, serialnumber, checkedin, checkedout, p.id, j.notes FROM lsmb12.jcitems j JOIN lsmb12.employee e ON j.employee_id = e.id JOIN person p ON e.entity_id = p.entity_id; INSERT INTO custom_table_catalog SELECT * FROM lsmb12. custom_table_catalog; INSERT INTO custom_field_catalog SELECT * FROM lsmb12. custom_field_catalog; INSERT INTO parts_translation SELECT * FROM lsmb12.translation where trans_id in (select id from parts); INSERT INTO partsgroup_translation SELECT * FROM lsmb12.translation where trans_id in (select id from partsgroup); INSERT INTO project_translation SELECT * FROM lsmb12.translation where trans_id in (select id from project); SELECT setval('id', max(id)) FROM transactions; SELECT setval('acc_trans_entry_id_seq', max(entry_id)) FROM acc_trans; SELECT setval('partsvendor_entry_id_seq', max(entry_id)) FROM partsvendor; SELECT setval('inventory_entry_id_seq', max(entry_id)) FROM inventory; SELECT setval('partscustomer_entry_id_seq', max(entry_id)) FROM partscustomer; SELECT setval('audittrail_entry_id_seq', max(entry_id)) FROM audittrail; SELECT setval('account_id_seq', max(id)) FROM account; SELECT setval('account_heading_id_seq', max(id)) FROM account_heading; SELECT setval('account_checkpoint_id_seq', max(id)) FROM account_checkpoint; SELECT setval('pricegroup_id_seq', max(id)) FROM pricegroup; SELECT setval('country_id_seq', max(id)) FROM country; SELECT setval('country_tax_form_id_seq', max(id)) FROM country_tax_form; SELECT setval('asset_dep_method_id_seq', max(id)) FROM asset_dep_method; SELECT setval('asset_class_id_seq', max(id)) FROM asset_class; SELECT setval('entity_class_id_seq', max(id)) FROM entity_class; SELECT setval('asset_item_id_seq', max(id)) FROM asset_item; SELECT setval('asset_disposal_method_id_seq', max(id)) FROM asset_disposal_method; SELECT setval('users_id_seq', max(id)) FROM users; SELECT setval('entity_id_seq', max(id)) FROM entity; SELECT setval('company_id_seq', max(id)) FROM company; SELECT setval('location_id_seq', max(id)) FROM location; SELECT setval('open_forms_id_seq', max(id)) FROM open_forms; SELECT setval('location_class_id_seq', max(id)) FROM location_class; SELECT setval('asset_report_id_seq', max(id)) FROM asset_report; SELECT setval('salutation_id_seq', max(id)) FROM salutation; SELECT setval('person_id_seq', max(id)) FROM person; SELECT setval('contact_class_id_seq', max(id)) FROM contact_class; SELECT setval('entity_credit_account_id_seq', max(id)) FROM entity_credit_account; SELECT setval('entity_bank_account_id_seq', max(id)) FROM entity_bank_account; SELECT setval('note_class_id_seq', max(id)) FROM note_class; SELECT setval('note_id_seq', max(id)) FROM note; SELECT setval('batch_class_id_seq', max(id)) FROM batch_class; SELECT setval('batch_id_seq', max(id)) FROM batch; SELECT setval('invoice_id_seq', max(id)) FROM invoice; SELECT setval('voucher_id_seq', max(id)) FROM voucher; SELECT setval('parts_id_seq', max(id)) FROM parts; SELECT setval('taxmodule_taxmodule_id_seq', max(taxmodule_id)) FROM taxmodule; SELECT setval('taxcategory_taxcategory_id_seq', max(taxcategory_id)) FROM taxcategory; SELECT setval('oe_id_seq', max(id)) FROM oe; SELECT setval('orderitems_id_seq', max(id)) FROM orderitems; SELECT setval('business_id_seq', max(id)) FROM business; SELECT setval('warehouse_id_seq', max(id)) FROM warehouse; SELECT setval('partsgroup_id_seq', max(id)) FROM partsgroup; SELECT setval('project_id_seq', max(id)) FROM project; SELECT setval('department_id_seq', max(id)) FROM department; SELECT setval('jcitems_id_seq', max(id)) FROM jcitems; SELECT setval('payment_type_id_seq', max(id)) FROM payment_type; SELECT setval('custom_table_catalog_table_id_seq', max(table_id)) FROM custom_table_catalog; SELECT setval('custom_field_catalog_field_id_seq', max(field_id)) FROM custom_field_catalog; SELECT setval('menu_node_id_seq', max(id)) FROM menu_node; SELECT setval('menu_attribute_id_seq', max(id)) FROM menu_attribute; SELECT setval('menu_acl_id_seq', max(id)) FROM menu_acl; SELECT setval('pending_job_id_seq', max(id)) FROM pending_job; SELECT setval('new_shipto_id_seq', max(id)) FROM new_shipto; SELECT setval('payment_id_seq', max(id)) FROM payment; SELECT setval('cr_report_id_seq', max(id)) FROM cr_report; SELECT setval('cr_report_line_id_seq', max(id)) FROM cr_report_line; UPDATE defaults SET value = '1.3.0' WHERE setting_key = 'version'; COMMIT; --TODO: Translation migratiion. Partsgroups? -- TODO: User/password Migration ledgersmb/sql/upgrade/1.2-1.3-manual.sql0000644000000000000000000006256612027277654016574 0ustar rootroot--Setup -- When moved to an interface, these will all be specified and preprocessed. \set lsmbdir `pwd` \set contribdir '/usr/share/pgsql/contrib' \set default_country '''us''' \set ar '''1200''' \set ap '''2100''' -- This will be moved out of this part. ALTER SCHEMA public RENAME TO lsmb12; CREATE SCHEMA public; \cd :contribdir \i pg_trgm.sql \i tsearch2.sql \i tablefunc.sql \cd :lsmbdir -- Full module load should be part of upgrade wizard, at this stage. \i sql/Pg-database.sql \i sql/modules/Setting.sql \i sql/modules/Location.sql \i sql/modules/Account.sql \i sql/modules/Payment.sql \i sql/modules/Person.sql \i sql/modules/Reconciliation.sql BEGIN; -- adding mapping info for import. ALTER TABLE lsmb12.vendor ADD COLUMN entity_id int; ALTER TABLE lsmb12.vendor ADD COLUMN company_id int; ALTER TABLE lsmb12.vendor ADD COLUMN credit_id int; ALTER TABLE lsmb12.customer ADD COLUMN entity_id int; ALTER TABLE lsmb12.customer ADD COLUMN company_id int; ALTER TABLE lsmb12.customer ADD COLUMN credit_id int; --Accounts INSERT INTO account_heading(id, accno, description) SELECT id, accno, description FROM lsmb12.chart WHERE charttype = 'H'; SELECT account_save(id, accno, description, category, gifi_accno, NULL, contra, CASE WHEN link like '%tax%' THEN true ELSE false END, string_to_array(link,':')) FROM lsmb12.chart WHERE charttype = 'A'; --Entity INSERT INTO entity (name, control_code, entity_class, country_id) SELECT name, 'V-' || vendornumber, 1, (select id from country where lower(short_name) = :default_country) FROM lsmb12.vendor GROUP BY name, vendornumber; INSERT INTO entity (name, control_code, entity_class, country_id) SELECT name, 'C-' || customernumber, 2, (select id from country where lower(short_name) = :default_country) FROM lsmb12.customer GROUP BY name, customernumber; UPDATE lsmb12.vendor SET entity_id = (SELECT id FROM entity WHERE 'V-' || vendornumber = control_code); UPDATE lsmb12.customer SET entity_id = coalesce((SELECT min(id) FROM entity WHERE 'C-' || customernumber = control_code), entity_id); --Entity Credit Account INSERT INTO entity_credit_account (entity_id, meta_number, business_id, creditlimit, ar_ap_account_id, cash_account_id, startdate, enddate, threshold, entity_class) SELECT entity_id, vendornumber, business_id, creditlimit, (select id from account where accno = :ap), NULL, startdate, enddate, 0, 1 FROM lsmb12.vendor WHERE entity_id IS NOT NULL; UPDATE lsmb12.vendor SET credit_id = (SELECT id FROM entity_credit_account e WHERE e.meta_number = vendornumber and entity_class = 1 and e.entity_id = vendor.entity_id); INSERT INTO entity_credit_account (entity_id, meta_number, business_id, creditlimit, ar_ap_account_id, cash_account_id, startdate, enddate, threshold, entity_class) SELECT entity_id, customernumber, business_id, creditlimit, (select id from account where accno = :ar), NULL, startdate, enddate, 0, 2 FROM lsmb12.customer WHERE entity_id IS NOT NULL; UPDATE lsmb12.customer SET credit_id = (SELECT id FROM entity_credit_account e WHERE e.meta_number = customernumber AND customer.entity_id = e.entity_id and entity_class = 2); --Company INSERT INTO company (entity_id, legal_name, tax_id) SELECT entity_id, name, max(taxnumber) FROM lsmb12.vendor WHERE entity_id IS NOT NULL AND entity_id IN (select id from entity) GROUP BY entity_id, name; UPDATE lsmb12.vendor SET company_id = (select id from company c where entity_id = vendor.entity_id); INSERT INTO company (entity_id, legal_name, tax_id) SELECT entity_id, name, max(taxnumber) FROM lsmb12.customer WHERE entity_id IS NOT NULL AND entity_id IN (select id from entity) GROUP BY entity_id, name; UPDATE lsmb12.customer SET company_id = (select id from company c where entity_id = customer.entity_id); -- Contact insert into eca_to_contact (credit_id, contact_class_id, contact,description) select v.credit_id, 1, v.phone, 'Primary phone: '||max(v.contact) as description from lsmb12.vendor v where v.company_id is not null and v.phone is not null and v.phone ~ '[[:alnum:]_]'::text group by v.credit_id, v.phone UNION select v.credit_id, 12, v.email, 'email address: '||max(v.contact) as description from lsmb12.vendor v where v.company_id is not null and v.email is not null and v.email ~ '[[:alnum:]_]'::text group by v.credit_id, v.email UNION select v.credit_id, 13, v.cc, 'Carbon Copy email address' as description from lsmb12.vendor v where v.company_id is not null and v.cc is not null and v.cc ~ '[[:alnum:]_]'::text group by v.credit_id, v.cc UNION select v.credit_id, 14, v.bcc, 'Blind Carbon Copy email address' as description from lsmb12.vendor v where v.company_id is not null and v.bcc is not null and v.bcc ~ '[[:alnum:]_]'::text group by v.credit_id, v.bcc UNION select v.credit_id, 9, v.fax, 'Fax number' as description from lsmb12.vendor v where v.company_id is not null and v.fax is not null and v.fax ~ '[[:alnum:]_]'::text group by v.credit_id, v.fax; insert into eca_to_contact (credit_id, contact_class_id, contact,description) select v.credit_id, 1, v.phone, 'Primary phone: '||max(v.contact) as description from lsmb12.customer v where v.company_id is not null and v.phone is not null and v.phone ~ '[[:alnum:]_]'::text group by v.credit_id, v.phone UNION select v.credit_id, 12, v.email, 'email address: '||max(v.contact) as description from lsmb12.customer v where v.company_id is not null and v.email is not null and v.email ~ '[[:alnum:]_]'::text group by v.credit_id, v.email UNION select v.credit_id, 13, v.cc, 'Carbon Copy email address' as description from lsmb12.customer v where v.company_id is not null and v.cc is not null and v.cc ~ '[[:alnum:]_]'::text group by v.credit_id, v.cc UNION select v.credit_id, 14, v.bcc, 'Blind Carbon Copy email address' as description from lsmb12.customer v where v.company_id is not null and v.bcc is not null and v.bcc ~ '[[:alnum:]_]'::text group by v.credit_id, v.bcc UNION select v.credit_id, 9, v.fax, 'Fax number' as description from lsmb12.customer v where v.company_id is not null and v.fax is not null and v.fax ~ '[[:alnum:]_]'::text group by v.credit_id, v.fax; -- addresses INSERT INTO public.country (id, name, short_name) VALUES (-1, 'Invalid Country', 'XX'); --tshvr address1 constraint "location_line_one_check" INSERT INTO eca_to_location(credit_id, location_class, location_id) SELECT eca.id, 1, min(location_save(NULL, case when oa.address1 is null then 'Null' when trim(oa.address1) = '' then 'Null' when oa.address1 !~ '[[:alnum:]_]' then 'Invalid' else oa.address1 end, oa.address2, NULL, case when oa.city !~ '[[:alnum:]_]' then 'Invalid' when oa.city is null then 'Null' else oa.city end, case when oa.state !~ '[[:alnum:]_]' then 'Invalid' when oa.state is null then 'Null' else oa.state end, case when oa.zipcode !~ '[[:alnum:]_]' then 'Invalid' when oa.zipcode is null then 'Null' else oa.zipcode end, coalesce(c.id, -1) )) FROM country c RIGHT OUTER JOIN lsmb12.vendor oa ON lower(trim(both ' ' from c.name)) = lower( trim(both ' ' from oa.country)) OR lower(trim(both ' ' from c.short_name)) = lower( trim(both ' ' from oa.country)) JOIN entity_credit_account eca ON (oa.credit_id = eca.id) GROUP BY eca.id; INSERT INTO eca_to_location(credit_id, location_class, location_id) SELECT eca.id, 1, min(location_save(NULL, case when oa.address1 is null then 'Null' when trim(oa.address1) = '' then 'Null' when oa.address1 !~ '[[:alnum:]_]' then 'Invalid' else oa.address1 end, oa.address2, NULL, case when oa.city !~ '[[:alnum:]_]' then 'Invalid' when oa.city is null then 'Null' else oa.city end, case when oa.state !~ '[[:alnum:]_]' then 'Invalid' when oa.state is null then 'Null' else oa.state end, case when oa.zipcode !~ '[[:alnum:]_]' then 'Invalid' when oa.zipcode is null then 'Null' else oa.zipcode end, coalesce(c.id, -1) )) FROM country c RIGHT OUTER JOIN lsmb12.customer oa ON lower(trim(both ' ' from c.name)) = lower( trim(both ' ' from oa.country)) OR lower(trim(both ' ' from c.short_name)) = lower( trim(both ' ' from oa.country)) JOIN entity_credit_account eca ON (oa.credit_id = eca.id) GROUP BY eca.id; -- Shipto INSERT INTO eca_to_location(credit_id, location_class, location_id) SELECT eca.id, 2, min(location_save(NULL, case when oa.shiptoaddress1 = '' then 'Null' when oa.shiptoaddress1 is null then 'Null' else oa.shiptoaddress1 end, oa.shiptoaddress2, NULL, case when oa.shiptocity !~ '[[:alnum:]_]' then 'Invalid' when oa.shiptocity is null then 'Null' else oa.shiptocity end, case when oa.shiptostate !~ '[[:alnum:]_]' then 'Invalid' when oa.shiptostate is null then 'Null' else oa.shiptostate end, case when oa.shiptozipcode !~ '[[:alnum:]_]' then 'Invalid' when oa.shiptozipcode is null then 'Null' else oa.shiptozipcode end, coalesce(c.id, -1) )) FROM country c RIGHT OUTER JOIN lsmb12.shipto oa ON lower(trim(both ' ' from c.name)) = lower( trim(both ' ' from oa.shiptocountry)) OR lower(trim(both ' ' from c.short_name)) = lower( trim(both ' ' from oa.shiptocountry)) JOIN lsmb12.vendor ov ON (oa.trans_id = ov.id) JOIN entity_credit_account eca ON (ov.credit_id = eca.id) GROUP BY eca.id; INSERT INTO eca_to_location(credit_id, location_class, location_id) SELECT eca.id, 2, min(location_save(NULL, case when oa.shiptoaddress1 = '' then 'Null' when oa.shiptoaddress1 is null then 'Null' else oa.shiptoaddress1 end, oa.shiptoaddress2, NULL, case when oa.shiptocity !~ '[[:alnum:]_]' then 'Invalid' when oa.shiptocity is null then 'Null' else oa.shiptocity end, case when oa.shiptostate !~ '[[:alnum:]_]' then 'Invalid' when oa.shiptostate is null then 'Null' else oa.shiptostate end, case when oa.shiptozipcode !~ '[[:alnum:]_]' then 'Invalid' when oa.shiptozipcode is null then 'Null' else oa.shiptozipcode end, coalesce(c.id, -1) )) FROM country c RIGHT OUTER JOIN lsmb12.shipto oa ON lower(trim(both ' ' from c.name)) = lower( trim(both ' ' from oa.shiptocountry)) OR lower(trim(both ' ' from c.short_name)) = lower( trim(both ' ' from oa.shiptocountry)) JOIN lsmb12.customer ov ON (oa.trans_id = ov.id) JOIN entity_credit_account eca ON (ov.credit_id = eca.id) GROUP BY eca.id; INSERT INTO eca_note(note_class, ref_key, note, vector) SELECT 3, credit_id, notes, '' FROM lsmb12.vendor WHERE notes IS NOT NULL AND credit_id IS NOT NULL; INSERT INTO eca_note(note_class, ref_key, note, vector) SELECT 3, credit_id, notes, '' FROM lsmb12.customer WHERE notes IS NOT NULL AND credit_id IS NOT NULL; UPDATE entity SET country_id = (select country_id FROM location l JOIN eca_to_location e2l ON l.id = e2l.location_id AND e2l.location_class = 1 JOIN entity_credit_account eca ON e2l.credit_id = eca.id WHERE eca.entity_id = entity_id AND l.country_id > -1 LIMIT 1) WHERE id IN (select eca.entity_id FROM location l JOIN eca_to_location e2l ON l.id = e2l.location_id AND e2l.location_class = 1 JOIN entity_credit_account eca ON e2l.credit_id = eca.id WHERE eca.entity_id = entity_id aND l.country_id > -1); INSERT INTO pricegroup SELECT * FROM lsmb12.pricegroup; ALTER TABLE lsmb12.employee ADD entity_id int; INSERT INTO entity(control_code, entity_class, name, country_id) select 'E-' || employeenumber, 3, name, (select id from country where lower(short_name) = :default_country) FROM lsmb12.employee; UPDATE lsmb12.employee set entity_id = (select id from entity where 'E-'||employeenumber = control_code); INSERT INTO person (first_name, last_name, entity_id) select name, name, entity_id FROM lsmb12.employee; INSERT INTO users (entity_id, username) SELECT entity_id, login FROM lsmb12.employee em; INSERT INTO entity_employee(entity_id, startdate, enddate, role, ssn, sales, employeenumber, dob, manager_id) SELECT entity_id, startdate, enddate, role, ssn, sales, employeenumber, dob, (select entity_id from lsmb12.employee where id = em.managerid) FROM lsmb12.employee em; -- must rebuild this table due to changes since 1.2 INSERT INTO makemodel SELECT * FROM lsmb12.makemodel; INSERT INTO gifi SELECT * FROM lsmb12.gifi; UPDATE defaults SET value = (select value from lsmb12.defaults src WHERE src.setting_key = defaults.setting_key) WHERE setting_key IN (select setting_key FROM lsmb12.defaults); INSERT INTO parts SELECT * FROM lsmb12.parts; INSERT INTO assembly SELECT * FROM lsmb12.assembly; ALTER TABLE gl DISABLE TRIGGER gl_audit_trail; INSERT INTO gl(id, reference, description, transdate, person_id, notes, department_id) SELECT gl.id, reference, description, transdate, p.id, gl.notes, department_id FROM lsmb12.gl LEFT JOIN lsmb12.employee em ON gl.employee_id = em.id LEFT JOIN person p ON em.entity_id = p.id; ALTER TABLE gl ENABLE TRIGGER gl_audit_trail; ALTER TABLE ar DISABLE TRIGGER ar_audit_trail; INSERT INTO ar(id, invnumber, transdate, taxincluded, amount, netamount, paid, datepaid, duedate, invoice, shippingpoint, terms, notes, curr, ordnumber, person_id, till, quonumber, intnotes, department_id, shipvia, language_code, ponumber, entity_credit_account) SELECT ar.id, invnumber, transdate, ar.taxincluded, amount, netamount, paid, datepaid, duedate, invoice, shippingpoint, ar.terms, ar.notes, ar.curr, ordnumber, em.entity_id, till, quonumber, intnotes, department_id, shipvia, ar.language_code, ponumber, credit_id FROM lsmb12.ar JOIN lsmb12.customer c ON c.id = ar.customer_id LEFT JOIN lsmb12.employee em ON em.id = ar.employee_id; ALTER TABLE ar ENABLE TRIGGER ar_audit_trail; ALTER TABLE ap DISABLE TRIGGER ap_audit_trail; INSERT INTO ap(id, invnumber, transdate, taxincluded, amount, netamount, paid, datepaid, duedate, invoice, shippingpoint, terms, notes, curr, ordnumber, person_id, till, quonumber, intnotes, department_id, shipvia, language_code, ponumber, entity_credit_account) SELECT ap.id, invnumber, transdate, ap.taxincluded, amount, netamount, paid, datepaid, duedate, invoice, shippingpoint, ap.terms, ap.notes, ap.curr, ordnumber, em.entity_id, till, quonumber, intnotes, department_id, shipvia, ap.language_code, ponumber, credit_id FROM lsmb12.ap JOIN lsmb12.vendor c ON c.id = ap.vendor_id LEFT JOIN lsmb12.employee em ON em.id = ap.employee_id; ALTER TABLE ap ENABLE TRIGGER ap_audit_trail; INSERT INTO acc_trans(trans_id, chart_id, amount, transdate, source, cleared, fx_transaction, project_id, memo, invoice_id, entry_id) SELECT trans_id, a.id, amount, transdate, source, cleared, fx_transaction, project_id, memo, invoice_id, entry_id FROM lsmb12.acc_trans JOIN lsmb12.chart ON acc_trans.chart_id = chart.id JOIN account a ON chart.accno = a.accno; INSERT INTO invoice (id, trans_id, parts_id, description, qty, allocated, sellprice, fxsellprice, discount, assemblyitem, unit, project_id, deliverydate, serialnumber, notes) SELECT id, trans_id, parts_id, description, qty, allocated, sellprice, fxsellprice, discount, assemblyitem, unit, project_id, deliverydate, serialnumber, notes FROM lsmb12.invoice; INSERT INTO partstax (parts_id, chart_id) SELECT parts_id, a.id FROM lsmb12.partstax pt JOIN lsmb12.chart ON chart.id = pt.chart_id JOIN account a ON chart.accno = a.accno; INSERT INTO tax(chart_id, rate, taxnumber, validto, pass, taxmodule_id) SELECT a.id, t.rate, t.taxnumber, coalesce(t.validto::timestamp, 'infinity'), pass, taxmodule_id FROM lsmb12.tax t JOIN lsmb12.chart c ON (t.chart_id = c.id) JOIN account a ON (a.accno = c.accno); INSERT INTO customertax (customer_id, chart_id) SELECT c.credit_id, a.id FROM lsmb12.customertax pt JOIN lsmb12.customer c ON (pt.customer_id = c.id) JOIN lsmb12.chart ON chart.id = pt.chart_id JOIN account a ON chart.accno = a.accno; INSERT INTO vendortax (vendor_id, chart_id) SELECT c.credit_id, a.id FROM lsmb12.vendortax pt JOIN lsmb12.vendor c ON (pt.vendor_id = c.id) JOIN lsmb12.chart ON chart.id = pt.chart_id JOIN account a ON chart.accno = a.accno; INSERT INTO oe(id, ordnumber, transdate, amount, netamount, reqdate, taxincluded, shippingpoint, notes, curr, person_id, closed, quotation, quonumber, intnotes, department_id, shipvia, language_code, ponumber, terms, entity_credit_account, oe_class_id) SELECT oe.id, ordnumber, transdate, amount, netamount, reqdate, oe.taxincluded, shippingpoint, oe.notes, oe.curr, p.id, closed, quotation, quonumber, intnotes, department_id, shipvia, oe.language_code, ponumber, oe.terms, coalesce(c.credit_id, v.credit_id), case when c.id is not null and quotation is not true THEN 1 WHEN v.id is not null and quotation is not true THEN 2 when c.id is not null and quotation is true THEN 3 WHEN v.id is not null and quotation is true THEN 4 end FROM lsmb12.oe LEFT JOIN lsmb12.customer c ON c.id = oe.customer_id LEFT JOIN lsmb12.vendor v ON v.id = oe.vendor_id LEFT JOIN lsmb12.employee e ON oe.employee_id = e.id LEFT JOIN person p ON e.entity_id = p.id; INSERT INTO orderitems(id, trans_id, parts_id, description, qty, sellprice, discount, unit, project_id, reqdate, ship, serialnumber, notes) SELECT id, trans_id, parts_id, description, qty, sellprice, discount, unit, project_id, reqdate, ship, serialnumber, notes FROM lsmb12.orderitems; INSERT INTO exchangerate select * from lsmb12.exchangerate; INSERT INTO project (id, projectnumber, description, startdate, enddate, parts_id, production, completed, credit_id) SELECT p.id, projectnumber, description, p.startdate, p.enddate, parts_id, production, completed, c.credit_id FROM lsmb12.project p JOIN lsmb12.customer c ON p.customer_id = c.id; INSERT INTO partsgroup SELECT * FROM lsmb12.partsgroup; INSERT INTO status SELECT * FROM lsmb12.status; INSERT INTO department SELECT * FROM lsmb12.department; INSERT INTO business SELECT * FROM lsmb12.business; INSERT INTO sic SELECT * FROM lsmb12.sic; INSERT INTO warehouse SELECT * FROM lsmb12.warehouse; INSERT INTO inventory(entity_id, warehouse_id, parts_id, trans_id, orderitems_id, qty, shippingdate, entry_id) SELECT e.entity_id, warehouse_id, parts_id, trans_id, orderitems_id, qty, shippingdate, i.entry_id FROM lsmb12.inventory i JOIN lsmb12.employee e ON i.employee_id = e.id; INSERT INTO yearend (trans_id, transdate) SELECT * FROM lsmb12.yearend; INSERT INTO partsvendor(credit_id, parts_id, partnumber, leadtime, lastcost, curr, entry_id) SELECT v.credit_id, parts_id, partnumber, leadtime, lastcost, pv.curr, entry_id FROM lsmb12.partsvendor pv JOIN lsmb12.vendor v ON v.id = pv.vendor_id; INSERT INTO partscustomer(parts_id, credit_id, pricegroup_id, pricebreak, sellprice, validfrom, validto, curr, entry_id) SELECT parts_id, credit_id, pv.pricegroup_id, pricebreak, sellprice, validfrom, validto, pv.curr, entry_id FROM lsmb12.partscustomer pv JOIN lsmb12.customer v ON v.id = pv.customer_id; INSERT INTO language SELECT * FROM lsmb12.language; INSERT INTO audittrail(trans_id, tablename, reference, formname, action, transdate, person_id, entry_id) SELECT trans_id, tablename, reference, formname, action, transdate, p.entity_id, entry_id FROM lsmb12.audittrail a JOIN lsmb12.employee e ON a.employee_id = e.id JOIN person p on e.entity_id = p.entity_id; INSERT INTO user_preference(id) SELECT id from users; INSERT INTO recurring SELECT * FROM lsmb12.recurring; INSERT INTO recurringemail SELECT * FROM lsmb12.recurringemail; INSERT INTO recurringprint SELECT * FROM lsmb12.recurringprint; INSERT INTO jcitems(id, project_id, parts_id, description, qty, allocated, sellprice, fxsellprice, serialnumber, checkedin, checkedout, person_id, notes) SELECT j.id, project_id, parts_id, description, qty, allocated, sellprice, fxsellprice, serialnumber, checkedin, checkedout, p.id, j.notes FROM lsmb12.jcitems j JOIN lsmb12.employee e ON j.employee_id = e.id JOIN person p ON e.entity_id = p.entity_id; INSERT INTO custom_table_catalog SELECT * FROM lsmb12. custom_table_catalog; INSERT INTO custom_field_catalog SELECT * FROM lsmb12. custom_field_catalog; INSERT INTO parts_translation SELECT * FROM lsmb12.translation where trans_id in (select id from parts); INSERT INTO partsgroup_translation SELECT * FROM lsmb12.translation where trans_id in (select id from partsgroup); INSERT INTO project_translation SELECT * FROM lsmb12.translation where trans_id in (select id from project); SELECT setval('id', max(id)) FROM transactions; SELECT setval('acc_trans_entry_id_seq', max(entry_id)) FROM acc_trans; SELECT setval('partsvendor_entry_id_seq', max(entry_id)) FROM partsvendor; SELECT setval('inventory_entry_id_seq', max(entry_id)) FROM inventory; SELECT setval('partscustomer_entry_id_seq', max(entry_id)) FROM partscustomer; SELECT setval('audittrail_entry_id_seq', max(entry_id)) FROM audittrail; SELECT setval('account_id_seq', max(id)) FROM account; SELECT setval('account_heading_id_seq', max(id)) FROM account_heading; SELECT setval('account_checkpoint_id_seq', max(id)) FROM account_checkpoint; SELECT setval('pricegroup_id_seq', max(id)) FROM pricegroup; SELECT setval('country_id_seq', max(id)) FROM country; SELECT setval('country_tax_form_id_seq', max(id)) FROM country_tax_form; SELECT setval('asset_dep_method_id_seq', max(id)) FROM asset_dep_method; SELECT setval('asset_class_id_seq', max(id)) FROM asset_class; SELECT setval('entity_class_id_seq', max(id)) FROM entity_class; SELECT setval('asset_item_id_seq', max(id)) FROM asset_item; SELECT setval('asset_disposal_method_id_seq', max(id)) FROM asset_disposal_method; SELECT setval('users_id_seq', max(id)) FROM users; SELECT setval('entity_id_seq', max(id)) FROM entity; SELECT setval('company_id_seq', max(id)) FROM company; SELECT setval('location_id_seq', max(id)) FROM location; SELECT setval('open_forms_id_seq', max(id)) FROM open_forms; SELECT setval('location_class_id_seq', max(id)) FROM location_class; SELECT setval('asset_report_id_seq', max(id)) FROM asset_report; SELECT setval('salutation_id_seq', max(id)) FROM salutation; SELECT setval('person_id_seq', max(id)) FROM person; SELECT setval('contact_class_id_seq', max(id)) FROM contact_class; SELECT setval('entity_credit_account_id_seq', max(id)) FROM entity_credit_account; SELECT setval('entity_bank_account_id_seq', max(id)) FROM entity_bank_account; SELECT setval('note_class_id_seq', max(id)) FROM note_class; SELECT setval('note_id_seq', max(id)) FROM note; SELECT setval('batch_class_id_seq', max(id)) FROM batch_class; SELECT setval('batch_id_seq', max(id)) FROM batch; SELECT setval('invoice_id_seq', max(id)) FROM invoice; SELECT setval('voucher_id_seq', max(id)) FROM voucher; SELECT setval('parts_id_seq', max(id)) FROM parts; SELECT setval('taxmodule_taxmodule_id_seq', max(taxmodule_id)) FROM taxmodule; SELECT setval('taxcategory_taxcategory_id_seq', max(taxcategory_id)) FROM taxcategory; SELECT setval('oe_id_seq', max(id)) FROM oe; SELECT setval('orderitems_id_seq', max(id)) FROM orderitems; SELECT setval('business_id_seq', max(id)) FROM business; SELECT setval('warehouse_id_seq', max(id)) FROM warehouse; SELECT setval('partsgroup_id_seq', max(id)) FROM partsgroup; SELECT setval('project_id_seq', max(id)) FROM project; SELECT setval('department_id_seq', max(id)) FROM department; SELECT setval('jcitems_id_seq', max(id)) FROM jcitems; SELECT setval('payment_type_id_seq', max(id)) FROM payment_type; SELECT setval('custom_table_catalog_table_id_seq', max(table_id)) FROM custom_table_catalog; SELECT setval('custom_field_catalog_field_id_seq', max(field_id)) FROM custom_field_catalog; SELECT setval('menu_node_id_seq', max(id)) FROM menu_node; SELECT setval('menu_attribute_id_seq', max(id)) FROM menu_attribute; SELECT setval('menu_acl_id_seq', max(id)) FROM menu_acl; SELECT setval('pending_job_id_seq', max(id)) FROM pending_job; SELECT setval('new_shipto_id_seq', max(id)) FROM new_shipto; SELECT setval('payment_id_seq', max(id)) FROM payment; SELECT setval('cr_report_id_seq', max(id)) FROM cr_report; SELECT setval('cr_report_line_id_seq', max(id)) FROM cr_report_line; UPDATE defaults SET value = '1.3.0' WHERE setting_key = 'version'; COMMIT; --TODO: Translation migratiion. Partsgroups? -- TODO: User/password Migration ledgersmb/sql/upgrade/sl2.8-1.3.sql0000644000000000000000000005521611732506614015652 0ustar rootroot--Setup -- When moved to an interface, these will all be specified and preprocessed. \set default_country '''''' \set ar '''''' \set ap '''''' BEGIN; -- adding mapping info for import. ALTER TABLE sl28.vendor ADD COLUMN entity_id int; ALTER TABLE sl28.vendor ADD COLUMN company_id int; ALTER TABLE sl28.vendor ADD COLUMN credit_id int; ALTER TABLE sl28.customer ADD COLUMN entity_id int; ALTER TABLE sl28.customer ADD COLUMN company_id int; ALTER TABLE sl28.customer ADD COLUMN credit_id int; --Accounts INSERT INTO account_heading(id, accno, description) SELECT id, accno, description FROM sl28.chart WHERE charttype = 'H'; SELECT account_save(id, accno, description, category, gifi_accno, NULL, contra, CASE WHEN link like '%tax%' THEN true ELSE false END, string_to_array(link,':')) FROM sl28.chart WHERE charttype = 'A'; --Entity INSERT INTO entity (name, control_code, entity_class, country_id) SELECT name, 'V-' || vendornumber, 1, (select id from country where lower(short_name) = lower(:default_country)) FROM sl28.vendor GROUP BY name, vendornumber; INSERT INTO entity (name, control_code, entity_class, country_id) SELECT name, 'C-' || customernumber, 2, (select id from country where lower(short_name) = lower(:default_country)) FROM sl28.customer GROUP BY name, customernumber; UPDATE sl28.vendor SET entity_id = (SELECT id FROM entity WHERE 'V-' || vendornumber = control_code); UPDATE sl28.customer SET entity_id = coalesce((SELECT min(id) FROM entity WHERE 'C-' || customernumber = control_code), entity_id); --Entity Credit Account INSERT INTO entity_credit_account (entity_id, meta_number, business_id, creditlimit, ar_ap_account_id, cash_account_id, startdate, enddate, threshold, entity_class) SELECT entity_id, vendornumber, business_id, creditlimit, arap_accno_id, payment_accno_id, startdate, enddate, threshold, 1 FROM orig.vendor WHERE entity_id IS NOT NULL); UPDATE sl28.vendor SET credit_id = (SELECT id FROM entity_credit_account e WHERE e.meta_number = vendornumber and entity_class = 1 and e.entity_id = vendor.entity_id); INSERT INTO entity_credit_account (entity_id, meta_number, business_id, creditlimit, ar_ap_account_id, cash_account_id, startdate, enddate, threshold, entity_class) SELECT entity_id, vendornumber, business_id, creditlimit, arap_accno_id, payment_accno_id, startdate, enddate, threshold, 2 FROM orig.customer WHERE entity_id IS NOT NULL); UPDATE sl28.customer SET credit_id = (SELECT id FROM entity_credit_account e WHERE e.meta_number = vendornumber and entity_class = 2 and e.entity_id = vendor.entity_id); --Company INSERT INTO company (entity_id, legal_name, tax_id) SELECT entity_id, name, max(taxnumber) FROM sl28.vendor WHERE entity_id IS NOT NULL AND entity_id IN (select id from entity) GROUP BY entity_id, name; UPDATE sl28.vendor SET company_id = (select id from company c where entity_id = vendor.entity_id); INSERT INTO company (entity_id, legal_name, tax_id) SELECT entity_id, name, max(taxnumber) FROM sl28.customer WHERE entity_id IS NOT NULL AND entity_id IN (select id from entity) GROUP BY entity_id, name; UPDATE sl28.customer SET company_id = (select id from company c where entity_id = customer.entity_id); -- Contact insert into eca_to_contact (credit_id, contact_class_id, contact,description) select v.credit_id, 1, v.phone, 'Primary phone: '||max(v.contact) as description from sl28.vendor v where v.company_id is not null and v.phone is not null and v.phone ~ '[[:alnum:]_]'::text group by v.credit_id, v.phone UNION select v.credit_id, 12, v.email, 'email address: '||max(v.contact) as description from sl28.vendor v where v.company_id is not null and v.email is not null and v.email ~ '[[:alnum:]_]'::text group by v.credit_id, v.email UNION select v.credit_id, 12, v.cc, 'Carbon Copy email address' as description from sl28.vendor v where v.company_id is not null and v.cc is not null and v.cc ~ '[[:alnum:]_]'::text group by v.credit_id, v.cc UNION select v.credit_id, 12, v.bcc, 'Blind Carbon Copy email address' as description from sl28.vendor v where v.company_id is not null and v.bcc is not null and v.bcc ~ '[[:alnum:]_]'::text group by v.credit_id, v.bcc UNION select v.credit_id, 9, v.fax, 'Fax number' as description from sl28.vendor v where v.company_id is not null and v.fax is not null and v.fax ~ '[[:alnum:]_]'::text group by v.credit_id, v.fax; insert into eca_to_contact (credit_id, contact_class_id, contact,description) select v.credit_id, 1, v.phone, 'Primary phone: '||max(v.contact) as description from sl28.customer v where v.company_id is not null and v.phone is not null and v.phone ~ '[[:alnum:]_]'::text group by v.credit_id, v.phone UNION select v.credit_id, 12, v.email, 'email address: '||max(v.contact) as description from sl28.customer v where v.company_id is not null and v.email is not null and v.email ~ '[[:alnum:]_]'::text group by v.credit_id, v.email UNION select v.credit_id, 12, v.cc, 'Carbon Copy email address' as description from sl28.customer v where v.company_id is not null and v.cc is not null and v.cc ~ '[[:alnum:]_]'::text group by v.credit_id, v.cc UNION select v.credit_id, 12, v.bcc, 'Blind Carbon Copy email address' as description from sl28.customer v where v.company_id is not null and v.bcc is not null and v.bcc ~ '[[:alnum:]_]'::text group by v.credit_id, v.bcc UNION select v.credit_id, 9, v.fax, 'Fax number' as description from sl28.customer v where v.company_id is not null and v.fax is not null and v.fax ~ '[[:alnum:]_]'::text group by v.credit_id, v.fax; -- addresses INSERT INTO public.country (id, name, short_name) VALUES (-1, 'Invalid Country', 'XX'); INSERT INTO eca_to_location(credit_id, location_class, location_id) SELECT eca.id, 1, min(location_save(NULL, case when oa.address1 = '' then 'Null' when oa.address1 is null then 'Null' else oa.address1 end, oa.address2, NULL, case when oa.city !~ '[[:alnum:]_]' then 'Invalid' when oa.city is null then 'Null' else oa.city end, case when oa.state !~ '[[:alnum:]_]' then 'Invalid' when oa.state is null then 'Null' else oa.state end, case when oa.zipcode !~ '[[:alnum:]_]' then 'Invalid' when oa.zipcode is null then 'Null' else oa.zipcode end, coalesce(c.id, -1) )) FROM country c RIGHT OUTER JOIN sl28.address oa ON lower(trim(both ' ' from c.name)) = lower( trim(both ' ' from oa.country)) OR lower(trim(both ' ' from c.short_name)) = lower( trim(both ' ' from oa.country)) JOIN entity_credit_account eca ON (v.credit_id = eca.id) JOIN (select credit_id, id from vendor union select credit_id, id from customer) v ON oa.trans_id = v.id GROUP BY eca.id; -- Shipto INSERT INTO eca_to_location(credit_id, location_class, location_id) SELECT eca.id, 2, min(location_save(NULL, case when oa.shiptoaddress1 = '' then 'Null' when oa.shiptoaddress1 is null then 'Null' else oa.shiptoaddress1 end, oa.shiptoaddress2, NULL, case when oa.shiptocity !~ '[[:alnum:]_]' then 'Invalid' when oa.shiptocity is null then 'Null' else oa.shiptocity end, case when oa.shiptostate !~ '[[:alnum:]_]' then 'Invalid' when oa.shiptostate is null then 'Null' else oa.shiptostate end, case when oa.shiptozipcode !~ '[[:alnum:]_]' then 'Invalid' when oa.shiptozipcode is null then 'Null' else oa.shiptozipcode end, coalesce(c.id, -1) )) FROM country c RIGHT OUTER JOIN sl28.shipto oa ON lower(trim(both ' ' from c.name)) = lower( trim(both ' ' from oa.shiptocountry)) OR lower(trim(both ' ' from c.short_name)) = lower( trim(both ' ' from oa.shiptocountry)) JOIN (select credit_id, id from vendor union select credit_id, id from customer) ov ON oa.trans_id = v.id JOIN entity_credit_account eca ON (ov.credit_id = eca.id) GROUP BY eca.id; INSERT INTO eca_note(note_class, ref_key, note, vector) SELECT 3, credit_id, notes, '' FROM sl28.vendor WHERE notes IS NOT NULL AND credit_id IS NOT NULL; INSERT INTO eca_note(note_class, ref_key, note, vector) SELECT 3, credit_id, notes, '' FROM sl28.customer WHERE notes IS NOT NULL AND credit_id IS NOT NULL; UPDATE entity SET country_id = (select country_id FROM location l JOIN eca_to_location e2l ON l.id = e2l.location_id AND e2l.location_class = 1 JOIN entity_credit_account eca ON e2l.credit_id = eca.id WHERE eca.entity_id = entity_id AND l.country_id > -1 LIMIT 1) WHERE id IN (select eca.entity_id FROM location l JOIN eca_to_location e2l ON l.id = e2l.location_id AND e2l.location_class = 1 JOIN entity_credit_account eca ON e2l.credit_id = eca.id WHERE eca.entity_id = entity_id aND l.country_id > -1); INSERT INTO pricegroup SELECT * FROM sl28.pricegroup; ALTER TABLE sl28.employee ADD entity_id int; INSERT INTO entity(control_code, entity_class, name, country_id) select 'E-' || employeenumber, 3, name, (select id from country where lower(short_name) = lower(:default_country)) FROM sl28.employee; UPDATE sl28.employee set entity_id = (select id from entity where 'E-'||employeenumber = control_code); INSERT INTO person (first_name, last_name, entity_id) select name, name, entity_id FROM sl28.employee; INSERT INTO users (entity_id, username) SELECT entity_id, login FROM sl28.employee em WHERE login IS NOT NULL; INSERT INTO entity_employee(entity_id, startdate, enddate, role, ssn, sales, employeenumber, dob, manager_id) SELECT entity_id, startdate, enddate, role, ssn, sales, employeenumber, dob, (select entity_id from sl28.employee where id = em.managerid) FROM sl28.employee em; -- must rebuild this table due to changes since 1.2 INSERT INTO makemodel SELECT * FROM sl28.makemodel; INSERT INTO gifi SELECT * FROM sl28.gifi; UPDATE defaults SET value = (select value from sl28.defaults src WHERE src.setting_key = defaults.setting_key) WHERE setting_key IN (select setting_key FROM sl28.defaults); INSERT INTO parts SELECT * FROM sl28.parts; INSERT INTO assembly SELECT * FROM sl28.assembly; ALTER TABLE gl DISABLE TRIGGER gl_audit_trail; INSERT INTO gl(id, reference, description, transdate, person_id, notes, department_id) SELECT gl.id, reference, description, transdate, p.id, gl.notes, department_id FROM sl28.gl LEFT JOIN sl28.employee em ON gl.employee_id = em.id LEFT JOIN person p ON em.entity_id = p.id; ALTER TABLE gl ENABLE TRIGGER gl_audit_trail; ALTER TABLE ar DISABLE TRIGGER ar_audit_trail; insert into ar (entity_credit_account, person_id, id, invnumber, transdate, taxincluded, amount, netamount, paid, datepaid, duedate, invoice, ordnumber, curr, notes, quonumber, intnotes, department_id, shipvia, language_code, ponumber, shippingpoint, on_hold, approved, reverse, terms, description) SELECT customer.credit_id, (select entity_id from orig.employee WHERE id = ap.employee_id), ap.id, invnumber, transdate, ap.taxincluded, amount, netamount, paid, datepaid, duedate, invoice, ordnumber, ap.curr, ap.notes, quonumber, intnotes, department_id, shipvia, ap.language_code, ponumber, shippingpoint, onhold, approved, case when amount < 0 then true else false end, ap.terms, description FROM orig.ar JOIN orig.customer ON (ap.vendor_id = customer.id) ; ALTER TABLE ar ENABLE TRIGGER ar_audit_trail; ALTER TABLE ap DISABLE TRIGGER ap_audit_trail; insert into ap (entity_credit_account, person_id, id, invnumber, transdate, taxincluded, amount, netamount, paid, datepaid, duedate, invoice, ordnumber, curr, notes, quonumber, intnotes, department_id, shipvia, language_code, ponumber, shippingpoint, on_hold, approved, reverse, terms, description) SELECT vendor.credit_id, (select entity_id from orig.employee WHERE id = ap.employee_id), ap.id, invnumber, transdate, ap.taxincluded, amount, netamount, paid, datepaid, duedate, invoice, ordnumber, ap.curr, ap.notes, quonumber, intnotes, department_id, shipvia, ap.language_code, ponumber, shippingpoint, onhold, approved, case when amount < 0 then true else false end, ap.terms, description FROM orig.ap JOIN orig.vendor ON (ap.vendor_id = vendor.id) ; ALTER TABLE ap ENABLE TRIGGER ap_audit_trail; INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, source, cleared, fx_transaction, project_id, memo, approved, cleared_on, reconciled_on, voucher_id) SELECT trans_id, chart_id, amount, transdate, source, CASE WHEN cleared IS NOT NULL THEN TRUE ELSE FALSE END, fx_transaction, project_id, memo, approved, cleared, reconciled, vr_id FROM orig.acc_trans ; INSERT INTO invoice (id, trans_id, parts_id, description, qty, allocated, sellprice, fxsellprice, discount, assemblyitem, unit, project_id, deliverydate, serialnumber, notes) SELECT id, trans_id, parts_id, description, qty, allocated, sellprice, fxsellprice, discount, assemblyitem, unit, project_id, deliverydate, serialnumber, notes FROM sl28.invoice; INSERT INTO partstax (parts_id, chart_id) SELECT parts_id, a.id FROM sl28.partstax pt JOIN sl28.chart ON chart.id = pt.chart_id JOIN account a ON chart.accno = a.accno; INSERT INTO tax(chart_id, rate, taxnumber, validto, pass, taxmodule_id) SELECT a.id, t.rate, t.taxnumber, coalesce(t.validto::timestamp, 'infinity'), pass, taxmodule_id FROM sl28.tax t JOIN sl28.chart c ON (t.chart_id = c.id) JOIN account a ON (a.accno = c.accno); INSERT INTO customertax (customer_id, chart_id) SELECT c.credit_id, a.id FROM sl28.customertax pt JOIN sl28.customer c ON (pt.customer_id = c.id) JOIN sl28.chart ON chart.id = pt.chart_id JOIN account a ON chart.accno = a.accno; INSERT INTO vendortax (vendor_id, chart_id) SELECT c.credit_id, a.id FROM sl28.vendortax pt JOIN sl28.vendor c ON (pt.vendor_id = c.id) JOIN sl28.chart ON chart.id = pt.chart_id JOIN account a ON chart.accno = a.accno; INSERT INTO oe(id, ordnumber, transdate, amount, netamount, reqdate, taxincluded, shippingpoint, notes, curr, person_id, closed, quotation, quonumber, intnotes, department_id, shipvia, language_code, ponumber, terms, entity_credit_account, oe_class_id) SELECT oe.id, ordnumber, transdate, amount, netamount, reqdate, oe.taxincluded, shippingpoint, oe.notes, oe.curr, p.id, closed, quotation, quonumber, intnotes, department_id, shipvia, oe.language_code, ponumber, oe.terms, coalesce(c.credit_id, v.credit_id), case when c.id is not null and quotation is not true THEN 1 WHEN v.id is not null and quotation is not true THEN 2 when c.id is not null and quotation is true THEN 3 WHEN v.id is not null and quotation is true THEN 4 end FROM sl28.oe LEFT JOIN sl28.customer c ON c.id = oe.customer_id LEFT JOIN sl28.vendor v ON v.id = oe.vendor_id LEFT JOIN sl28.employee e ON oe.employee_id = e.id LEFT JOIN person p ON e.entity_id = p.id; INSERT INTO orderitems(id, trans_id, parts_id, description, qty, sellprice, discount, unit, project_id, reqdate, ship, serialnumber, notes) SELECT id, trans_id, parts_id, description, qty, sellprice, discount, unit, project_id, reqdate, ship, serialnumber, notes FROM sl28.orderitems; INSERT INTO exchangerate select * from sl28.exchangerate; INSERT INTO project (id, projectnumber, description, startdate, enddate, parts_id, production, completed, credit_id) SELECT p.id, projectnumber, description, p.startdate, p.enddate, parts_id, production, completed, c.credit_id FROM sl28.project p JOIN sl28.customer c ON p.customer_id = c.id; INSERT INTO partsgroup SELECT * FROM sl28.partsgroup; INSERT INTO status SELECT * FROM sl28.status; INSERT INTO department SELECT * FROM sl28.department; INSERT INTO business SELECT * FROM sl28.business; INSERT INTO sic SELECT * FROM sl28.sic; INSERT INTO warehouse SELECT * FROM sl28.warehouse; INSERT INTO inventory(entity_id, warehouse_id, parts_id, trans_id, orderitems_id, qty, shippingdate, entry_id) SELECT e.entity_id, warehouse_id, parts_id, trans_id, orderitems_id, qty, shippingdate, i.entry_id FROM sl28.inventory i JOIN sl28.employee e ON i.employee_id = e.id; INSERT INTO yearend (trans_id, transdate) SELECT * FROM sl28.yearend; INSERT INTO partsvendor(credit_id, parts_id, partnumber, leadtime, lastcost, curr, entry_id) SELECT v.credit_id, parts_id, partnumber, leadtime, lastcost, pv.curr, entry_id FROM sl28.partsvendor pv JOIN sl28.vendor v ON v.id = pv.vendor_id; INSERT INTO partscustomer(parts_id, credit_id, pricegroup_id, pricebreak, sellprice, validfrom, validto, curr, entry_id) SELECT parts_id, credit_id, pv.pricegroup_id, pricebreak, sellprice, validfrom, validto, pv.curr, entry_id FROM sl28.partscustomer pv JOIN sl28.customer v ON v.id = pv.customer_id; INSERT INTO language SELECT * FROM sl28.language; INSERT INTO audittrail(trans_id, tablename, reference, formname, action, transdate, person_id, entry_id) SELECT trans_id, tablename, reference, formname, action, transdate, p.entity_id, entry_id FROM sl28.audittrail a JOIN sl28.employee e ON a.employee_id = e.id JOIN person p on e.entity_id = p.entity_id; INSERT INTO user_preference(id) SELECT id from users; INSERT INTO recurring SELECT * FROM sl28.recurring; INSERT INTO recurringemail SELECT * FROM sl28.recurringemail; INSERT INTO recurringprint SELECT * FROM sl28.recurringprint; INSERT INTO jcitems(id, project_id, parts_id, description, qty, allocated, sellprice, fxsellprice, serialnumber, checkedin, checkedout, person_id, notes) SELECT j.id, project_id, parts_id, description, qty, allocated, sellprice, fxsellprice, serialnumber, checkedin, checkedout, p.id, j.notes FROM sl28.jcitems j JOIN sl28.employee e ON j.employee_id = e.id JOIN person p ON e.entity_id = p.entity_id; INSERT INTO custom_table_catalog SELECT * FROM sl28. custom_table_catalog; INSERT INTO custom_field_catalog SELECT * FROM sl28. custom_field_catalog; INSERT INTO parts_translation SELECT * FROM sl28.translation where trans_id in (select id from parts); INSERT INTO partsgroup_translation SELECT * FROM sl28.translation where trans_id in (select id from partsgroup); INSERT INTO project_translation SELECT * FROM sl28.translation where trans_id in (select id from project); SELECT setval('id', max(id)) FROM transactions; SELECT setval('acc_trans_entry_id_seq', max(entry_id)) FROM acc_trans; SELECT setval('partsvendor_entry_id_seq', max(entry_id)) FROM partsvendor; SELECT setval('inventory_entry_id_seq', max(entry_id)) FROM inventory; SELECT setval('partscustomer_entry_id_seq', max(entry_id)) FROM partscustomer; SELECT setval('audittrail_entry_id_seq', max(entry_id)) FROM audittrail; SELECT setval('account_id_seq', max(id)) FROM account; SELECT setval('account_heading_id_seq', max(id)) FROM account_heading; SELECT setval('account_checkpoint_id_seq', max(id)) FROM account_checkpoint; SELECT setval('pricegroup_id_seq', max(id)) FROM pricegroup; SELECT setval('country_id_seq', max(id)) FROM country; SELECT setval('country_tax_form_id_seq', max(id)) FROM country_tax_form; SELECT setval('asset_dep_method_id_seq', max(id)) FROM asset_dep_method; SELECT setval('asset_class_id_seq', max(id)) FROM asset_class; SELECT setval('entity_class_id_seq', max(id)) FROM entity_class; SELECT setval('asset_item_id_seq', max(id)) FROM asset_item; SELECT setval('asset_disposal_method_id_seq', max(id)) FROM asset_disposal_method; SELECT setval('users_id_seq', max(id)) FROM users; SELECT setval('entity_id_seq', max(id)) FROM entity; SELECT setval('company_id_seq', max(id)) FROM company; SELECT setval('location_id_seq', max(id)) FROM location; SELECT setval('open_forms_id_seq', max(id)) FROM open_forms; SELECT setval('location_class_id_seq', max(id)) FROM location_class; SELECT setval('asset_report_id_seq', max(id)) FROM asset_report; SELECT setval('salutation_id_seq', max(id)) FROM salutation; SELECT setval('person_id_seq', max(id)) FROM person; SELECT setval('contact_class_id_seq', max(id)) FROM contact_class; SELECT setval('entity_credit_account_id_seq', max(id)) FROM entity_credit_account; SELECT setval('entity_bank_account_id_seq', max(id)) FROM entity_bank_account; SELECT setval('note_class_id_seq', max(id)) FROM note_class; SELECT setval('note_id_seq', max(id)) FROM note; SELECT setval('batch_class_id_seq', max(id)) FROM batch_class; SELECT setval('batch_id_seq', max(id)) FROM batch; SELECT setval('invoice_id_seq', max(id)) FROM invoice; SELECT setval('voucher_id_seq', max(id)) FROM voucher; SELECT setval('parts_id_seq', max(id)) FROM parts; SELECT setval('taxmodule_taxmodule_id_seq', max(taxmodule_id)) FROM taxmodule; SELECT setval('taxcategory_taxcategory_id_seq', max(taxcategory_id)) FROM taxcategory; SELECT setval('oe_id_seq', max(id)) FROM oe; SELECT setval('orderitems_id_seq', max(id)) FROM orderitems; SELECT setval('business_id_seq', max(id)) FROM business; SELECT setval('warehouse_id_seq', max(id)) FROM warehouse; SELECT setval('partsgroup_id_seq', max(id)) FROM partsgroup; SELECT setval('project_id_seq', max(id)) FROM project; SELECT setval('department_id_seq', max(id)) FROM department; SELECT setval('jcitems_id_seq', max(id)) FROM jcitems; SELECT setval('payment_type_id_seq', max(id)) FROM payment_type; SELECT setval('custom_table_catalog_table_id_seq', max(table_id)) FROM custom_table_catalog; SELECT setval('custom_field_catalog_field_id_seq', max(field_id)) FROM custom_field_catalog; SELECT setval('menu_node_id_seq', max(id)) FROM menu_node; SELECT setval('menu_attribute_id_seq', max(id)) FROM menu_attribute; SELECT setval('menu_acl_id_seq', max(id)) FROM menu_acl; SELECT setval('pending_job_id_seq', max(id)) FROM pending_job; SELECT setval('new_shipto_id_seq', max(id)) FROM new_shipto; SELECT setval('payment_id_seq', max(id)) FROM payment; SELECT setval('cr_report_id_seq', max(id)) FROM cr_report; SELECT setval('cr_report_line_id_seq', max(id)) FROM cr_report_line; UPDATE defaults SET value = '1.3.0' WHERE setting_key = 'version'; COMMIT; --TODO: Translation migratiion. Partsgroups? -- TODO: User/password Migration ledgersmb/sql/upgrade/sql-ledger2ledgersmb-wip.sql0000644000000000000000000002076611663127666021323 0ustar rootrootALTER SCHEMA public RENAME TO orig; CREATE SCHEMA public; \i /usr/local/src/postgresql-8.2.6/contrib/tsearch2/tsearch2.sql \i /usr/local/src/postgresql-8.2.6/contrib/pg_trgm/pg_trgm.sql \i /usr/local/src/postgresql-8.2.6/contrib/tablefunc/tablefunc.sql \i /home/ledgersmb/ledger-smb/sql/Pg-database.sql \i /home/ledgersmb/ledger-smb/sql/modules/Account.sql \i /home/ledgersmb/ledger-smb/sql/modules/Session.sql \i /home/ledgersmb/ledger-smb/sql/modules/chart.sql \i /home/ledgersmb/ledger-smb/sql/modules/Business_type.sql \i /home/ledgersmb/ledger-smb/sql/modules/Location.sql \i /home/ledgersmb/ledger-smb/sql/modules/Company.sql \i /home/ledgersmb/ledger-smb/sql/modules/Customer.sql \i /home/ledgersmb/ledger-smb/sql/modules/Date.sql \i /home/ledgersmb/ledger-smb/sql/modules/Defaults.sql \i /home/ledgersmb/ledger-smb/sql/modules/Settings.sql \i /home/ledgersmb/ledger-smb/sql/modules/Employee.sql \i /home/ledgersmb/ledger-smb/sql/modules/Entity.sql \i /home/ledgersmb/ledger-smb/sql/modules/Payment.sql \i /home/ledgersmb/ledger-smb/sql/modules/Person.sql \i /home/ledgersmb/ledger-smb/sql/modules/Report.sql \i /home/ledgersmb/ledger-smb/sql/modules/Voucher.sql GRANT EXECUTE ON FUNCTION eca__list_notes(int) TO lsmb_paycom_eu__read_contact; GRANT INSERT ON eca_note TO lsmb_paycom_eu__edit_contact; ALTER TABLE orig.vendor ADD COLUMN entity_id int; ALTER TABLE orig.vendor ADD COLUMN company_id int; ALTER TABLE orig.vendor ADD COLUMN credit_id int; INSERT INTO chart SELECT * FROM orig.chart; -- The blank entities are tests and not used for anything anyway. INSERT INTO business SELECT * FROM orig.business; -- Importing vendors CREATE TEMPORARY TABLE entity_temp (name text, control_code text); INSERT INTO entity_temp (name, control_code) SELECT name, vendornumber FROM orig.vendor GROUP BY name, vendornumber; INSERT INTO entity (name, control_code, entity_class) SELECT name, control_code, 1 FROM entity_temp WHERE control_code IS NOT NULL AND name IS NOT NULL AND name <> '' GROUP BY name, control_code; UPDATE orig.vendor SET entity_id = coalesce((SELECT id FROM entity WHERE (vendornumber like control_code), entity_id); insert into entity (id, name, entity_class) values (-1, 'UNKNOWN', 1); DELETE FROM entity_credit_account; -- necessary because the builtin inventory -- control accounts have the same meta_number -- CT INSERT INTO entity_credit_account (entity_id, meta_number, business_id, creditlimit, ar_ap_account_id, cash_account_id, startdate, enddate, threshold, entity_class) SELECT entity_id, vendornumber, business_id, creditlimit, arap_accno_id, payment_accno_id, startdate, enddate, threshold, 1 FROM orig.vendor; create UNIQUE index entity_credit_account_meta_number_idx_u on entity_credit_account (meta_number ); UPDATE orig.vendor SET credit_id = (SELECT id FROM entity_credit_account e WHERE e.meta_number = vendornumber AND vendor.entity_id = e.entity_id); -- companies INSERT INTO company (entity_id, legal_name, tax_id) SELECT entity_id, name, max(taxnumber) FROM orig.vendor WHERE entity_id IS NOT NULL AND entity_id IN (select id from entity) GROUP BY entity_id, name; UPDATE orig.vendor SET company_id = (select id from company c where entity_id = vendor.entity_id); -- Moving to a UNION query insert into eca_to_contact (credit_id, contact_class_id, contact,description) select v.credit_id, 1, v.phone, 'Primary phone: '||max(v.contact) as description from orig.vendor v where v.company_id is not null and v.phone is not null and v.phone ~ '[[:alnum:]_]'::text group by v.credit_id, v.phone UNION select v.credit_id, 12, v.email, 'email address: '||max(v.contact) as description from orig.vendor v where v.company_id is not null and v.email is not null and v.email ~ '[[:alnum:]_]'::text group by v.credit_id, v.email UNION select v.credit_id, 12, v.cc, 'Carbon Copy email address' as description from orig.vendor v where v.company_id is not null and v.cc is not null and v.cc ~ '[[:alnum:]_]'::text group by v.credit_id, v.cc UNION select v.credit_id, 12, v.bcc, 'Blind Carbon Copy email address' as description from orig.vendor v where v.company_id is not null and v.bcc is not null and v.bcc ~ '[[:alnum:]_]'::text group by v.credit_id, v.bcc UNION select v.credit_id, 9, v.fax, 'Fax number' as description from orig.vendor v where v.company_id is not null and v.fax is not null and v.fax ~ '[[:alnum:]_]'::text group by v.credit_id, v.fax; -- addresses INSERT INTO public.country (id, name, short_name) VALUES (-1, 'Invalid Country', 'XX'); INSERT INTO eca_to_location(credit_id, location_class, location_id) SELECT eca.id, 1, min(location_save(NULL, case when oa.address1 = '' then 'Null' when oa.address1 is null then 'Null' else oa.address1 end, oa.address2, NULL, case when oa.city !~ '[[:alnum:]_]' then 'Invalid' when oa.city is null then 'Null' else oa.city end, case when oa.state !~ '[[:alnum:]_]' then 'Invalid' when oa.state is null then 'Null' else oa.state end, case when oa.zipcode !~ '[[:alnum:]_]' then 'Invalid' when oa.zipcode is null then 'Null' else oa.zipcode end, coalesce(c.id, -1) )) FROM country c RIGHT OUTER JOIN orig.address oa ON lower(trim(both ' ' from c.name)) = lower( trim(both ' ' from oa.country)) OR lower(trim(both ' ' from c.short_name)) = lower( trim(both ' ' from oa.country)) JOIN orig.vendor ov ON ov.id = oa.trans_id JOIN entity_credit_account eca ON (ov.credit_id = eca.id) GROUP BY eca.id; -- notes INSERT INTO eca_note(note_class, ref_key, note, vector) SELECT 3, credit_id, notes, '' FROM orig.vendor WHERE notes IS NOT NULL AND credit_id IS NOT NULL; alter table orig.employee add entity_id int; update orig.employee set entity_id = (select entity_id from person where first_name = employee.name UNION select entity_id from users where username = lower(employee.login)); -- batches, transactions, and vouchers insert into batch (id, control_code, description, approved_on, approved_by, created_on, created_by, batch_class_id, default_date) select b.id, b.batchnumber, b.description, b.apprdate, me.entity_id, transdate, ee.entity_id, bc.id, b.transdate FROM orig.br b LEFT JOIN orig.employee me ON (b.managerid = me.id) LEFT JOIN orig.employee ee ON (ee.id = b.employee_id) JOIN public.batch_class bc ON (b.batch = bc.class); insert into ap (entity_credit_account, person_id, id, invnumber, transdate, taxincluded, amount, netamount, paid, datepaid, duedate, invoice, ordnumber, curr, notes, quonumber, intnotes, department_id, shipvia, language_code, ponumber, shippingpoint, on_hold, approved, reverse, terms, description) SELECT vendor.credit_id, (select entity_id from orig.employee WHERE id = ap.employee_id), ap.id, invnumber, transdate, ap.taxincluded, amount, netamount, paid, datepaid, duedate, invoice, ordnumber, ap.curr, ap.notes, quonumber, intnotes, department_id, shipvia, ap.language_code, ponumber, shippingpoint, onhold, approved, case when amount < 0 then true else false end, ap.terms, description FROM orig.ap JOIN orig.vendor ON (ap.vendor_id = vendor.id); INSERT INTO gl (id, reference, description, transdate, person_id, notes, approved, department_id) SELECT id, reference, description, transdate, (select max(id) from person where entity_id = (select entity_id from orig.employee WHERE id = gl.employee_id)), notes, approved, department_id FROM orig.gl; insert into voucher(trans_id, batch_id, id, batch_class) select min(v.trans_id), v.br_id, v.id, bc.id from orig.vr v JOIN orig.br b ON (v.br_id = b.id) JOIN public.batch_class bc ON (b.batch = bc.class) JOIN public.transactions t ON (t.id = v.trans_id) group by v.br_id, bc.id, v.id; -- acc_trans entries/financial line items INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, source, cleared, fx_transaction, project_id, memo, approved, cleared_on, reconciled_on, voucher_id) SELECT trans_id, chart_id, amount, transdate, source, CASE WHEN cleared IS NOT NULL THEN TRUE ELSE FALSE END, fx_transaction, project_id, memo, approved, cleared, reconciled, vr_id FROM orig.acc_trans; -- sequences select setval('voucher_id_seq', (select max(id) from orig.vr)); SELECT setval('batch_id_seq', (select max(id) from orig.br)); SELECT setval('id', max(id)) FROM transactions; INSERT INTO defaults (setting_key, value) SELECT fldname, fldvalue FROM orig.defaults WHERE fldname = 'currencies'; ledgersmb/sql/upgrade/1.3-1.2.sql0000644000000000000000000000123211730550107015263 0ustar rootroot BEGIN; ALTER SCHEMA public RENAME TO lsmb_13fail; ALTER SCHEMA lsmb12 RENAME TO public; COMMIT; BEGIN; ALTER TABLE vendor DROP COLUMN entity_id; ALTER TABLE vendor DROP COLUMN company_id; ALTER TABLE vendor DROP COLUMN credit_id; ALTER TABLE customer DROP COLUMN entity_id; ALTER TABLE customer DROP COLUMN company_id; ALTER TABLE customer DROP COLUMN credit_id; ALTER TABLE employee DROP COLUMN entity_id; COMMIT; \echo Note that this creates a lsmb_13fail schema with the failed migration data. \echo You must drop that schema when you are done troubleshooting why this failed. \echo Otherwise you will be unable to roll back after then next upgrade attempt. ledgersmb/sql/upgrade/rc3-rc4.sql0000644000000000000000000000025311641406502015643 0ustar rootrootalter table asset_report alter column entered_by set default person__get_my_entity_id(); DROP TYPE asset_nbv_line CASCADE; ALTER TABLE entity ADD UNIQUE (control_code); ledgersmb/sql/upgrade/rc4-1.3.0.sql0000644000000000000000000000240711644062743015626 0ustar rootrootINSERT INTO language (code, description) VALUES ('ar_EG', 'Arabic (Egypt)'), ('bg', 'Bulgarian'), ('ca', 'Catalan'), ('cs', 'Czech'), ('da', 'Danish'), ('de', 'German'), ('de_CH', 'German (Switzerland)'), ('el', 'Greek'), ('en', 'English'), ('es', 'Spanish'), ('es_CO', 'Spanish (Colombia)'), ('es_EC', 'Spanish (Ecuador)'), ('es_MX', 'Spanish (Mexico)'), ('es_PA', 'Spanish (Panama)'), ('es_PY', 'Spanish (Paraguay)'), ('es_VE', 'Spanish (Venezuela)'), ('et', 'Estonian'), ('fi', 'Finnish'), ('fr', 'French'), ('fr_BE', 'French (Belgium)'), ('fr_CA', 'French (Canada)'), ('hu', 'Hungarian'), ('id', 'Indonesian'), ('is', 'Icelandic'), ('it', 'Italian'), ('lt', 'Latvian'), ('nb', 'Norwegian'), ('nl', 'Dutch'), ('nl_BE', 'Dutch (Belgium)'), ('pl', 'Polish'), ('pt', 'Portuguese'), ('pt_BR', 'Portuguese (Brazil)'), ('ru', 'Russian'), ('sv', 'Swedish'), ('tr', 'Turkish'), ('uk', 'Ukranian'), ('zh_CN', 'Chinese (China)'), ('zh_TW', 'Chinese (Taiwan)'); ledgersmb/sql/upgrade/rc2-rc3.sql0000644000000000000000000000015011640367231015641 0ustar rootrootDROP FUNCTION reconciliation__delete_report(in_report_id int); ALTER TABLE session DROP transaction_id; ledgersmb/sql/upgrade/svn/0000755000000000000000000000000012060044550014550 5ustar rootrootledgersmb/sql/upgrade/svn/3538-asset-menu-fix.sql0000644000000000000000000000065511634752153020557 0ustar rootrootUPDATE menu_attribute set attribute = 'depreciation' where attribute = 'depreciate'; SELECT menu_insert(parent, position + 1, 'Disposal') FROM menu_node WHERE label = 'Depreciate'; INSERT INTO menu_attribute(attribute, value, node_id) VALUES ('module', 'asset.pl', currval('menu_node_id_seq')); INSERT INTO menu_attribute(attribute, value, node_id) VALUES ('action', 'new_report', currval('menu_node_id_seq')); ledgersmb/sql/upgrade/svn/3679-drop-payment-function.sql0000644000000000000000000000043111634752153022152 0ustar rootrootDROP FUNCTION payment_bulk_post (in_transactions numeric[], in_batch_id int, in_source text, in_total numeric, in_ar_ap_accno text, in_cash_accno text, in_payment_date date, in_account_class int, in_payment_type int, in_exchangerate numeric, in_curr text); ledgersmb/sql/upgrade/svn/3356-fkeys.sql0000644000000000000000000000066611634752153017033 0ustar rootrootALTER TABLE partscustomer ALTER COLUMN credit_id drop not null; ALTER TABLE partscustomer ADD foreign key (pricegroup_id) references pricegroup(id); CREATE TABLE parts_translation () INHERITS (translation); ALTER TABLE parts_translation ADD foreign key (trans_id) REFERENCES parts(id); CREATE TABLE project_translation () INHERITS (translation); ALTER TABLE project_translation ADD foreign key (trans_id) REFERENCES project(id); ledgersmb/sql/upgrade/svn/3585-mime-type-data.sql0000644000000000000000000011302411634752153020524 0ustar rootrootINSERT INTO mime_type (mime_type) VALUES('all/all'); INSERT INTO mime_type (mime_type) VALUES('all/allfiles'); INSERT INTO mime_type (mime_type) VALUES('audio/x-flac'); INSERT INTO mime_type (mime_type) VALUES('audio/x-ape'); INSERT INTO mime_type (mime_type) VALUES('audio/x-scpls'); INSERT INTO mime_type (mime_type) VALUES('audio/mp4'); INSERT INTO mime_type (mime_type) VALUES('audio/mpeg'); INSERT INTO mime_type (mime_type) VALUES('audio/x-iriver-pla'); INSERT INTO mime_type (mime_type) VALUES('audio/x-speex+ogg'); INSERT INTO mime_type (mime_type) VALUES('audio/x-mod'); INSERT INTO mime_type (mime_type) VALUES('audio/x-tta'); INSERT INTO mime_type (mime_type) VALUES('audio/annodex'); INSERT INTO mime_type (mime_type) VALUES('audio/x-mo3'); INSERT INTO mime_type (mime_type) VALUES('audio/midi'); INSERT INTO mime_type (mime_type) VALUES('audio/mp2'); INSERT INTO mime_type (mime_type) VALUES('audio/x-musepack'); INSERT INTO mime_type (mime_type) VALUES('audio/x-minipsf'); INSERT INTO mime_type (mime_type) VALUES('audio/x-mpegurl'); INSERT INTO mime_type (mime_type) VALUES('audio/x-aiff'); INSERT INTO mime_type (mime_type) VALUES('audio/x-xm'); INSERT INTO mime_type (mime_type) VALUES('audio/x-aifc'); INSERT INTO mime_type (mime_type) VALUES('audio/x-m4b'); INSERT INTO mime_type (mime_type) VALUES('audio/aac'); INSERT INTO mime_type (mime_type) VALUES('audio/x-psflib'); INSERT INTO mime_type (mime_type) VALUES('audio/x-pn-realaudio-plugin'); INSERT INTO mime_type (mime_type) VALUES('audio/basic'); INSERT INTO mime_type (mime_type) VALUES('audio/x-ms-wma'); INSERT INTO mime_type (mime_type) VALUES('audio/AMR-WB'); INSERT INTO mime_type (mime_type) VALUES('audio/x-riff'); INSERT INTO mime_type (mime_type) VALUES('audio/x-psf'); INSERT INTO mime_type (mime_type) VALUES('audio/x-adpcm'); INSERT INTO mime_type (mime_type) VALUES('audio/ogg'); INSERT INTO mime_type (mime_type) VALUES('audio/x-wav'); INSERT INTO mime_type (mime_type) VALUES('audio/x-matroska'); INSERT INTO mime_type (mime_type) VALUES('audio/x-voc'); INSERT INTO mime_type (mime_type) VALUES('audio/ac3'); INSERT INTO mime_type (mime_type) VALUES('audio/x-flac+ogg'); INSERT INTO mime_type (mime_type) VALUES('audio/x-aiffc'); INSERT INTO mime_type (mime_type) VALUES('audio/x-it'); INSERT INTO mime_type (mime_type) VALUES('audio/AMR'); INSERT INTO mime_type (mime_type) VALUES('audio/x-s3m'); INSERT INTO mime_type (mime_type) VALUES('audio/x-speex'); INSERT INTO mime_type (mime_type) VALUES('audio/x-wavpack'); INSERT INTO mime_type (mime_type) VALUES('audio/x-xi'); INSERT INTO mime_type (mime_type) VALUES('audio/x-xmf'); INSERT INTO mime_type (mime_type) VALUES('audio/x-wavpack-correction'); INSERT INTO mime_type (mime_type) VALUES('audio/prs.sid'); INSERT INTO mime_type (mime_type) VALUES('audio/x-gsm'); INSERT INTO mime_type (mime_type) VALUES('audio/x-ms-asx'); INSERT INTO mime_type (mime_type) VALUES('audio/x-vorbis+ogg'); INSERT INTO mime_type (mime_type) VALUES('audio/x-stm'); INSERT INTO mime_type (mime_type) VALUES('x-epoc/x-sisx-app'); INSERT INTO mime_type (mime_type) VALUES('image/x-fpx'); INSERT INTO mime_type (mime_type) VALUES('image/x-panasonic-raw'); INSERT INTO mime_type (mime_type) VALUES('image/x-xwindowdump'); INSERT INTO mime_type (mime_type) VALUES('image/x-nikon-nef'); INSERT INTO mime_type (mime_type) VALUES('image/x-niff'); INSERT INTO mime_type (mime_type) VALUES('image/x-pict'); INSERT INTO mime_type (mime_type) VALUES('image/svg+xml-compressed'); INSERT INTO mime_type (mime_type) VALUES('image/jp2'); INSERT INTO mime_type (mime_type) VALUES('image/x-msod'); INSERT INTO mime_type (mime_type) VALUES('image/x-dds'); INSERT INTO mime_type (mime_type) VALUES('image/x-olympus-orf'); INSERT INTO mime_type (mime_type) VALUES('image/x-portable-graymap'); INSERT INTO mime_type (mime_type) VALUES('image/x-skencil'); INSERT INTO mime_type (mime_type) VALUES('image/x-sony-srf'); INSERT INTO mime_type (mime_type) VALUES('image/x-dib'); INSERT INTO mime_type (mime_type) VALUES('image/x-emf'); INSERT INTO mime_type (mime_type) VALUES('image/x-eps'); INSERT INTO mime_type (mime_type) VALUES('image/ief'); INSERT INTO mime_type (mime_type) VALUES('image/x-pcx'); INSERT INTO mime_type (mime_type) VALUES('image/x-gzeps'); INSERT INTO mime_type (mime_type) VALUES('image/x-xcf'); INSERT INTO mime_type (mime_type) VALUES('image/x-portable-pixmap'); INSERT INTO mime_type (mime_type) VALUES('image/x-kde-raw'); INSERT INTO mime_type (mime_type) VALUES('image/openraster'); INSERT INTO mime_type (mime_type) VALUES('image/x-macpaint'); INSERT INTO mime_type (mime_type) VALUES('image/x-wmf'); INSERT INTO mime_type (mime_type) VALUES('image/x-win-bitmap'); INSERT INTO mime_type (mime_type) VALUES('image/x-sgi'); INSERT INTO mime_type (mime_type) VALUES('image/x-ilbm'); INSERT INTO mime_type (mime_type) VALUES('image/x-sony-sr2'); INSERT INTO mime_type (mime_type) VALUES('image/x-sigma-x3f'); INSERT INTO mime_type (mime_type) VALUES('image/x-bzeps'); INSERT INTO mime_type (mime_type) VALUES('image/x-icns'); INSERT INTO mime_type (mime_type) VALUES('image/g3fax'); INSERT INTO mime_type (mime_type) VALUES('image/x-applix-graphics'); INSERT INTO mime_type (mime_type) VALUES('image/x-xcursor'); INSERT INTO mime_type (mime_type) VALUES('image/x-kodak-dcr'); INSERT INTO mime_type (mime_type) VALUES('image/x-hdr'); INSERT INTO mime_type (mime_type) VALUES('image/x-cmu-raster'); INSERT INTO mime_type (mime_type) VALUES('image/x-sun-raster'); INSERT INTO mime_type (mime_type) VALUES('image/fax-g3'); INSERT INTO mime_type (mime_type) VALUES('image/x-kodak-kdc'); INSERT INTO mime_type (mime_type) VALUES('image/jpeg'); INSERT INTO mime_type (mime_type) VALUES('image/tiff'); INSERT INTO mime_type (mime_type) VALUES('image/dpx'); INSERT INTO mime_type (mime_type) VALUES('image/x-dcraw'); INSERT INTO mime_type (mime_type) VALUES('image/x-adobe-dng'); INSERT INTO mime_type (mime_type) VALUES('image/x-canon-crw'); INSERT INTO mime_type (mime_type) VALUES('image/bmp'); INSERT INTO mime_type (mime_type) VALUES('image/x-xfig'); INSERT INTO mime_type (mime_type) VALUES('image/x-lwo'); INSERT INTO mime_type (mime_type) VALUES('image/x-fuji-raf'); INSERT INTO mime_type (mime_type) VALUES('image/x-xbitmap'); INSERT INTO mime_type (mime_type) VALUES('image/x-pentax-pef'); INSERT INTO mime_type (mime_type) VALUES('image/x-exr'); INSERT INTO mime_type (mime_type) VALUES('image/rle'); INSERT INTO mime_type (mime_type) VALUES('image/x-3ds'); INSERT INTO mime_type (mime_type) VALUES('image/svg+xml'); INSERT INTO mime_type (mime_type) VALUES('image/x-lws'); INSERT INTO mime_type (mime_type) VALUES('image/x-tga'); INSERT INTO mime_type (mime_type) VALUES('image/x-compressed-xcf'); INSERT INTO mime_type (mime_type) VALUES('image/fits'); INSERT INTO mime_type (mime_type) VALUES('image/x-kodak-k25'); INSERT INTO mime_type (mime_type) VALUES('image/x-portable-bitmap'); INSERT INTO mime_type (mime_type) VALUES('image/x-quicktime'); INSERT INTO mime_type (mime_type) VALUES('image/x-sony-arw'); INSERT INTO mime_type (mime_type) VALUES('image/x-xpixmap'); INSERT INTO mime_type (mime_type) VALUES('image/gif'); INSERT INTO mime_type (mime_type) VALUES('image/x-portable-anymap'); INSERT INTO mime_type (mime_type) VALUES('image/x-jng'); INSERT INTO mime_type (mime_type) VALUES('image/x-iff'); INSERT INTO mime_type (mime_type) VALUES('image/x-canon-cr2'); INSERT INTO mime_type (mime_type) VALUES('image/cgm'); INSERT INTO mime_type (mime_type) VALUES('image/x-photo-cd'); INSERT INTO mime_type (mime_type) VALUES('image/png'); INSERT INTO mime_type (mime_type) VALUES('image/x-minolta-mrw'); INSERT INTO mime_type (mime_type) VALUES('image/x-rgb'); INSERT INTO mime_type (mime_type) VALUES('image/x-pic'); INSERT INTO mime_type (mime_type) VALUES('message/disposition-notification'); INSERT INTO mime_type (mime_type) VALUES('message/news'); INSERT INTO mime_type (mime_type) VALUES('message/partial'); INSERT INTO mime_type (mime_type) VALUES('message/x-gnu-rmail'); INSERT INTO mime_type (mime_type) VALUES('message/delivery-status'); INSERT INTO mime_type (mime_type) VALUES('message/external-body'); INSERT INTO mime_type (mime_type) VALUES('message/rfc822'); INSERT INTO mime_type (mime_type) VALUES('uri/mmst'); INSERT INTO mime_type (mime_type) VALUES('uri/rtspu'); INSERT INTO mime_type (mime_type) VALUES('uri/pnm'); INSERT INTO mime_type (mime_type) VALUES('uri/mmsu'); INSERT INTO mime_type (mime_type) VALUES('uri/rtspt'); INSERT INTO mime_type (mime_type) VALUES('uri/mms'); INSERT INTO mime_type (mime_type) VALUES('text/x-tcl'); INSERT INTO mime_type (mime_type) VALUES('text/directory'); INSERT INTO mime_type (mime_type) VALUES('text/htmlh'); INSERT INTO mime_type (mime_type) VALUES('text/x-literate-haskell'); INSERT INTO mime_type (mime_type) VALUES('text/xmcd'); INSERT INTO mime_type (mime_type) VALUES('text/x-ms-regedit'); INSERT INTO mime_type (mime_type) VALUES('text/x-microdvd'); INSERT INTO mime_type (mime_type) VALUES('text/x-erlang'); INSERT INTO mime_type (mime_type) VALUES('text/x-ssa'); INSERT INTO mime_type (mime_type) VALUES('text/plain'); INSERT INTO mime_type (mime_type) VALUES('text/spreadsheet'); INSERT INTO mime_type (mime_type) VALUES('text/sgml'); INSERT INTO mime_type (mime_type) VALUES('text/x-uil'); INSERT INTO mime_type (mime_type) VALUES('text/x-troff-mm'); INSERT INTO mime_type (mime_type) VALUES('text/x-gettext-translation'); INSERT INTO mime_type (mime_type) VALUES('text/x-vhdl'); INSERT INTO mime_type (mime_type) VALUES('text/x-java'); INSERT INTO mime_type (mime_type) VALUES('text/x-nfo'); INSERT INTO mime_type (mime_type) VALUES('text/csv'); INSERT INTO mime_type (mime_type) VALUES('text/x-install'); INSERT INTO mime_type (mime_type) VALUES('text/x-c++src'); INSERT INTO mime_type (mime_type) VALUES('text/x-subviewer'); INSERT INTO mime_type (mime_type) VALUES('text/x-adasrc'); INSERT INTO mime_type (mime_type) VALUES('text/x-dsl'); INSERT INTO mime_type (mime_type) VALUES('text/x-chdr'); INSERT INTO mime_type (mime_type) VALUES('text/calendar'); INSERT INTO mime_type (mime_type) VALUES('text/x-csharp'); INSERT INTO mime_type (mime_type) VALUES('text/x-lua'); INSERT INTO mime_type (mime_type) VALUES('text/x-ocaml'); INSERT INTO mime_type (mime_type) VALUES('text/x-iMelody'); INSERT INTO mime_type (mime_type) VALUES('text/enriched'); INSERT INTO mime_type (mime_type) VALUES('text/richtext'); INSERT INTO mime_type (mime_type) VALUES('text/x-objchdr'); INSERT INTO mime_type (mime_type) VALUES('text/x-makefile'); INSERT INTO mime_type (mime_type) VALUES('text/x-copying'); INSERT INTO mime_type (mime_type) VALUES('text/x-pascal'); INSERT INTO mime_type (mime_type) VALUES('text/x-credits'); INSERT INTO mime_type (mime_type) VALUES('text/x-mup'); INSERT INTO mime_type (mime_type) VALUES('text/x-opml+xml'); INSERT INTO mime_type (mime_type) VALUES('text/x-rpm-spec'); INSERT INTO mime_type (mime_type) VALUES('text/x-xmi'); INSERT INTO mime_type (mime_type) VALUES('text/x-dsrc'); INSERT INTO mime_type (mime_type) VALUES('text/x-patch'); INSERT INTO mime_type (mime_type) VALUES('text/x-authors'); INSERT INTO mime_type (mime_type) VALUES('text/x-ldif'); INSERT INTO mime_type (mime_type) VALUES('text/x-moc'); INSERT INTO mime_type (mime_type) VALUES('text/x-tex'); INSERT INTO mime_type (mime_type) VALUES('text/x-dcl'); INSERT INTO mime_type (mime_type) VALUES('text/x-python'); INSERT INTO mime_type (mime_type) VALUES('text/x-lilypond'); INSERT INTO mime_type (mime_type) VALUES('text/x-katefilelist'); INSERT INTO mime_type (mime_type) VALUES('text/troff'); INSERT INTO mime_type (mime_type) VALUES('text/x-hex'); INSERT INTO mime_type (mime_type) VALUES('text/x-google-video-pointer'); INSERT INTO mime_type (mime_type) VALUES('text/x-haskell'); INSERT INTO mime_type (mime_type) VALUES('text/x-ocl'); INSERT INTO mime_type (mime_type) VALUES('text/x-idl'); INSERT INTO mime_type (mime_type) VALUES('text/x-troff-me'); INSERT INTO mime_type (mime_type) VALUES('text/x-bibtex'); INSERT INTO mime_type (mime_type) VALUES('text/x-sql'); INSERT INTO mime_type (mime_type) VALUES('text/x-emacs-lisp'); INSERT INTO mime_type (mime_type) VALUES('text/x-eiffel'); INSERT INTO mime_type (mime_type) VALUES('text/css'); INSERT INTO mime_type (mime_type) VALUES('text/x-fortran'); INSERT INTO mime_type (mime_type) VALUES('text/x-xslfo'); INSERT INTO mime_type (mime_type) VALUES('text/x-matlab'); INSERT INTO mime_type (mime_type) VALUES('text/x-uri'); INSERT INTO mime_type (mime_type) VALUES('text/x-setext'); INSERT INTO mime_type (mime_type) VALUES('text/x-readme'); INSERT INTO mime_type (mime_type) VALUES('text/x-troff-ms'); INSERT INTO mime_type (mime_type) VALUES('text/x-cmake'); INSERT INTO mime_type (mime_type) VALUES('text/tab-separated-values'); INSERT INTO mime_type (mime_type) VALUES('text/x-log'); INSERT INTO mime_type (mime_type) VALUES('text/x-mpsub'); INSERT INTO mime_type (mime_type) VALUES('text/x-mof'); INSERT INTO mime_type (mime_type) VALUES('text/html'); INSERT INTO mime_type (mime_type) VALUES('text/x-txt2tags'); INSERT INTO mime_type (mime_type) VALUES('text/x-csrc'); INSERT INTO mime_type (mime_type) VALUES('text/rfc822-headers'); INSERT INTO mime_type (mime_type) VALUES('text/x-mrml'); INSERT INTO mime_type (mime_type) VALUES('text/x-vala'); INSERT INTO mime_type (mime_type) VALUES('text/x-iptables'); INSERT INTO mime_type (mime_type) VALUES('text/x-c++hdr'); INSERT INTO mime_type (mime_type) VALUES('text/x-scheme'); INSERT INTO mime_type (mime_type) VALUES('text/x-texinfo'); INSERT INTO mime_type (mime_type) VALUES('text/x-objcsrc'); INSERT INTO mime_type (mime_type) VALUES('text/x-changelog'); INSERT INTO mime_type (mime_type) VALUES('x-content/audio-dvd'); INSERT INTO mime_type (mime_type) VALUES('x-content/video-svcd'); INSERT INTO mime_type (mime_type) VALUES('x-content/video-hddvd'); INSERT INTO mime_type (mime_type) VALUES('x-content/blank-dvd'); INSERT INTO mime_type (mime_type) VALUES('x-content/video-vcd'); INSERT INTO mime_type (mime_type) VALUES('x-content/unix-software'); INSERT INTO mime_type (mime_type) VALUES('x-content/blank-cd'); INSERT INTO mime_type (mime_type) VALUES('x-content/audio-cdda'); INSERT INTO mime_type (mime_type) VALUES('x-content/win32-software'); INSERT INTO mime_type (mime_type) VALUES('x-content/blank-hddvd'); INSERT INTO mime_type (mime_type) VALUES('x-content/audio-player'); INSERT INTO mime_type (mime_type) VALUES('x-content/video-dvd'); INSERT INTO mime_type (mime_type) VALUES('x-content/image-picturecd'); INSERT INTO mime_type (mime_type) VALUES('x-content/blank-bd'); INSERT INTO mime_type (mime_type) VALUES('x-content/video-bluray'); INSERT INTO mime_type (mime_type) VALUES('x-content/image-dcf'); INSERT INTO mime_type (mime_type) VALUES('x-content/software'); INSERT INTO mime_type (mime_type) VALUES('model/vrml'); INSERT INTO mime_type (mime_type) VALUES('fonts/package'); INSERT INTO mime_type (mime_type) VALUES('application/x-hwp'); INSERT INTO mime_type (mime_type) VALUES('application/x-pkcs7-certificates'); INSERT INTO mime_type (mime_type) VALUES('application/x-shockwave-flash'); INSERT INTO mime_type (mime_type) VALUES('application/x-turtle'); INSERT INTO mime_type (mime_type) VALUES('application/x-rar'); INSERT INTO mime_type (mime_type) VALUES('application/x-bittorrent'); INSERT INTO mime_type (mime_type) VALUES('application/prs.plucker'); INSERT INTO mime_type (mime_type) VALUES('application/smil'); INSERT INTO mime_type (mime_type) VALUES('application/x-abiword'); INSERT INTO mime_type (mime_type) VALUES('application/x-blender'); INSERT INTO mime_type (mime_type) VALUES('application/x-oleo'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-sunos-news'); INSERT INTO mime_type (mime_type) VALUES('application/x-tex-gf'); INSERT INTO mime_type (mime_type) VALUES('application/x-netshow-channel'); INSERT INTO mime_type (mime_type) VALUES('application/x-m4'); INSERT INTO mime_type (mime_type) VALUES('application/x-kexiproject-sqlite2'); INSERT INTO mime_type (mime_type) VALUES('application/x-kpovmodeler'); INSERT INTO mime_type (mime_type) VALUES('application/illustrator'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-snf'); INSERT INTO mime_type (mime_type) VALUES('application/x-gedcom'); INSERT INTO mime_type (mime_type) VALUES('application/x-kexiproject-shortcut'); INSERT INTO mime_type (mime_type) VALUES('application/andrew-inset'); INSERT INTO mime_type (mime_type) VALUES('application/x-bzdvi'); INSERT INTO mime_type (mime_type) VALUES('application/x-siag'); INSERT INTO mime_type (mime_type) VALUES('application/x-ktheme'); INSERT INTO mime_type (mime_type) VALUES('application/x-kspread'); INSERT INTO mime_type (mime_type) VALUES('application/x-cbr'); INSERT INTO mime_type (mime_type) VALUES('application/x-cmakecache'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-framemaker'); INSERT INTO mime_type (mime_type) VALUES('application/x-msx-rom'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-vfont'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-ttx'); INSERT INTO mime_type (mime_type) VALUES('application/x-uml'); INSERT INTO mime_type (mime_type) VALUES('application/x-cdrdao-toc'); INSERT INTO mime_type (mime_type) VALUES('application/x-kpresenter'); INSERT INTO mime_type (mime_type) VALUES('application/x-kseg'); INSERT INTO mime_type (mime_type) VALUES('application/x-dvi'); INSERT INTO mime_type (mime_type) VALUES('application/x-java-applet'); INSERT INTO mime_type (mime_type) VALUES('application/x-palm-database'); INSERT INTO mime_type (mime_type) VALUES('application/pgp-encrypted'); INSERT INTO mime_type (mime_type) VALUES('application/x-pocket-word'); INSERT INTO mime_type (mime_type) VALUES('application/x-kmplot'); INSERT INTO mime_type (mime_type) VALUES('application/x-core'); INSERT INTO mime_type (mime_type) VALUES('application/x-profile'); INSERT INTO mime_type (mime_type) VALUES('application/x-mswinurl'); INSERT INTO mime_type (mime_type) VALUES('application/x-lha'); INSERT INTO mime_type (mime_type) VALUES('application/x-netcdf'); INSERT INTO mime_type (mime_type) VALUES('application/msword'); INSERT INTO mime_type (mime_type) VALUES('application/x-dar'); INSERT INTO mime_type (mime_type) VALUES('application/pgp-signature'); INSERT INTO mime_type (mime_type) VALUES('application/x-dmod'); INSERT INTO mime_type (mime_type) VALUES('application/x-fictionbook+xml'); INSERT INTO mime_type (mime_type) VALUES('application/x-gettext-translation'); INSERT INTO mime_type (mime_type) VALUES('application/x-ace'); INSERT INTO mime_type (mime_type) VALUES('application/x-macbinary'); INSERT INTO mime_type (mime_type) VALUES('application/x-nintendo-ds-rom'); INSERT INTO mime_type (mime_type) VALUES('application/x-troff-man-compressed'); INSERT INTO mime_type (mime_type) VALUES('application/x-java'); INSERT INTO mime_type (mime_type) VALUES('application/x-mimearchive'); INSERT INTO mime_type (mime_type) VALUES('application/xml-dtd'); INSERT INTO mime_type (mime_type) VALUES('application/x-smaf'); INSERT INTO mime_type (mime_type) VALUES('application/x-pw'); INSERT INTO mime_type (mime_type) VALUES('application/x-lhz'); INSERT INTO mime_type (mime_type) VALUES('application/x-dia-diagram'); INSERT INTO mime_type (mime_type) VALUES('application/x-kugar'); INSERT INTO mime_type (mime_type) VALUES('application/x-sv4cpio'); INSERT INTO mime_type (mime_type) VALUES('application/x-kcachegrind'); INSERT INTO mime_type (mime_type) VALUES('application/x-gnumeric'); INSERT INTO mime_type (mime_type) VALUES('application/x-fluid'); INSERT INTO mime_type (mime_type) VALUES('application/x-quattropro'); INSERT INTO mime_type (mime_type) VALUES('application/x-gzip'); INSERT INTO mime_type (mime_type) VALUES('application/x-shared-library-la'); INSERT INTO mime_type (mime_type) VALUES('application/x-gba-rom'); INSERT INTO mime_type (mime_type) VALUES('application/x-sc'); INSERT INTO mime_type (mime_type) VALUES('application/x-glade'); INSERT INTO mime_type (mime_type) VALUES('application/x-catalog'); INSERT INTO mime_type (mime_type) VALUES('application/x-php'); INSERT INTO mime_type (mime_type) VALUES('application/x-kexiproject-sqlite3'); INSERT INTO mime_type (mime_type) VALUES('application/x-asp'); INSERT INTO mime_type (mime_type) VALUES('application/x-sqlite2'); INSERT INTO mime_type (mime_type) VALUES('application/x-tzo'); INSERT INTO mime_type (mime_type) VALUES('application/x-wais-source'); INSERT INTO mime_type (mime_type) VALUES('application/x-jbuilder-project'); INSERT INTO mime_type (mime_type) VALUES('application/x-package-list'); INSERT INTO mime_type (mime_type) VALUES('application/annodex'); INSERT INTO mime_type (mime_type) VALUES('application/x-toutdoux'); INSERT INTO mime_type (mime_type) VALUES('application/x-stuffit'); INSERT INTO mime_type (mime_type) VALUES('application/pkcs10'); INSERT INTO mime_type (mime_type) VALUES('application/x-sv4crc'); INSERT INTO mime_type (mime_type) VALUES('application/x-java-keystore'); INSERT INTO mime_type (mime_type) VALUES('application/x-kommander'); INSERT INTO mime_type (mime_type) VALUES('application/x-sami'); INSERT INTO mime_type (mime_type) VALUES('application/xspf+xml'); INSERT INTO mime_type (mime_type) VALUES('application/x-killustrator'); INSERT INTO mime_type (mime_type) VALUES('application/x-kgetlist'); INSERT INTO mime_type (mime_type) VALUES('application/x-hdf'); INSERT INTO mime_type (mime_type) VALUES('application/x-mobipocket-ebook'); INSERT INTO mime_type (mime_type) VALUES('application/x-shellscript'); INSERT INTO mime_type (mime_type) VALUES('application/xhtml+xml'); INSERT INTO mime_type (mime_type) VALUES('application/x-compressed-tar'); INSERT INTO mime_type (mime_type) VALUES('application/x-nzb'); INSERT INTO mime_type (mime_type) VALUES('application/x-markaby'); INSERT INTO mime_type (mime_type) VALUES('application/x-sms-rom'); INSERT INTO mime_type (mime_type) VALUES('application/rtf'); INSERT INTO mime_type (mime_type) VALUES('application/x-tuberling'); INSERT INTO mime_type (mime_type) VALUES('application/x-kgeo'); INSERT INTO mime_type (mime_type) VALUES('application/x-n64-rom'); INSERT INTO mime_type (mime_type) VALUES('application/x-smb-server'); INSERT INTO mime_type (mime_type) VALUES('application/pkix-crl'); INSERT INTO mime_type (mime_type) VALUES('application/x-dbf'); INSERT INTO mime_type (mime_type) VALUES('application/x-webarchive'); INSERT INTO mime_type (mime_type) VALUES('application/x-smb-workgroup'); INSERT INTO mime_type (mime_type) VALUES('application/x-gnome-theme-package'); INSERT INTO mime_type (mime_type) VALUES('application/epub+zip'); INSERT INTO mime_type (mime_type) VALUES('application/x-kchart'); INSERT INTO mime_type (mime_type) VALUES('application/x-aportisdoc'); INSERT INTO mime_type (mime_type) VALUES('application/x-cisco-vpn-settings'); INSERT INTO mime_type (mime_type) VALUES('application/x-egon'); INSERT INTO mime_type (mime_type) VALUES('application/x-kword'); INSERT INTO mime_type (mime_type) VALUES('application/x-xbel'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-type1'); INSERT INTO mime_type (mime_type) VALUES('application/x-lzip'); INSERT INTO mime_type (mime_type) VALUES('application/x-gdbm'); INSERT INTO mime_type (mime_type) VALUES('application/x-executable'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-linux-psf'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-tex-tfm'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-afm'); INSERT INTO mime_type (mime_type) VALUES('application/x-kcsrc'); INSERT INTO mime_type (mime_type) VALUES('application/x-kontour'); INSERT INTO mime_type (mime_type) VALUES('application/x-msi'); INSERT INTO mime_type (mime_type) VALUES('application/x-cd-image'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-libgrx'); INSERT INTO mime_type (mime_type) VALUES('application/x-designer'); INSERT INTO mime_type (mime_type) VALUES('application/x-nautilus-link'); INSERT INTO mime_type (mime_type) VALUES('application/x-zerosize'); INSERT INTO mime_type (mime_type) VALUES('application/x-superkaramba'); INSERT INTO mime_type (mime_type) VALUES('application/x-quanta'); INSERT INTO mime_type (mime_type) VALUES('application/ram'); INSERT INTO mime_type (mime_type) VALUES('application/javascript'); INSERT INTO mime_type (mime_type) VALUES('application/rdf+xml'); INSERT INTO mime_type (mime_type) VALUES('application/x-spss-por'); INSERT INTO mime_type (mime_type) VALUES('application/x-gnuplot'); INSERT INTO mime_type (mime_type) VALUES('application/x-kformula'); INSERT INTO mime_type (mime_type) VALUES('application/x-mif'); INSERT INTO mime_type (mime_type) VALUES('application/x-amipro'); INSERT INTO mime_type (mime_type) VALUES('application/x-slp'); INSERT INTO mime_type (mime_type) VALUES('application/x-audacity-project'); INSERT INTO mime_type (mime_type) VALUES('application/x-archive'); INSERT INTO mime_type (mime_type) VALUES('application/x-windows-themepack'); INSERT INTO mime_type (mime_type) VALUES('application/x-t602'); INSERT INTO mime_type (mime_type) VALUES('application/x-mswrite'); INSERT INTO mime_type (mime_type) VALUES('application/dicom'); INSERT INTO mime_type (mime_type) VALUES('application/x-gzdvi'); INSERT INTO mime_type (mime_type) VALUES('application/x-chm'); INSERT INTO mime_type (mime_type) VALUES('application/x-lzma-compressed-tar'); INSERT INTO mime_type (mime_type) VALUES('application/x-7z-compressed'); INSERT INTO mime_type (mime_type) VALUES('application/postscript'); INSERT INTO mime_type (mime_type) VALUES('application/x-gtktalog'); INSERT INTO mime_type (mime_type) VALUES('application/x-alz'); INSERT INTO mime_type (mime_type) VALUES('application/x-ustar'); INSERT INTO mime_type (mime_type) VALUES('application/x-troff-man'); INSERT INTO mime_type (mime_type) VALUES('application/xml'); INSERT INTO mime_type (mime_type) VALUES('application/sieve'); INSERT INTO mime_type (mime_type) VALUES('application/x-konsole'); INSERT INTO mime_type (mime_type) VALUES('application/x-dc-rom'); INSERT INTO mime_type (mime_type) VALUES('application/xsd'); INSERT INTO mime_type (mime_type) VALUES('application/pkcs7-mime'); INSERT INTO mime_type (mime_type) VALUES('application/x-xz'); INSERT INTO mime_type (mime_type) VALUES('application/x-cda'); INSERT INTO mime_type (mime_type) VALUES('application/x-abicollab'); INSERT INTO mime_type (mime_type) VALUES('application/x-cpio'); INSERT INTO mime_type (mime_type) VALUES('application/x-tgif'); INSERT INTO mime_type (mime_type) VALUES('application/x-class-file'); INSERT INTO mime_type (mime_type) VALUES('application/x-desktop'); INSERT INTO mime_type (mime_type) VALUES('application/x-reject'); INSERT INTO mime_type (mime_type) VALUES('application/x-xz-compressed-tar'); INSERT INTO mime_type (mime_type) VALUES('application/x-kivio'); INSERT INTO mime_type (mime_type) VALUES('application/x-kopete-emoticons'); INSERT INTO mime_type (mime_type) VALUES('application/x-kexi-connectiondata'); INSERT INTO mime_type (mime_type) VALUES('application/x-compress'); INSERT INTO mime_type (mime_type) VALUES('application/x-gmc-link'); INSERT INTO mime_type (mime_type) VALUES('application/x-krita'); INSERT INTO mime_type (mime_type) VALUES('application/x-java-archive'); INSERT INTO mime_type (mime_type) VALUES('application/x-theme'); INSERT INTO mime_type (mime_type) VALUES('application/x-deb'); INSERT INTO mime_type (mime_type) VALUES('application/x-gnucash'); INSERT INTO mime_type (mime_type) VALUES('application/x-cabri'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-otf'); INSERT INTO mime_type (mime_type) VALUES('application/x-kexiproject-sqlite'); INSERT INTO mime_type (mime_type) VALUES('application/x-lzma'); INSERT INTO mime_type (mime_type) VALUES('application/rss+xml'); INSERT INTO mime_type (mime_type) VALUES('application/x-khtml-adaptor'); INSERT INTO mime_type (mime_type) VALUES('application/x-gzpostscript'); INSERT INTO mime_type (mime_type) VALUES('application/x-bzip'); INSERT INTO mime_type (mime_type) VALUES('application/mathml+xml'); INSERT INTO mime_type (mime_type) VALUES('application/x-chess-pgn'); INSERT INTO mime_type (mime_type) VALUES('application/x-remote-connection'); INSERT INTO mime_type (mime_type) VALUES('application/x-gameboy-rom'); INSERT INTO mime_type (mime_type) VALUES('application/pkix-pkipath'); INSERT INTO mime_type (mime_type) VALUES('application/x-shorten'); INSERT INTO mime_type (mime_type) VALUES('application/x-snes-rom'); INSERT INTO mime_type (mime_type) VALUES('application/x-quicktime-media-link'); INSERT INTO mime_type (mime_type) VALUES('application/x-ruby'); INSERT INTO mime_type (mime_type) VALUES('application/x-tarz'); INSERT INTO mime_type (mime_type) VALUES('application/ogg'); INSERT INTO mime_type (mime_type) VALUES('application/x-ole-storage'); INSERT INTO mime_type (mime_type) VALUES('application/x-shar'); INSERT INTO mime_type (mime_type) VALUES('application/x-ksysv-package'); INSERT INTO mime_type (mime_type) VALUES('application/x-x509-ca-cert'); INSERT INTO mime_type (mime_type) VALUES('application/x-par2'); INSERT INTO mime_type (mime_type) VALUES('application/x-linguist'); INSERT INTO mime_type (mime_type) VALUES('application/x-trig'); INSERT INTO mime_type (mime_type) VALUES('application/mac-binhex40'); INSERT INTO mime_type (mime_type) VALUES('application/x-qw'); INSERT INTO mime_type (mime_type) VALUES('application/xml-external-parsed-entity'); INSERT INTO mime_type (mime_type) VALUES('application/octet-stream'); INSERT INTO mime_type (mime_type) VALUES('application/x-matroska'); INSERT INTO mime_type (mime_type) VALUES('application/x-applix-spreadsheet'); INSERT INTO mime_type (mime_type) VALUES('application/x-plasma'); INSERT INTO mime_type (mime_type) VALUES('application/x-e-theme'); INSERT INTO mime_type (mime_type) VALUES('application/x-cbz'); INSERT INTO mime_type (mime_type) VALUES('application/x-java-jnlp-file'); INSERT INTO mime_type (mime_type) VALUES('application/x-kns'); INSERT INTO mime_type (mime_type) VALUES('application/x-win-lnk'); INSERT INTO mime_type (mime_type) VALUES('application/x-ufraw'); INSERT INTO mime_type (mime_type) VALUES('application/x-drgeo'); INSERT INTO mime_type (mime_type) VALUES('application/x-perl'); INSERT INTO mime_type (mime_type) VALUES('application/pkcs7-signature'); INSERT INTO mime_type (mime_type) VALUES('application/x-ms-dos-executable'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-tex'); INSERT INTO mime_type (mime_type) VALUES('application/x-kolf'); INSERT INTO mime_type (mime_type) VALUES('application/x-planperfect'); INSERT INTO mime_type (mime_type) VALUES('application/x-go-sgf'); INSERT INTO mime_type (mime_type) VALUES('application/x-kwallet'); INSERT INTO mime_type (mime_type) VALUES('application/x-rpm'); INSERT INTO mime_type (mime_type) VALUES('application/sdp'); INSERT INTO mime_type (mime_type) VALUES('application/x-java-pack200'); INSERT INTO mime_type (mime_type) VALUES('application/relaxng'); INSERT INTO mime_type (mime_type) VALUES('application/x-servicepack'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-bdf'); INSERT INTO mime_type (mime_type) VALUES('application/pkix-cert'); INSERT INTO mime_type (mime_type) VALUES('application/x-ipod-firmware'); INSERT INTO mime_type (mime_type) VALUES('application/x-object'); INSERT INTO mime_type (mime_type) VALUES('application/x-ica'); INSERT INTO mime_type (mime_type) VALUES('application/x-it87'); INSERT INTO mime_type (mime_type) VALUES('application/x-zoo'); INSERT INTO mime_type (mime_type) VALUES('application/x-gzpdf'); INSERT INTO mime_type (mime_type) VALUES('application/x-magicpoint'); INSERT INTO mime_type (mime_type) VALUES('application/docbook+xml'); INSERT INTO mime_type (mime_type) VALUES('application/x-csh'); INSERT INTO mime_type (mime_type) VALUES('application/x-nes-rom'); INSERT INTO mime_type (mime_type) VALUES('application/x-graphite'); INSERT INTO mime_type (mime_type) VALUES('application/x-spss-sav'); INSERT INTO mime_type (mime_type) VALUES('application/x-tar'); INSERT INTO mime_type (mime_type) VALUES('application/x-kvtml'); INSERT INTO mime_type (mime_type) VALUES('application/metalink+xml'); INSERT INTO mime_type (mime_type) VALUES('application/ecmascript'); INSERT INTO mime_type (mime_type) VALUES('application/x-hwt'); INSERT INTO mime_type (mime_type) VALUES('application/x-pak'); INSERT INTO mime_type (mime_type) VALUES('application/x-sqlite3'); INSERT INTO mime_type (mime_type) VALUES('application/x-trash'); INSERT INTO mime_type (mime_type) VALUES('application/x-arj'); INSERT INTO mime_type (mime_type) VALUES('application/x-k3b'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-pcf'); INSERT INTO mime_type (mime_type) VALUES('application/oda'); INSERT INTO mime_type (mime_type) VALUES('application/x-genesis-rom'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-ttf'); INSERT INTO mime_type (mime_type) VALUES('application/zip'); INSERT INTO mime_type (mime_type) VALUES('application/x-cbt'); INSERT INTO mime_type (mime_type) VALUES('application/x-kspread-crypt'); INSERT INTO mime_type (mime_type) VALUES('application/x-pef-executable'); INSERT INTO mime_type (mime_type) VALUES('application/x-brasero'); INSERT INTO mime_type (mime_type) VALUES('application/x-cb7'); INSERT INTO mime_type (mime_type) VALUES('application/x-frame'); INSERT INTO mime_type (mime_type) VALUES('application/x-lyx'); INSERT INTO mime_type (mime_type) VALUES('application/x-lzop'); INSERT INTO mime_type (mime_type) VALUES('application/x-planner'); INSERT INTO mime_type (mime_type) VALUES('application/x-vnc'); INSERT INTO mime_type (mime_type) VALUES('application/atom+xml'); INSERT INTO mime_type (mime_type) VALUES('application/x-gz-font-linux-psf'); INSERT INTO mime_type (mime_type) VALUES('application/x-xliff'); INSERT INTO mime_type (mime_type) VALUES('application/mathematica'); INSERT INTO mime_type (mime_type) VALUES('application/xslt+xml'); INSERT INTO mime_type (mime_type) VALUES('application/x-sharedlib'); INSERT INTO mime_type (mime_type) VALUES('application/x-kwordquiz'); INSERT INTO mime_type (mime_type) VALUES('application/x-bzpostscript'); INSERT INTO mime_type (mime_type) VALUES('application/x-pkcs12'); INSERT INTO mime_type (mime_type) VALUES('application/x-mozilla-bookmarks'); INSERT INTO mime_type (mime_type) VALUES('application/x-awk'); INSERT INTO mime_type (mime_type) VALUES('application/x-navi-animation'); INSERT INTO mime_type (mime_type) VALUES('application/x-cpio-compressed'); INSERT INTO mime_type (mime_type) VALUES('application/x-arc'); INSERT INTO mime_type (mime_type) VALUES('application/x-icq'); INSERT INTO mime_type (mime_type) VALUES('application/x-bzpdf'); INSERT INTO mime_type (mime_type) VALUES('application/mbox'); INSERT INTO mime_type (mime_type) VALUES('application/x-ksysguard'); INSERT INTO mime_type (mime_type) VALUES('application/x-java-jce-keystore'); INSERT INTO mime_type (mime_type) VALUES('application/x-subrip'); INSERT INTO mime_type (mime_type) VALUES('application/x-karbon'); INSERT INTO mime_type (mime_type) VALUES('application/x-python-bytecode'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-dos'); INSERT INTO mime_type (mime_type) VALUES('application/pgp-keys'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-speedo'); INSERT INTO mime_type (mime_type) VALUES('application/pdf'); INSERT INTO mime_type (mime_type) VALUES('application/x-cue'); INSERT INTO mime_type (mime_type) VALUES('application/x-gnome-saved-search'); INSERT INTO mime_type (mime_type) VALUES('application/x-bcpio'); INSERT INTO mime_type (mime_type) VALUES('application/x-applix-word'); INSERT INTO mime_type (mime_type) VALUES('application/mxf'); INSERT INTO mime_type (mime_type) VALUES('application/x-wpg'); INSERT INTO mime_type (mime_type) VALUES('application/x-bzip-compressed-tar'); INSERT INTO mime_type (mime_type) VALUES('application/x-kword-crypt'); INSERT INTO mime_type (mime_type) VALUES('application/x-kig'); INSERT INTO mime_type (mime_type) VALUES('application/gnunet-directory'); INSERT INTO mime_type (mime_type) VALUES('application/x-kourse'); INSERT INTO mime_type (mime_type) VALUES('application/x-kudesigner'); INSERT INTO mime_type (mime_type) VALUES('application/x-tex-pk'); INSERT INTO mime_type (mime_type) VALUES('video/x-ms-asf'); INSERT INTO mime_type (mime_type) VALUES('video/mp4'); INSERT INTO mime_type (mime_type) VALUES('video/mpeg'); INSERT INTO mime_type (mime_type) VALUES('video/annodex'); INSERT INTO mime_type (mime_type) VALUES('video/x-sgi-movie'); INSERT INTO mime_type (mime_type) VALUES('video/isivideo'); INSERT INTO mime_type (mime_type) VALUES('video/x-ogm+ogg'); INSERT INTO mime_type (mime_type) VALUES('video/x-mng'); INSERT INTO mime_type (mime_type) VALUES('video/x-flv'); INSERT INTO mime_type (mime_type) VALUES('video/x-flic'); INSERT INTO mime_type (mime_type) VALUES('video/x-theora+ogg'); INSERT INTO mime_type (mime_type) VALUES('video/3gpp'); INSERT INTO mime_type (mime_type) VALUES('video/x-ms-wmv'); INSERT INTO mime_type (mime_type) VALUES('video/ogg'); INSERT INTO mime_type (mime_type) VALUES('video/dv'); INSERT INTO mime_type (mime_type) VALUES('video/x-matroska'); INSERT INTO mime_type (mime_type) VALUES('video/vivo'); INSERT INTO mime_type (mime_type) VALUES('video/quicktime'); INSERT INTO mime_type (mime_type) VALUES('video/x-ms-wmp'); INSERT INTO mime_type (mime_type) VALUES('video/x-msvideo'); INSERT INTO mime_type (mime_type) VALUES('video/x-anim'); INSERT INTO mime_type (mime_type) VALUES('video/wavelet'); INSERT INTO mime_type (mime_type) VALUES('video/x-nsv'); INSERT INTO mime_type (mime_type) VALUES('interface/x-winamp-skin'); INSERT INTO mime_type (mime_type) VALUES('multipart/encrypted'); INSERT INTO mime_type (mime_type) VALUES('multipart/x-mixed-replace'); INSERT INTO mime_type (mime_type) VALUES('multipart/related'); INSERT INTO mime_type (mime_type) VALUES('multipart/report'); INSERT INTO mime_type (mime_type) VALUES('multipart/signed'); INSERT INTO mime_type (mime_type) VALUES('multipart/appledouble'); INSERT INTO mime_type (mime_type) VALUES('multipart/mixed'); INSERT INTO mime_type (mime_type) VALUES('multipart/alternative'); INSERT INTO mime_type (mime_type) VALUES('multipart/digest'); ledgersmb/sql/upgrade/svn/3410-menu-functions.sql0000644000000000000000000001410011634752153020637 0ustar rootrootCREATE OR REPLACE FUNCTION menu_generate() RETURNS SETOF menu_item AS $$ DECLARE item menu_item; arg menu_attribute%ROWTYPE; BEGIN FOR item IN SELECT n.position, n.id, c.level, n.label, c.path, to_args(array[ma.attribute, ma.value]) FROM connectby('menu_node', 'id', 'parent', 'position', '0', 0, ',') c(id integer, parent integer, "level" integer, path text, list_order integer) JOIN menu_node n USING(id) JOIN menu_attribute ma ON (n.id = ma.node_id) WHERE n.id IN (select node_id FROM menu_acl WHERE pg_has_role(CASE WHEN role_name ilike 'public' THEN current_user ELSE role_name END, 'USAGE') GROUP BY node_id HAVING bool_and(CASE WHEN acl_type ilike 'DENY' THEN FALSE WHEN acl_type ilike 'ALLOW' THEN TRUE END)) or exists (select cn.id, cc.path FROM connectby('menu_node', 'id', 'parent', 'position', '0', 0, ',') cc(id integer, parent integer, "level" integer, path text, list_order integer) JOIN menu_node cn USING(id) WHERE cn.id IN (select node_id FROM menu_acl WHERE pg_has_role(CASE WHEN role_name ilike 'public' THEN current_user ELSE role_name END, 'USAGE') GROUP BY node_id HAVING bool_and(CASE WHEN acl_type ilike 'DENY' THEN false WHEN acl_type ilike 'ALLOW' THEN TRUE END)) and cc.path like c.path || ',%') GROUP BY n.position, n.id, c.level, n.label, c.path, c.list_order ORDER BY c.list_order LOOP RETURN NEXT item; END LOOP; END; $$ language plpgsql; CREATE OR REPLACE FUNCTION menu_children(in_parent_id int) RETURNS SETOF menu_item AS $$ declare item menu_item; arg menu_attribute%ROWTYPE; begin FOR item IN SELECT n.position, n.id, c.level, n.label, c.path, to_args(array[ma.attribute, ma.value]) FROM connectby('menu_node', 'id', 'parent', 'position', in_parent_id, 1, ',') c(id integer, parent integer, "level" integer, path text, list_order integer) JOIN menu_node n USING(id) JOIN menu_attribute ma ON (n.id = ma.node_id) WHERE n.id IN (select node_id FROM menu_acl WHERE pg_has_role(CASE WHEN role_name ilike 'public' THEN current_user ELSE role_name END, 'USAGE') GROUP BY node_id HAVING bool_and(CASE WHEN acl_type ilike 'DENY' THEN FALSE WHEN acl_type ilike 'ALLOW' THEN TRUE END)) or exists (select cn.id, cc.path FROM connectby('menu_node', 'id', 'parent', 'position', '0', 0, ',') cc(id integer, parent integer, "level" integer, path text, list_order integer) JOIN menu_node cn USING(id) WHERE cn.id IN (select node_id FROM menu_acl WHERE pg_has_role(CASE WHEN role_name ilike 'public' THEN current_user ELSE role_name END, 'USAGE') GROUP BY node_id HAVING bool_and(CASE WHEN acl_type ilike 'DENY' THEN false WHEN acl_type ilike 'ALLOW' THEN TRUE END)) and cc.path like c.path || ',%') GROUP BY n.position, n.id, c.level, n.label, c.path, c.list_order ORDER BY c.list_order LOOP return next item; end loop; end; $$ language plpgsql; ledgersmb/sql/upgrade/svn/3252-uniques.sql0000644000000000000000000000012111634752153017360 0ustar rootrootALTER TABLE ar ADD unique(invnumber); ALTER TABLE person ADD UNIQUE (entity_id); ledgersmb/sql/upgrade/svn/3478-files.sql0000644000000000000000000001220711634752153017013 0ustar rootrootBEGIN; CREATE TABLE mime_type ( id serial not null unique, mime_type text primary key ); COMMENT ON TABLE mime_type IS $$ This is a lookup table for storing MIME types.$$; CREATE TABLE file_class ( id serial not null unique, class text primary key ); insert into file_class values (1, 'transaction'); insert into file_class values (2, 'order'); COMMENT ON TABLE file_class IS $$ File classes are collections of files attached against rows in specific tables in the database. They can be used in the future to implement other form of file attachment. $$; CREATE TABLE file_base ( content bytea NOT NULL, mime_type_id int not null references mime_type(id), file_name text not null, description text, uploaded_by int not null default person__get_my_entity_id() references entity(id), uploaded_at timestamp not null default now(), id serial not null unique, ref_key int not null, file_class int not null references file_class(id), primary key (ref_key, file_name, file_class) ); COMMENT ON TABLE file_base IS $$Abstract table, holds no records. Inheriting table store actual file attachment data. Can be queried however to retrieve lists of all files. $$; COMMENT ON COLUMN file_base.ref_key IS $$This column inheriting tables is used to reference the database row for the attachment. Inheriting tables MUST set the foreign key here appropriately. This can also be used to create classifications of other documents, such as by source of automatic import (where the file is not yet attached) or even standard, long-lived documents.$$; CREATE TABLE file_transaction ( check (file_class = 1), unique(id), primary key (ref_key, file_name, file_class), foreign key (ref_key) REFERENCES transactions(id) ) inherits (file_base); COMMENT ON TABLE file_transaction IS $$ File attachments primarily attached to AR/AP/GL.$$; CREATE TABLE file_order ( check (file_class=2), unique(id), primary key (ref_key, file_name, file_class), foreign key (ref_key) references oe(id) ) inherits (file_base); COMMENT ON TABLE file_transaction IS $$ File attachments primarily attached to orders and quotatoins.$$; CREATE TABLE file_secondary_attachment ( file_id int not null, source_class int references file_class(id), ref_key int not null, dest_class int references file_class(id), attached_by int not null references entity(id), attached_at timestamp not null default now() ); COMMENT ON TABLE file_secondary_attachment IS $$Another abstract table. This one will use rewrite rules to make inserts safe because of the difficulty in managing inserts otherwise. Inheriting tables provide secondary links between the file and other database objects. Due to the nature of database inheritance and unique constraints in PostgreSQL, this must be partitioned in a star format.$$; CREATE TABLE file_tx_to_order ( foreign key (file_id) references file_transaction(id), foreign key (ref_key) references oe(id), check (source_class = 1), check (dest_class = 2) ) INHERITS (file_secondary_attachment); CREATE RULE file_sec_insert_tx_oe AS ON INSERT TO file_secondary_attachment WHERE source_class = 1 and dest_class = 2 DO INSTEAD INSERT INTO file_tx_to_order(file_id, source_class, ref_key, dest_class, attached_by, attached_at) VALUES (new.file_id, 1, new.ref_key, 2, coalesce(new.attached_by, person__get_my_entity_id()), coalesce(new.attached_at, now())); COMMENT ON TABLE file_tx_to_order IS $$ Secondary links from transactions to orders.$$; CREATE TABLE file_order_to_order ( foreign key (file_id) references file_order(id), foreign key (ref_key) references oe(id), check (source_class = 2), check (dest_class = 2) ) INHERITS (file_secondary_attachment); COMMENT ON TABLE file_order_to_order IS $$ Secondary links from one order to another, for example to support order consolidation.$$; CREATE RULE file_sec_insert_oe_oe AS ON INSERT TO file_secondary_attachment WHERE source_class = 2 and dest_class = 2 DO INSTEAD INSERT INTO file_order_to_order(file_id, source_class, ref_key, dest_class, attached_by, attached_at) VALUES (new.file_id, 2, new.ref_key, 2, coalesce(new.attached_by, person__get_my_entity_id()), coalesce(new.attached_at, now())); CREATE TABLE file_order_to_tx ( foreign key (file_id) references file_order(id), foreign key (ref_key) references transactions(id), check (source_class = 2), check (dest_class = 1) ) INHERITS (file_secondary_attachment); COMMENT ON TABLE file_order_to_tx IS $$ Secondary links from orders to transactions, for example to track files when invoices are generated from orders.$$; CREATE RULE file_sec_insert_oe_tx AS ON INSERT TO file_secondary_attachment WHERE source_class = 2 and dest_class = 1 DO INSTEAD INSERT INTO file_order_to_order(file_id, source_class, ref_key, dest_class, attached_by, attached_at) VALUES (new.file_id, 2, new.ref_key, 1, coalesce(new.attached_by, person__get_my_entity_id()), coalesce(new.attached_at, now())); COMMIT; ledgersmb/sql/upgrade/svn/3537-note-table.sql0000644000000000000000000000006611634752153017737 0ustar rootrootalter table note alter column vector set default ''; ledgersmb/sql/upgrade/svn/3445-drop-save-user.sql0000644000000000000000000000014111634752153020551 0ustar rootrootDROP FUNCTION admin__save_user (in_id int,in_entity_id INT, in_username text, in_password TEXT); ledgersmb/sql/upgrade/svn/3482-file_view_catelog.sql0000644000000000000000000000020711634752153021350 0ustar rootrootCREATE TABLE file_view_catalog ( file_class int references file_class(id) primary key, view_name text not null unique ); ledgersmb/sql/upgrade/svn/3383-menu-attributes.sql0000644000000000000000000000041311634752153021030 0ustar rootrootinsert into menu_attribute(node_id, attribute, value) values (87, 'module', 'ic.pl'); insert into menu_attribute(node_id, attribute, value) values (86, 'searchitems', 'all'); insert into menu_attribute(node_id, attribute, value) values (86, 'action', 'search'); ledgersmb/sql/upgrade/svn/3333-location-function-drop.sql0000644000000000000000000000000011634752153022260 0ustar rootrootledgersmb/sql/upgrade/svn/3551-asset-approval-menu.sql0000644000000000000000000000224011634752153021600 0ustar rootrootBEGIN; SELECT setval('menu_node_id_seq', max(id)) from menu_node; SELECT setval('menu_attribute_id_seq', max(id)) from menu_attribute; SELECT * FROM menu_insert(236, 2, 'Depreciation'); INSERT INTO menu_attribute(node_id, attribute, value) VALUES (currval('menu_node_id_seq')::int, 'module', 'asset.pl'); INSERT INTO menu_attribute(node_id, attribute, value) VALUES (currval('menu_node_id_seq')::int, 'action', 'search_reports'); INSERT INTO menu_attribute(node_id, attribute, value) VALUES (currval('menu_node_id_seq')::int, 'depreciation', '1'); INSERT INTO menu_acl(node_id, acl_type, role_name) values (currval('menu_node_id_seq')::int, 'allow', 'lsmb_' || current_database() || '__assets_approve'); SELECT * FROM menu_insert(236, 3, 'Disposal'); INSERT INTO menu_attribute(node_id, attribute, value) VALUES (currval('menu_node_id_seq')::int, 'module', 'asset.pl'); INSERT INTO menu_attribute(node_id, attribute, value) VALUES (currval('menu_node_id_seq')::int, 'action', 'search_reports'); INSERT INTO menu_acl(node_id, acl_type, role_name) values (currval('menu_node_id_seq')::int, 'allow', 'lsmb_' || current_database() || '__assets_approve'); COMMIT; ledgersmb/sql/upgrade/svn/3422-tax_tables.sql0000644000000000000000000000051111634752153020017 0ustar rootrootALTER TABLE tax_extended DROP COLUMN account_id; ALTER TABLE tax_extended DROP COLUMN tx_id; ALTER TABLE tax_extended DROP COLUMN reference; ALTER TABLE tax_extended DROP COLUMN tax_amount; ALTER TABLE tax_extended ADD entry_id int primary key; ALTER TABLE tax_extended ADD FOREIGN KEY(entry_id) references acc_trans(entry_id); ledgersmb/sql/upgrade/svn/3308-menu_update.sql0000644000000000000000000000053511640367231020204 0ustar rootroot insert into menu_attribute (node_id, attribute, value) values (49, 'l_first_name', '1'); insert into menu_attribute (node_id, attribute, value) values (49, 'l_id', '1'); insert into menu_attribute (node_id, attribute, value) values (49, 'l_startdate', '1'); insert into menu_attribute (node_id, attribute, value) values (49, 'l_enddate', '1'); ledgersmb/sql/upgrade/svn/3313-role-updates.sql0000644000000000000000000000026611634752153020303 0ustar rootroot INSERT INTO menu_acl (node_id, acl_type, role_name) SELECT id, 'allow', 'lsmb_' || current_database() ||'__tax_form_save' FROM menu_node WHERE parent = 217 and position in (2,3); ledgersmb/sql/upgrade/svn/3310-taxform-function.sql0000644000000000000000000000017411634752153021175 0ustar rootrootDROP FUNCTION tax_form__save(in_country_id int, in_form_name text, in_default_reportable bool); ledgersmb/sql/upgrade/svn/3335-drop-location_saves.sql0000644000000000000000000000076611634752153021663 0ustar rootrootDROP function eca__location_save( in_credit_id int, in_location_id int, in_location_class int, in_line_one text, in_line_two text, in_line_three text, in_city TEXT, in_state TEXT, in_mail_code text, in_country_code int); DROP function person__save_location( in_entity_id int, in_location_id int, in_location_class int, in_line_one text, in_line_two text, in_line_three text, in_city TEXT, in_state TEXT, in_mail_code text, in_country_code int); ledgersmb/sql/upgrade/svn/3479-inheritance_pkeys.sql0000644000000000000000000000043211634752153021413 0ustar rootrootalter table entity_note add primary key(id); alter table eca_note add primary key(id); alter table invoice_note add primary key(id); alter table parts_translation add PRIMARY KEY (trans_id, language_code); alter table project_translation add PRIMARY KEY (trans_id, language_code); ledgersmb/sql/upgrade/svn/3302-menu_changes.sql0000644000000000000000000000054311634752153020327 0ustar rootrootupdate menu_attribute set node_id = 49, attribute = 'l_last_name', value = '1' WHERE id = 115; update menu_attribute set node_id = 49, attribute = 'l_employeenumber', value = '1' WHERE id = 116; update menu_attribute set node_id = 49, attribute = 'module', value = 'employee.pl' WHERE id = 118; ledgersmb/sql/upgrade/svn/3534-drop_unused_function.sql0000644000000000000000000000006111634752153022131 0ustar rootroot DROP FUNCTION employee_delete (in_id integer); ledgersmb/sql/upgrade/svn/3497-schema-changes.sql0000644000000000000000000000052411634752153020557 0ustar rootrootALTER TABLE invoice ADD FOREIGN KEY (trans_id) REFERENCES transactions(id); ALTER TABLE invoice ADD FOREIGN KEY (parts_id) REFERENCES parts(id); ALTER TABLE tax ADD FOREIGN KEY (chart_id) REFERENCES account(id); CREATE TRIGGER ap_audit_trail AFTER insert or update or delete ON ap FOR EACH ROW EXECUTE PROCEDURE gl_audit_trail_append(); ledgersmb/sql/upgrade/svn/3286-qty_type.sql0000644000000000000000000000005411634752153017561 0ustar rootrootalter table invoice alter qty type numeric; ledgersmb/sql/upgrade/svn/3536-menu-update.sql0000644000000000000000000000011011634752153020116 0ustar rootrootupdate menu_attribute set value = 'asset.pl' where value = 'assets.pl'; ledgersmb/sql/upgrade/svn/3509-drop-function.sql0000644000000000000000000000011411634752153020465 0ustar rootrootDROP FUNCTION eca__get_location( in_credit_id int, in_class text ); ledgersmb/sql/upgrade/svn/3560-settings.sql0000644000000000000000000000012211634752153017532 0ustar rootroot DROP FUNCTION setting_set(varchar, varchar); DROP FUNCTION setting_get(varchar); ledgersmb/sql/upgrade/svn/3455-asset-schema.sql0000644000000000000000000001122311634752153020256 0ustar rootroot CREATE TABLE asset_unit_class ( id int not null unique, class text primary key ); INSERT INTO asset_unit_class (id, class) values (1, 'time'); INSERT INTO asset_unit_class (id, class) values (2, 'production'); -- production-based depreciation is unlikely to be supported initially CREATE TABLE asset_dep_method( id serial unique not null, method text primary key, sproc text not null unique, unit_label text not null, short_name text not null unique, unit_class int not null references asset_unit_class(id) ); comment on column asset_dep_method.method IS $$ These are keyed to specific stored procedures. Currently only "straight_line" is supported$$; INSERT INTO asset_dep_method(method, unit_class, sproc, unit_label, short_name) values ('Annual Straight Line Daily', 1, 'asset_dep_straight_line_yr_d', 'in years', 'SLYD'); INSERT INTO asset_dep_method(method, unit_class, sproc, unit_label, short_name) values ('Whole Month Straight Line', 1, 'asset_dep_straight_line_whl_m', 'in months', 'SLMM'); INSERT INTO asset_dep_method(method, unit_class, sproc, unit_label, short_name) values ('Annual Straight Line Daily', 1, 'asset_dep_straight_line_yr_m', 'in years', 'SLYM'); CREATE TABLE asset_class ( id serial not null unique, label text primary key, asset_account_id int references account(id), dep_account_id int references account(id), method int references asset_dep_method(id) ); COMMENT ON TABLE asset_class IS $$ The account fields here set the defaults for the individual asset items. They are non-authoritative. $$; CREATE TABLE asset_disposal_method ( label text primary key, id serial unique, multiple int check (multiple in (1, 0, -1)), short_label char(1) ); INSERT INTO asset_disposal_method (label, multiple, short_label) values ('Abandonment', '0', 'A'); INSERT INTO asset_disposal_method (label, multiple, short_label) values ('Sale', '1', 'S'); CREATE TABLE asset_rl_to_disposal_method ( report_id int references asset_report(id), asset_id int references asset_item(id), disposal_method_id int references asset_disposal_method(id), percent_disposed numeric, primary key (report_id, asset_id, disposal_method_id) ); CREATE TABLE asset_item ( id serial primary key, -- needed due to possible null in natural key description text, tag text not null, purchase_value numeric, salvage_value numeric, usable_life numeric, purchase_date date not null, start_depreciation date not null, location_id int references warehouse(id), department_id int references department(id), invoice_id int references ap(id), asset_account_id int references account(id), dep_account_id int references account(id), exp_account_id int references account(id), obsolete_by int references asset_item(id), asset_class_id int references asset_class(id), unique (tag, obsolete_by) -- part 1 of natural key enforcement ); CREATE UNIQUE INDEX asset_item_active_tag_u ON asset_item(tag) WHERE obsolete_by is null; -- part 2 of natural key enforcement COMMENT ON column asset_item.tag IS $$ This can be plugged into other routines to generate it automatically via ALTER TABLE .... SET DEFAULT.....$$; CREATE TABLE asset_note ( foreign key (ref_key) references asset_item(id), check (note_class = 4) ) inherits (note); INSERT INTO note_class (id, class) values (4, 'Asset'); ALTER TABLE asset_note alter column note_class set default 4; CREATE TABLE asset_report_class ( id int not null unique, class text primary key ); INSERT INTO asset_report_class (id, class) values (1, 'depreciation'); INSERT INTO asset_report_class (id, class) values (2, 'disposal'); INSERT INTO asset_report_class (id, class) values (3, 'import'); INSERT INTO asset_report_class (id, class) values (4, 'partial disposal'); CREATE TABLE asset_report ( id serial primary key, report_date date, gl_id bigint references gl(id) unique, asset_class bigint references asset_class(id), report_class int references asset_report_class(id), entered_by bigint not null references entity(id), approved_by bigint references entity(id), entered_at timestamp default now(), approved_at timestamp, depreciated_qty numeric, dont_approve bool default false, submitted bool not null default false ); CREATE TABLE asset_report_line( asset_id bigint references asset_item(id), report_id bigint references asset_report(id), amount numeric, department_id int references department(id), warehouse_id int references warehouse(id), PRIMARY KEY(asset_id, report_id) ); COMMENT ON COLUMN asset_report_line.department_id IS $$ In case assets are moved between departments, we have to store this here.$$; ledgersmb/sql/upgrade/svn/3637-dbversion-upgrade.sql0000644000000000000000000000010611634752153021321 0ustar rootroot UPDATE defaults SET value = '1.2.99' WHERE setting_key = 'version'; ledgersmb/sql/upgrade/svn/3297-employee_changes.sql0000644000000000000000000000170611634752153021221 0ustar rootrootdrop function employee__get(int); CREATE TYPE employee_result AS ( entity_id int, person_id int, salutation text, first_name text, middle_name text, last_name text, startdate date, enddate date, role varchar(20), ssn text, sales bool, manager_id int, manager_first_name text, manager_last_name text, employeenumber varchar(32), dob date ); CREATE OR REPLACE FUNCTION employee__get (in_entity_id integer) returns employee_result as $$ SELECT p.entity_id, p.id, s.salutation, p.first_name, p.middle_name, p.last_name, ee.startdate, ee.enddate, ee.role, ee.ssn, ee.sales, ee.manager_id, mp.first_name, mp.last_name, ee.employeenumber, ee.dob FROM person p JOIN entity_employee ee on (ee.entity_id = p.entity_id) LEFT JOIN salutation s on (p.salutation_id = s.id) LEFT JOIN person mp ON ee.manager_id = p.entity_id WHERE p.entity_id = $1; $$ language sql; ledgersmb/sql/upgrade/svn/3319-taxtable.-change.sql0000644000000000000000000000006311634752153021005 0ustar rootrootALTER TABLE tax alter column validto set not null; ledgersmb/sql/upgrade/svn/3448-drop-location-search.sql0000644000000000000000000000034211634752153021720 0ustar rootrootDROP FUNCTION location_search (in_companyname varchar, in_address1 varchar, in_address2 varchar, in_city varchar, in_state varchar, in_zipcode varchar, in_country varchar); DROP TYPE location_result CASCADE; ledgersmb/sql/upgrade/svn/3353-add-assembly-fkeys.sql0000644000000000000000000000020611634752153021361 0ustar rootrootALTER TABLE assembly ADD foreign key (id) REFERENCES parts(id); ALTER TABLE assembly ADD foreign key (parts_id) REFERENCES parts(id); ledgersmb/sql/upgrade/svn/3738-drop-session-transaction-id.sql0000644000000000000000000000005111640367231023240 0ustar rootrootALTER TABLE session DROP transaction_id; ledgersmb/sql/upgrade/svn/3313-list_taxform_menu.sql0000644000000000000000000000071511634752153021435 0ustar rootrootSELECT menu_insert(217, 2, 'List Tax Forms'); INSERT INTO menu_attribute(node_id, attribute, value) VALUES (currval('menu_node_id_seq')::int, 'module', 'taxform.pl'); INSERT INTO menu_attribute(node_id, attribute, value) VALUES (currval('menu_node_id_seq')::int, 'action', 'list_all'); SELECT menu_insert(217, 3, 'Reports'); INSERT INTO menu_attribute(node_id, attribute, value) VALUES (currval('menu_node_id_seq')::int, 'module', 'taxform.pl'); ledgersmb/sql/upgrade/svn/3495_drop_mime_func.sql0000644000000000000000000000007011634752153020753 0ustar rootrootDROP FUNCTION file__get_mime_type(in_mime_type_id int); ledgersmb/sql/upgrade/svn/3480-pkeys-2.sql0000644000000000000000000000061311634752153017172 0ustar rootrootALTER TABLE file_secondary_attachment ADD PRIMARY KEY(file_id, source_class, dest_class, ref_key); ALTER TABLE file_tx_to_order ADD PRIMARY KEY(file_id, source_class, dest_class, ref_key); ALTER TABLE file_order_to_order ADD PRIMARY KEY(file_id, source_class, dest_class, ref_key); ALTER TABLE file_order_to_tx ADD PRIMARY KEY(file_id, source_class, dest_class, ref_key); ledgersmb/sql/upgrade/svn/3640-new-file-type.sql0000644000000000000000000000053011634752153020361 0ustar rootrootinsert into file_class values (3, 'part'); CREATE TABLE file_part ( check (file_class=3), unique(id), primary key (ref_key, file_name, file_class), foreign key (ref_key) references parts(id) ) inherits (file_base); COMMENT ON TABLE file_part IS $$ File attachments primarily attached to orders and quotations.$$; ledgersmb/sql/upgrade/svn/3626-more-mime-types.sql0000644000000000000000000001513211634752153020735 0ustar rootrootINSERT INTO mime_type (mime_type) VALUES('audio/vnd.rn-realaudio'); INSERT INTO mime_type (mime_type) VALUES('image/vnd.dwg'); INSERT INTO mime_type (mime_type) VALUES('image/vnd.djvu'); INSERT INTO mime_type (mime_type) VALUES('image/vnd.rn-realpix'); INSERT INTO mime_type (mime_type) VALUES('image/vnd.dxf'); INSERT INTO mime_type (mime_type) VALUES('image/vnd.wap.wbmp'); INSERT INTO mime_type (mime_type) VALUES('image/vnd.ms-modi'); INSERT INTO mime_type (mime_type) VALUES('image/vnd.microsoft.icon'); INSERT INTO mime_type (mime_type) VALUES('image/vnd.adobe.photoshop'); INSERT INTO mime_type (mime_type) VALUES('text/vnd.wap.wml'); INSERT INTO mime_type (mime_type) VALUES('text/vnd.wap.wmlscript'); INSERT INTO mime_type (mime_type) VALUES('text/vnd.sun.j2me.app-descriptor'); INSERT INTO mime_type (mime_type) VALUES('text/vnd.abc'); INSERT INTO mime_type (mime_type) VALUES('text/vnd.rn-realtext'); INSERT INTO mime_type (mime_type) VALUES('text/vnd.graphviz'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.mozilla.xul+xml'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.text-web'); INSERT INTO mime_type (mime_type) VALUES('application/x-vnd.kde.kexi'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-word.document.macroenabled.12'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.scribus'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.sun.xml.writer.global'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.emusic-emusic_package'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.hp-pcl'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.stardivision.mail'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.google-earth.kml+xml'); INSERT INTO mime_type (mime_type) VALUES('application/x-vnd.kde.plan'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.kde.okular-archive'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.openxmlformats-officedocument.presentationml.presentation'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-wpl'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.formula'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.openxmlformats-officedocument.wordprocessingml.document'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.text-flat-xml'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.chart'); INSERT INTO mime_type (mime_type) VALUES('application/x-vnd.kde.plan.work'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-excel.sheet.macroenabled.12'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.lotus-1-2-3'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.hp-hpgl'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.sun.xml.writer'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.text-master'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.corel-draw'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.stardivision.draw'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.spreadsheet'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.stardivision.calc'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-powerpoint.presentation.macroenabled.12'); INSERT INTO mime_type (mime_type) VALUES('application/x-vnd.kde.kplato'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.text'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.stardivision.math'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.stardivision.writer'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.graphics-flat-xml'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.sun.xml.impress'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.spreadsheet-flat-xml'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.htmldoc-book'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.symbian.install'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-excel.sheet.binary.macroenabled.12'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.google-earth.kmz'); INSERT INTO mime_type (mime_type) VALUES('application/x-vnd.kde.kplato.work'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-excel'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.kde.kphotoalbum-import'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.sun.xml.draw'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.openxmlformats-officedocument.presentationml.slideshow'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.sun.xml.calc'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-cab-compressed'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.sun.xml.base'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.sun.xml.math'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-powerpoint'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.apple.mpegurl'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-works'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.image'); INSERT INTO mime_type (mime_type) VALUES('application/x-vnd.kde.contactgroup'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.presentation'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.rn-realmedia'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.database'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.stardivision.impress'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-access'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.openofficeorg.extension'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-xpsdocument'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.presentation-flat-xml'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.stardivision.chart'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.wordperfect'); INSERT INTO mime_type (mime_type) VALUES('application/x-vnd.kde.kugar.mixed'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.iccprofile'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.graphics'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-tnef'); INSERT INTO mime_type (mime_type) VALUES('video/vnd.rn-realvideo'); ledgersmb/sql/upgrade/svn/3328-drop-location_result.sql0000644000000000000000000000004311634752153022046 0ustar rootrootdrop type location_result cascade; ledgersmb/sql/upgrade/svn/3714-drop-recon-delete.sql0000644000000000000000000000007711640367231021210 0ustar rootrootDROP FUNCTION reconciliation__delete_report(in_report_id int); ledgersmb/sql/upgrade/svn/3686-batch_post.sql0000644000000000000000000000030211634752153020031 0ustar rootrootALTER FUNCTION batch_post(int) SECURITY DEFINER; REVOKE EXECUTE ON FUNCTION batch_post(int) FROM public; \echo you will need to GRANT execute on function batch_post to lsmb_[dbname]__batch_post ledgersmb/sql/upgrade/svn/3372-drop-location-delete.sql0000644000000000000000000000011611634752153021710 0ustar rootrootDROP FUNCTION person__delete_location (in_entity_id INT, in_location_id INT); ledgersmb/sql/upgrade/svn/3450-drop-user-function.sql0000644000000000000000000000006511634752153021441 0ustar rootrootDROP FUNCTION admin__delete_user (in_username TEXT); ledgersmb/sql/upgrade/svn/3764-control_code_index.sql0000644000000000000000000000005611641406502021537 0ustar rootrootALTER TABLE entity ADD UNIQUE (control_code); ledgersmb/sql/upgrade/svn/3299-person_functions.sql0000644000000000000000000000136611634752153021314 0ustar rootrootCREATE OR REPLACE FUNCTION person__list_bank_account(in_entity_id int) RETURNS SETOF entity_bank_account AS $$ DECLARE out_row entity_bank_account%ROWTYPE; BEGIN FOR out_row IN SELECT * from entity_bank_account where entity_id = in_entity_id LOOP RETURN NEXT out_row; END LOOP; END; $$ LANGUAGE PLPGSQL; CREATE OR REPLACE FUNCTION person__list_notes(in_entity_id int) RETURNS SETOF entity_note AS $$ DECLARE out_row record; BEGIN FOR out_row IN SELECT * FROM entity_note WHERE ref_key = in_entity_id ORDER BY created LOOP RETURN NEXT out_row; END LOOP; END; $$ LANGUAGE PLPGSQL; ledgersmb/sql/upgrade/svn/3808-language-table.sql0000644000000000000000000000240711644062743020557 0ustar rootrootINSERT INTO language (code, description) VALUES ('ar_EG', 'Arabic (Egypt)'), ('bg', 'Bulgarian'), ('ca', 'Catalan'), ('cs', 'Czech'), ('da', 'Danish'), ('de', 'German'), ('de_CH', 'German (Switzerland)'), ('el', 'Greek'), ('en', 'English'), ('es', 'Spanish'), ('es_CO', 'Spanish (Colombia)'), ('es_EC', 'Spanish (Ecuador)'), ('es_MX', 'Spanish (Mexico)'), ('es_PA', 'Spanish (Panama)'), ('es_PY', 'Spanish (Paraguay)'), ('es_VE', 'Spanish (Venezuela)'), ('et', 'Estonian'), ('fi', 'Finnish'), ('fr', 'French'), ('fr_BE', 'French (Belgium)'), ('fr_CA', 'French (Canada)'), ('hu', 'Hungarian'), ('id', 'Indonesian'), ('is', 'Icelandic'), ('it', 'Italian'), ('lt', 'Latvian'), ('nb', 'Norwegian'), ('nl', 'Dutch'), ('nl_BE', 'Dutch (Belgium)'), ('pl', 'Polish'), ('pt', 'Portuguese'), ('pt_BR', 'Portuguese (Brazil)'), ('ru', 'Russian'), ('sv', 'Swedish'), ('tr', 'Turkish'), ('uk', 'Ukranian'), ('zh_CN', 'Chinese (China)'), ('zh_TW', 'Chinese (Taiwan)'); ledgersmb/sql/upgrade/svn/3355-yearend-fkey.sql0000644000000000000000000000010211634752153020255 0ustar rootrootALTER TABLE yearend ADD FOREIGN KEY (trans_id) REFERENCES gl(id); ledgersmb/sql/upgrade/svn/3760-alter-asset_reports.sql0000644000000000000000000000017511641406502021676 0ustar rootrootalter table asset_report alter column entered_by set default person__get_my_entity_id(); DROP TYPE asset_nbv_line CASCADE; ledgersmb/sql/upgrade/svn/3421-tax_tables.sql0000644000000000000000000000054711634752153020027 0ustar rootrootCREATE TABLE tax_extended ( account_id int references account(id), tx_id int references transactions(id), reference text not null, tax_basis numeric, rate numeric, tax_amount numeric, check (tax_amount = rate*tax_basis/100) ); COMMENT ON TABLE tax_extended IS $$ This stores extended information for manual tax calculations.$$; ledgersmb/sql/upgrade/svn/3470-asset-menu.sql0000644000000000000000000000761511634752153017771 0ustar rootrootBEGIN; CREATE TEMPORARY TABLE menu_track (token text, node_id int); INSERT INTO menu_track(node_id, token) values (menu_insert(0, 17, 'Fixed Assets'), 'asset_top'); INSERT INTO menu_attribute (node_id, attribute, value) VALUES (currval('menu_node_id_seq')::int, 'menu', '1'); INSERT INTO menu_track values ('asset_class', menu_insert((SELECT node_id from menu_track where token = 'asset_top'), 1, 'Asset Classes')); INSERT INTO menu_attribute (node_id, attribute, value) VALUES (currval('menu_node_id_seq')::int, 'menu', '1'); INSERT INTO menu_track values ('asset_item', menu_insert((SELECT node_id from menu_track where token = 'asset_top'), 2, 'Assets')); INSERT INTO menu_attribute (node_id, attribute, value) VALUES (currval('menu_node_id_seq')::int, 'menu', '1'); SELECT menu_insert((SELECT node_id from menu_track where token = 'asset_class'), 1, 'Add Class'); INSERT INTO menu_attribute(node_id, attribute, value) VALUES (currval('menu_node_id_seq'), 'module', 'assets.pl'); INSERT INTO menu_attribute(node_id, attribute, value) VALUES (currval('menu_node_id_seq'), 'action', 'asset_category_screen'); SELECT menu_insert((SELECT node_id from menu_track where token = 'asset_class'), 2, 'List Classes'); INSERT INTO menu_attribute(node_id, attribute, value) VALUES (currval('menu_node_id_seq'), 'module', 'assets.pl'); INSERT INTO menu_attribute(node_id, attribute, value) VALUES (currval('menu_node_id_seq'), 'action', 'asset_category_search'); SELECT menu_insert((SELECT node_id from menu_track where token = 'asset_item'), 1, 'Add Assets'); INSERT INTO menu_attribute(node_id, attribute, value) VALUES (currval('menu_node_id_seq'), 'module', 'assets.pl'); INSERT INTO menu_attribute(node_id, attribute, value) VALUES (currval('menu_node_id_seq'), 'action', 'asset_screen'); SELECT menu_insert((SELECT node_id from menu_track where token = 'asset_items'), 2, 'Search Assets'); INSERT INTO menu_attribute(node_id, attribute, value) VALUES (currval('menu_node_id_seq'), 'module', 'assets.pl'); INSERT INTO menu_attribute(node_id, attribute, value) VALUES (currval('menu_node_id_seq'), 'action', 'asset_search'); SELECT menu_insert( (SELECT id FROM menu_node WHERE parent = (select id from menu_node where position = 17 and parent = 0) AND position=2), 3, 'Depreciate'); INSERT INTO menu_attribute (node_id, attribute, value) values (currval('menu_node_id_seq'), 'module', 'asset.pl'); INSERT INTO menu_attribute (node_id, attribute, value) values (currval('menu_node_id_seq'), 'action', 'new_report'); INSERT INTO menu_attribute (node_id, attribute, value) values (currval('menu_node_id_seq'), 'depreciate', '1'); SELECT menu_insert( (select id FROM menu_node where parent = (select id from menu_node where parent = 0 and position = 17 and label = 'Fixed Assets') and position = 2), 2, 'Import'); INSERT INTO menu_attribute (node_id, attribute, value) VALUES (currval('menu_node_id_seq')::int, 'module', 'asset.pl'); INSERT INTO menu_attribute (node_id, attribute, value) VALUES (currval('menu_node_id_seq')::int, 'action', 'import'); SELECT menu_insert( (SELECT id FROM menu_node WHERE parent = (select id from menu_node where position = 17 and parent = 0) AND position=2), 10, 'Reports'); INSERT INTO menu_attribute (node_id, attribute, value) values (currval('menu_node_id_seq'), 'menu', '1'); select menu_insert(currval('menu_node_id_seq')::int, 1, 'Net Book Value'); INSERT INTO menu_attribute (node_id, attribute, value) values (currval('menu_node_id_seq'), 'module', 'asset.pl'); INSERT INTO menu_attribute (node_id, attribute, value) values (currval('menu_node_id_seq'), 'action', 'display_nbv'); COMMIT; ledgersmb/sql/upgrade/svn/3572-letterhead-template-editing.sql0000644000000000000000000000135011634752153023254 0ustar rootroot-- Copy Letterhead HTML and TeX menus from their respective Invoice counterparts insert into menu_node (id, label, parent, position) values (241, 'Letterhead', 159, 16); insert into menu_node (id, label, parent, position) values (242, 'Letterhead', 172, 16); insert into menu_attribute select 241 as node_id, attribute, value from menu_attribute where node_id = 159; insert into menu_attribute select 242 as node_id, attribute, value from menu_attribute where node_id = 173; insert into menu_acl select nextval('menu_acl_id_seq'), role_name, acl_type, 241 as node_id from menu_acl where node_id = 159; insert into menu_acl select nextval('menu_acl_id_seq'), role_name, acl_type, 242 as node_id from menu_acl where node_id = 173; ledgersmb/sql/upgrade/svn/3694-update_version.sql0000644000000000000000000000053511634752153020741 0ustar rootrootUPDATE defaults SET value = '1.3.0' where setting_key = 'version'; CREATE TABLE partsgroup_translation (PRIMARY KEY (trans_id, language_code)) INHERITS (translation); ALTER TABLE partsgroup_translation ADD foreign key (trans_id) REFERENCES partsgroup(id); COMMENT ON TABLE partsgroup_translation IS $$ Translation information for partsgroups.$$; ledgersmb/sql/upgrade/svn/3613-drop-file_type.sql0000644000000000000000000000004211634752153020614 0ustar rootrootDROP TYPE file_list_item CASCADE; ledgersmb/sql/upgrade/svn/3293-recon_payee.sql0000644000000000000000000000220111634752153020166 0ustar rootroot CREATE OR REPLACE VIEW recon_payee AS SELECT n.name AS payee, rr.id, rr.report_id, rr.scn, rr.their_balance, rr.our_balance, rr.errorcode, rr."user", rr.clear_time, rr.insert_time, rr.trans_type, rr.post_date, rr.ledger_id, rr.voucher_id, rr.overlook, rr.cleared FROM cr_report_line rr LEFT JOIN acc_trans ac ON rr.ledger_id = ac.entry_id LEFT JOIN gl ON ac.trans_id = gl.id LEFT JOIN (( SELECT ap.id, e.name FROM ap JOIN entity_credit_account eca ON ap.entity_credit_account = eca.id JOIN entity e ON eca.entity_id = e.id UNION SELECT ar.id, e.name FROM ar JOIN entity_credit_account eca ON ar.entity_credit_account = eca.id JOIN entity e ON eca.entity_id = e.id) UNION SELECT gl.id, gl.description FROM gl) n ON n.id = ac.trans_id; CREATE OR REPLACE FUNCTION reconciliation__report_details_payee (in_report_id INT) RETURNS setof recon_payee as $$ DECLARE row recon_payee; BEGIN FOR row IN select * from recon_payee where report_id = in_report_id order by scn, post_date LOOP RETURN NEXT row; END LOOP; END; $$ language 'plpgsql';ledgersmb/sql/upgrade/svn/3703-grant-select-perm.sql0000644000000000000000000000006211634752153021225 0ustar rootrootGRANT SELECT ON partsgroup_translation TO public; ledgersmb/sql/upgrade/svn/3290-tax-account.sql0000644000000000000000000000730711634752153020134 0ustar rootroot ALTER TABLE account ADD tax bool not null default false; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax' UNION SELECT chart_id FROM tax); DROP FUNCTION account_save (in_id int, in_accno text, in_description text, in_category char(1), in_gifi_accno text, in_heading int, in_contra bool, in_link text[]); CREATE OR REPLACE FUNCTION account_save (in_id int, in_accno text, in_description text, in_category char(1), in_gifi_accno text, in_heading int, in_contra bool, in_tax bool, in_link text[]) RETURNS int AS $$ DECLARE t_heading_id int; t_link record; t_id int; BEGIN -- check to ensure summary accounts are exclusive -- necessary for proper handling by legacy code FOR t_link IN SELECT description FROM account_link_description WHERE summary='t' LOOP IF t_link.description = ANY (in_link) and array_upper(in_link, 1) > 1 THEN RAISE EXCEPTION 'Invalid link settings: Summary'; END IF; END LOOP; -- heading settings IF in_heading IS NULL THEN SELECT id INTO t_heading_id FROM account_heading WHERE accno < in_accno order by accno desc limit 1; ELSE t_heading_id := in_heading; END IF; -- don't remove custom links. DELETE FROM account_link WHERE account_id = in_id and description in ( select description from account_link_description where custom = 'f'); UPDATE account SET accno = in_accno, description = in_description, category = in_category, gifi_accno = in_gifi_accno, heading = t_heading_id, contra = in_contra, tax = in_tax WHERE id = in_id; IF FOUND THEN t_id := in_id; ELSE INSERT INTO account (accno, description, category, gifi_accno, heading, contra, tax) VALUES (in_accno, in_description, in_category, in_gifi_accno, t_heading_id, in_contra, in_tax); t_id := currval('account_id_seq'); END IF; FOR t_link IN select in_link[generate_series] AS val FROM generate_series(array_lower(in_link, 1), array_upper(in_link, 1)) LOOP INSERT INTO account_link (account_id, description) VALUES (t_id, t_link.val); END LOOP; RETURN t_id; END; $$ language plpgsql; DROP VIEW chart CASCADE; CREATE VIEW chart AS SELECT id, accno, description, 'H' as charttype, NULL as category, NULL as link, NULL as account_heading, null as gifi_accno, false as contra, false as tax from account_heading UNION select c.id, c.accno, c.description, 'A' as charttype, c.category, concat_colon(l.description) as link, heading, gifi_accno, contra, tax from account c left join account_link l ON (c.id = l.account_id) group by c.id, c.accno, c.description, c.category, c.heading, c.gifi_accno, c.contra, c.tax; GRANT SELECT ON chart TO public; CREATE OR REPLACE RULE chart_i AS ON INSERT TO chart DO INSTEAD SELECT CASE WHEN new.charttype='H' THEN account_heading_save(new.id, new.accno, new.description, NULL) ELSE account_save(new.id, new.accno, new.description, new.category, new.gifi_accno, NULL, CASE WHEN new.contra IS NULL THEN FALSE ELSE new.contra END, CASE WHEN new.tax IS NULL THEN FALSE ELSE new.tax END, string_to_array(new.link, ':')) END; ledgersmb/sql/upgrade/svn/3326-new_custom_fields_funcs.sql0000644000000000000000000000276711634752153022622 0ustar rootroot CREATE OR REPLACE FUNCTION add_custom_field (VARCHAR, VARCHAR, VARCHAR) RETURNS BOOL AS ' DECLARE table_name ALIAS FOR $1; new_field_name ALIAS FOR $2; field_datatype ALIAS FOR $3; BEGIN perform TABLE_ID FROM custom_table_catalog WHERE extends = table_name; IF NOT FOUND THEN BEGIN INSERT INTO custom_table_catalog (extends) VALUES (table_name); EXECUTE ''CREATE TABLE '' || quote_ident(''custom_'' ||table_name) || '' (row_id INT PRIMARY KEY)''; EXCEPTION WHEN duplicate_table THEN -- do nothing END; END IF; INSERT INTO custom_field_catalog (field_name, table_id) values (new_field_name, (SELECT table_id FROM custom_table_catalog WHERE extends = table_name)); EXECUTE ''ALTER TABLE ''|| quote_ident(''custom_''||table_name) || '' ADD COLUMN '' || quote_ident(new_field_name) || '' '' || quote_ident(field_datatype); RETURN TRUE; END; ' LANGUAGE PLPGSQL; -- end function CREATE OR REPLACE FUNCTION drop_custom_field (VARCHAR, VARCHAR) RETURNS BOOL AS ' DECLARE table_name ALIAS FOR $1; custom_field_name ALIAS FOR $2; BEGIN DELETE FROM custom_field_catalog WHERE field_name = custom_field_name AND table_id = (SELECT table_id FROM custom_table_catalog WHERE extends = table_name); EXECUTE ''ALTER TABLE '' || quote_ident(''custom_'' || table_name) || '' DROP COLUMN '' || quote_ident(custom_field_name); RETURN TRUE; END; ' LANGUAGE PLPGSQL; -- end function ledgersmb/sql/upgrade/svn/3331-drop-bank-acct-save.sql0000644000000000000000000000030011634752153021405 0ustar rootrootDROP FUNCTION eca__save_bank_account (in_entity_id int, in_credit_id int, in_bic text, in_iban text); DROP FUNCTION entity__save_bank_account (in_entity_id int, in_bic text, in_iban text); ledgersmb/sql/upgrade/svn/3476-drop-unused-fields.sql0000644000000000000000000000033611634752153021420 0ustar rootrootBEGIN; \echo This may fail on a fairly new database. In these cases, failures and \echo rollbacks are expected and normal. alter table entity_credit_account drop cc; alter table entity_credit_account drop bcc; COMMIT; ledgersmb/sql/upgrade/svn/3467-assets.sql0000644000000000000000000000043611634752153017212 0ustar rootrootBEGIN; INSERT INTO account_link_description (description, summary, custom) VALUES ('Asset_Dep', FALSE, FALSE), ('Fixed_Asset', FALSE, FALSE), ('asset_expense', FALSE, FALSE), ('asset_gain', FALSE, FALSE), ('asset_loss', FALSE, FALSE); ledgersmb/sql/upgrade/svn/3532-drop-used-function.sql0000644000000000000000000000007611634752153021426 0ustar rootrootDROP FUNCTION person__all_locations ( in_entity_id int ); ledgersmb/sql/upgrade/svn/3263-menu_generate.sql0000644000000000000000000001407711634752153020526 0ustar rootroot CREATE OR REPLACE FUNCTION menu_generate() RETURNS SETOF menu_item AS $$ DECLARE item menu_item; arg menu_attribute%ROWTYPE; BEGIN FOR item IN SELECT n.position, n.id, c.level, n.label, c.path, to_args(array[ma.attribute, ma.value]) FROM connectby('menu_node', 'id', 'parent', 'position', '0', 0, ',') c(id integer, parent integer, "level" integer, path text, list_order integer) JOIN menu_node n USING(id) JOIN menu_attribute ma ON (n.id = ma.node_id) WHERE n.id IN (select node_id FROM menu_acl WHERE pg_has_role(CASE WHEN role_name ilike 'public' THEN current_user ELSE role_name END, 'USAGE') GROUP BY node_id HAVING bool_and(CASE WHEN acl_type ilike 'DENY' THEN FALSE WHEN acl_type ilike 'ALLOW' THEN TRUE END)) or exists (select cn.id, cc.path FROM connectby('menu_node', 'id', 'parent', 'position', '0', 0, ',') cc(id integer, parent integer, "level" integer, path text, list_order integer) JOIN menu_node cn USING(id) WHERE cn.id IN (select node_id FROM menu_acl WHERE pg_has_role(CASE WHEN role_name ilike 'public' THEN current_user ELSE role_name END, 'USAGE') GROUP BY node_id HAVING bool_and(CASE WHEN acl_type ilike 'DENY' THEN false WHEN acl_type ilike 'ALLOW' THEN TRUE END)) and cc.path like c.path || '%') GROUP BY n.position, n.id, c.level, n.label, c.path, c.list_order ORDER BY c.list_order LOOP RETURN NEXT item; END LOOP; END; $$ language plpgsql; CREATE OR REPLACE FUNCTION menu_children(in_parent_id int) RETURNS SETOF menu_item AS $$ declare item menu_item; arg menu_attribute%ROWTYPE; begin FOR item IN SELECT n.position, n.id, c.level, n.label, c.path, to_args(array[ma.attribute, ma.value]) FROM connectby('menu_node', 'id', 'parent', 'position', in_parent_id, 1, ',') c(id integer, parent integer, "level" integer, path text, list_order integer) JOIN menu_node n USING(id) JOIN menu_attribute ma ON (n.id = ma.node_id) WHERE n.id IN (select node_id FROM menu_acl WHERE pg_has_role(CASE WHEN role_name ilike 'public' THEN current_user ELSE role_name END, 'USAGE') GROUP BY node_id HAVING bool_and(CASE WHEN acl_type ilike 'DENY' THEN FALSE WHEN acl_type ilike 'ALLOW' THEN TRUE END)) or exists (select cn.id, cc.path FROM connectby('menu_node', 'id', 'parent', 'position', '0', 0, ',') cc(id integer, parent integer, "level" integer, path text, list_order integer) JOIN menu_node cn USING(id) WHERE cn.id IN (select node_id FROM menu_acl WHERE pg_has_role(CASE WHEN role_name ilike 'public' THEN current_user ELSE role_name END, 'USAGE') GROUP BY node_id HAVING bool_and(CASE WHEN acl_type ilike 'DENY' THEN false WHEN acl_type ilike 'ALLOW' THEN TRUE END)) and cc.path like c.path || '%') GROUP BY n.position, n.id, c.level, n.label, c.path, c.list_order ORDER BY c.list_order LOOP return next item; end loop; end; $$ language plpgsql; ledgersmb/sql/upgrade/svn/3206-invoice_order.sql0000644000000000000000000000012111634752153020515 0ustar rootrootALTER TABLE invoice ADD precision int; ALTER TABLE orderitems ADD precision int; ledgersmb/sql/upgrade/svn/3386-drop-type.sql0000644000000000000000000000005711634752153017632 0ustar rootrootDROP TYPE tax_form_report_detail_item CASCADE; ledgersmb/sql/upgrade/svn/3594-drop-batch-update.sql0000644000000000000000000000021211634752153021204 0ustar rootrootDROP FUNCTION batch_update (in_batch text, in_login varchar, in_entered date, in_batch_number text, in_description text, in_id integer); ledgersmb/sql/upgrade/svn/3547-constraints-upgrade.sql0000644000000000000000000000121311634752153021675 0ustar rootrootALTER TABLE audittrail DROP CONSTRAINT "audittrail_person_id_fkey"; \echo If the update below fails, it may be because the table is set up correctly \echo already. It's safe to ignore constraint errors there. --' UPDATE audittrail SET person_id = (select entity_id from person where id = person_id); \echo If the alter table below fails, there is something wrong. Please correct \echo before proceding. ALTER TABLE audittrail ADD FOREIGN KEY (person_id) REFERENCES person(entity_id); ALTER TABLE lsmb_roles DROP CONSTRAINT "lsmb_roles_user_id_fkey"; ALTER TABLE lsmb_roles ADD foreign key (user_id) references users(id) ON DELETE CASCADE; ledgersmb/sql/upgrade/svn/3441-periods-view.sql0000644000000000000000000000063611634752153020317 0ustar rootroot CREATE OR REPLACE VIEW periods AS SELECT 'ytd' as id, 'Year to Date' as label, now()::date as date_to, (extract('year' from now())::text || '-01-01')::date as date_from UNION SELECT 'last_year', 'Last Year', ((extract('YEAR' from now()) - 1)::text || '-12-31')::date as date_to, ((extract('YEAR' from now()) - 1)::text || '-01-01')::date as date_from ; GRANT SELECT ON periods TO public; ledgersmb/sql/modules/0000755000000000000000000000000012060044550013763 5ustar rootrootledgersmb/sql/modules/Roles.sql0000644000000000000000000017716512053315004015606 0ustar rootrootGRANT ALL ON SCHEMA public TO public; -- required for Pg 8.2 -- Exchange rate creation (required insert and update on 'exchangerate' table) CREATE ROLE "lsmb___exchangerate_edit" WITH INHERIT NOLOGIN; GRANT INSERT, UPDATE ON exchangerate TO "lsmb___exchangerate_edit"; -- Basic file attachments CREATE ROLE "lsmb___file_read" WITH INHERIT NOLOGIN; GRANT SELECT ON file_base, file_secondary_attachment, file_transaction, file_order, file_links, file_part TO "lsmb___file_read"; CREATE ROLE "lsmb___file_attach_tx" WITH INHERIT NOLOGIN; GRANT INSERT, UPDATE ON file_transaction, file_order_to_tx TO "lsmb___file_attach_tx"; CREATE ROLE "lsmb___file_attach_order" WITH INHERIT NOLOGIN; GRANT INSERT, UPDATE ON file_order, file_order_to_order, file_tx_to_order TO "lsmb___file_attach_order"; GRANT INSERT, UPDATE ON file_transaction, file_order_to_tx TO "lsmb___file_attach_tx"; CREATE ROLE "lsmb___file_attach_part" WITH INHERIT NOLOGIN; GRANT INSERT, UPDATE ON file_part TO "lsmb___file_attach_part"; GRANT ALL ON file_base_id_seq TO "lsmb___file_attach_tx"; GRANT ALL ON file_base_id_seq TO "lsmb___file_attach_part"; GRANT ALL ON file_base_id_seq TO "lsmb___file_attach_order"; -- Contacts CREATE ROLE "lsmb___contact_read" WITH INHERIT NOLOGIN; GRANT SELECT ON partsvendor, partscustomer, taxcategory TO "lsmb___contact_read"; GRANT SELECT ON entity TO "lsmb___contact_read"; GRANT SELECT ON company TO "lsmb___contact_read"; GRANT SELECT ON location TO "lsmb___contact_read"; GRANT SELECT ON person TO "lsmb___contact_read"; GRANT SELECT ON entity_credit_account TO "lsmb___contact_read"; GRANT SELECT ON company_to_contact TO "lsmb___contact_read"; GRANT SELECT ON company_to_entity TO "lsmb___contact_read"; GRANT SELECT ON company_to_location TO "lsmb___contact_read"; GRANT SELECT ON customertax TO "lsmb___contact_read"; GRANT SELECT ON contact_class TO "lsmb___contact_read"; GRANT SELECT ON entity_class TO "lsmb___contact_read"; GRANT SELECT ON entity_bank_account TO "lsmb___contact_read"; GRANT SELECT ON entity_note TO "lsmb___contact_read"; GRANT SELECT ON entity_class_to_entity TO "lsmb___contact_read"; GRANT SELECT ON entity_other_name TO "lsmb___contact_read"; GRANT SELECT ON location_class TO "lsmb___contact_read"; GRANT SELECT ON person_to_company TO "lsmb___contact_read"; GRANT SELECT ON person_to_contact TO "lsmb___contact_read"; GRANT SELECT ON person_to_contact TO "lsmb___contact_read"; GRANT SELECT ON person_to_location TO "lsmb___contact_read"; GRANT SELECT ON person_to_location TO "lsmb___contact_read"; GRANT SELECT ON company_to_location TO "lsmb___contact_read"; GRANT SELECT ON vendortax TO "lsmb___contact_read"; GRANT SELECT ON eca_to_location TO "lsmb___contact_read"; GRANT SELECT ON eca_to_contact TO "lsmb___contact_read"; GRANT EXECUTE ON FUNCTION eca__list_notes(int) TO "lsmb___contact_read"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (14, 'allow', 'lsmb___contact_read'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (33, 'allow', 'lsmb___contact_read'); DELETE FROM menu_acl WHERE node_id = 49 AND role_name = 'lsmb___contact_read'; CREATE ROLE "lsmb___contact_create" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read"; GRANT INSERT ON entity TO "lsmb___contact_create"; GRANT ALL ON entity_id_seq TO "lsmb___contact_create"; GRANT INSERT ON company TO "lsmb___contact_create"; GRANT ALL ON company_id_seq TO "lsmb___contact_create"; GRANT INSERT ON location TO "lsmb___contact_create"; GRANT ALL ON location_id_seq TO "lsmb___contact_create"; GRANT INSERT ON person TO "lsmb___contact_create"; GRANT ALL ON person_id_seq TO "lsmb___contact_create"; GRANT INSERT ON entity_credit_account TO "lsmb___contact_create"; GRANT ALL ON entity_credit_account_id_seq TO "lsmb___contact_create"; GRANT INSERT ON company_to_contact TO "lsmb___contact_create"; GRANT INSERT ON company_to_entity TO "lsmb___contact_create"; GRANT ALL ON note_id_seq TO "lsmb___contact_create"; GRANT INSERT ON company_to_location TO "lsmb___contact_create"; GRANT INSERT ON customertax TO "lsmb___contact_create"; GRANT INSERT ON entity_bank_account TO "lsmb___contact_create"; GRANT ALL ON entity_bank_account_id_seq TO "lsmb___contact_create"; GRANT INSERT ON entity_note TO "lsmb___contact_create"; GRANT INSERT ON entity_class_to_entity TO "lsmb___contact_create"; GRANT INSERT ON entity_other_name TO "lsmb___contact_create"; GRANT INSERT ON person_to_company TO "lsmb___contact_create"; GRANT INSERT ON person_to_contact TO "lsmb___contact_create"; GRANT INSERT ON person_to_contact TO "lsmb___contact_create"; GRANT INSERT ON person_to_location TO "lsmb___contact_create"; GRANT INSERT ON person_to_location TO "lsmb___contact_create"; GRANT INSERT ON company_to_location TO "lsmb___contact_create"; GRANT DELETE ON company_to_location TO "lsmb___contact_create"; GRANT INSERT ON vendortax TO "lsmb___contact_create"; GRANT INSERT ON eca_to_location TO "lsmb___contact_create"; GRANT DELETE ON eca_to_location TO "lsmb___contact_create"; GRANT INSERT ON eca_to_contact TO "lsmb___contact_create"; GRANT DELETE ON eca_to_contact TO "lsmb___contact_create"; GRANT UPDATE ON eca_to_contact TO "lsmb___contact_create"; GRANT INSERT ON eca_note TO "lsmb___contact_create"; GRANT ALL ON customertax TO"lsmb___contact_create"; GRANT ALL ON vendortax TO"lsmb___contact_create"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (12, 'allow', 'lsmb___contact_create'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (31, 'allow', 'lsmb___contact_create'); CREATE ROLE "lsmb___employees_manage" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read"; GRANT ALL ON entity_employee, person, entity, entity_id_seq TO "lsmb___employees_manage"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (48, 'allow', 'lsmb___employees_manage'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (49, 'allow', 'lsmb___employees_manage'); CREATE ROLE "lsmb___contact_edit" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read"; GRANT UPDATE ON entity TO "lsmb___contact_edit"; GRANT UPDATE ON company TO "lsmb___contact_edit"; GRANT UPDATE ON location TO "lsmb___contact_edit"; GRANT UPDATE ON person TO "lsmb___contact_edit"; GRANT UPDATE ON entity_credit_account TO "lsmb___contact_edit"; GRANT UPDATE ON company_to_contact TO "lsmb___contact_edit"; GRANT UPDATE ON company_to_entity TO "lsmb___contact_edit"; GRANT UPDATE ON company_to_location TO "lsmb___contact_edit"; GRANT UPDATE ON customertax TO "lsmb___contact_edit"; GRANT UPDATE ON entity_bank_account TO "lsmb___contact_edit"; GRANT UPDATE ON entity_note TO "lsmb___contact_edit"; GRANT UPDATE ON entity_class_to_entity TO "lsmb___contact_edit"; GRANT UPDATE ON entity_other_name TO "lsmb___contact_edit"; GRANT UPDATE ON person_to_company TO "lsmb___contact_edit"; GRANT UPDATE ON person_to_contact TO "lsmb___contact_edit"; GRANT UPDATE ON person_to_contact TO "lsmb___contact_edit"; GRANT UPDATE, DELETE ON person_to_location TO "lsmb___contact_edit"; GRANT UPDATE ON eca_to_location TO "lsmb___contact_edit"; GRANT DELETE, INSERT ON vendortax TO "lsmb___contact_edit"; GRANT DELETE, INSERT ON entity_bank_account TO "lsmb___contact_edit"; GRANT ALL ON customertax TO"lsmb___contact_edit"; GRANT ALL ON vendortax TO"lsmb___contact_edit"; CREATE ROLE "lsmb___contact_all_rights" WITH INHERIT NOLOGIN in role "lsmb___contact_create", "lsmb___contact_edit", "lsmb___contact_read"; -- Batches and VOuchers CREATE ROLE "lsmb___batch_create" WITH INHERIT NOLOGIN; GRANT INSERT ON batch TO "lsmb___batch_create"; GRANT ALL ON batch_id_seq TO "lsmb___batch_create"; GRANT SELECT ON batch_class TO "lsmb___batch_create"; GRANT INSERT ON voucher TO "lsmb___batch_create"; GRANT ALL ON voucher_id_seq TO "lsmb___contact_create"; -- No menu acls CREATE ROLE "lsmb___batch_post" WITH INHERIT NOLOGIN; GRANT EXECUTE ON FUNCTION batch_post(int) TO "lsmb___batch_post"; DELETE FROM menu_acl WHERE node_id in (206, 210) AND role_name = 'lsmb___contact_create'; INSERT INTO menu_acl (node_id, acl_type, role_name) values (206, 'allow', 'lsmb___batch_post'), (210, 'allow', 'lsmb___batch_post'); -- AR CREATE ROLE "lsmb___ar_transaction_create" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read"; -- Role created later; using the GRANT construct, we support upgrades GRANT "lsmb___exchangerate_edit" TO "lsmb___ar_transaction_create"; GRANT INSERT ON ar, invoice_note TO "lsmb___ar_transaction_create"; GRANT SELECT ON oe TO "lsmb___ar_transaction_create"; GRANT ALL ON id TO "lsmb___ar_transaction_create"; GRANT INSERT ON acc_trans TO "lsmb___ar_transaction_create"; GRANT ALL ON acc_trans_entry_id_seq TO "lsmb___ar_transaction_create"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (2, 'allow', 'lsmb___ar_transaction_create'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (194, 'allow', 'lsmb___ar_transaction_create'); CREATE ROLE "lsmb___ar_transaction_create_voucher" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read", "lsmb___batch_create"; GRANT INSERT ON ar TO "lsmb___ar_transaction_create_voucher"; GRANT ALL ON id TO "lsmb___ar_transaction_create_voucher"; GRANT INSERT ON acc_trans TO "lsmb___ar_transaction_create_voucher"; GRANT ALL ON acc_trans_entry_id_seq TO "lsmb___ar_transaction_create_voucher"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (198, 'allow', 'lsmb___ar_transaction_create_voucher'); CREATE ROLE "lsmb___ar_invoice_create" WITH INHERIT NOLOGIN IN ROLE "lsmb___ar_transaction_create"; --### oldcode: UPDATE granted because old code wants it GRANT SELECT, INSERT, UPDATE ON invoice, new_shipto, new_shipto_id_seq TO "lsmb___ar_invoice_create"; GRANT ALL ON invoice_id_seq TO "lsmb___ar_invoice_create"; GRANT INSERT ON inventory TO "lsmb___ar_invoice_create"; GRANT ALL ON inventory_entry_id_seq TO "lsmb___ar_invoice_create"; GRANT INSERT ON tax_extended TO "lsmb___ar_invoice_create"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (3, 'allow', 'lsmb___ar_invoice_create'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (195, 'allow', 'lsmb___ar_invoice_create'); --CREATE ROLE "lsmb___ar_invoice_create_voucher" --WITH INHERIT NOLOGIN --IN ROLE "lsmb___contact_read", --"lsmb___batch_create", --"lsmb___ar_transaction_create_voucher"; --GRANT INSERT ON invoice TO "lsmb___ar_invoice_create_voucher"; --GRANT ALL ON invoice_id_seq TO "lsmb___ar_invoice_create_voucher"; --GRANT INSERT ON inventory TO "lsmb___ar_invoice_create_voucher"; --GRANT ALL ON inventory_entry_id_seq TO "lsmb___ar_invoice_create_voucher"; -- TODO add Menu ACLs CREATE ROLE "lsmb___ar_transaction_list" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read", "lsmb___file_read"; GRANT SELECT ON ar TO "lsmb___ar_transaction_list"; GRANT SELECT ON acc_trans TO "lsmb___ar_transaction_list"; GRANT SELECT ON invoice TO "lsmb___ar_transaction_list"; GRANT SELECT ON inventory TO "lsmb___ar_transaction_list"; GRANT SELECT ON tax_extended TO "lsmb___ar_transaction_list"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (5, 'allow', 'lsmb___ar_transaction_list'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (6, 'allow', 'lsmb___ar_transaction_list'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (7, 'allow', 'lsmb___ar_transaction_list'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (9, 'allow', 'lsmb___ar_transaction_list'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (10, 'allow', 'lsmb___ar_transaction_list'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (15, 'allow', 'lsmb___ar_transaction_list'); --CREATE ROLE "lsmb___ar_voucher_all" --WITH INHERIT NOLOGIN --IN ROLE "lsmb___ar_transaction_create_voucher", --"lsmb___ar_invoice_create_voucher"; CREATE ROLE "lsmb___ar_transaction_all" WITH INHERIT NOLOGIN IN ROLE "lsmb___ar_transaction_create", "lsmb___ar_invoice_create", "lsmb___ar_transaction_list", "lsmb___file_attach_tx"; CREATE ROLE "lsmb___sales_order_create" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read"; -- Role created later; using the GRANT construct, we support upgrades GRANT "lsmb___exchangerate_edit" TO "lsmb___sales_order_create"; GRANT ALL ON oe TO "lsmb___sales_order_create"; GRANT ALL ON oe_id_seq TO "lsmb___sales_order_create"; GRANT ALL ON orderitems TO "lsmb___sales_order_create"; GRANT ALL ON orderitems_id_seq TO "lsmb___sales_order_create"; GRANT ALL on inventory TO "lsmb___sales_order_create"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (51, 'allow', 'lsmb___sales_order_create'); CREATE ROLE "lsmb___sales_order_edit"; GRANT DELETE ON orderitems TO "lsmb___sales_order_edit"; GRANT DELETE ON new_shipto TO "lsmb___sales_order_edit"; CREATE ROLE "lsmb___sales_quotation_create" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read"; -- Role created later; using the GRANT construct, we support upgrades GRANT "lsmb___exchangerate_edit" TO "lsmb___sales_quotation_create"; GRANT ALL ON oe TO "lsmb___sales_quotation_create"; GRANT ALL ON oe_id_seq TO "lsmb___sales_quotation_create"; GRANT INSERT, UPDATE ON orderitems TO "lsmb___sales_quotation_create"; GRANT ALL ON orderitems_id_seq TO "lsmb___sales_quotation_create"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (68, 'allow', 'lsmb___sales_quotation_create'); CREATE ROLE "lsmb___sales_order_list" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read", "lsmb___file_read"; GRANT SELECT ON oe TO "lsmb___sales_order_list"; GRANT SELECT ON orderitems TO "lsmb___sales_order_list"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (54, 'allow', 'lsmb___sales_order_list'); CREATE ROLE "lsmb___sales_quotation_list" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read", "lsmb___file_read"; GRANT SELECT ON oe TO "lsmb___sales_quotation_list"; GRANT SELECT ON orderitems TO "lsmb___sales_quotation_list"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (71, 'allow', 'lsmb___sales_quotation_list'); CREATE ROLE "lsmb___ar_all" WITH INHERIT NOLOGIN IN ROLE --### "lsmb___ar_voucher_all", "lsmb___ar_transaction_all", "lsmb___sales_order_create", "lsmb___sales_quotation_create", "lsmb___sales_order_list", "lsmb___sales_quotation_list", "lsmb___file_attach_tx"; -- AP CREATE ROLE "lsmb___ap_transaction_create" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read"; -- Role created later; using the GRANT construct, we support upgrades GRANT "lsmb___exchangerate_edit" TO "lsmb___ap_transaction_create"; GRANT SELECT, INSERT ON ap, invoice_note TO "lsmb___ap_transaction_create"; GRANT ALL ON id TO "lsmb___ap_transaction_create"; GRANT INSERT ON acc_trans TO "lsmb___ap_transaction_create"; GRANT ALL ON acc_trans_entry_id_seq TO "lsmb___ap_transaction_create"; GRANT SELECT ON oe TO "lsmb___ap_transaction_create"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (22, 'allow', 'lsmb___ap_transaction_create'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (196, 'allow', 'lsmb___ap_transaction_create'); CREATE ROLE "lsmb___ap_transaction_create_voucher" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read", "lsmb___batch_create"; GRANT SELECT,INSERT, UPDATE ON ap, invoice TO "lsmb___ap_transaction_create_voucher"; GRANT ALL ON id TO "lsmb___ap_transaction_create_voucher"; GRANT INSERT ON acc_trans TO "lsmb___ap_transaction_create_voucher"; GRANT ALL ON acc_trans_entry_id_seq TO "lsmb___ap_transaction_create_voucher"; GRANT SELECT ON oe TO "lsmb___ap_transaction_create_voucher"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (199, 'allow', 'lsmb___ap_transaction_create_voucher'); CREATE ROLE "lsmb___ap_invoice_create" WITH INHERIT NOLOGIN IN ROLE "lsmb___ap_transaction_create"; GRANT INSERT ON invoice TO "lsmb___ap_invoice_create"; GRANT INSERT ON inventory TO "lsmb___ap_invoice_create"; GRANT ALL ON invoice_id_seq TO "lsmb___ap_invoice_create"; GRANT ALL ON inventory_entry_id_seq TO "lsmb___ap_invoice_create"; GRANT INSERT ON tax_extended TO "lsmb___ap_invoice_create"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (23, 'allow', 'lsmb___ap_invoice_create'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (197, 'allow', 'lsmb___ap_transaction_create'); CREATE ROLE "lsmb___ap_invoice_create_voucher" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read", "lsmb___batch_create"; GRANT INSERT ON invoice TO "lsmb___ap_invoice_create_voucher"; GRANT INSERT ON inventory TO "lsmb___ap_invoice_create_voucher"; GRANT ALL ON invoice_id_seq TO "lsmb___ap_invoice_create_voucher"; GRANT ALL ON inventory_entry_id_seq TO "lsmb___ap_invoice_create_voucher"; -- TODO add Menu ACLs CREATE ROLE "lsmb___ap_transaction_list" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read", "lsmb___file_read"; GRANT SELECT ON ap TO "lsmb___ap_transaction_list"; GRANT SELECT ON acc_trans TO "lsmb___ap_transaction_list"; GRANT SELECT ON invoice TO "lsmb___ap_transaction_list"; GRANT SELECT ON inventory TO "lsmb___ap_transaction_list"; GRANT SELECT ON tax_extended TO "lsmb___ap_transaction_list"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (25, 'allow', 'lsmb___ap_transaction_list'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (26, 'allow', 'lsmb___ap_transaction_list'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (27, 'allow', 'lsmb___ap_transaction_list'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (28, 'allow', 'lsmb___ap_transaction_list'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (29, 'allow', 'lsmb___ap_transaction_list'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (34, 'allow', 'lsmb___ap_transaction_list'); CREATE ROLE "lsmb___ap_all_vouchers" WITH INHERIT NOLOGIN IN ROLE "lsmb___ap_transaction_create_voucher", "lsmb___ap_invoice_create_voucher"; CREATE ROLE "lsmb___ap_all_transactions" WITH INHERIT NOLOGIN IN ROLE "lsmb___ap_transaction_create", "lsmb___ap_invoice_create", "lsmb___ap_transaction_list"; CREATE ROLE "lsmb___purchase_order_create" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read"; CREATE ROLE "lsmb___ap_transaction_all" WITH INHERIT NOLOGIN IN ROLE "lsmb___ap_transaction_create", "lsmb___ap_invoice_create", "lsmb___ap_transaction_list", "lsmb___file_attach_tx"; -- Role created later; using the GRANT construct, we support upgrades GRANT "lsmb___exchangerate_edit" TO "lsmb___purchase_order_create"; GRANT ALL ON oe TO "lsmb___purchase_order_create"; GRANT ALL ON orderitems TO "lsmb___purchase_order_create"; GRANT ALL ON oe_id_seq TO "lsmb___purchase_order_create"; GRANT ALL ON orderitems_id_seq TO "lsmb___purchase_order_create"; GRANT ALL on inventory TO "lsmb___purchase_order_create"; CREATE ROLE "lsmb___purchase_order_edit"; GRANT DELETE ON orderitems TO "lsmb___purchase_order_edit"; GRANT DELETE ON new_shipto TO "lsmb___purchase_order_edit"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (52, 'allow', 'lsmb___purchase_order_create'); CREATE ROLE "lsmb___rfq_create" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read"; -- Role created later; using the GRANT construct, we support upgrades GRANT "lsmb___exchangerate_edit" TO "lsmb___rfq_create"; GRANT ALL ON oe TO "lsmb___rfq_create"; GRANT ALL ON orderitems TO "lsmb___rfq_create"; GRANT ALL ON oe_id_seq TO "lsmb___rfq_create"; GRANT ALL ON orderitems_id_seq TO "lsmb___rfq_create"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (69, 'allow', 'lsmb___rfq_create'); CREATE ROLE "lsmb___purchase_order_list" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read"; GRANT SELECT ON oe TO "lsmb___purchase_order_list"; GRANT SELECT ON orderitems TO "lsmb___purchase_order_list"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (55, 'allow', 'lsmb___purchase_order_list'); CREATE ROLE "lsmb___rfq_list" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read"; GRANT SELECT ON oe TO "lsmb___rfq_list"; GRANT SELECT ON orderitems TO "lsmb___rfq_list"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (72, 'allow', 'lsmb___rfq_list'); CREATE ROLE "lsmb___ap_all" WITH INHERIT NOLOGIN IN ROLE "lsmb___ap_all_vouchers", "lsmb___ap_all_transactions", "lsmb___purchase_order_create", "lsmb___rfq_create", "lsmb___purchase_order_list", "lsmb___rfq_list"; -- CASH CREATE ROLE "lsmb___reconciliation_enter" WITH INHERIT NOLOGIN; GRANT SELECT ON recon_payee, cr_coa_to_account TO "lsmb___reconciliation_enter"; GRANT UPDATE ON cr_report TO "lsmb___reconciliation_enter"; GRANT ALL ON cr_report_line_id_seq TO "lsmb___reconciliation_enter"; GRANT INSERT, SELECT ON cr_report, cr_report_line TO "lsmb___reconciliation_enter"; GRANT DELETE, UPDATE ON cr_report_line TO "lsmb___reconciliation_enter"; GRANT SELECT ON acc_trans, account_checkpoint TO "lsmb___reconciliation_enter"; GRANT ALL ON cr_report_id_seq TO "lsmb___reconciliation_enter"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (45, 'allow', 'lsmb___reconciliation_enter'); CREATE ROLE "lsmb___reconciliation_approve" WITH INHERIT NOLOGIN; GRANT SELECT ON recon_payee TO "lsmb___reconciliation_approve"; GRANT EXECUTE ON FUNCTION reconciliation__delete_unapproved(in_report_id int) TO "lsmb___reconciliation_approve"; GRANT DELETE ON cr_report_line TO "lsmb___reconciliation_approve"; GRANT UPDATE ON cr_report TO "lsmb___reconciliation_approve"; GRANT SELECT ON acc_trans, account_checkpoint TO "lsmb___reconciliation_approve"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (44, 'allow', 'lsmb___reconciliation_approve'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (211, 'allow', 'lsmb___reconciliation_approve'); CREATE ROLE "lsmb___reconciliation_all" WITH INHERIT NOLOGIN IN ROLE "lsmb___reconciliation_enter", "lsmb___reconciliation_approve"; CREATE ROLE "lsmb___payment_process" WITH INHERIT NOLOGIN IN ROLE "lsmb___ap_transaction_list"; GRANT INSERT, SELECT ON payment, payment_links, overpayments TO "lsmb___payment_process"; GRANT SELECT, INSERT ON acc_trans TO "lsmb___payment_process"; GRANT ALL ON acc_trans_entry_id_seq TO "lsmb___payment_process"; GRANT UPDATE ON ap TO "lsmb___payment_process"; GRANT ALL ON payment, payment_id_seq TO "lsmb___payment_process"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (38, 'allow', 'lsmb___payment_process'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (43, 'allow', 'lsmb___payment_process'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (201, 'allow', 'lsmb___payment_process'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (202, 'allow', 'lsmb___payment_process'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (223, 'allow', 'lsmb___payment_process'); CREATE ROLE "lsmb___receipt_process" WITH INHERIT NOLOGIN IN ROLE "lsmb___ar_transaction_list"; GRANT INSERT, SELECT ON payment, payment_links, overpayments TO "lsmb___receipt_process"; GRANT INSERT ON acc_trans TO "lsmb___receipt_process"; GRANT ALL ON acc_trans_entry_id_seq TO "lsmb___receipt_process"; GRANT UPDATE ON ar TO "lsmb___receipt_process"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (36, 'allow', 'lsmb___receipt_process'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (37, 'allow', 'lsmb___receipt_process'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (42, 'allow', 'lsmb___receipt_process'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (203, 'allow', 'lsmb___receipt_process'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (204, 'allow', 'lsmb___receipt_process'); CREATE ROLE "lsmb___cash_all" WITH INHERIT NOLOGIN IN ROLE "lsmb___reconciliation_all", "lsmb___payment_process", "lsmb___receipt_process"; -- Inventory Control CREATE ROLE "lsmb___part_create" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read"; GRANT ALL ON partsvendor, partscustomer TO "lsmb___part_create"; GRANT INSERT ON parts, makemodel, partsgroup, assembly TO "lsmb___part_create"; GRANT ALL ON parts_id_seq, partsgroup_id_seq TO "lsmb___part_create"; GRANT INSERT ON partstax TO "lsmb___part_create"; GRANT ALL ON partsvendor_entry_id_seq, partscustomer_entry_id_seq TO "lsmb___part_create", "lsmb___contact_create"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (78, 'allow', 'lsmb___part_create'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (79, 'allow', 'lsmb___part_create'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (80, 'allow', 'lsmb___part_create'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (81, 'allow', 'lsmb___part_create'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (82, 'allow', 'lsmb___part_create'); CREATE ROLE "lsmb___part_edit" WITH INHERIT NOLOGIN; GRANT "lsmb___file_read" TO "lsmb___part_edit"; GRANT ALL ON partscustomer_entry_id_seq TO "lsmb___contact_edit", "lsmb___part_edit"; GRANT SELECT ON assembly, orderitems, jcitems, invoice TO "lsmb___part_edit"; GRANT DELETE ON assembly TO "lsmb___part_edit"; GRANT UPDATE ON parts, partsgroup, assembly TO "lsmb___part_edit"; GRANT ALL ON makemodel TO "lsmb___part_edit"; --###oldcode: Should have been UPDATE GRANT ALL ON partstax TO "lsmb___part_edit"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (86, 'allow', 'lsmb___part_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (87, 'allow', 'lsmb___part_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (88, 'allow', 'lsmb___part_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (89, 'allow', 'lsmb___part_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (90, 'allow', 'lsmb___part_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (91, 'allow', 'lsmb___part_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (93, 'allow', 'lsmb___part_edit'); CREATE ROLE "lsmb___inventory_reports" WITH INHERIT NOLOGIN; GRANT SELECT ON ar TO "lsmb___inventory_reports"; GRANT SELECT ON ap TO "lsmb___inventory_reports"; GRANT SELECT ON inventory TO "lsmb___inventory_reports"; GRANT SELECT ON invoice TO "lsmb___inventory_reports"; GRANT SELECT ON acc_trans TO "lsmb___inventory_reports"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (88, 'allow', 'lsmb___inventory_reports'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (94, 'allow', 'lsmb___inventory_reports'); CREATE ROLE "lsmb___pricegroup_create" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read"; GRANT INSERT ON pricegroup TO "lsmb___pricegroup_create"; GRANT ALL ON pricegroup_id_seq TO "lsmb___pricegroup_create"; GRANT UPDATE ON entity_credit_account TO "lsmb___pricegroup_create"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (83, 'allow', 'lsmb___pricegroup_create'); CREATE ROLE "lsmb___pricegroup_edit" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read"; GRANT UPDATE ON pricegroup TO "lsmb___pricegroup_edit"; GRANT UPDATE ON entity_credit_account TO "lsmb___pricegroup_edit"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (92, 'allow', 'lsmb___pricegroup_edit'); CREATE ROLE "lsmb___assembly_stock" WITH INHERIT NOLOGIN; GRANT UPDATE ON parts TO "lsmb___assembly_stock"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (84, 'allow', 'lsmb___assembly_stock'); CREATE ROLE "lsmb___inventory_ship" WITH INHERIT NOLOGIN IN ROLE "lsmb___sales_order_list"; GRANT INSERT ON inventory TO "lsmb___inventory_ship"; GRANT ALL ON inventory_entry_id_seq TO "lsmb___inventory_ship"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (64, 'allow', 'lsmb___inventory_ship'); CREATE ROLE "lsmb___inventory_receive" WITH INHERIT NOLOGIN IN ROLE "lsmb___purchase_order_list"; GRANT INSERT ON inventory TO "lsmb___inventory_receive"; GRANT ALL ON inventory_entry_id_seq TO "lsmb___inventory_receive"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (65, 'allow', 'lsmb___inventory_receive'); CREATE ROLE "lsmb___inventory_transfer" WITH INHERIT NOLOGIN; GRANT INSERT ON inventory TO "lsmb___inventory_transfer"; GRANT ALL ON inventory_entry_id_seq TO "lsmb___inventory_transfer"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (66, 'allow', 'lsmb___inventory_transfer'); CREATE ROLE "lsmb___warehouse_create" WITH INHERIT NOLOGIN; GRANT INSERT ON warehouse TO "lsmb___warehouse_create"; GRANT ALL ON warehouse_id_seq TO "lsmb___warehouse_create"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (142, 'allow', 'lsmb___warehouse_create'); CREATE ROLE "lsmb___warehouse_edit" WITH INHERIT NOLOGIN; GRANT UPDATE ON warehouse TO "lsmb___warehouse_edit"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (143, 'allow', 'lsmb___warehouse_edit'); CREATE ROLE "lsmb___inventory_all" WITH INHERIT NOLOGIN IN ROLE "lsmb___part_create", "lsmb___inventory_reports", "lsmb___assembly_stock", "lsmb___inventory_ship", "lsmb___inventory_receive", "lsmb___inventory_transfer", "lsmb___warehouse_edit", "lsmb___warehouse_create"; -- GL CREATE ROLE "lsmb___gl_transaction_create" WITH INHERIT NOLOGIN; GRANT SELECT, INSERT, UPDATe ON gl TO "lsmb___gl_transaction_create"; GRANT INSERT ON acc_trans TO "lsmb___gl_transaction_create"; GRANT ALL ON id TO "lsmb___gl_transaction_create"; GRANT ALL ON acc_trans_entry_id_seq TO "lsmb___gl_transaction_create"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (74, 'allow', 'lsmb___gl_transaction_create'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (75, 'allow', 'lsmb___gl_transaction_create'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (40, 'allow', 'lsmb___gl_transaction_create'); CREATE ROLE "lsmb___gl_voucher_create" WITH INHERIT NOLOGIN; GRANT INSERT ON gl TO "lsmb___gl_voucher_create"; GRANT INSERT ON acc_trans TO "lsmb___gl_voucher_create"; GRANT ALL ON id TO "lsmb___gl_voucher_create"; GRANT ALL ON acc_trans_entry_id_seq TO "lsmb___gl_voucher_create"; -- TODO Add menu permissions CREATE ROLE "lsmb___gl_reports" WITH INHERIT NOLOGIN IN ROLE "lsmb___ar_transaction_list", "lsmb___ap_transaction_list"; GRANT SELECT ON gl, acc_trans, account_checkpoint TO "lsmb___gl_reports"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (76, 'allow', 'lsmb___gl_reports'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (105, 'allow', 'lsmb___gl_reports'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (114, 'allow', 'lsmb___gl_reports'); CREATE ROLE "lsmb___yearend_run" WITH INHERIT NOLOGIN; GRANT INSERT, SELECT ON acc_trans, account_checkpoint, yearend TO "lsmb___yearend_run"; GRANT ALL ON account_checkpoint_id_seq TO "lsmb___yearend_run"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (132, 'allow', 'lsmb___yearend_run'); CREATE ROLE "lsmb___batch_list" WITH INHERIT NOLOGIN IN ROLE "lsmb___gl_reports"; GRANT SELECT ON batch TO "lsmb___batch_list"; GRANT SELECT ON batch_class TO "lsmb___batch_list"; GRANT SELECT ON voucher TO "lsmb___batch_list"; CREATE ROLE "lsmb___gl_all" WITH INHERIT NOLOGIN IN ROLE "lsmb___gl_transaction_create", "lsmb___gl_voucher_create", "lsmb___yearend_run", "lsmb___gl_reports"; -- PROJECTS CREATE ROLE "lsmb___project_create" WITH INHERIT NOLOGIN; GRANT INSERT ON project TO "lsmb___project_create"; GRANT ALL ON project_id_seq TO "lsmb___project_create"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (99, 'allow', 'lsmb___project_create'); CREATE ROLE "lsmb___project_edit" WITH INHERIT NOLOGIN; GRANT UPDATE ON project TO "lsmb___project_edit"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (104, 'allow', 'lsmb___project_edit'); CREATE ROLE "lsmb___project_timecard_add" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read"; GRANT INSERT, UPDATE ON jcitems TO "lsmb___project_timecard_add"; GRANT ALL ON jcitems_id_seq TO "lsmb___project_timecard_add"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (100, 'allow', 'lsmb___project_timecard_add'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (106, 'allow', 'lsmb___project_timecard_add'); CREATE ROLE "lsmb___project_timecard_list" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read"; GRANT SELECT ON jcitems TO "lsmb___project_timecard_list"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (106, 'allow', 'lsmb___project_timecard_list'); -- ORDER GENERATION CREATE ROLE "lsmb___orders_generate" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_read"; GRANT SELECT, INSERT, UPDATE ON oe TO "lsmb___orders_generate"; GRANT SELECT, INSERT, UPDATE ON orderitems TO "lsmb___orders_generate"; GRANT ALL ON oe_id_seq TO "lsmb___orders_generate"; GRANT ALL ON orderitems_id_seq TO "lsmb___orders_generate"; CREATE ROLE "lsmb___project_order_generate" WITH INHERIT NOLOGIN IN ROLE "lsmb___orders_generate", "lsmb___project_timecard_list"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (102, 'allow', 'lsmb___project_order_generate'); CREATE ROLE "lsmb___orders_sales_to_purchase" WITH INHERIT NOLOGIN IN ROLE "lsmb___orders_generate"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (57, 'allow', 'lsmb___orders_sales_to_purchase'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (58, 'allow', 'lsmb___orders_sales_to_purchase'); CREATE ROLE "lsmb___orders_purchase_consolidate" WITH INHERIT NOLOGIN IN ROLE "lsmb___orders_generate"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (60, 'allow', 'lsmb___orders_purchase_consolidate'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (62, 'allow', 'lsmb___orders_purchase_consolidate'); CREATE ROLE "lsmb___orders_sales_consolidate" WITH INHERIT NOLOGIN IN ROLE "lsmb___orders_generate"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (60, 'allow', 'lsmb___orders_sales_consolidate'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (61, 'allow', 'lsmb___orders_sales_consolidate'); CREATE ROLE "lsmb___orders_manage" WITH INHERIT NOLOGIN IN ROLE "lsmb___project_order_generate", "lsmb___orders_sales_to_purchase", "lsmb___orders_purchase_consolidate", "lsmb___orders_sales_consolidate"; -- FINANCIAL REPORTS CREATE ROLE "lsmb___financial_reports" WITH INHERIT NOLOGIN IN ROLE "lsmb___gl_reports"; GRANT select ON yearend TO "lsmb___financial_reports"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (110, 'allow', 'lsmb___financial_reports'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (111, 'allow', 'lsmb___financial_reports'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (112, 'allow', 'lsmb___financial_reports'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (113, 'allow', 'lsmb___financial_reports'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (114, 'allow', 'lsmb___financial_reports'); -- RECURRING TRANSACTIONS CREATE ROLE "lsmb___recurring" WITH INHERIT NOLOGIN; INSERT INTO menu_acl (node_id, acl_type, role_name) values (115, 'allow', 'lsmb___print_jobs_list'); -- BATCH PRINTING CREATE ROLE "lsmb___print_jobs_list" WITH INHERIT NOLOGIN; INSERT INTO menu_acl (node_id, acl_type, role_name) values (117, 'allow', 'lsmb___print_jobs_list'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (118, 'allow', 'lsmb___print_jobs_list'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (119, 'allow', 'lsmb___print_jobs_list'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (120, 'allow', 'lsmb___print_jobs_list'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (121, 'allow', 'lsmb___print_jobs_list'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (122, 'allow', 'lsmb___print_jobs_list'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (123, 'allow', 'lsmb___print_jobs_list'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (124, 'allow', 'lsmb___print_jobs_list'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (125, 'allow', 'lsmb___print_jobs_list'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (126, 'allow', 'lsmb___print_jobs_list'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (127, 'allow', 'lsmb___print_jobs_list'); CREATE ROLE "lsmb___print_jobs" WITH INHERIT NOLOGIN IN ROLE "lsmb___print_jobs_list"; --Tax Forms CREATE ROLE "lsmb___tax_form_save" WITH INHERIT NOLOGIN; GRANT ALL ON country_tax_form TO "lsmb___tax_form_save"; GRANT ALL ON country_tax_form_id_seq TO "lsmb___tax_form_save"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (218, 'allow', 'lsmb___tax_form_save'); INSERT INTO menu_acl (node_id, acl_type, role_name) SELECT id, 'allow', 'lsmb___tax_form_save' FROM menu_node WHERE parent = 217 and position in (2,3); -- -- SYSTEM SETTINGS CREATE ROLE "lsmb___system_settings_list" WITH INHERIT NOLOGIN; INSERT INTO menu_acl (node_id, acl_type, role_name) values (129, 'allow', 'lsmb___system_settings_list'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (131, 'allow', 'lsmb___system_settings_list'); CREATE ROLE "lsmb___system_settings_change" WITH INHERIT NOLOGIN IN ROLE "lsmb___system_settings_list"; CREATE ROLE "lsmb___taxes_set" WITH INHERIT NOLOGIN; GRANT INSERT, UPDATE ON tax TO "lsmb___taxes_set"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (130, 'allow', 'lsmb___taxes_set'); CREATE ROLE "lsmb___account_create" WITH INHERIT NOLOGIN; GRANT INSERT ON chart TO "lsmb___account_create"; GRANT INSERT ON account, cr_coa_to_account TO "lsmb___account_create"; GRANT ALL ON account_id_seq TO "lsmb___account_create"; GRANT INSERT ON account_heading TO "lsmb___account_create"; GRANT ALL ON account_heading_id_seq TO "lsmb___account_create"; GRANT INSERT ON account_link TO "lsmb___account_create"; -- account_link no longer appears to have a sequence and references account(id) --GRANT ALL ON account_link_id_seq TO "lsmb___account_create"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (137, 'allow', 'lsmb___account_create'); CREATE ROLE "lsmb___account_edit" WITH INHERIT NOLOGIN; GRANT ALL ON account, account_heading, account_link, cr_coa_to_account TO "lsmb___account_edit"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (138, 'allow', 'lsmb___account_edit'); CREATE ROLE "lsmb___auditor" WITH INHERIT NOLOGIN; GRANT SELECT ON audittrail TO "lsmb___auditor"; CREATE ROLE "lsmb___audit_trail_maintenance" WITH INHERIT NOLOGIN; GRANT DELETE ON audittrail TO "lsmb___audit_trail_maintenance"; CREATE ROLE "lsmb___gifi_create" WITH INHERIT NOLOGIN; GRANT INSERT ON gifi TO "lsmb___gifi_create"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (139, 'allow', 'lsmb___gifi_create'); CREATE ROLE "lsmb___gifi_edit" WITH INHERIT NOLOGIN; GRANT UPDATE ON gifi TO "lsmb___gifi_edit"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (140, 'allow', 'lsmb___gifi_edit'); CREATE ROLE "lsmb___account_all" WITH INHERIT NOLOGIN IN ROLE "lsmb___account_create", "lsmb___taxes_set", "lsmb___account_edit", "lsmb___gifi_create", "lsmb___gifi_edit"; CREATE ROLE "lsmb___department_create" WITH INHERIT NOLOGIN; GRANT INSERT ON department TO "lsmb___department_create"; GRANT ALL ON department_id_seq TO "lsmb___department_create"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (145, 'allow', 'lsmb___department_create'); CREATE ROLE "lsmb___department_edit" WITH INHERIT NOLOGIN; GRANT UPDATE ON department TO "lsmb___department_edit"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (146, 'allow', 'lsmb___department_edit'); CREATE ROLE "lsmb___department_all" WITH INHERIT NOLOGIN IN ROLE "lsmb___department_create", "lsmb___department_edit"; CREATE ROLE "lsmb___business_type_create" WITH INHERIT NOLOGIN; GRANT INSERT ON business TO "lsmb___business_type_create"; GRANT ALL ON business_id_seq TO "lsmb___business_type_create"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (148, 'allow', 'lsmb___business_type_create'); CREATE ROLE "lsmb___business_type_edit" WITH INHERIT NOLOGIN; GRANT UPDATE, DELETE ON business TO "lsmb___business_type_edit"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (149, 'allow', 'lsmb___business_type_edit'); CREATE ROLE "lsmb___business_type_all" WITH INHERIT NOLOGIN IN ROLE "lsmb___business_type_create", "lsmb___business_type_edit"; CREATE ROLE "lsmb___sic_create" WITH INHERIT NOLOGIN; GRANT INSERT ON sic TO "lsmb___sic_create"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (154, 'allow', 'lsmb___sic_create'); CREATE ROLE "lsmb___sic_edit" WITH INHERIT NOLOGIN; GRANT UPDATE ON sic TO "lsmb___sic_edit"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (155, 'allow', 'lsmb___sic_edit'); CREATE ROLE "lsmb___sic_all" WITH INHERIT NOLOGIN IN ROLE "lsmb___sic_create", "lsmb___sic_edit"; CREATE ROLE "lsmb___template_edit" WITH INHERIT NOLOGIN; -- TODO Add db permissions as templates get moved into db. INSERT INTO menu_acl (node_id, acl_type, role_name) values (157, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (158, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (159, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (160, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (161, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (162, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (163, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (164, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (165, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (166, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (167, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (168, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (169, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (170, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (171, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (173, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (174, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (175, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (176, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (177, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (178, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (179, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (180, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (181, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (182, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (183, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (184, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (185, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (186, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (187, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (189, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (190, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (241, 'allow', 'lsmb___template_edit'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (242, 'allow', 'lsmb___template_edit'); CREATE ROLE "lsmb___users_manage" WITH INHERIT NOLOGIN IN ROLE "lsmb___contact_edit", "lsmb___contact_create", "lsmb___employees_manage"; GRANT SELECT ON role_view TO "lsmb___users_manage"; GRANT EXECUTE ON FUNCTION admin__add_user_to_role(TEXT, TEXT) TO "lsmb___users_manage"; GRANT EXECUTE ON FUNCTION admin__remove_user_from_role(TEXT, TEXT) TO "lsmb___users_manage"; GRANT EXECUTE ON FUNCTION admin__add_function_to_group(TEXT, TEXT) TO "lsmb___users_manage"; GRANT EXECUTE ON FUNCTION admin__remove_function_from_group(text, text) TO "lsmb___users_manage"; GRANT EXECUTE ON FUNCTION admin__get_roles_for_user(INT) TO "lsmb___users_manage"; GRANT EXECUTE ON FUNCTION admin__save_user(int, INT, text, TEXT, BOOL) TO "lsmb___users_manage"; GRANT EXECUTE ON FUNCTION admin__create_group(TEXT) TO "lsmb___users_manage"; GRANT EXECUTE ON FUNCTION admin__delete_user(text, bool) TO "lsmb___users_manage"; GRANT EXECUTE ON FUNCTION admin__list_roles(text) TO "lsmb___users_manage"; GRANT EXECUTE ON FUNCTION admin__delete_group(text) TO "lsmb___users_manage"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (220, 'allow', 'lsmb___users_manage'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (221, 'allow', 'lsmb___users_manage'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (222, 'allow', 'lsmb___users_manage'); CREATE ROLE "lsmb___backup" WITH INHERIT NOLOGIN; -- TODO GRANT SELECT ON ALL TABLES INSERT INTO menu_acl (node_id, acl_type, role_name) values (134, 'allow', 'lsmb___backup'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (135, 'allow', 'lsmb___backup'); CREATE ROLE "lsmb___system_admin" WITH INHERIT NOLOGIN IN ROLE "lsmb___system_settings_change", "lsmb___account_all", "lsmb___department_all", "lsmb___business_type_all", "lsmb___sic_all", "lsmb___template_edit", "lsmb___users_manage", "lsmb___backup", "lsmb___tax_form_save"; -- Manual Translation CREATE ROLE "lsmb___language_create" WITH INHERIT NOLOGIN; GRANT INSERT ON language TO "lsmb___language_create"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (151, 'allow', 'lsmb___language_create'); CREATE ROLE "lsmb___language_edit" WITH INHERIT NOLOGIN; GRANT UPDATE ON language TO "lsmb___language_edit"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (152, 'allow', 'lsmb___language_edit'); CREATE ROLE "lsmb___part_translation_create" WITH INHERIT NOLOGIN; GRANT ALL ON parts_translation TO "lsmb___part_translation_create"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (96, 'allow', 'lsmb___part_translation_create'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (97, 'allow', 'lsmb___part_translation_create'); CREATE ROLE "lsmb___project_translation_create" WITH INHERIT NOLOGIN; GRANT ALL ON project_translation TO "lsmb___project_translation_create"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (108, 'allow', 'lsmb___project_translation_create'); CREATE ROLE "lsmb___partsgroup_translation_create" WITH INHERIT NOLOGIN; GRANT ALL ON partsgroup_translation TO "lsmb___partsgroup_translation_create"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (108, 'allow', 'lsmb___partsgroup_translation_create'); CREATE ROLE "lsmb___manual_translation_all" WITH INHERIT NOLOGIN IN ROLE "lsmb___language_create", "lsmb___part_translation_create", "lsmb___partsgroup_translation_create", "lsmb___project_translation_create"; -- Fixed Assets CREATE ROLE "lsmb___assets_administer" NOLOGIN INHERIT; GRANT INSERT, UPDATE, SELECT, DELETE ON asset_class TO "lsmb___assets_administer"; GRANT SELECT, UPDATE ON asset_class_id_seq TO "lsmb___assets_administer"; INSERT INTO menu_acl(role_name, acl_type, node_id) values('lsmb___assets_enter', 'allow', 237); CREATE ROLE "lsmb___assets_enter" NOLOGIN INHERIT; GRANT ALL ON asset_item_id_seq TO "lsmb___assets_enter"; GRANT INSERT, UPDATE ON asset_item TO "lsmb___assets_enter"; GRANT INSERT, SELECT ON asset_note TO "lsmb___assets_enter"; INSERT INTO menu_acl(role_name, acl_type, node_id) values('lsmb___assets_enter', 'allow', 230); INSERT INTO menu_acl(role_name, acl_type, node_id) values('lsmb___assets_enter', 'allow', 231); INSERT INTO menu_acl(role_name, acl_type, node_id) values('lsmb___assets_enter', 'allow', 232); INSERT INTO menu_acl(role_name, acl_type, node_id) values('lsmb___assets_enter', 'allow', 233); INSERT INTO menu_acl(role_name, acl_type, node_id) values('lsmb___assets_enter', 'allow', 235); CREATE ROLE "lsmb___assets_depreciate" NOLOGIN INHERIT; GRANT SELECT, INSERT ON asset_report, asset_report_line, asset_item, asset_class TO "lsmb___assets_depreciate"; GRANT UPDATE ON asset_report TO "lsmb___assets_depreciate"; GRANT ALL ON asset_report_id_seq TO "lsmb___assets_depreciate"; INSERT INTO menu_acl(role_name, acl_type, node_id) values('lsmb___assets_depreciate', 'allow', 238); INSERT INTO menu_acl(role_name, acl_type, node_id) values('lsmb___assets_depreciate', 'allow', 234); CREATE ROLE "lsmb___assets_approve" NOLOGIN INHERIT; GRANT SELECT ON asset_report, asset_report_line, asset_item, asset_class TO "lsmb___assets_approve"; GRANT EXECUTE ON FUNCTION asset_report__approve(int, int, int, int) TO "lsmb___assets_approve"; INSERT INTO menu_acl (role_name, acl_type, node_id) values('lsmb___assets_approve', 'allow', 239), ('lsmb___assets_approve', 'allow', 240); GRANT SELECT ON asset_class, asset_item to public; GRANT SELECT ON asset_unit_class TO public; GRANT SELECT ON asset_dep_method TO public; -- Grants to all users; GRANT SELECT ON makemodel TO public; GRANT SELECT ON custom_field_catalog TO public; GRANT SELECT ON custom_table_catalog TO public; GRANT SELECT ON oe_class TO public; GRANT SELECT ON note_class TO public; GRANT ALL ON defaults TO public; GRANT ALL ON "session" TO public; GRANT ALL ON session_session_id_seq TO PUBLIC; GRANT SELECT ON users TO public; GRANT ALL ON user_preference TO public; GRANT SELECT ON user_listable TO public; GRANT SELECT ON custom_table_catalog TO PUBLIC; GRANT SELECT ON custom_field_catalog TO PUBLIC; grant select on menu_node, menu_attribute, menu_acl to public; GRANT select on chart, gifi, country to public; GRANT SELECT ON parts, partsgroup TO public; GRANT SELECT ON language, project TO public; GRANT SELECT ON business, exchangerate, department, new_shipto, tax TO public; GRANT ALL ON recurring, recurringemail, recurringprint, status TO public; GRANT ALL ON transactions TO public; GRANT SELECT ON entity_employee TO public; REVOKE INSERT, UPDATE, DELETE ON entity_employee FROM public; --fixing old perms GRANT ALL ON pending_job, payments_queue TO PUBLIC; GRANT ALL ON pending_job_id_seq TO public; GRANT ALL ON invoice_tax_form TO public; GRANT SELECT ON taxmodule TO public; GRANT ALL ON ac_tax_form to public; GRANT SELECT ON country_tax_form to public; GRANT SELECT ON translation TO public; GRANT SELECT ON pricegroup TO public; GRANT SELECT ON partstax TO public; GRANT SELECT ON salutation TO public; GRANT SELECT ON partscustomer TO public; GRANT SELECT ON assembly TO public; GRANT SELECT ON jcitems TO public; GRANT SELECT ON payment_type TO public; GRANT SELECT ON lsmb_roles TO public; GRANT SELECT ON employee_search TO PUBLIC; GRANT SELECT ON warehouse TO public; GRANT SELECT ON voucher TO public; GRANT select ON account, account_link, account_link_description TO PUBLIC; GRANT select ON sic TO public; GRANT SELECT ON parts_translation, partsgroup_translation, project_translation TO public; GRANT SELECT ON asset_report_class, asset_rl_to_disposal_method, asset_disposal_method TO PUBLIC; GRANT SELECT ON mime_type, file_class TO PUBLIC; GRANT EXECUTE ON FUNCTION user__get_all_users() TO public; --TODO, lock recurring, pending_job, payment_queue down more -- Roles with no db permissions: CREATE ROLE "lsmb___draft_edit" WITH INHERIT NOLOGIN; INSERT INTO menu_acl (node_id, acl_type, role_name) values (210, 'allow', 'lsmb___draft_edit'); -- CT: The following grant is required for now, but will hopefully become less -- important when we get to 1.4 and can more sensibly lock things down. GRANT ALL ON dpt_trans TO public; -- Roles dependant on FUNCTIONS CREATE ROLE "lsmb___voucher_delete" WITH INHERIT NOLOGIN; GRANT EXECUTE ON FUNCTION voucher__delete(int) TO "lsmb___voucher_delete"; GRANT EXECUTE ON FUNCTION batch_delete(int) TO "lsmb___voucher_delete"; INSERT INTO menu_acl (node_id, acl_type, role_name) values (191, 'allow', 'public'); -- "New Window" menu item INSERT INTO menu_acl (node_id, acl_type, role_name) values (192, 'allow', 'public'); INSERT INTO menu_acl (node_id, acl_type, role_name) values (193, 'allow', 'public'); ledgersmb/sql/modules/Person.sql0000644000000000000000000002166611664065244016001 0ustar rootroot -- Copyright (C) 2011 LedgerSMB Core Team. Licensed under the GNU General -- Public License v 2 or at your option any later version. -- Docstrings already added to this file. BEGIN; CREATE OR REPLACE FUNCTION person__get_my_entity_id() RETURNS INT AS $$ SELECT entity_id from users where username = SESSION_USER; $$ LANGUAGE SQL; COMMENT ON FUNCTION person__get_my_entity_id() IS $$ Returns the entity_id of the current, logged in user.$$; CREATE OR REPLACE FUNCTION person__list_languages() RETURNS SETOF language AS $$ SELECT * FROM language ORDER BY code ASC $$ language sql; COMMENT ON FUNCTION person__list_languages() IS $$ Returns a list of languages ordered by code$$; CREATE OR REPLACE FUNCTION person__list_salutations() RETURNS SETOF salutation AS $$ SELECT * FROM salutation ORDER BY id ASC $$ language sql; COMMENT ON FUNCTION person__list_salutations() IS $$ Returns a list of salutations ordered by id.$$; CREATE OR REPLACE FUNCTION person__save (in_entity_id integer, in_salutation_id int, in_first_name text, in_middle_name text, in_last_name text, in_country_id integer ) RETURNS INT AS $$ DECLARE e_id int; e entity; loc location; l_id int; p_id int; BEGIN select * into e from entity where id = in_entity_id and entity_class = 3; e_id := in_entity_id; IF FOUND THEN UPDATE entity SET name = in_first_name || ' ' || in_last_name, country_id = in_country_id WHERE id = in_entity_id; ELSE INSERT INTO entity (name, entity_class, country_id) values (in_first_name || ' ' || in_last_name, 3, in_country_id); e_id := currval('entity_id_seq'); END IF; UPDATE person SET salutation_id = in_salutation_id, first_name = in_first_name, last_name = in_last_name, middle_name = in_middle_name WHERE entity_id = in_entity_id; IF FOUND THEN RETURN in_entity_id; ELSE -- Do an insert INSERT INTO person (salutation_id, first_name, last_name, entity_id) VALUES (in_salutation_id, in_first_name, in_last_name, e_id); RETURN e_id; END IF; END; $$ language plpgsql; COMMENT ON FUNCTION person__save (in_entity_id integer, in_salutation_id int, in_first_name text, in_middle_name text, in_last_name text, in_country_id integer ) IS $$ Saves the person with the information specified. Returns the entity_id of the record saved.$$; CREATE OR REPLACE FUNCTION person__list_locations(in_entity_id int) RETURNS SETOF location_result AS $$ DECLARE out_row RECORD; BEGIN FOR out_row IN SELECT l.id, l.line_one, l.line_two, l.line_three, l.city, l.state, l.mail_code, c.id, c.name, lc.id, lc.class FROM location l JOIN person_to_location ctl ON (ctl.location_id = l.id) JOIN person p ON (ctl.person_id = p.id) JOIN location_class lc ON (ctl.location_class = lc.id) JOIN country c ON (c.id = l.country_id) WHERE p.entity_id = in_entity_id ORDER BY lc.id, l.id, c.name LOOP RETURN NEXT out_row; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION person__list_locations(in_entity_id int) IS $$ Returns a list of locations specified attached to the person.$$; CREATE OR REPLACE FUNCTION person__list_contacts(in_entity_id int) RETURNS SETOF contact_list AS $$ DECLARE out_row RECORD; BEGIN FOR out_row IN SELECT cc.class, cc.id, c.description, c.contact FROM person_to_contact c JOIN contact_class cc ON (c.contact_class_id = cc.id) JOIN person p ON (c.person_id = p.id) WHERE p.entity_id = in_entity_id LOOP RETURN NEXT out_row; END LOOP; END; $$ LANGUAGE plpgsql; COMMENT ON FUNCTION person__list_contacts(in_entity_id int) IS $$ Returns a list of contacts attached to the function.$$; -- CREATE OR REPLACE FUNCTION person__delete_contact (in_person_id int, in_contact_class_id int, in_contact text) returns bool as $$ BEGIN DELETE FROM person_to_contact WHERE person_id = in_person_id and contact_class_id = in_contact_class_id and contact= in_contact; RETURN FOUND; END; $$ language plpgsql; COMMENT ON FUNCTION person__delete_contact (in_person_id int, in_contact_class_id int, in_contact text) IS $$ Deletes a contact record specified for the person. Returns true if a record was found and deleted, false if not.$$; DROP FUNCTION IF EXISTS person__save_contact (in_entity_id int, in_contact_class int, in_contact_orig text, in_contact_new TEXT); CREATE OR REPLACE FUNCTION person__save_contact (in_entity_id int, in_contact_class int, in_old_contact text, in_contact_new TEXT, in_description text, in_old_contact_class int) RETURNS INT AS $$ DECLARE out_id int; v_orig person_to_contact; BEGIN SELECT cc.* into v_orig FROM person_to_contact cc, person p WHERE p.entity_id = in_entity_id and cc.contact_class_id = in_old_contact_class AND cc.contact = in_old_contact AND cc.person_id = p.id; IF NOT FOUND THEN -- create INSERT INTO person_to_contact(person_id, contact_class_id, contact, description) VALUES ( (SELECT id FROM person WHERE entity_id = in_entity_id), in_contact_class, in_contact_new, in_description ); return 1; ELSE -- edit. UPDATE person_to_contact SET contact = in_contact_new, description = in_description WHERE contact = in_old_contact AND person_id = v_orig.person_id AND contact_class_id = in_old_contact_class; return 0; END IF; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION person__save_contact (in_entity_id int, in_contact_class int, in_old_contact text, in_contact_new TEXT, in_description text, in_old_contact_class int) IS $$ Saves saves contact info. Returns 1 if a row was inserted, 0 if it was updated. $$; CREATE OR REPLACE FUNCTION person__list_bank_account(in_entity_id int) RETURNS SETOF entity_bank_account AS $$ DECLARE out_row entity_bank_account%ROWTYPE; BEGIN FOR out_row IN SELECT * from entity_bank_account where entity_id = in_entity_id LOOP RETURN NEXT out_row; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION person__list_bank_account(in_entity_id int) IS $$ Lists bank accounts for a person$$; CREATE OR REPLACE FUNCTION person__list_notes(in_entity_id int) RETURNS SETOF entity_note AS $$ DECLARE out_row record; BEGIN FOR out_row IN SELECT * FROM entity_note WHERE ref_key = in_entity_id ORDER BY created LOOP RETURN NEXT out_row; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION person__list_notes(in_entity_id int) IS $$ Returns a list of notes attached to a person.$$; -- CREATE OR REPLACE FUNCTION person__delete_location (in_person_id int, in_location_id int, in_location_class int) RETURNS BOOL AS $$ BEGIN DELETE FROM person_to_location WHERE person_id = in_person_id AND location_id = in_location_id AND location_class = in_location_class; RETURN FOUND; END; $$ language plpgsql; COMMENT ON FUNCTION person__delete_location (in_person_id int, in_location_id int, in_location_class int) IS $$Deletes a location mapping to a person. Returns true if found, false if no data deleted.$$; CREATE OR REPLACE FUNCTION person__save_location( in_entity_id int, in_location_id int, in_location_class int, in_line_one text, in_line_two text, in_line_three text, in_city TEXT, in_state TEXT, in_mail_code text, in_country_code int, in_old_location_class int ) returns int AS $$ DECLARE l_row location; l_id INT; t_person_id int; BEGIN SELECT id INTO t_person_id FROM person WHERE entity_id = in_entity_id; UPDATE person_to_location SET location_class = in_location_class WHERE person_id = t_person_id AND location_class = in_old_location_class AND location_id = in_location_id; IF NOT FOUND THEN -- Create a new one. l_id := location_save( in_location_id, in_line_one, in_line_two, in_line_three, in_city, in_state, in_mail_code, in_country_code); INSERT INTO person_to_location (person_id, location_id, location_class) VALUES (t_person_id, l_id, in_location_class); ELSE l_id := location_save( in_location_id, in_line_one, in_line_two, in_line_three, in_city, in_state, in_mail_code, in_country_code); -- Update the old one. END IF; return l_id; END; $$ language 'plpgsql'; COMMENT ON FUNCTION person__save_location( in_entity_id int, in_location_id int, in_location_class int, in_line_one text, in_line_two text, in_line_three text, in_city TEXT, in_state TEXT, in_mail_code text, in_country_code int, in_old_location_class int ) IS $$ Saves a location mapped to the person with the specified information. Returns the location id saved.$$; COMMIT; ledgersmb/sql/modules/Business_type.sql0000644000000000000000000000056011603754547017361 0ustar rootrootCREATE OR REPLACE FUNCTION business_type__list() RETURNS SETOF business AS $$ DECLARE out_row business%ROWTYPE; BEGIN FOR out_row IN SELECT * FROM business ORDER BY description LOOP RETURN NEXT out_row; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON function business_type__list() IS $$Returns a list of all business types. Ordered by description by default.$$; ledgersmb/sql/modules/Date.sql0000644000000000000000000001116611607474061015400 0ustar rootroot -- Copyright (C) 2011 LedgerSMB Core Team. Licensed under the GNU General -- Public License v 2 or at your option any later version. -- Docstrings already added to this file. CREATE OR REPLACE FUNCTION date_get_all_years() returns setof INT AS $$ DECLARE next_record int; BEGIN SELECT MIN(EXTRACT ('YEAR' FROM transdate))::INT INTO next_record FROM acc_trans; LOOP EXIT WHEN next_record IS NULL; RETURN NEXT next_record; SELECT MIN(EXTRACT ('YEAR' FROM transdate))::INT AS YEAR INTO next_record FROM acc_trans WHERE EXTRACT ('YEAR' FROM transdate) > next_record; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION date_get_all_years() IS $$ This function return each year inside transdate in transactions. Currently it uses a sparse index scan because the number of rows returned is very small and the table can be very large.$$; CREATE OR REPLACE FUNCTION is_leapyear(in_date date) returns bool as $$ select extract('day' FROM ( (extract('year' FROM $1)::text || '-02-28')::date + '1 day'::interval)::date) = 29; $$ language sql; COMMENT ON FUNCTION is_leapyear(in_date date) IS $$ Returns true if date is in a leapyear. False if not. Uses the built-in PostgreSQL date handling, and no direct detection is done in our code.$$; CREATE OR REPLACE FUNCTION leap_days(in_year_from int, in_year_to int) RETURNS int AS $$ SELECT count(*)::int FROM generate_series($1, $2) WHERE is_leapyear((generate_series::text || '-01-01')::date); $$ LANGUAGE SQL; COMMENT ON FUNCTION leap_days(in_year_from int, in_year_to int) IS $$Returns the number of leap years between the two year inputs, inclusive.$$; CREATE OR REPLACE FUNCTION next_leap_year_calc(in_date date, is_end bool) returns int as $$ SELECT (CASE WHEN extract('doy' FROM $1) < 59 THEN extract('year' FROM $1) ELSE extract('year' FROM $1) + 1 END)::int - CASE WHEN $2 THEN 1 ELSE 0 END; $$ LANGUAGE SQL; COMMENT ON FUNCTION next_leap_year_calc(in_date date, is_end bool) IS $$Next relevant leap year calculation for a daily depreciation calculation$$; CREATE OR REPLACE FUNCTION get_fractional_year (in_date_from date, in_date_to date) RETURNS numeric AS $$ select ($2 - $1 - leap_days(next_leap_year_calc($1, false), next_leap_year_calc($2, true))) /365::numeric; $$ LANGUAGE SQL; COMMENT ON FUNCTION get_fractional_year (in_date_from date, in_date_to date) IS $$ Returns the decimal representation of the fractional year.$$; CREATE OR REPLACE FUNCTION days_in_month(in_date date) returns int AS $$ SELECT (extract(DOM FROM date_trunc('month', $1) + '1 month - 1 second'::interval) )::int; $$ language sql; COMMENT ON FUNCTION days_in_month(in_date date) IS $$ Returns the number of days in the month that includes in_date.$$; CREATE OR REPLACE FUNCTION is_same_year (in_date1 date, in_date2 date) returns bool as $$ SELECT extract ('YEAR' from $1) = extract ('YEAR' from $2); $$ language sql; COMMENT ON FUNCTION is_same_year (in_date1 date, in_date2 date) IS $$ Returns true if the two dates are in the same year, false otherwise.$$; CREATE OR REPLACE FUNCTION is_same_month (in_date1 date, in_date2 date) returns bool as $$ SELECT is_same_year($1, $2) and extract ('MONTH' from $1) = extract ('MONTH' from $2); $$ language sql; COMMENT ON FUNCTION is_same_month (in_date1 date, in_date2 date) IS $$ Returns true if the two dates are in the same month and year. False otherwise.$$; CREATE OR REPLACE FUNCTION get_fractional_month (in_date_first date, in_date_second date) RETURNS NUMERIC AS $$ SELECT CASE WHEN is_same_month($1, $2) THEN ($2 - $1)::numeric / days_in_month($1) ELSE (get_fractional_month( $1, (date_trunc('MONTH', $1) + '1 month - 1 second'::interval)::date) + get_fractional_month(date_trunc('MONTH', $2)::date, $2) + (extract ('YEAR' from $2) - extract ('YEAR' from $1) * 12) + extract ('MONTH' from $1) - extract ('MONTH' from $2) - 1)::numeric END; $$ language sql; COMMENT ON FUNCTION get_fractional_month (in_date_first date, in_date_second date) IS $$ Returns the number of months between two dates in numeric form.$$; CREATE OR REPLACE FUNCTION periods_get() RETURNS SETOF periods AS $$ SELECT * FROM periods ORDER BY id $$ language sql; COMMENT ON FUNCTION periods_get() IS $$ Returns dates for year to date, and last year.$$; ledgersmb/sql/modules/Reconciliation.sql0000644000000000000000000005075712003403612017457 0ustar rootrootBEGIN; CREATE OR REPLACE FUNCTION reconciliation__submit_set( in_report_id int, in_line_ids int[]) RETURNS bool AS $$ BEGIN UPDATE cr_report set submitted = true where id = in_report_id; PERFORM reconciliation__save_set(in_report_id, in_line_ids); RETURN FOUND; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION reconciliation__submit_set( in_report_id int, in_line_ids int[]) IS $$Submits a reconciliation report for approval. in_line_ids is used to specify which report lines are cleared, finalizing the report.$$; CREATE OR REPLACE FUNCTION reconciliation__save_set( in_report_id int, in_line_ids int[]) RETURNS bool AS $$ BEGIN UPDATE cr_report_line SET cleared = false WHERE report_id = in_report_id; UPDATE cr_report_line SET cleared = true WHERE report_id = in_report_id AND id = ANY(in_line_ids); RETURN found; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION reconciliation__save_set( in_report_id int, in_line_ids int[]) IS $$Sets which lines of the report are cleared.$$; CREATE OR REPLACE FUNCTION reconciliation__delete_my_report(in_report_id int) RETURNS BOOL AS $$ BEGIN DELETE FROM cr_report_line WHERE report_id = in_report_id AND report_id IN (SELECT id FROM cr_report WHERE entered_username = SESSION_USER AND submitted IS NOT TRUE and approved IS NOT TRUE); DELETE FROM cr_report WHERE id = in_report_id AND entered_username = SESSION_USER AND submitted IS NOT TRUE AND approved IS NOT TRUE; RETURN FOUND; END; $$ LANGUAGE PLPGSQL SECURITY DEFINER; -- Granting execute permission to public because everyone has an ability to -- delete their own reconciliation reports provided they have not been -- submitted. --CT GRANT EXECUTE ON FUNCTION reconciliation__delete_my_report(in_report_id int) TO PUBLIC; COMMENT ON FUNCTION reconciliation__delete_my_report(in_report_id int) IS $$This function allows a user to delete his or her own unsubmitted, unapproved reconciliation reports only. This is designed to allow a user to back out of the reconciliation process without cluttering up the search results for others. $$; CREATE OR REPLACE FUNCTION reconciliation__delete_unapproved(in_report_id int) RETURNS BOOL AS $$ BEGIN DELETE FROM cr_report_line WHERE report_id = in_report_id AND report_id IN (SELECT id FROM cr_report WHERE approved IS NOT TRUE); DELETE FROM cr_report WHERE id = in_report_id AND approved IS NOT TRUE; RETURN FOUND; END; $$ LANGUAGE PLPGSQL SECURITY DEFINER; -- This function is a bit more dangerous and so it is not granted public -- permission. Only those who have the permission to those with an ability to -- approve reports should have access to this. REVOKE EXECUTE ON FUNCTION reconciliation__delete_unapproved(in_report_id int) FROM PUBLIC; COMMENT ON FUNCTION reconciliation__delete_unapproved(in_report_id int) IS $$This function deletes any specified unapproved transaction.$$; CREATE OR REPLACE FUNCTION cr_report_block_changing_approved() RETURNS TRIGGER AS $$ BEGIN IF OLD.approved IS TRUE THEN RAISE EXCEPTION 'Report is approved. Cannot change!'; END IF; IF TG_OP = 'DELETE' THEN RETURN OLD; ELSE RETURN NEW; END IF; END; $$ LANGUAGE PLPGSQL; DROP TRIGGER IF EXISTS block_change_when_approved ON cr_report; CREATE TRIGGER block_change_when_approved BEFORE UPDATE OR DELETE ON cr_report FOR EACH ROW EXECUTE PROCEDURE cr_report_block_changing_approved(); COMMENT ON FUNCTION cr_report_block_changing_approved() IS $$ This is a simple filter that prevents updating or deleting reconciliation reports that have already been approved. To purge old reconciliations you must disable the block_change_when_approved trigger on cr_report.$$; CREATE OR REPLACE FUNCTION reconciliation__get_cleared_balance(in_chart_id int) RETURNS numeric AS $$ select CASE WHEN c.category in('A', 'E') THEN sum(ac.amount) * -1 ELSE sum(ac.amount) END FROM account c JOIN acc_trans ac ON (ac.chart_id = c.id) JOIN (select id from ar where approved union select id from ap where approved union select id from gl where approved) g on (g.id = ac.trans_id) WHERE c.id = $1 AND ac.cleared is true and ac.approved is true GROUP BY c.id, c.category; $$ LANGUAGE sql; COMMENT ON FUNCTION reconciliation__get_cleared_balance(in_chart_id int) IS $$ Gets the cleared balance of the account specified by chart_id. This is specified in normal format (i.e. positive numbers for debits for asset and espense accounts, and positive numbers for credits in other accounts Note that currently contra accounts will show negative balances.$$; CREATE OR REPLACE FUNCTION reconciliation__report_approve (in_report_id INT) returns INT as $$ -- Does some basic checks before allowing the approval to go through; -- moves the approval to "cr_report_line", I guess, or some other "final" table. -- -- Pending may just be a single flag in the database to mark that it is -- not finalized. Will need to discuss with Chris. DECLARE current_row RECORD; completed cr_report_line; total_errors INT; in_user TEXT; ac_entries int[]; BEGIN in_user := current_user; -- so far, so good. Different user, and no errors remain. Therefore, -- we can move it to completed reports. -- -- User may not be necessary - I would think it better to use the -- in_user, to note who approved the report, than the user who -- filed it. This may require clunkier syntax.. -- ac_entries := '{}'; update cr_report set approved = 't', approved_by = person__get_my_entity_id(), approved_username = SESSION_USER where id = in_report_id; FOR current_row IN SELECT compound_array(entries) AS entries FROM ( select as_array(ac.entry_id) as entries FROM acc_trans ac JOIN transactions t on (ac.trans_id = t.id) JOIN (select id, entity_credit_account::text as ref, 'ar' as table FROM ar UNION select id, entity_credit_account::text, 'ap' as table FROM ap UNION select id, reference, 'gl' as table FROM gl) gl ON (gl.table = t.table_name AND gl.id = t.id) LEFT JOIN cr_report_line rl ON (rl.report_id = in_report_id AND ((rl.ledger_id = ac.entry_id AND ac.voucher_id IS NULL) OR (rl.voucher_id = ac.voucher_id)) and rl.cleared is true) WHERE ac.cleared IS FALSE AND ac.chart_id = (select chart_id from cr_report where id = in_report_id) GROUP BY gl.ref, ac.source, ac.transdate, ac.memo, ac.voucher_id, gl.table HAVING count(rl.report_id) > 0) a LOOP ac_entries := ac_entries || current_row.entries; END LOOP; UPDATE acc_trans SET cleared = TRUE where entry_id = any(ac_entries); return 1; END; $$ language 'plpgsql' security definer; COMMENT ON FUNCTION reconciliation__report_approve (in_report_id INT) IS $$Marks the report approved and marks all cleared transactions in it cleared.$$; -- XXX Badly named, rename for 1.4. --CT CREATE OR REPLACE FUNCTION reconciliation__new_report_id (in_chart_id int, in_total numeric, in_end_date date, in_recon_fx bool) returns INT as $$ INSERT INTO cr_report(chart_id, their_total, end_date, recon_fx) values ($1, $2, $3, $4); SELECT currval('cr_report_id_seq')::int; $$ language 'sql'; COMMENT ON FUNCTION reconciliation__new_report_id (in_chart_id int, in_total numeric, in_end_date date, in_recon_fx bool) IS $$ Inserts creates a new report and returns the id.$$; create or replace function reconciliation__add_entry( in_report_id INT, in_scn TEXT, in_type TEXT, in_date TIMESTAMP, in_amount numeric ) RETURNS INT AS $$ DECLARE in_account int; la RECORD; t_errorcode INT; our_value NUMERIC; lid INT; in_count int; t_scn TEXT; t_uid int; t_prefix text; t_amount numeric; BEGIN SELECT CASE WHEN a.category in ('A', 'E') THEN in_amount * -1 ELSE in_amount END into t_amount FROM cr_report r JOIN account a ON r.chart_id = a.id WHERE r.id = in_report_id; SELECT value into t_prefix FROM defaults WHERE setting_key = 'check_prefix'; t_uid := person__get_my_entity_id(); IF in_scn = '' THEN t_scn := NULL; ELSE t_scn := t_prefix || in_scn; END IF; IF t_scn IS NOT NULL THEN SELECT count(*) INTO in_count FROM cr_report_line WHERE scn ilike t_scn AND report_id = in_report_id AND their_balance = 0; IF in_count = 0 THEN INSERT INTO cr_report_line (report_id, scn, their_balance, our_balance, clear_time, "user", trans_type) VALUES (in_report_id, t_scn, t_amount, 0, in_date, t_uid, in_type); ELSIF in_count = 1 THEN UPDATE cr_report_line SET their_balance = t_amount, clear_time = in_date, cleared = true WHERE t_scn = scn AND report_id = in_report_id AND their_balance = 0; ELSE SELECT count(*) INTO in_count FROM cr_report_line WHERE t_scn ilike scn AND report_id = in_report_id AND our_value = t_amount and their_balance = 0; IF in_count = 0 THEN -- no match among many of values SELECT id INTO lid FROM cr_report_line WHERE t_scn ilike scn AND report_id = in_report_id ORDER BY our_balance ASC limit 1; UPDATE cr_report_line SET their_balance = t_amount, clear_time = in_date, trans_type = in_type, cleared = true WHERE id = lid; ELSIF in_count = 1 THEN -- EXECT MATCH UPDATE cr_report_line SET their_balance = t_amount, trans_type = in_type, clear_time = in_date, cleared = true WHERE t_scn = scn AND report_id = in_report_id AND our_value = t_amount AND their_balance = 0; ELSE -- More than one match SELECT id INTO lid FROM cr_report_line WHERE t_scn ilike scn AND report_id = in_report_id AND our_value = t_amount ORDER BY id ASC limit 1; UPDATE cr_report_line SET their_balance = t_amount, trans_type = in_type, cleared = true, clear_time = in_date WHERE id = lid; END IF; END IF; ELSE -- scn IS NULL, check on amount instead SELECT count(*) INTO in_count FROM cr_report_line WHERE report_id = in_report_id AND our_balance = t_amount AND their_balance = 0 and post_date = in_date and scn NOT LIKE t_prefix || '%'; IF in_count = 0 THEN -- no match INSERT INTO cr_report_line (report_id, scn, their_balance, our_balance, clear_time, "user", trans_type) VALUES (in_report_id, t_scn, t_amount, 0, in_date, t_uid, in_type); ELSIF in_count = 1 THEN -- perfect match UPDATE cr_report_line SET their_balance = t_amount, trans_type = in_type, clear_time = in_date, cleared = true WHERE report_id = in_report_id AND our_balance = t_amount AND their_balance = 0 and in_scn NOT LIKE t_prefix || '%'; ELSE -- more than one match SELECT min(id) INTO lid FROM cr_report_line WHERE report_id = in_report_id AND our_balance = t_amount AND their_balance = 0 and post_date = in_date AND scn NOT LIKE t_prefix || '%' LIMIT 1; UPDATE cr_report_line SET their_balance = t_amount, trans_type = in_type, clear_time = in_date, cleared = true WHERE id = lid; END IF; END IF; return 1; END; $$ language 'plpgsql'; comment on function reconciliation__add_entry( in_report_id INT, in_scn TEXT, in_type TEXT, in_date TIMESTAMP, in_amount numeric ) IS $$ This function is used for automatically matching entries from an external source like a bank-produced csv file. This function is very sensitive to ordering of inputs. NULL or empty in_scn values MUST be submitted after meaningful scns. It is also highly recommended that within each category, one submits in order of amount. We should therefore wrap it in another function which can operate on a set, perhaps in 1.4....$$; create or replace function reconciliation__pending_transactions (in_end_date DATE, in_chart_id int, in_report_id int, in_their_total numeric) RETURNS int as $$ DECLARE gl_row RECORD; t_recon_fx BOOL; BEGIN SELECT recon_fx INTO t_recon_fx FROM cr_report WHERE id = in_report_id; INSERT INTO cr_report_line (report_id, scn, their_balance, our_balance, "user", voucher_id, ledger_id, post_date) SELECT in_report_id, CASE WHEN ac.source IS NULL OR ac.source = '' THEN gl.ref ELSE ac.source END, 0, sum(amount / CASE WHEN t_recon_fx IS NOT TRUE OR gl.table = 'gl' THEN 1 WHEN t_recon_fx and gl.table = 'ap' THEN ex.sell WHEN t_recon_fx and gl.table = 'ar' THEN ex.buy END) AS amount, (select entity_id from users where username = CURRENT_USER), ac.voucher_id, min(ac.entry_id), ac.transdate FROM acc_trans ac JOIN transactions t on (ac.trans_id = t.id) JOIN (select id, entity_credit_account::text as ref, curr, transdate, 'ar' as table FROM ar where approved UNION select id, entity_credit_account::text, curr, transdate, 'ap' as table FROM ap WHERE approved UNION select id, reference, '', transdate, 'gl' as table FROM gl WHERE approved) gl ON (gl.table = t.table_name AND gl.id = t.id) LEFT JOIN cr_report_line rl ON (rl.report_id = in_report_id AND ((rl.ledger_id = ac.entry_id AND ac.voucher_id IS NULL) OR (rl.voucher_id = ac.voucher_id))) LEFT JOIN exchangerate ex ON gl.transdate = ex.transdate WHERE ac.cleared IS FALSE AND ac.approved IS TRUE AND ac.chart_id = in_chart_id AND ac.transdate <= in_end_date AND ((t_recon_fx is not true and ac.fx_transaction is not true) OR (t_recon_fx is true AND (gl.table <> 'gl' OR ac.fx_transaction IS TRUE))) GROUP BY gl.ref, ac.source, ac.transdate, ac.memo, ac.voucher_id, gl.table, case when gl.table = 'gl' then gl.id else 1 end HAVING count(rl.id) = 0; UPDATE cr_report set updated = now(), their_total = coalesce(in_their_total, their_total) where id = in_report_id; RETURN in_report_id; END; $$ LANGUAGE plpgsql; COMMENT ON function reconciliation__pending_transactions (in_end_date DATE, in_chart_id int, in_report_id int, in_their_total numeric) IS $$Ensures that the list of pending transactions in the report is up to date. $$; CREATE OR REPLACE FUNCTION reconciliation__report_details (in_report_id INT) RETURNS setof cr_report_line as $$ DECLARE row cr_report_line; BEGIN FOR row IN select * from cr_report_line where report_id = in_report_id order by scn, post_date LOOP RETURN NEXT row; END LOOP; END; $$ language 'plpgsql'; COMMENT ON FUNCTION reconciliation__report_details (in_report_id INT) IS $$ Returns the details of the report. $$; CREATE OR REPLACE FUNCTION reconciliation__report_summary (in_report_id INT) RETURNS cr_report as $$ DECLARE row cr_report; BEGIN select * into row from cr_report where id = in_report_id; RETURN row; END; $$ language 'plpgsql'; -- why is this not called reconciliation__get_report or something? --CT CREATE OR REPLACE FUNCTION reconciliation__get_total (in_report_id INT) returns setof cr_report AS $$ DECLARE row cr_report; BEGIN SELECT * INTO row FROM cr_report where id = in_report_id AND scn = -1; IF NOT FOUND THEN -- I think this is a fairly major error condition RAISE EXCEPTION 'Bad report id.'; ELSE return next row; END IF; END; $$ language 'plpgsql'; COMMENT ON FUNCTION reconciliation__get_total (in_report_id INT) IS $$ Retrieves all header info from the reconciliation report.$$; CREATE OR REPLACE FUNCTION reconciliation__search (in_date_from date, in_date_to date, in_balance_from numeric, in_balance_to numeric, in_chart_id int, in_submitted bool, in_approved bool) returns setof cr_report AS $$ DECLARE report cr_report; BEGIN FOR report IN SELECT r.* FROM cr_report r JOIN account c ON (r.chart_id = c.id) WHERE (in_date_from IS NULL OR in_date_from <= end_date) and (in_date_to IS NULL OR in_date_to >= end_date) AND (in_balance_from IS NULL or in_balance_from <= their_total ) AND (in_balance_to IS NULL OR in_balance_to >= their_total) AND (in_chart_id IS NULL OR in_chart_id = chart_id) AND (in_submitted IS NULL or in_submitted = submitted) AND (in_approved IS NULL OR in_approved = approved) AND (r.deleted IS FALSE) ORDER BY c.accno, end_date, their_total LOOP RETURN NEXT report; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION reconciliation__search (in_date_from date, in_date_to date, in_balance_from numeric, in_balance_to numeric, in_chart_id int, in_submitted bool, in_approved bool) IS $$ Searches for reconciliation reports. NULLs match all values. in_date_to and in_date_from give a range of reports. All other inputs are exact matches. $$; DROP TYPE IF EXISTS recon_accounts CASCADE; create type recon_accounts as ( name text, accno text, id int ); create or replace function reconciliation__account_list () returns setof recon_accounts as $$ SELECT coa.accno || ' ' || coa.description as name, coa.accno, coa.id as id FROM account coa JOIN cr_coa_to_account cta ON cta.chart_id = coa.id ORDER BY coa.accno; $$ language sql; COMMENT ON function reconciliation__account_list () IS $$ returns set of accounts set up for reconciliation. Currently we pull the account number and description from the account table.$$; CREATE OR REPLACE FUNCTION reconciliation__get_current_balance (in_account_id int, in_date date) returns numeric as $$ DECLARE outval NUMERIC; BEGIN SELECT CASE WHEN (select category FROM account WHERE id = in_account_id) IN ('A', 'E') THEN sum(a.amount) * -1 ELSE sum(a.amount) END FROM acc_trans a JOIN ( SELECT id FROM ar WHERE approved is true UNION SELECT id FROM ap WHERE approved is true UNION SELECT id FROM gl WHERE approved is true ) gl ON a.trans_id = gl.id WHERE a.approved IS TRUE AND a.chart_id = in_account_id AND a.transdate <= in_date; RETURN outval; END; $$ language plpgsql; COMMENT ON FUNCTION reconciliation__get_current_balance (in_account_id int, in_date date) IS $$ Gets the current balance of all approved transactions against a specific account. For asset and expense accounts this is the debit balance, for others this is the credit balance.$$; CREATE OR REPLACE VIEW recon_payee AS SELECT n.name AS payee, rr.id, rr.report_id, rr.scn, rr.their_balance, rr.our_balance, rr.errorcode, rr."user", rr.clear_time, rr.insert_time, rr.trans_type, rr.post_date, rr.ledger_id, rr.voucher_id, rr.overlook, rr.cleared FROM cr_report_line rr LEFT JOIN acc_trans ac ON rr.ledger_id = ac.entry_id LEFT JOIN gl ON ac.trans_id = gl.id LEFT JOIN (( SELECT ap.id, e.name FROM ap JOIN entity_credit_account eca ON ap.entity_credit_account = eca.id JOIN entity e ON eca.entity_id = e.id UNION SELECT ar.id, e.name FROM ar JOIN entity_credit_account eca ON ar.entity_credit_account = eca.id JOIN entity e ON eca.entity_id = e.id) UNION SELECT gl.id, gl.description FROM gl) n ON n.id = ac.trans_id; CREATE OR REPLACE FUNCTION reconciliation__report_details_payee (in_report_id INT) RETURNS setof recon_payee as $$ DECLARE row recon_payee; BEGIN FOR row IN select * from recon_payee where report_id = in_report_id order by scn, post_date LOOP RETURN NEXT row; END LOOP; END; $$ language 'plpgsql'; COMMENT ON FUNCTION reconciliation__report_details_payee (in_report_id INT) IS $$ Pulls the payee information for the reconciliation report.$$; COMMIT; ledgersmb/sql/modules/Voucher.sql0000644000000000000000000004205611626013537016136 0ustar rootroot CREATE OR REPLACE FUNCTION voucher_get_batch (in_batch_id integer) RETURNS batch AS $$ DECLARE batch_out batch%ROWTYPE; BEGIN SELECT * INTO batch_out FROM batch b WHERE b.id = in_batch_id; RETURN batch_out; END; $$ language plpgsql; COMMENT ON FUNCTION voucher_get_batch (in_batch_id integer) is $$ Retrieves basic batch information based on batch_id.$$; CREATE TYPE voucher_list AS ( id int, reference text, description text, batch_id int, transaction_id integer, amount numeric, transaction_date date, batch_class text ); -- voucher_list could use refactoring CREATE OR REPLACE FUNCTION voucher_list (in_batch_id integer) RETURNS SETOF voucher_list AS $$ declare voucher_item record; BEGIN FOR voucher_item IN SELECT v.id, a.invnumber, e.name, v.batch_id, v.trans_id, a.amount, a.transdate, 'Payable' FROM voucher v JOIN ap a ON (v.trans_id = a.id) JOIN entity_credit_account eca ON (eca.id = a.entity_credit_account) JOIN entity e ON (eca.entity_id = e.id) WHERE v.batch_id = in_batch_id AND v.batch_class = (select id from batch_class WHERE class = 'ap') UNION SELECT v.id, a.invnumber, e.name, v.batch_id, v.trans_id, a.amount, a.transdate, 'Receivable' FROM voucher v JOIN ar a ON (v.trans_id = a.id) JOIN entity_credit_account eca ON (eca.id = a.entity_credit_account) JOIN entity e ON (eca.entity_id = e.id) WHERE v.batch_id = in_batch_id AND v.batch_class = (select id from batch_class WHERE class = 'ar') UNION ALL -- TODO: Add the class labels to the class table. SELECT v.id, a.source, cr.meta_number || '--' || co.legal_name , v.batch_id, v.trans_id, sum(CASE WHEN bc.class LIKE 'payment%' THEN a.amount * -1 ELSE a.amount END), a.transdate, CASE WHEN bc.class = 'payment' THEN 'Payment' WHEN bc.class = 'payment_reversal' THEN 'Payment Reversal' END FROM voucher v JOIN acc_trans a ON (v.id = a.voucher_id) JOIN batch_class bc ON (bc.id = v.batch_class) JOIN chart c ON (a.chart_id = c.id) JOIN ap ON (ap.id = a.trans_id) JOIN entity_credit_account cr ON (ap.entity_credit_account = cr.id) JOIN company co ON (cr.entity_id = co.entity_id) WHERE v.batch_id = in_batch_id AND a.voucher_id = v.id AND (bc.class like 'payment%' AND c.link = 'AP') GROUP BY v.id, a.source, cr.meta_number, co.legal_name , v.batch_id, v.trans_id, a.transdate, bc.class UNION ALL SELECT v.id, a.source, a.memo, v.batch_id, v.trans_id, CASE WHEN bc.class LIKE 'receipt%' THEN sum(a.amount) * -1 ELSE sum(a.amount) END, a.transdate, CASE WHEN bc.class = 'receipt' THEN 'Receipt' WHEN bc.class = 'receipt_reversal' THEN 'Receipt Reversal' END FROM voucher v JOIN acc_trans a ON (v.id = a.voucher_id) JOIN batch_class bc ON (bc.id = v.batch_class) JOIN chart c ON (a.chart_id = c.id) JOIN ar ON (ar.id = a.trans_id) JOIN entity_credit_account cr ON (ar.entity_credit_account = cr.id) JOIN company co ON (cr.entity_id = co.entity_id) WHERE v.batch_id = in_batch_id AND a.voucher_id = v.id AND (bc.class like 'receipt%' AND c.link = 'AR') GROUP BY v.id, a.source, cr.meta_number, co.legal_name , a.memo, v.batch_id, v.trans_id, a.transdate, bc.class UNION ALL SELECT v.id, g.reference, g.description, v.batch_id, v.trans_id, sum(a.amount), g.transdate, 'GL' FROM voucher v JOIN gl g ON (g.id = v.trans_id) JOIN acc_trans a ON (v.trans_id = a.trans_id) WHERE a.amount > 0 AND v.batch_id = in_batch_id AND v.batch_class IN (select id from batch_class where class = 'gl') GROUP BY v.id, g.reference, g.description, v.batch_id, v.trans_id, g.transdate ORDER BY 7, 1 LOOP RETURN NEXT voucher_item; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION voucher_list (in_batch_id integer) IS $$ Retrieves a list of vouchers and amounts attached to the batch.$$; CREATE TYPE batch_list_item AS ( id integer, batch_class text, control_code text, description text, created_by text, created_on date, default_date date, transaction_total numeric, payment_total numeric ); CREATE OR REPLACE FUNCTION batch_search(in_class_id int, in_description text, in_created_by_eid int, in_date_from date, in_date_to date, in_amount_gt numeric, in_amount_lt numeric, in_approved bool) RETURNS SETOF batch_list_item AS $$ DECLARE out_value batch_list_item; BEGIN FOR out_value IN SELECT b.id, c.class, b.control_code, b.description, u.username, b.created_on, b.default_date, sum( CASE WHEN vc.id = 5 AND al.amount < 0 -- GL THEN al.amount WHEN vc.id = 1 THEN ap.amount WHEN vc.id = 2 THEN ap.amount ELSE 0 END) AS transaction_total, sum( CASE WHEN alc.link = 'AR' AND vc.id IN (6, 7) THEN al.amount WHEN alc.link = 'AP' AND vc.id IN (3, 4) THEN al.amount * -1 ELSE 0 END ) AS payment_total FROM batch b JOIN batch_class c ON (b.batch_class_id = c.id) LEFT JOIN users u ON (u.entity_id = b.created_by) LEFT JOIN voucher v ON (v.batch_id = b.id) LEFT JOIN batch_class vc ON (v.batch_class = vc.id) LEFT JOIN ar ON (vc.id = 2 AND v.trans_id = ar.id) LEFT JOIN ap ON (vc.id = 1 AND v.trans_id = ap.id) LEFT JOIN acc_trans al ON ((vc.id = 5 AND v.trans_id = al.trans_id) OR (vc.id IN (3, 4, 6, 7) AND al.voucher_id = v.id)) LEFT JOIN chart alc ON (al.chart_id = alc.id) WHERE (c.id = in_class_id OR in_class_id IS NULL) AND (b.description LIKE '%' || in_description || '%' OR in_description IS NULL) AND (in_created_by_eid = b.created_by OR in_created_by_eid IS NULL) AND ((in_approved = false OR in_approved IS NULL AND approved_on IS NULL) OR (in_approved = true AND approved_on IS NOT NULL) ) and (in_date_from IS NULL or b.default_date >= in_date_from) and (in_date_to IS NULL or b.default_date <= in_date_to) GROUP BY b.id, c.class, b.description, u.username, b.created_on, b.control_code, b.default_date HAVING (in_amount_gt IS NULL OR sum(coalesce(ar.amount - ar.paid, ap.amount - ap.paid, al.amount)) >= in_amount_gt) AND (in_amount_lt IS NULL OR sum(coalesce(ar.amount - ar.paid, ap.amount - ap.paid, al.amount)) <= in_amount_lt) ORDER BY b.control_code, b.description LOOP RETURN NEXT out_value; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION batch_search(in_class_id int, in_description text, in_created_by_eid int, in_date_from date, in_date_to date, in_amount_gt numeric, in_amount_lt numeric, in_approved bool) IS $$Returns a list of batches and amounts processed on the batch. Nulls match all values. in_date_from and in_date_to specify date ranges. in_description is a partial match. All other criteria are exact matches. $$; CREATE OR REPLACE FUNCTION batch_get_class_id (in_type text) returns int AS $$ SELECT id FROM batch_class WHERE class = $1; $$ language sql; COMMENT ON FUNCTION batch_get_class_id (in_type text) IS $$ returns the batch class id associated with the in_type label provided.$$; CREATE OR REPLACE FUNCTION batch_search_mini (in_class_id int, in_description text, in_created_by_eid int, in_approved bool) RETURNS SETOF batch_list_item AS $$ DECLARE out_value batch_list_item; BEGIN FOR out_value IN SELECT b.id, c.class, b.control_code, b.description, u.username, b.created_on, b.default_date, NULL FROM batch b JOIN batch_class c ON (b.batch_class_id = c.id) LEFT JOIN users u ON (u.entity_id = b.created_by) WHERE (c.id = in_class_id OR in_class_id IS NULL) AND (b.description LIKE '%' || in_description || '%' OR in_description IS NULL) AND (in_created_by_eid = b.created_by OR in_created_by_eid IS NULL) AND ((in_approved = false OR in_approved IS NULL AND approved_on IS NULL) OR (in_approved = true AND approved_on IS NOT NULL) ) GROUP BY b.id, c.class, b.description, u.username, b.created_on, b.control_code, b.default_date LOOP RETURN NEXT out_value; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION batch_search_mini (in_class_id int, in_description text, in_created_by_eid int, in_approved bool) IS $$ This performs a simple search of open batches created by the entity_id in question. This is used to pull up batches that were currently used so that they can be picked up and more vouchers added. NULLs match all values. in_description is a partial match All other inouts are exact matches. $$; CREATE OR REPLACE FUNCTION batch_search_empty(in_class_id int, in_description text, in_created_by_eid int, in_amount_gt numeric, in_amount_lt numeric, in_approved bool) RETURNS SETOF batch_list_item AS $$ DECLARE out_value batch_list_item; BEGIN FOR out_value IN SELECT b.id, c.class, b.control_code, b.description, u.username, b.created_on, b.default_date, 0, 0 FROM batch b JOIN batch_class c ON (b.batch_class_id = c.id) JOIN users u ON (u.entity_id = b.created_by) LEFT JOIN voucher v ON (v.batch_id = b.id) where v.id is null and(u.entity_id = in_created_by_eid or in_created_by_eid is null) and (in_description is null or b.description like '%' || in_description || '%') and (in_class_id is null or c.id = in_class_id) GROUP BY b.id, c.class, b.description, u.username, b.created_on, b.control_code, b.default_date ORDER BY b.control_code, b.description LOOP RETURN NEXT out_value; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION batch_search_empty(in_class_id int, in_description text, in_created_by_eid int, in_amount_gt numeric, in_amount_lt numeric, in_approved bool) IS $$ This is a full search for the batches, listing them by amount processed. in_amount_gt and in_amount_lt provide a range to search for. in_description is a partial match field. Other fields are exact matches. NULLs match all values. $$; CREATE OR REPLACE FUNCTION batch_post(in_batch_id INTEGER) returns date AS $$ BEGIN UPDATE ar SET approved = true WHERE id IN (select trans_id FROM voucher WHERE batch_id = in_batch_id AND batch_class = 2); UPDATE ap SET approved = true WHERE id IN (select trans_id FROM voucher WHERE batch_id = in_batch_id AND batch_class = 1); UPDATE gl SET approved = true WHERE id IN (select trans_id FROM voucher WHERE batch_id = in_batch_id AND batch_class = 5); UPDATE acc_trans SET approved = true WHERE voucher_id IN (select id FROM voucher WHERE batch_id = in_batch_id AND batch_class IN (3, 4, 6, 7)); UPDATE batch SET approved_on = now(), approved_by = (select entity_id FROM users WHERE username = SESSION_USER) WHERE id = in_batch_id; RETURN now()::date; END; $$ LANGUAGE PLPGSQL SECURITY DEFINER; REVOKE EXECUTE ON FUNCTION batch_post(in_batch_id INTEGER) FROM public; COMMENT ON FUNCTION batch_post(in_batch_id INTEGER) is $$ Posts the specified batch to the books. Only posted batches should show up on standard financial reports.$$; CREATE OR REPLACE FUNCTION batch_list_classes() RETURNS SETOF batch_class AS $$ DECLARE out_val record; BEGIN FOR out_val IN select * from batch_class order by id LOOP return next out_val; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION batch_list_classes() IS $$ Returns a list of all batch classes.$$; -- Move to the admin module and call it from there. CREATE OR REPLACE FUNCTION batch_get_users() RETURNS SETOF users AS $$ DECLARE out_record users%ROWTYPE; BEGIN FOR out_record IN SELECT * from users WHERE entity_id IN (select created_by from batch) LOOP RETURN NEXT out_record; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION batch_get_users() IS $$ Returns a sim[ple set of user objects. This should be renamed so that it is more obvious it is a general purpose function.$$; CREATE OR REPLACE FUNCTION batch_create( in_batch_number text, in_description text, in_batch_class text, in_batch_date date) RETURNS int AS $$ BEGIN INSERT INTO batch (batch_class_id, default_date, description, control_code, created_by) VALUES ((SELECT id FROM batch_class WHERE class = in_batch_class), in_batch_date, in_description, in_batch_number, (select entity_id FROM users WHERE username = session_user)); return currval('batch_id_seq'); END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION batch_create( in_batch_number text, in_description text, in_batch_class text, in_batch_date date) IS $$ Inserts the batch into the table.$$; CREATE OR REPLACE FUNCTION batch_delete(in_batch_id int) RETURNS int AS $$ DECLARE t_transaction_ids int[]; BEGIN -- Adjust AR/AP tables for payment and payment reversal vouchers -- voucher_id is only set in acc_trans on payment/receipt vouchers and -- their reversals. -CT perform * from batch where id = in_batch_id and approved_on IS NULL; IF NOT FOUND THEN RAISE EXCEPTION 'Batch not found'; END IF; update ar set paid = amount + (select sum(amount) from acc_trans join chart ON (acc_trans.chart_id = chart.id) where link = 'AR' AND trans_id = ar.id AND (voucher_id IS NULL OR voucher_id NOT IN (select id from voucher WHERE batch_id = in_batch_id))) where id in (select trans_id from acc_trans where voucher_id IN (select id from voucher where batch_id = in_batch_id)); update ap set paid = amount - (select sum(amount) from acc_trans join chart ON (acc_trans.chart_id = chart.id) where link = 'AP' AND trans_id = ap.id AND (voucher_id IS NULL OR voucher_id NOT IN (select id from voucher WHERE batch_id = in_batch_id))) where id in (select trans_id from acc_trans where voucher_id IN (select id from voucher where batch_id = in_batch_id)); DELETE FROM ac_tax_form WHERE entry_id IN (select entry_id from acc_trans where voucher_id in (select id from voucher where batch_id = in_batch_id) ); DELETE FROM acc_trans WHERE voucher_id IN (select id FROM voucher where batch_id = in_batch_id); -- The rest of this function involves the deletion of actual -- transactions, vouchers, and batches, and jobs which are in progress. -- -CT SELECT as_array(trans_id) INTO t_transaction_ids FROM voucher WHERE batch_id = in_batch_id AND batch_class IN (1, 2, 5); DELETE FROM ac_tax_form WHERE entry_id in (select entry_id from acc_trans where trans_id = any(t_transaction_ids)); DELETE FROM acc_trans WHERE trans_id = ANY(t_transaction_ids); DELETE FROM ap WHERE id = ANY(t_transaction_ids); DELETE FROM gl WHERE id = ANY(t_transaction_ids); DELETE FROM voucher WHERE batch_id = in_batch_id; DELETE FROM payments_queue WHERE batch_id = in_batch_id; DELETE FROM pending_job WHERE batch_id = in_batch_id; DELETE FROM batch WHERE id = in_batch_id; DELETE FROM transactions WHERE id = ANY(t_transaction_ids); RETURN 1; END; $$ language plpgsql SECURITY DEFINER; COMMENT ON FUNCTION batch_delete(in_batch_id int) IS $$ If the batch is found and unapproved, deletes it and returns 1. Otherwise raises an exception.$$; REVOKE ALL ON FUNCTION batch_delete(int) FROM PUBLIC; CREATE OR REPLACE FUNCTION voucher__delete(in_voucher_id int) RETURNS int AS $$ DECLARE voucher_row RECORD; BEGIN SELECT * INTO voucher_row FROM voucher WHERE id = in_voucher_id; IF voucher_row.batch_class IN (1, 2, 5) THEN DELETE FROM ac_tax_form WHERE entry_id IN ( SELECT entry_id FROM acc_trans WHERE trans_id = voucher_row.trans_id); DELETE FROM acc_trans WHERE trans_id = voucher_row.trans_id; DELETE FROM ar WHERE id = voucher_row.trans_id; DELETE FROM ap WHERE id = voucher_row.trans_id; DELETE FROM gl WHERE id = voucher_row.trans_id; DELETE FROM voucher WHERE id = voucher_row.id; -- DELETE FROM transactions WHERE id = voucher_row.trans_id; ELSE update ar set paid = amount + (select sum(amount) from acc_trans join chart ON (acc_trans.chart_id = chart.id) where link = 'AR' AND trans_id = ar.id AND (voucher_id IS NULL OR voucher_id <> voucher_row.id)) where id in (select trans_id from acc_trans where voucher_id = voucher_row.id); update ap set paid = amount - (select sum(amount) from acc_trans join chart ON (acc_trans.chart_id = chart.id) where link = 'AP' AND trans_id = ap.id AND (voucher_id IS NULL OR voucher_id <> voucher_row.id)) where id in (select trans_id from acc_trans where voucher_id = voucher_row.id); DELETE FROM ac_tax_form WHERE entry_id IN (select entry_id from acc_trans where voucher_id = voucher_row.id); DELETE FROM acc_trans where voucher_id = voucher_row.id; END IF; RETURN 1; END; $$ LANGUAGE PLPGSQL SECURITY DEFINER; REVOKE ALL ON FUNCTION voucher__delete(int) FROM public; COMMENT ON FUNCTION voucher__delete(in_voucher_id int) IS $$ Deletes the specified voucher from the batch.$$; ledgersmb/sql/modules/test/0000755000000000000000000000000012060044550014742 5ustar rootrootledgersmb/sql/modules/test/System.sql0000644000000000000000000000677311616553114016773 0ustar rootrootBEGIN; \i Base.sql CREATE TABLE test_exempt_funcs (funcname text primary key); insert into test_exempt_funcs values ('rewrite'); insert into test_exempt_funcs values ('gin_extract_trgm'); insert into test_exempt_funcs values ('plainto_tsquery'); insert into test_exempt_funcs values ('headline'); insert into test_exempt_funcs values ('rank'); insert into test_exempt_funcs values ('to_tsquery'); insert into test_exempt_funcs values ('to_tsvector'); insert into test_exempt_funcs values ('stat'); insert into test_exempt_funcs values ('product'); insert into test_exempt_funcs values ('lexize'); insert into test_exempt_funcs values ('connectby'); insert into test_exempt_funcs values ('parse'); insert into test_exempt_funcs values ('set_curprs'); insert into test_exempt_funcs values ('rank_cd'); insert into test_exempt_funcs values ('set_curdict'); insert into test_exempt_funcs values ('set_curcfg'); insert into test_exempt_funcs values ('token_type'); insert into test_exempt_funcs values ('crosstab'); insert into test_exempt_funcs values ('concat_colon'); insert into test_exempt_funcs values ('to_args'); insert into test_exempt_funcs values ('table_log_restore_table'); create table test_exempt_tables (tablename text, reason text); insert into test_exempt_tables values ('note', 'abstract table, no data'); insert into test_exempt_tables values ('open_forms', 'security definer only'); insert into test_exempt_tables values ('pg_ts_cfg', 'security definer only'); insert into test_exempt_tables values ('pg_ts_cfgmap', 'security definer only'); insert into test_exempt_tables values ('pg_ts_dict', 'security definer only'); insert into test_exempt_tables values ('pg_ts_parser', 'security definer only'); insert into test_exempt_tables values ('file_view_catalog', 'addon installaiton only'); insert into test_exempt_tables values ('person_to_company', 'Unused in core, for addons only'); insert into test_exempt_tables values ('person_to_entity', 'Unused in core, for addons only'); insert into test_exempt_tables values ('test_exempt_funcs', 'test data only'); insert into test_exempt_tables values ('test_exempt_tables', 'test data only'); insert into test_exempt_tables values ('menu_friendly', 'dev info only'); insert into test_exempt_tables values ('note', 'abstract table, no data'); analyze test_exempt_tables; INSERT INTO test_result(test_name, success) select 'No overloaded functions in current schema', count(*) = 0 FROM (select proname FROM pg_proc WHERE pronamespace = (select oid from pg_namespace where nspname = current_schema()) AND proname NOT IN (select funcname FROM test_exempt_funcs) group by proname having count(*) > 1 ) t; select proname FROM pg_proc WHERE pronamespace = (select oid from pg_namespace where nspname = current_schema()) AND proname NOT IN (select funcname from test_exempt_funcs) group by proname having count(*) > 1; CREATE TEMPORARY table permissionless_tables AS SELECT nspname, relname FROM pg_namespace nsp JOIN pg_class rel ON (relkind = 'r' and nsp.oid = rel.relnamespace) WHERE nspname = 'public' AND relacl IS NULL and relname NOT IN (select tablename from test_exempt_tables); select * from permissionless_tables; INSERT INTO test_result (test_name, success) select 'All tables in public have some permissions', count(*)=0 from permissionless_tables; SELECT * FROM test_result; SELECT (select count(*) from test_result where success is true) || ' tests passed and ' || (select count(*) from test_result where success is not true) || ' failed' as message; ROLLBACK; ledgersmb/sql/modules/test/Business_type.sql0000644000000000000000000000070011073717024020322 0ustar rootrootBEGIN; \i Base.sql INSERT INTO business (description) values ('testing'); INSERT INTO test_result (test_name, success) SELECT 'Business Class Inserted', count(*) > 0 from business_type__list() WHERE description = 'testing'; SELECT * FROM test_result; SELECT (select count(*) from test_result where success is true) || ' tests passed and ' || (select count(*) from test_result where success is not true) || ' failed' as message; ROLLBACK; ledgersmb/sql/modules/test/Reconciliation.sql0000644000000000000000000001346712007101511020430 0ustar rootrootBEGIN; \i Base.sql \i data/Reconciliation.sql INSERT INTO test_result(test_name, success) SELECT 'check_prefix set', count(*) = 1 FROM defaults where setting_key = 'check_prefix'; update defaults set value = 'Recon gl test ' where setting_key = 'check_prefix'; INSERT INTO test_result(test_name, success) SELECT 'Create Recon Report', reconciliation__new_report_id(test_get_account_id('-11111'), 100, now()::date, 'f') > 0; INSERT INTO test_result(test_name, success) SELECT 'Pending Transactions Ran', reconciliation__pending_transactions(now()::date, test_get_account_id('-11111'), currval('cr_report_id_seq')::int, 110) > 0; INSERT INTO test_result(test_name, success) select 'Correct number of transactions 1', count(*) = 10 from cr_report_line where report_id = currval('cr_report_id_seq')::int; INSERT INTO test_result(test_name, success) SELECT 'Correct number of GL groups', count(*) = 3 from cr_report_line where scn like '% gl %' and report_id = currval('cr_report_id_seq')::int; INSERT INTO test_result(test_name, success) SELECT 'Correct number of report lines', count(*) = 10 from cr_report_line where report_id = currval('cr_report_id_seq')::int; INSERT INTO test_result(test_name, success) SELECT 'Report Submitted', reconciliation__submit_set(currval('cr_report_id_seq')::int, (select as_array(id::int) from cr_report_line where report_id = currval('cr_report_id_seq')::int)); INSERT INTO test_result(test_name, success) SELECT 'Report Submitted', reconciliation__submit_set(currval('cr_report_id_seq')::int, (select as_array(id::int) from cr_report_line where report_id = currval('cr_report_id_seq')::int)); INSERT INTO test_result(test_name, success) SELECT '1 Report Approved', reconciliation__report_approve(currval('cr_report_id_seq')::int) > 0; INSERT INTO test_result(test_name, success) SELECT '1 Transactions closed', count(*) = 2 FROM acc_trans JOIN account a ON (acc_trans.chart_id = a.id) WHERE a.accno = '-11111' and cleared is false; INSERT INTO test_result(test_name, success) SELECT '1 Create Recon Report', reconciliation__new_report_id(test_get_account_id('-11112'), 100, now()::date, 'f') > 0; INSERT INTO test_result(test_name, success) SELECT '1 Pending Transactions Ran', reconciliation__pending_transactions(now()::date, test_get_account_id('-11112'), currval('cr_report_id_seq')::int, 110) > 0; INSERT INTO test_result(test_name, success) select 'Correct number of transactions 2', count(*) = 10 from cr_report_line where report_id = currval('cr_report_id_seq')::int; INSERT INTO test_result(test_name, success) SELECT '1 Pending Transactions Ran', reconciliation__pending_transactions(now()::date, test_get_account_id('-11112'), currval('cr_report_id_seq')::int, 110) > 0; INSERT INTO test_result(test_name, success) select 'Correct number of transactions 3', count(*) = 10 from cr_report_line where report_id = currval('cr_report_id_seq')::int; INSERT INTO test_result(test_name, success) SELECT '1 Correct number of GL groups', count(*) = 3 from cr_report_line where scn like '% gl %' and report_id = currval('cr_report_id_seq')::int; INSERT INTO test_result(test_name, success) SELECT '1 Correct number of report lines', count(*) = 10 from cr_report_line where report_id = currval('cr_report_id_seq')::int; INSERT INTO test_result(test_name, success) SELECT '1 Report Submitted', reconciliation__submit_set(currval('cr_report_id_seq')::int, '{}'); INSERT INTO test_result(test_name, success) SELECT '1 Cleared balance pre-approval is 10', reconciliation__get_cleared_balance(test_get_account_id('-11112')) = -10; INSERT INTO test_result(test_name, success) SELECT '1 Report Approved', reconciliation__report_approve(currval('cr_report_id_seq')::int) > 0; INSERT INTO test_result(test_name, success) SELECT '1 Transactions open', count(*) = 14 FROM acc_trans JOIN account ON (acc_trans.chart_id = account.id) WHERE accno = '-11112' and cleared is false; INSERT INTO test_result(test_name, success) SELECT '1 Cleared balance post-approval is 10', reconciliation__get_cleared_balance(test_get_account_id('-11112')) = -10; INSERT INTO test_result(test_name, success) SELECT '1 Create Recon Report', reconciliation__new_report_id(test_get_account_id('-11112'), 100, now()::date, 'f') > 0; INSERT INTO test_result(test_name, success) SELECT '1 Pending Transactions Ran', reconciliation__pending_transactions(now()::date, test_get_account_id('-11112'), currval('cr_report_id_seq')::int, 110) > 0; INSERT INTO test_result(test_name, success) select 'Correct number of transactions 4', count(*) = 10 from cr_report_line where report_id = currval('cr_report_id_seq')::int; INSERT INTO test_result(test_name, success) SELECT 'Report Submitted', reconciliation__submit_set(currval('cr_report_id_seq')::int, (select as_array(id::int) from cr_report_line where report_id = currval('cr_report_id_seq')::int)); INSERT INTO test_result(test_name, success) SELECT 'Their Balance Updated', their_total = 110 FROM reconciliation__report_summary(currval('cr_report_id_seq')::int); INSERT INTO test_result(test_name, success) SELECT 'Cleared balance pre-approval is 10', reconciliation__get_cleared_balance(test_get_account_id('-11112')) = -10; INSERT INTO test_result(test_name, success) SELECT 'Report Approved', reconciliation__report_approve(currval('cr_report_id_seq')::int) > 0; INSERT INTO test_result(test_name, success) SELECT 'Transactions closed', count(*) = 2 FROM acc_trans JOIN account a ON (acc_trans.chart_id = a.id) WHERE accno = '-11112' and cleared is false; INSERT INTO test_result(test_name, success) SELECT 'Cleared balance post-approval is 130', reconciliation__get_cleared_balance(test_get_account_id('-11112')) = -130; SELECT * FROM test_result; SELECT (select count(*) from test_result where success is true) || ' tests passed and ' || (select count(*) from test_result where success is not true) || ' failed' as message; ROLLBACK; ledgersmb/sql/modules/test/Voucher.sql0000644000000000000000000000755311616556735017133 0ustar rootrootBEGIN; \i Base.sql INSERT INTO test_result (test_name, success) SELECT 'Batch Created', batch_create('_TEST', '_TEST', 'payment', '2008-01-01') IS NOT NULL; INSERT INTO entity (id, name, entity_class, control_code, country_id) values (-3, 'Test', 1, 'test', 242); INSERT INTO entity_credit_account (entity_id, id, meta_number, entity_class, ar_ap_account_id) values (-3, -1, 'Test', 1, -1000); INSERT INTO entity_employee(entity_id) values (-3); INSERT INTO account(id, accno, description, category, heading, contra) values (-5, '-21111', 'Testing AP', 'A', (select id from account_heading WHERE accno = '000000000000000000000'), false); INSERT INTO country_tax_form(country_id, form_name, id) values (232, 'TEST', '-101'); INSERT INTO account_link(account_id, description) values (-5, 'AP'); INSERT INTO ap (id, invnumber, amount, curr, approved, entity_credit_account) VALUES (-5, 'test1', '1000', 'USD', false, -1); INSERT INTO acc_trans(trans_id, chart_id, amount, approved) values (-5, test_get_account_id('-21111'), 1000, true); INSERT INTO ap (id, invnumber, amount, curr, approved, entity_credit_account) VALUES (-6, 'test1', '1000', 'USD', false, -1); INSERT INTO acc_trans(trans_id, chart_id, amount, approved, entry_id) values (-6, test_get_account_id('-21111'), 1000, true, -1); INSERT INTO voucher(id, trans_id, batch_id, batch_class) values (-6, -6, currval('batch_id_seq'), 1); INSERT INTO ac_tax_form (entry_id, reportable) values (-1, false); INSERT INTO ap (id, invnumber, amount, curr, approved, entity_credit_account) VALUES (-7, 'test1', '1000', 'USD', false, -1); INSERT INTO acc_trans(trans_id, chart_id, amount, approved, entry_id) values (-7, test_get_account_id('-21111'), 1000, true, -2); INSERT INTO ac_tax_form (entry_id, reportable) values (-2, false); INSERT INTO voucher (id, trans_id, batch_id, batch_class) values (-1, -5, currval('batch_id_seq'), 1); INSERT INTO voucher (id, trans_id, batch_id, batch_class) values (-2, -5, currval('batch_id_seq'), 3); INSERT INTO voucher (id, trans_id, batch_id, batch_class) values (-3, -5, currval('batch_id_seq'), 3); INSERT INTO test_result(test_name, success) select 'Voucher Seach finds Payable Vouchers', count(*)=2 from voucher_list( currval('batch_id_seq')::int); INSERT INTO test_result (test_name, success) SELECT 'partial payment support', count(*) > 1 FROM voucher where trans_id = -5 and batch_class = 3; -- Adding the test for empty batch sproc INSERT INTO test_result(test_name, success) SELECT 'creating batch 2', batch_create('EMPTYBATCHTEST1', 'EMPTY BATCH TEST', 'ap', '2008-01-01') IS NOT NULL; INSERT INTO test_result (test_name, success) SELECT 'Empty Batch Detected', count(*) = 1 FROM batch_search_empty(1, -- Batch class ID 'EMPTY BATCH TEST', -- Batch description -100, -- Entity ID NULL::numeric, -- Amount greater than NULL::numeric, -- Amount less than 'f'::bool -- Approved ); INSERT INTO test_result(test_name, success) SELECT 'Delete voucher with tax_form', voucher__delete(-6) = 1; INSERT INTO test_result(test_name, success) SELECT 'not all tax form lines deleted', count(*) > 0 FROM ac_tax_form; INSERT INTO test_result(test_name, success) select 'DELETED voucher does not exist', count(*) = 0 FROM ap WHERE id = -6; INSERT INTO test_result(test_name, success) SELECT 'Delete batch', batch_delete(currval('batch_id_seq')::int) = 1; INSERT INTO test_result(test_name, success) SELECT 'Batch is deleted', count(*) = 0 FROM batch where id = currval('batch_id_seq'); SELECT * FROM test_result; SELECT (select count(*) from test_result where success is true) || ' tests passed and ' || (select count(*) from test_result where success is not true) || ' failed' as message; ROLLBACK; ledgersmb/sql/modules/test/Base.sql0000644000000000000000000000301211603046541016335 0ustar rootrootCREATE TEMPORARY TABLE test_result ( test_name text, success bool ); INSERT INTO entity (id, name, entity_class, control_code, country_id) VALUES (-100, 'Testing.....', 3, '_TESTING.....', 242); INSERT INTO entity (id, name, entity_class, control_code, country_id) VALUES (-101, 'Testing..... 2', 3, '_TEST2', 242); INSERT INTO person(id, entity_id, first_name, last_name) values (-100, -100, 'Test', 'User'); DELETE FROM users WHERE username = CURRENT_USER; INSERT INTO users (entity_id, username) SELECT -100, CURRENT_USER; INSERT INTO entity_employee(entity_id) values (-100); INSERT INTO entity(name, id, entity_class, control_code, country_id) values ('test user 1', -200, 3, 'Test User 1', 242); select account_heading_save(NULL, '000000000000000000000', 'TEST', NULL); INSERT INTO account(id, accno, description, category, heading, contra) values (-1000, '-1000000000', 'Test cases only', 'A', (select id from account_heading WHERE accno = '000000000000000000000'), false); INSERT INTO account(id, accno, description, category, heading, contra) values (-1001, '-1000000001', 'Test cases only', 'A', (select id from account_heading WHERE accno = '000000000000000000000'), false); INSERT INTO account(id, accno, description, category, heading, contra) values (-1002, '-1000000002', 'Test cases only', 'A', (select id from account_heading WHERE accno = '000000000000000000000'), false); CREATE OR REPLACE FUNCTION test_get_account_id(in_accno text) returns int as $$ SELECT id FROM chart WHERE accno = $1; $$ language sql; ledgersmb/sql/modules/test/Payment.sql0000644000000000000000000001327411764326710017122 0ustar rootrootBEGIN; \i Base.sql insert into users (entity_id, username, id) values (-200, '_test1', -200); insert into session (session_id, users_id, token, last_used) values (-200, -200, md5(random()::text), now()); INSERT INTO chart (accno, description, charttype, category, link) VALUES ('00001', 'testing', 'A', 'L', 'AP'); INSERT INTO chart (accno, description, charttype, category, link) VALUES ('00002', 'testing2', 'A', 'E', 'AP_amount'); INSERT INTO chart (accno, description, charttype, category, link) VALUES ('00003', 'testing2', 'A', 'A', 'AP_paid'); INSERT INTO session (users_id, last_used, token) values (currval('users_id_seq'), now(), md5('test2')); INSERT INTO test_result(test_name, success) SELECT 'AP Batch created', (SELECT batch_create('test', 'test', 'ap', now()::date)) IS NOT NULL; INSERT INTO company (id, legal_name, entity_id) VALUES (-101, 'TEST', -101); INSERT INTO business (id, description) values (-101, 'test'); INSERT INTO entity_credit_account (id, meta_number, threshold, entity_id, entity_class, business_id, ar_ap_account_id) values (-101, 'TEST1', 100000, -101, 1, -101, -1000); INSERT INTO ap (invnumber, entity_credit_account, approved, amount, netamount, curr) values ('test_hide', -101, false, '1', '1', 'USD'); INSERT INTO voucher (trans_id, batch_class, batch_id) VALUES (currval('id'), 1, currval('batch_id_seq')); INSERT INTO test_result(test_name, success) SELECT 'Payment Batch created', (SELECT batch_create('test2', 'test2', 'ap', now()::date)) IS NOT NULL; INSERT INTO ap (invnumber, entity_credit_account, approved, amount, netamount, curr, transdate, paid) VALUES ('test_show2', -101, true, 100000, 100000, 'USD', now()::date, 0); INSERT INTO acc_trans (approved, transdate, amount, trans_id, chart_id) VALUES (true, now()::date, '100000', currval('id'), (select id from chart where accno = '00001')); INSERT INTO acc_trans (approved, transdate, amount, trans_id, chart_id) VALUES (true, now()::date, '-100000', currval('id'), (select id from chart where accno = '00002')); INSERT INTO ap (id, invnumber, entity_credit_account, approved, amount, netamount, curr, transdate, paid) VALUES (-300, 'test_show3', -101, true, 1000000, 1000000, 'USD', now()::date, 0); INSERT INTO acc_trans (approved, transdate, amount, trans_id, chart_id) VALUES (true, now()::date, '1000000', -300, (select id from chart where accno = '00001')); INSERT INTO acc_trans (approved, transdate, amount, trans_id, chart_id) VALUES (true, now()::date, '-1000000', -300, (select id from chart where accno = '00002')); update transactions set locked_by = -200 where id = -300; INSERT INTO ap (invnumber, entity_credit_account, approved, amount, netamount, curr, transdate, paid) values ('test_show', -101, false, '1', '1', 'USD', now()::date, 0); INSERT INTO acc_trans (approved, transdate, amount, trans_id, chart_id) VALUES (true, now()::date, '1', currval('id'), (select id from chart where accno = '00001')); INSERT INTO acc_trans (approved, transdate, amount, trans_id, chart_id) VALUES (true, now()::date, '-1', currval('id'), (select id from chart where accno = '00002')); INSERT INTO voucher (trans_id, batch_class, batch_id) VALUES (currval('id'), 1, currval('batch_id_seq')); CREATE FUNCTION test_convert_array(anyarray) RETURNS text AS ' SELECT array_to_string($1, ''::''); ' LANGUAGE SQL; INSERT INTO test_result(test_name, success) VALUES ('Batch Voucher In Payment Selection', (SELECT test_convert_array(invoices) LIKE '%::test_show::%' FROM ( SELECT invoices FROM payment_get_all_contact_invoices(1, NULL, 'USD', NULL, NULL, currval('batch_id_seq')::int, '00001', 'TEST1') )p)); INSERT INTO test_result(test_name, success) VALUES ('Locked Invoice In Payment Selection', (SELECT test_convert_array(invoices) LIKE '%::test_show3::%' FROM ( SELECT invoices FROM payment_get_all_contact_invoices(1, NULL, 'USD', NULL, NULL, currval('batch_id_seq')::int, '00001', 'TEST1') )p)); INSERT INTO test_result(test_name, success) VALUES ('Threshold met', (SELECT test_convert_array(invoices) LIKE '%::test_show2::%' FROM ( SELECT invoices FROM payment_get_all_contact_invoices(1, NULL, 'USD', NULL, NULL, NULL, '00001', 'TEST1') )p)); SELECT invoices FROM payment_get_all_contact_invoices(1, NULL, 'USD', NULL, NULL, NULL, '00002', 'TEST1'); INSERT INTO test_result(test_name, success) VALUES ('Non-Batch Voucher Not In Payment Selection', (SELECT test_convert_array(invoices) NOT LIKE '%::test_hide::%' FROM (SELECT invoices FROM payment_get_all_contact_invoices(1, NULL, 'USD', NULL, NULL, currval('batch_id_seq')::int, '00001', 'TEST1'))p )); INSERT INTO test_result(test_name, success) VALUES ('Locked Invoice not in total', (SELECT total_due < 1000000 FROM payment_get_all_contact_invoices(1, NULL, 'USD', NULL, NULL, currval('batch_id_seq')::int, '00001', 'TEST1')) ); INSERT INTO voucher(batch_id, batch_class, id, trans_id) values (currval('batch_id_seq')::int, 4, -100, currval('id')::int); INSERT INTO acc_trans(trans_id, chart_id, voucher_id, approved, amount, transdate, source) values (currval('id')::int, (select id from chart where accno = '00003'), -100, true, '1', now(), '_test_src1'); INSERT INTO acc_trans(trans_id, chart_id, voucher_id, approved, amount, transdate, source) values (currval('id')::int, (select id from chart where accno = '00001'), -100, true, '-1', now(), '_test_src1'); INSERT INTO test_result(test_name, success) SELECT 'batch_description exists', count(batch_description) = 1 FROM payment__search('_test_src1', NULL, NULL, -101, '00003', 1, 'USD'); SELECT * FROM TEST_RESULT; SELECT (select count(*) from test_result where success is true) || ' tests passed and ' || (select count(*) from test_result where success is not true) || ' failed' as message; ROLLBACK; ledgersmb/sql/modules/test/Company.sql0000644000000000000000000000561711764326710017115 0ustar rootrootBEGIN; \i Base.sql INSERT INTO test_result (test_name, success) SELECT 'Saving Company', company_save (NULL, 'TESTING...', 1,'TESTING', 'TESTING', NULL, '1234', 232) IS NOT NULL; INSERT INTO test_result (test_name, success) SELECT 'Saving Credit Acct', entity_credit_save( NULL , 1, currval('entity_id_seq')::int, 'TEST', 0, false, 0, 0, 0, 'test-123', NULL, NULL, NULL, 'USD', now()::date, now()::date, 0, -1000, NULL, NULL, NULL, NULL) IS NOT NULL; INSERT INTO test_result (test_name, success) SELECT 'eca_location_save', eca__location_save(currval('entity_credit_account_id_seq')::int, NULL, 2, 'Test', 'Test', NULL, 'Test', 'Test', '12345', 25, NULL) IS NOT NULL; INSERT INTO test_result (test_name, success) SELECT 'eca_location_save returns same id with same args and no in_location_id', eca__location_save(currval('entity_credit_account_id_seq')::int, NULL, 1, 'Test2', 'Test', '', 'Test', 'Test123', '12345', 25, NULL) = eca__location_save(currval('entity_credit_account_id_seq')::int, NULL, 3, 'Test2', 'Test', '', 'Test', 'Test123', '12345', 25, NULL); INSERT INTO test_result (test_name, success) SELECT 'list_locations', count(*) = 3 FROM eca__list_locations(currval('entity_credit_account_id_seq')::int); INSERT INTO test_result(test_name, success) SELECT 'saving eca contact', eca__save_contact(currval('entity_credit_account_id_seq')::int, 1, 'test_d', 'test_c', NULL, NULL) IS NOT NULL; INSERT INTO test_result(test_name, success) SELECT 'Contact found correctly', count(*) = 1 FROM eca__list_contacts(currval('entity_credit_account_id_seq')::int) WHERE contact = 'test_c'; INSERT INTO test_result(test_name, success) SELECT 'Company_get_billing_info working', count(*) = 1 FROM company_get_billing_info((select max(id) from entity_credit_account)) WHERE control_code is not null; -- Note tests -- INSERT INTO test_result (test_name, success) SELECT 'entity__save_notes', entity__save_notes ( currval('entity_id_seq')::int, 'Test note text', 'Test note subject' ) > 0; INSERT INTO test_result (test_name, success) SELECT 'entity__save_note subject record', CASE WHEN subject = 'Test note subject' THEN 't'::bool ELSE 'f'::bool END FROM entity_note WHERE id = currval('note_id_seq'); INSERT INTO test_result(test_name, success) SELECT 'eca_save_notes', eca__save_notes( currval('entity_credit_account_id_seq')::int, 'Test note text', 'ECA test note subject' ) > 0; INSERT INTO test_result (test_name, success) SELECT 'eca__save_notes subject record', CASE WHEN subject = 'ECA test note subject' THEN 't'::bool ELSE 'f'::bool END FROM eca_note WHERE id = currval('note_id_seq'); SELECT * FROM test_result; SELECT (select count(*) from test_result where success is true) || ' tests passed and ' || (select count(*) from test_result where success is not true) || ' failed' as message; ROLLBACK; ledgersmb/sql/modules/test/Draft.sql0000644000000000000000000000736211602333025016532 0ustar rootrootBEGIN; \i Base.sql INSERT INTO entity (id, entity_class, name, country_id) VALUES (-1000, 1, '__TEST', 243); INSERT INTO entity_credit_account (id, meta_number, entity_class, entity_id, ar_ap_account_id) VALUES (-1000, '_testv', 1, -1000, -1000); INSERT INTO entity_credit_account (id, meta_number, entity_class, entity_id, ar_ap_account_id) VALUES (-1001, '_testc', 2, -1000, -1000); SELECT account_save (NULL, '00001', 'test only', 'A', NULL, NULL, FALSE, FALSE,'{}'); SELECT account_save (NULL, '00002', 'test only', 'A', NULL, NULL, FALSE, FALSE,'{}'); INSERT INTO ap (invnumber, entity_credit_account, amount, netamount, paid, approved, curr) select '_TEST AP', -1000, '100', '100', '0', FALSE, 'USD'; INSERT INTO acc_trans (chart_id, trans_id, amount, approved) SELECT id, currval('id'), '100', TRUE FROM chart WHERE accno = '00001'; INSERT INTO ac_tax_form (entry_id, reportable) VALUES (currval('acc_trans_entry_id_seq')::int, true); INSERT INTO acc_trans (chart_id, trans_id, amount, approved) SELECT id, currval('id'), '-100', TRUE FROM chart WHERE accno = '00002'; INSERT INTO ac_tax_form (entry_id, reportable) VALUES (currval('acc_trans_entry_id_seq')::int, false); INSERT INTO ar (invnumber, entity_credit_account, amount, netamount, paid, approved, curr) select '_TEST AR', -1001, '100', '100', '0', FALSE, 'USD'; INSERT INTO acc_trans (chart_id, trans_id, amount, approved) SELECT id, currval('id'), '-100', TRUE FROM chart WHERE accno = '00001'; INSERT INTO acc_trans (chart_id, trans_id, amount, approved) SELECT id, currval('id'), '100', TRUE FROM chart WHERE accno = '00002'; INSERT INTO gl (reference, description, approved) VALUES ('_TEST GL', 'Testing GL Drafts', false); INSERT INTO acc_trans (chart_id, trans_id, amount, approved) SELECT id, currval('id'), '-100', TRUE FROM chart WHERE accno = '00001'; INSERT INTO acc_trans (chart_id, trans_id, amount, approved) SELECT id, currval('id'), '100', TRUE FROM chart WHERE accno = '00002'; INSERT INTO test_result(test_name, success) SELECT '"ap" search successful', count(*) = 1 FROM draft__search('ap', NULL, NULL, NULL, NULL, NULL) WHERE reference = '_TEST AP'; INSERT INTO test_result(test_name, success) SELECT '"AP" search successful', count(*) = 1 FROM draft__search('AP', NULL, NULL, NULL, NULL, NULL) WHERE reference = '_TEST AP'; INSERT INTO test_result(test_name, success) SELECT '"AP" delete successful (w/1099)', draft_delete(id) FROM draft__search('AP', NULL, NULL, NULL, NULL, NULL) WHERE reference = '_TEST AP'; INSERT INTO test_result(test_name, success) SELECT '"ar" search successful', count(*) = 1 FROM draft__search('ar', NULL, NULL, NULL, NULL, NULL) WHERE reference = '_TEST AR'; INSERT INTO test_result(test_name, success) SELECT '"AR" search successful', count(*) = 1 FROM draft__search('AR', NULL, NULL, NULL, NULL, NULL) WHERE reference = '_TEST AR'; INSERT INTO test_result(test_name, success) SELECT '"gl" search successful', count(*) = 1 FROM draft__search('gl', NULL, NULL, NULL, NULL, NULL) WHERE reference = '_TEST GL'; INSERT INTO test_result(test_name, success) SELECT '"GL" search successful', count(*) = 1 FROM draft__search('GL', NULL, NULL, NULL, NULL, NULL) WHERE reference = '_TEST GL'; INSERT INTO test_result(test_name, success) SELECT 'gl draft deletion', draft_delete(currval('id')::int); INSERT INTO test_result(test_name, success) SELECT 'gl table cleanup', count(*) = 0 from gl where id = currval('id'); INSERT INTO test_result(test_name, success) SELECT 'acc_trans table cleanup', count(*) = 0 from acc_trans where trans_id = currval('id'); SELECT * FROM test_result; SELECT (select count(*) from test_result where success is true) || ' tests passed and ' || (select count(*) from test_result where success is not true) || ' failed' as message; ROLLBACK; ledgersmb/sql/modules/test/Session.sql0000644000000000000000000000523411764326710017125 0ustar rootrootBEGIN; \i Base.sql \i data/Reconciliation.sql INSERT INTO test_result (test_name, success) values ('timeout set', (select count(*) from defaults where setting_key = 'timeout') = 1); INSERT INTO session (users_id, last_used, token) SELECT currval('users_id_seq'), now() - coalesce((select value from defaults where setting_key = 'timeout')::interval, '90 minutes'::interval) - '1 minute'::interval, md5('test2'); INSERT INTO session (users_id, last_used, token) SELECT currval('users_id_seq'), now() - coalesce((select value from defaults where setting_key = 'timeout')::interval, '2 days'::interval), md5('test3'); INSERT INTO session (users_id, last_used, token) SELECT currval('users_id_seq'), now(), md5('test1'); INSERT INTO test_result (test_name, success) SELECT 'records exist in transactions table', count(*) > 0 FROM transactions; INSERT INTO test_result (test_name, success) SELECT 'unlock record fails when record is not locked', unlock(max(id)) IS FALSE FROM transactions; INSERT INTO test_result (test_name, success) SELECT 'lock record', lock_record(max(id), currval('session_session_id_seq')::int) FROM transactions WHERE locked_by IS NULL; INSERT INTO test_result (test_name, success) SELECT 'unlock record', unlock(max(id)) FROM transactions WHERE locked_by = currval('session_session_id_seq')::int; INSERT INTO test_result (test_name, success) SELECT 'lock all record', bool_and(lock_record(id, currval('session_session_id_seq')::int)) FROM transactions WHERE locked_by IS NULL; INSERT INTO test_result (test_name, success) SELECT 'unlock all records', unlock_all(); INSERT INTO test_result (test_name, success) values ('session1 retrieved', (select t.token = md5('test1') FROM session_check( currval('session_session_id_seq')::int, md5('test1') ) t ) ); INSERT INTO test_result (test_name, success) select 'Form_open on correct syntax', form_open(currval('session_session_id_seq')::int) > 0; INSERT INTO test_result (test_name, success) select 'Form_close fails on bad values', form_close(currval('session_session_id_seq')::int + 1, currval('open_forms_id_seq')::int) is false; INSERT INTO test_result (test_name, success) select 'Form_close fails on bad values', form_close(currval('session_session_id_seq')::int, currval('open_forms_id_seq')::int); INSERT INTO test_result (test_name, success) VALUES ('session 2 removed', (select count(*) from session where token = md5('test2') AND users_id = currval('users_id_seq')) = 0); SELECT * FROM test_result; SELECT (select count(*) from test_result where success is true) || ' tests passed and ' || (select count(*) from test_result where success is not true) || ' failed' as message; ROLLBACK; ledgersmb/sql/modules/test/admin.sql0000644000000000000000000000040411073717024016557 0ustar rootrootBEGIN; \i Base.sql \echo no tests yet! SELECT * FROM test_result; SELECT (select count(*) from test_result where success is true) || ' tests passed and ' || (select count(*) from test_result where success is not true) || ' failed' as message; ROLLBACK; ledgersmb/sql/modules/test/data/0000755000000000000000000000000012060044550015653 5ustar rootrootledgersmb/sql/modules/test/data/Reconciliation.sql0000644000000000000000000001672011602575436021361 0ustar rootroot-- To run from other transaction test scripts! INSERT INTO account(id, accno, description, category, heading, contra) values (-200, '-11111', 'Test Act 1', 'A', (select id from account_heading WHERE accno = '000000000000000000000'), false); INSERT INTO account(id, accno, description, category, heading, contra) values (-201, '-11112', 'Test Act 1', 'A', (select id from account_heading WHERE accno = '000000000000000000000'), false); INSERT INTO entity (id, control_code, name, entity_class, country_id) values (-201, '-11111', 'Test 1', 1, 242); INSERT INTO entity_credit_account (entity_id, id, meta_number, entity_class, ar_ap_account_id) values (-201, -200, 'T-11111', 1, -1000); INSERT INTO entity_credit_account (entity_id, id, meta_number, entity_class, ar_ap_account_id) values (-201, -201, 'T-11112', 1, -1000); INSERT INTO ar (id, invnumber, amount, netamount, paid, entity_credit_account, transdate, curr) values (-200, '-2000', '10', '10', '0', -200, '1000-01-01', 'USD'); INSERT INTO ar (id, invnumber, amount, netamount, paid, entity_credit_account, transdate, curr) values (-201, '-2001', '10', '10', '0', -200, '1000-01-03', 'USD'); INSERT INTO ar (id, invnumber, amount, netamount, paid, entity_credit_account, transdate, curr) values (-204, '-2002', '10', '10', '0', -200, '1000-01-01', 'USD'); INSERT INTO ar (id, invnumber, amount, netamount, paid, entity_credit_account, transdate, curr) values (-205, '-2003', '10', '10', '0', -200, '1000-01-03', 'USD'); INSERT INTO ar (id, invnumber, amount, netamount, paid, entity_credit_account, transdate, curr) values (-206, '-2004', '10', '10', '0', -201, '1000-01-01', 'USD'); INSERT INTO ar (id, invnumber, amount, netamount, paid, entity_credit_account, transdate, curr) values (-207, '-2005', '10', '10', '0', -201, '1000-01-03', 'USD'); INSERT INTO ar (id, invnumber, amount, netamount, paid, entity_credit_account, transdate, curr) values (-208, '-2006', '10', '10', '0', -201, '1000-01-01', 'USD'); INSERT INTO ar (id, invnumber, amount, netamount, paid, entity_credit_account, transdate, curr) values (-209, '-2007', '10', '10', '0', -201, '1000-01-03', 'USD'); INSERT INTO gl (id, reference, transdate) values (-202, 'Recon gl test 1', '1000-01-01'); INSERT INTO gl (id, reference, transdate) values (-203, 'Recon gl test 2', '1000-01-01'); INSERT INTO gl (id, reference, transdate) values (-210, 'Recon gl test 3', '1000-01-03'); INSERT INTO gl (id, reference, transdate) values (-211, 'Recon gl test 4', '1000-01-03'); INSERT INTO gl (id, reference, transdate, approved) values (-212, 'Cleared gl trans', '1000-01-03', true); INSERT INTO gl (id, reference, transdate, approved) values (-213, 'Unapproved gl trans', '1000-01-03', false); INSERT INTO gl (id, reference, transdate, approved) values (-214, 'gl trans, unapproved lines', '1000-01-03', false); CREATE OR REPLACE FUNCTION test_get_account_id(in_accno text) returns int as $$ SELECT id FROM chart WHERE accno = $1; $$ language sql; INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-200, test_get_account_id('-11111'), '1000-01-01', -10, '1'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source, cleared, approved) values (-200, test_get_account_id('-11111'), '1000-01-01', -10, '1', true, false); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source, cleared, approved) values (-200, test_get_account_id('-11112'), '1000-01-01', 10, '1', true, false); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-200, test_get_account_id('-11112'), '1000-01-01', 10, '1'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-201, test_get_account_id('-11111'), '1000-01-03', -10, '1'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-201, test_get_account_id('-11112'), '1000-01-03', 10, '1'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-202, test_get_account_id('-11111'), '1000-01-01', -10, 't gl 1'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-202, test_get_account_id('-11112'), '1000-01-01', 10, 't gl 1'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-203, test_get_account_id('-11111'), '1000-01-01', -10, 't gl 1'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-203, test_get_account_id('-11112'), '1000-01-01', 10, 't gl 1'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-204, test_get_account_id('-11111'), '1000-01-01', -10, '1'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-204, test_get_account_id('-11112'), '1000-01-01', 10, '1'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-205, test_get_account_id('-11111'), '1000-01-03', -10, '1'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-205, test_get_account_id('-11112'), '1000-01-03', 10, '1'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-206, test_get_account_id('-11111'), '1000-01-01', -10, '1'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-206, test_get_account_id('-11112'), '1000-01-01', 10, '1'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-207, test_get_account_id('-11111'), '1000-01-03', -10, '1'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-207, test_get_account_id('-11112'), '1000-01-03', 10, '1'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-208, test_get_account_id('-11111'), '1000-01-01', -10, '2'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-208, test_get_account_id('-11112'), '1000-01-01', 10, '2'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-209, test_get_account_id('-11111'), '1000-01-03', -10, '2'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-209, test_get_account_id('-11112'), '1000-01-03', 10, '2'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-210, test_get_account_id('-11111'), '1000-01-03', -10, '1'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-210, test_get_account_id('-11112'), '1000-01-03', 10, '1'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-211, test_get_account_id('-11111'), '1000-01-03', -10, 't gl 1'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-211, test_get_account_id('-11112'), '1000-01-03', 10, 't gl 1'); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source, cleared) values (-212, test_get_account_id('-11111'), '1000-01-03', -10, '1', true); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source, cleared) values (-212, test_get_account_id('-11112'), '1000-01-03', 10, '1', true); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source, cleared) values (-213, test_get_account_id('-11111'), '1000-01-03', -10, '1', false); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source, cleared) values (-213, test_get_account_id('-11112'), '1000-01-03', 10, '1', false); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source, approved) values (-214, test_get_account_id('-11111'), '1000-01-03', -10, '1', false); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source, approved) values (-214, test_get_account_id('-11112'), '1000-01-03', 10, '1', false); ledgersmb/sql/modules/test/EndOfYear.sql0000644000000000000000000000175211602342237017310 0ustar rootroot BEGIN; \i Base.sql DELETE FROM account_checkpoint; DELETE FROM yearend; INSERT INTO gl (id, reference, description, transdate, approved) values (-1000, 'test', 'test', '1520-01-01', true); -- way in the future. INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, approved) values (-1000, '-1000', '1520-01-01', '10000', true); INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, approved) values (-1000, '-1001', '1520-01-01', '-10000', true); insert into test_result (success, test_name) select eoy_close_books('1520-05-01', 'test', 'test', '-1002'), 'Close books succeeded'; insert into test_result (success, test_name) select amount = 10000, 'Account checkpoint added' from account_checkpoint where end_date = '1520-05-01' and account_id = -1000; SELECT * FROM test_result; SELECT (select count(*) from test_result where success is true) || ' tests passed and ' || (select count(*) from test_result where success is not true) || ' failed' as message; ROLLBACK; ledgersmb/sql/modules/test/Taxform.sql0000644000000000000000000006164211604023162017113 0ustar rootroot/* *igning tests. Thinking: 1) Correct number of lines on summary report 2) Correct total on summary report 3) Correct number of lines on detail report 4) Correct totals on detail report 5) Correct total summary report for future year 6) Correct number of lines for report on future year 7) Correct number of lines on detail report for futture year 8) Correct totals on lines of details report for future year Invoices 8: 1) AP transaction: Reportable amount 1000, non-reportable amount $10, paid in full in current year. 2) AP transaction: Reportable amount $1000, non-reportable amount $10, partially paid ($500) in current year 3) AP Transaction: Reportable amount $1000, non-reportable amount $10, paid $500 currnet year, $500 in future year 4) AP invoice: Reportable amount 1000, non-reportable amount $10, paid in full in current year. 5) AP invoice: Reportable amount $1000, non-reportable amount $10, partially paid ($500) in current year 6) AP invice: Reportable amount $1000, non-reportable amount $10, paid $500 currnet year, $500 in future year 7 like 1 but different vendor 8 like 4 but different vendor --CT */ BEGIN; \i Base.sql -- Basic setup INSERT INTO account_heading(id, accno ) VALUES (-255, '-billion'); INSERT INTO account (id, accno, category, heading ) VALUES (-255, '-billion', 'T', -255); INSERT INTO account (id, accno, category, heading ) VALUES (-256, '-billiontest', 'T', -255); INSERT INTO country_tax_form (country_id, form_name, id) VALUES (232, 'Testing Form', -511); INSERT INTO parts (id, partnumber, description) values (-255, 'test1', 'test 1'); INSERT INTO parts (id, partnumber, description) values (-256, 'test2', 'test 2'); -- Set up an ECAs, for AP. INSERT INTO entity_credit_account (id, entity_id, entity_class, meta_number, taxform_id, ar_ap_account_id) VALUES (-255, -100, 1, 'Test account 1', -511, -255); INSERT INTO company (id, entity_id, legal_name) VALUES (-1024, -100, 'Testing Tax Form'); INSERT INTO entity_credit_account (id, entity_id, entity_class, meta_number, taxform_id, ar_ap_account_id) VALUES (-256, -101, 1, 'Test account 2', -511, -255); INSERT INTO company (id, entity_id, legal_name) VALUES (-1025, -101, 'Testing Tax Form'); CREATE OR REPLACE FUNCTION date1() RETURNS date AS $$ SELECT (extract('YEAR' from now())|| '-12-01')::date; $$ language sql; CREATE OR REPLACE FUNCTION date2() RETURNS date AS $$ SELECT ((extract('YEAR' from now())|| '-12-01')::date + '1 year'::interval)::date; $$ language sql; INSERT INTO account_link (account_id, description) values (-1000, 'AP'); INSERT INTO account_link (account_id, description) values (-1001, 'AP_amount'); INSERT INTO account_link (account_id, description) values (-1002, 'AP_paid'); --AP transactions. --1) AP transaction: Reportable amount 1000, non-reportable amount $10, paid -- in full in current year. id -1024 INSERT INTO ap (id, transdate, amount, netamount, curr, entity_credit_account, approved) values(-1024, date1(), 1010, 1010, 'USD', -255, true); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1024, -1000, date1(), 1010, true, -111); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1024, -1001, date1(), -1000, true, -112); INSERT INTO ac_tax_form(entry_id, reportable) values (-112, true); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1024, -1001, date1(), -10, true, -113); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1024, -1002, date1(), 1010, true, -114); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1024, -1000, date1(), -1010, true, -115); -- 2) AP transaction: Reportable amount $1000, non-reportable amount $10, -- partially paid ($500) in current year -1025 INSERT INTO ap (id, transdate, amount, netamount, curr, entity_credit_account, approved) values(-1025, date1(), 1010, 1010, 'USD', -255, true); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1025, -1000, date1(), 1010, true, -121); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1025, -1001, date1(), -1000, true, -122); INSERT INTO ac_tax_form(entry_id, reportable) values (-122, true); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1025, -1001, date1(), -10, true, -123); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1025, -1002, date1(), 505, true, -124); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1025, -1000, date1(), -505, true, -125); -- 3)_AP Transaction: Reportable amount $1000, non-reportable amount $10, -- paid $500 currnet year, $500 in future year -1026 INSERT INTO ap (id, transdate, amount, netamount, curr, entity_credit_account, approved) values(-1026, date1(), 1010, 1010, 'USD', -255, true); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1026, -1000, date1(), 1010, true, -131); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1026, -1001, date1(), -1000, true, -132); INSERT INTO ac_tax_form(entry_id, reportable) values (-132, true); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1026, -1001, date1(), -10, true, -133); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1026, -1002, date1(), 505, true, -134); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1026, -1000, date1(), -505, true, -135); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1026, -1002, date2(), 505, true, -136); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1026, -1000, date2(), -505, true, -137); -- 4) AP transaction: Reportable amount 1000, non-reportable amount $10, paid -- $500 currnet year, $500 in future year -1027, to second vendor -- Vendor Invoices. INSERT INTO ap (id, transdate, amount, netamount, curr, entity_credit_account, approved) values(-1027, date1(), 1010, 1010, 'USD', -256, true); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1027, -1000, date1(), 1010, true, -141); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1027, -1001, date1(), -1000, true, -142); INSERT INTO ac_tax_form(entry_id, reportable) values (-142, true); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1027, -1001, date1(), -10, true, -143); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1027, -1002, date1(), 1010, true, -144); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1027, -1000, date1(), -1010, true, -145); -- 2) AP invoice: Reportable amount $1000, non-reportable amount $10, -- partially paid ($500) in current year -1035 INSERT INTO ar (id, transdate, amount, netamount, curr, entity_credit_account, approved, invoice) values(-1035, date1(), 1010, 1010, 'USD', -255, true, true); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1035, -1000, date1(), 1010, true, -221); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1035, -1001, date1(), -1000, true, -222); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1035, -1001, date1(), -10, true, -223); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1035, -1002, date1(), 505, true, -224); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1035, -1000, date1(), -505, true, -225); insert into invoice(trans_id, id, parts_id, description, qty, sellprice) VALUES (-1035, -211, -255, 'test 1', -1, 1000); INSERT INTO invoice_tax_form(invoice_id, reportable) VALUES (-211, true); insert into invoice(trans_id, id, parts_id, description, qty, sellprice) VALUES (-1035, -212, -256, 'test 1', -1, 10); -- 3)_AP invoice: Reportable amount $1000, non-reportable amount $10, -- paid $500 currnet year, $500 in future year -1036 INSERT INTO ar (id, transdate, amount, netamount, curr, entity_credit_account, approved, invoice) values(-1036, date1(), 1010, 1010, 'USD', -255, true, true); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1036, -1000, date1(), 1010, true, -231); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1036, -1001, date1(), -1000, true, -232); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1036, -1001, date1(), -10, true, -233); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1036, -1002, date1(), 505, true, -234); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1036, -1000, date1(), -505, true, -235); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1036, -1002, date2(), 505, true, -236); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1036, -1000, date2(), -505, true, -237); insert into invoice(trans_id, id, parts_id, description, qty, sellprice) VALUES (-1036, -221, -255, 'test 1', -1, 1000); INSERT INTO invoice_tax_form(invoice_id, reportable) VALUES (-221, true); insert into invoice(trans_id, id, parts_id, description, qty, sellprice) VALUES (-1036, -222, -256, 'test 1', -1, 10); -- 4) AP invoice: Reportable amount 1000, non-reportable amount $10, paid -- $500 currnet year, $500 in future year -1037, to second vendor INSERT INTO ar (id, transdate, amount, netamount, curr, entity_credit_account, approved, invoice) values(-1037, date1(), 1010, 1010, 'USD', -256, true, true); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1037, -1000, date1(), 1010, true, -241); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1037, -1001, date1(), -1000, true, -242); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1037, -1001, date1(), -10, true, -243); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1037, -1002, date1(), 1010, true, -244); INSERT INTO acc_trans(trans_id, chart_id, transdate, amount, approved, entry_id) VALUES (-1037, -1000, date1(), -1010, true, -245); insert into invoice(trans_id, id, parts_id, description, qty, sellprice) VALUES (-1037, -231, -255, 'test 1', -1, 1000); INSERT INTO invoice_tax_form(invoice_id, reportable) VALUES (-231, true); insert into invoice(trans_id, id, parts_id, description, qty, sellprice) VALUES (-1037, -232, -256, 'test 1', -1, 10); -- Tests INSERT INTO test_result(test_name, success) SELECT '2 rows on current summary report', count(*) = 2 FROM tax_form_summary_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date); INSERT INTO test_result(test_name, success) SELECT '1 row on future summary report', count(*) = 1 FROM tax_form_summary_report(-511, (date2() - '1 day'::interval)::date, (date2() + '1 day'::interval)::date); INSERT INTO test_result(test_name, success) SELECT 'inv_sum for test vendor 1, current report is $2000', invoice_sum = 1000 FROM tax_form_summary_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date) where meta_number = 'Test account 1'; INSERT INTO test_result(test_name, success) SELECT 'inv_sum for test vendor 1, future report is $500', invoice_sum = 500 FROM tax_form_summary_report(-511, (date2() - '1 day'::interval)::date, (date2() + '1 day'::interval)::date) where meta_number = 'Test account 1'; INSERT INTO test_result(test_name, success) SELECT 'inv_sum for test vendor 2, current report is $1000', invoice_sum = 1000 FROM tax_form_summary_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date) where meta_number = 'Test account 2'; INSERT INTO test_result(test_name, success) SELECT 'total_sum for test vendor 1, current report is $4000', total_sum = 3000 FROM tax_form_summary_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date) where meta_number = 'Test account 1'; INSERT INTO test_result(test_name, success) SELECT 'total_sum for test vendor 1, future report is $1000', total_sum = 1000 FROM tax_form_summary_report(-511, (date2() - '1 day'::interval)::date, (date2() + '1 day'::interval)::date) where meta_number = 'Test account 1'; INSERT INTO test_result(test_name, success) SELECT 'total_sum for test vendor 2, current report is $2000', total_sum = 2000 FROM tax_form_summary_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date) where meta_number = 'Test account 2'; INSERT INTO test_result(test_name, success) SELECT 'ac_sum for test vendor 1, current report is $2000', acc_sum = 2000 FROM tax_form_summary_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date) where meta_number = 'Test account 1'; INSERT INTO test_result(test_name, success) SELECT 'ac_sum for test vendor 1, future report is $500', acc_sum = 500 FROM tax_form_summary_report(-511, (date2() - '1 day'::interval)::date, (date2() + '1 day'::interval)::date) where meta_number = 'Test account 1'; INSERT INTO test_result(test_name, success) SELECT 'ac_sum for test vendor 2, current report is $1000', acc_sum = 1000 FROM tax_form_summary_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date) where meta_number = 'Test account 2'; INSERT INTO test_result(test_name, success) SELECT '6 in detail report for current report, vendor 1', count(*) = 5 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 1'); INSERT INTO test_result(test_name, success) SELECT '2 in detail report for current report, vendor 2', count(*) = 2 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 2'); INSERT INTO test_result(test_name, success) SELECT '2 in detail report for future report, vendor 1', count(*) = 2 FROM tax_form_details_report(-511, (date2() - '1 day'::interval)::date, (date2() + '1 day'::interval)::date, 'Test account 1'); INSERT INTO test_result(test_name, success) SELECT '0 in detail report for future report, vendor 2', count(*) = 0 FROM tax_form_details_report(-511, (date2() - '1 day'::interval)::date, (date2() + '1 day'::interval)::date, 'Test account 2'); INSERT INTO test_result(test_name, success) SELECT 'current report, invoice -1024, acc $1000', acc_sum= 1000 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 1') WHERE invoice_id = -1024; INSERT INTO test_result(test_name, success) SELECT 'current report, invoice -1025, acc $500', acc_sum= 500 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 1') WHERE invoice_id = -1025; INSERT INTO test_result(test_name, success) SELECT 'current report, invoice -1026, acc $500', acc_sum= 500 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 1') WHERE invoice_id = -1026; INSERT INTO test_result(test_name, success) SELECT 'current report, invoice -1027, acc $1000', acc_sum= 1000 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 2') WHERE invoice_id = -1027; INSERT INTO test_result(test_name, success) SELECT 'current report, invoice -1024, total $1000', total_sum= 1000 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 1') WHERE invoice_id = -1024; INSERT INTO test_result(test_name, success) SELECT 'current report, invoice -1025, total $500', total_sum= 500 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 1') WHERE invoice_id = -1025; INSERT INTO test_result(test_name, success) SELECT 'current report, invoice -1026, total $500', total_sum= 500 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 1') WHERE invoice_id = -1026; INSERT INTO test_result(test_name, success) SELECT 'current report, invoice -1027, total $1000', total_sum= 1000 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 2') WHERE invoice_id = -1027; INSERT INTO test_result(test_name, success) SELECT 'current report, invoice -1024, inv_total 0', invoice_sum= 0 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 1') WHERE invoice_id = -1024; INSERT INTO test_result(test_name, success) SELECT 'current report, invoice -1025, inv 0', invoice_sum= 0 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 1') WHERE invoice_id = -1025; INSERT INTO test_result(test_name, success) SELECT 'current report, invoice -1026, inv 0', invoice_sum = 0 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 1') WHERE invoice_id = -1026; INSERT INTO test_result(test_name, success) SELECT 'current report, invoice -1027, inv 0', invoice_sum= 0 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 2') WHERE invoice_id = -1027; INSERT INTO test_result(test_name, success) SELECT 'current report, invoice -1035, inv $500', invoice_sum= 500 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 1') WHERE invoice_id = -1035; INSERT INTO test_result(test_name, success) SELECT 'current report, invoice -1036, inv $500', invoice_sum= 500 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 1') WHERE invoice_id = -1036; INSERT INTO test_result(test_name, success) SELECT 'current report, invoice -1037, inv $1000', invoice_sum= 1000 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 2') WHERE invoice_id = -1037; INSERT INTO test_result(test_name, success) SELECT 'current report, invoice -1035, total $500', total_sum= 500 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 1') WHERE invoice_id = -1035; INSERT INTO test_result(test_name, success) SELECT 'current report, invoice -1036, total $500', total_sum= 500 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 1') WHERE invoice_id = -1036; INSERT INTO test_result(test_name, success) SELECT 'current report, invoice -1037, total $1000', total_sum= 1000 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 2') WHERE invoice_id = -1037; INSERT INTO test_result(test_name, success) SELECT 'current report, invoice -1035, acc 0', acc_sum = 0 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 1') WHERE invoice_id = -1035; INSERT INTO test_result(test_name, success) SELECT 'current report, invoice -1036, acc 0', acc_sum = 0 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 1') WHERE invoice_id = -1036; INSERT INTO test_result(test_name, success) SELECT 'current report, invoice -1037, acc 0', acc_sum = 0 FROM tax_form_details_report(-511, (date1() - '1 day'::interval)::date, (date1() + '1 day'::interval)::date, 'Test account 2') WHERE invoice_id = -1037; INSERT INTO test_result(test_name, success) SELECT 'future report, invoice -1026, acc 500', acc_sum = 500 FROM tax_form_details_report(-511, (date2() - '1 day'::interval)::date, (date2() + '1 day'::interval)::date, 'Test account 1') WHERE invoice_id = -1026; INSERT INTO test_result(test_name, success) SELECT 'future report, invoice -1026, inv 0', invoice_sum = 0 FROM tax_form_details_report(-511, (date2() - '1 day'::interval)::date, (date2() + '1 day'::interval)::date, 'Test account 1') WHERE invoice_id = -1026; INSERT INTO test_result(test_name, success) SELECT 'future report, invoice -1026, total 500', total_sum = 500 FROM tax_form_details_report(-511, (date2() - '1 day'::interval)::date, (date2() + '1 day'::interval)::date, 'Test account 1') WHERE invoice_id = -1026; INSERT INTO test_result(test_name, success) SELECT 'future report, invoice -1036, acc 0', acc_sum = 0 FROM tax_form_details_report(-511, (date2() - '1 day'::interval)::date, (date2() + '1 day'::interval)::date, 'Test account 1') WHERE invoice_id = -1036; INSERT INTO test_result(test_name, success) SELECT 'future report, invoice -1036, inv 500', invoice_sum = 500 FROM tax_form_details_report(-511, (date2() - '1 day'::interval)::date, (date2() + '1 day'::interval)::date, 'Test account 1') WHERE invoice_id = -1036; INSERT INTO test_result(test_name, success) SELECT 'future report, invoice -1036, total 500', total_sum = 500 FROM tax_form_details_report(-511, (date2() - '1 day'::interval)::date, (date2() + '1 day'::interval)::date, 'Test account 1') WHERE invoice_id = -1036; SELECT * FROM test_result; SELECT (select count(*) from test_result where success is true) || ' tests passed and ' || (select count(*) from test_result where success is not true) || ' failed' as message; ROLLBACK; ledgersmb/sql/modules/test/Account.sql0000644000000000000000000001340011430043011017044 0ustar rootrootBEGIN; \i Base.sql INSERT INTO chart (description, charttype, category, accno) VALUES ('TEST testing 1', 'A', 'A', '00001'); INSERT INTO chart (description, charttype, category, accno) VALUES ('TEST testing 2', 'A', 'A', '00002'); INSERT INTO entity_credit_account (id, meta_number, entity_id, entity_class, ar_ap_account_id) values (-100, 'test1', -100, 1, -1000); INSERT INTO ap (invnumber, netamount, amount, entity_credit_account, id, curr) VALUES ('TEST', '0', '0', -100, -100, 'USD'); INSERT INTO acc_trans (trans_id, chart_id, amount) VALUES (-100, currval('account_id_seq')::int, '0'); INSERT INTO chart (description, charttype, category, accno, link) VALUES ('TEST AP 1', 'A', 'L', '00003', 'AP'); INSERT INTO chart (description, charttype, category, accno, link) VALUES ('TEST AP 2', 'A', 'L', '00004', 'AP'); INSERT INTO chart (description, charttype, category, accno, link) VALUES ('TEST AR 1', 'A', 'A', '00005', 'AR'); INSERT INTO chart (description, charttype, category, accno, link) VALUES ('TEST AR 2', 'A', 'A', '00006', 'AR'); INSERT INTO chart (description, charttype, category, accno, link) VALUES ('TEST AR PAID 1', 'A', 'A', '00007', 'AR_paid'); insert into account_link_description(description, summary, custom) values ('AR_paid1', false, true); INSERT INTO chart (description, charttype, category, accno, link) VALUES ('TEST AR PAID 2', 'A', 'A', '00008', 'AR_paid1'); INSERT INTO chart (description, charttype, category, accno, link) VALUES ('TEST AR PAID 3', 'A', 'A', '00009', 'IC_tax:AR_paid'); insert into account_link_description(description, summary, custom) values ('AR_p', false, true); INSERT INTO chart (description, charttype, category, accno, link) VALUES ('TEST AR PAID 4 INVALID', 'A', 'A', '00010', 'AR_p'); INSERT INTO chart (description, charttype, category, accno, link) VALUES ('TEST AP PAID 1', 'A', 'A', '00011', 'AP_paid'); insert into account_link_description(description, summary, custom) values ('AP_paid1', false, true); INSERT INTO chart (description, charttype, category, accno, link) VALUES ('TEST AP PAID 2', 'A', 'A', '00012', 'AP_paid1'); INSERT INTO chart (description, charttype, category, accno, link) VALUES ('TEST AP PAID 3', 'A', 'A', '00013', 'IC_tax:AP_paid'); insert into account_link_description(description, summary, custom) values ('AP_p', false, true); INSERT INTO chart (description, charttype, category, accno, link) VALUES ('TEST AP PAID 4 INVALID', 'A', 'A', '00014', 'AP_p'); INSERT INTO chart (description, charttype, category, accno, link) VALUES ('TEST AP Overpayment 1', 'A', 'A', '00015', 'AP_overpayment'); insert into account_link_description(description, summary, custom) values ('AP_overpayment1', false, true); INSERT INTO chart (description, charttype, category, accno, link) VALUES ('TEST AP Overpayment 2', 'A', 'A', '00016', 'AP_overpayment1'); INSERT INTO chart (description, charttype, category, accno, link) VALUES ('TEST AP Overpayment 3', 'A', 'A', '00017', 'IC_tax:AP_overpayment'); insert into account_link_description(description, summary, custom) values ('AP_overp', false, true); INSERT INTO chart (description, charttype, category, accno, link) VALUES ('TEST AP Overpayment 4 INVALID', 'A', 'A', '00018', 'AP_overp'); INSERT INTO chart (description, charttype, category, accno, link) VALUES ('TEST AP Overpayment 1', 'A', 'A', '00019', 'AR_overpayment'); insert into account_link_description(description, summary, custom) values ('AR_overpayment1', false, true); INSERT INTO chart (description, charttype, category, accno, link) VALUES ('TEST AP Overpayment 2', 'A', 'A', '00020', 'AR_overpayment1'); INSERT INTO chart (description, charttype, category, accno, link) VALUES ('TEST AP Overpayment 3', 'A', 'A', '00021', 'IC_tax:AR_overpayment'); insert into account_link_description(description, summary, custom) values ('AR_overp', false, true); INSERT INTO chart (description, charttype, category, accno, link) VALUES ('TEST AP Overpayment 4 INVALID', 'A', 'A', '00022', 'AR_overp'); INSERT INTO test_result(test_name, success) VALUES ('Accounts created', currval('account_id_seq') is not null); INSERT INTO test_result(test_name, success) VALUES ('Chart 1 is orphaned', account_has_transactions((select id from chart where description = 'TEST testing 1')) is false); INSERT INTO test_result(test_name, success) VALUES ('Chart 2 is not orphaned', account_has_transactions((select id from chart where accno = '00002')) is true); INSERT INTO test_result(test_name, success) SELECT 'All Test Accounts Exist', count(*) = 23 FROM chart_list_all() where accno like '0%' AND description LIKE 'TEST%'; INSERT INTO test_result(test_name, success) SELECT 'List AR Cash Test Accounts', count(*) = 3 FROM chart_list_cash(2) where accno like '0%' AND description LIKE 'TEST%'; INSERT INTO test_result(test_name, success) SELECT 'List AP Cash Test Accounts', count(*) = 3 FROM chart_list_cash(1) where accno like '0%' AND description LIKE 'TEST%'; INSERT INTO test_result(test_name, success) SELECT 'List AP Overpayment Accts', count(*) = 3 FROM chart_list_overpayment(1) where accno like '0%' AND description LIKE 'TEST%'; INSERT INTO test_result(test_name, success) SELECT 'List AR Overpayment Accts', count(*) = 3 FROM chart_list_overpayment(2) where accno like '0%' AND description LIKE 'TEST%'; INSERT INTO test_result(test_name, success) SELECT 'Test AP Accounts Are Found', count(*) = 2 FROM chart_get_ar_ap(1) where accno like '0%' AND description LIKE 'TEST%'; INSERT INTO test_result(test_name, success) SELECT 'Test AR Accounts Are Found', count(*) = 2 FROM chart_get_ar_ap(2) where accno like '0%' AND description LIKE 'TEST%'; SELECT * FROM test_result; SELECT (select count(*) from test_result where success is true) || ' tests passed and ' || (select count(*) from test_result where success is not true) || ' failed' as message; ROLLBACK; ledgersmb/sql/modules/Files.sql0000644000000000000000000002237312007072444015561 0ustar rootrootBEGIN; CREATE OR REPLACE FUNCTION file__get_mime_type (in_mime_type_id int, in_mime_type_text text) RETURNS mime_type AS $$ select * from mime_type where ($1 IS NULL OR id = $1) AND ($2 IS NULL OR mime_type = $2); $$ language sql; COMMENT ON FUNCTION file__get_mime_type(in_mime_type_id int, in_mime_type text) IS $$Retrieves mime type information associated with a file object.$$; CREATE OR REPLACE FUNCTION file__attach_to_tx (in_content bytea, in_mime_type_id int, in_file_name text, in_description text, in_id int, in_ref_key int, in_file_class int) RETURNS file_base AS $$ DECLARE retval file_base; BEGIN IF in_id IS NOT NULL THEN IF in_content THEN RAISE EXCEPTION $e$Can't specify id and content in attachment$e$;--' END IF; INSERT INTO file_order_to_tx (file_id, source_class, ref_key, dest_class, attached_by, attached_at) VALUES (in_id, 2, in_ref_key, 1, person__get_my_entity_id(), now()); SELECT * INTO retval FROM file_base where id = in_id; RETURN retval; ELSE INSERT INTO file_transaction (content, mime_type_id, file_name, description, ref_key, file_class, uploaded_by, uploaded_at) VALUES (in_content, in_mime_type_id, in_file_name, in_description, in_ref_key, in_file_class, person__get_my_entity_id(), now()); SELECT * INTO retval FROM file_base where id = currval('file_base_id_seq'); RETURN retval; END IF; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION file__attach_to_tx (in_content bytea, in_mime_type_id int, in_file_name text, in_description text, in_id int, in_ref_key int, in_file_class int) IS $$ Attaches or links a file to a transaction. in_content OR id can be set. Setting both raises an exception.$$; CREATE OR REPLACE FUNCTION file__attach_to_part (in_content bytea, in_mime_type_id int, in_file_name text, in_description text, in_id int, in_ref_key int, in_file_class int) RETURNS file_base AS $$ DECLARE retval file_base; BEGIN IF in_id IS NOT NULL THEN IF in_content THEN RAISE EXCEPTION $e$Can't specify id and content in attachment$e$;--' END IF; RAISE EXCEPTION 'links not implemented'; RETURN retval; ELSE INSERT INTO file_part (content, mime_type_id, file_name, description, ref_key, file_class, uploaded_by, uploaded_at) VALUES (in_content, in_mime_type_id, in_file_name, in_description, in_ref_key, in_file_class, person__get_my_entity_id(), now()); SELECT * INTO retval FROM file_base where id = currval('file_base_id_seq'); RETURN retval; END IF; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION file__attach_to_part (in_content bytea, in_mime_type_id int, in_file_name text, in_description text, in_id int, in_ref_key int, in_file_class int) IS $$ Attaches or links a file to a good or service. in_content OR id can be set. Setting both raises an exception. Note that currently links (setting id) is NOT supported because we dont have a use case of linking files to parts$$; CREATE OR REPLACE FUNCTION file__attach_to_order (in_content bytea, in_mime_type_id int, in_file_name text, in_description text, in_id int, in_ref_key int, in_file_class int) RETURNS file_base AS $$ DECLARE retval file_base; BEGIN IF in_id IS NOT NULL THEN IF in_content THEN RAISE EXCEPTION $e$Conflicting options file_id and content$e$; END IF; IF in_file_class = 1 THEN INSERT INTO file_tx_to_order (file_id, source_class, ref_key, dest_class, attached_by, attached_at) VALUES (in_id, 1, in_ref_key, 2, person__get_my_entity_id(), now()); ELSIF in_file_class = 2 THEN INSERT INTO file_order_to_order (file_id, source_class, ref_key, dest_class, attached_by, attached_at) VALUES (in_id, 2, in_ref_key, 2, person__get_my_entity_id(), now()); ELSE RAISE EXCEPTION $E$Invalid file class$E$; END IF; SELECT * INTO retval FROM file_base where id = in_id; RETURN retval; ELSE INSERT INTO file_order (content, mime_type_id, file_name, description, ref_key, file_class, uploaded_by, uploaded_at) VALUES (in_content, in_mime_type_id, in_file_name, in_description, in_ref_key, in_file_class, person__get_my_entity_id(), now()); SELECT * INTO retval FROM file_base where id = currval('file_base_id_seq'); RETURN retval; END IF; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION file__attach_to_order (in_content bytea, in_mime_type_id int, in_file_name text, in_description text, in_id int, in_ref_key int, in_file_class int) IS $$ Attaches or links a file to an order. in_content OR id can be set. Setting both raises an exception.$$; DROP TYPE IF EXISTS file_list_item CASCADE; CREATE TYPE file_list_item AS ( mime_type text, file_name text, description text, uploaded_by_id int, uploaded_by_name text, uploaded_at timestamp, id int, ref_key int, file_class int, content bytea ); CREATE OR REPLACE FUNCTION file__get_for_template (in_ref_key int, in_file_class int) RETURNS SETOF file_list_item AS $$ SELECT m.mime_type, CASE WHEN f.file_class = 3 THEN ref_key ||'-'|| f.file_name ELSE f.file_name END, f.description, f.uploaded_by, e.name, f.uploaded_at, f.id, f.ref_key, f.file_class, f.content FROM mime_type m JOIN file_base f ON f.mime_type_id = m.id JOIN entity e ON f.uploaded_by = e.id WHERE f.ref_key = $1 and f.file_class = $2 AND m.invoice_include OR f.id IN (SELECT max(fb.id) FROM file_base fb JOIN mime_type m ON fb.mime_type_id = m.id AND m.mime_type ilike 'image%' JOIN invoice i ON i.trans_id = $1 AND i.parts_id = fb.ref_key WHERE fb.file_class = 3) $$ language sql; CREATE OR REPLACE FUNCTION file__list_by(in_ref_key int, in_file_class int) RETURNS SETOF file_list_item AS $$ SELECT m.mime_type, f.file_name, f.description, f.uploaded_by, e.name, f.uploaded_at, f.id, f.ref_key, f.file_class, case when m.mime_type = 'text/x-uri' THEN f.content ELSE NULL END FROM mime_type m JOIN file_base f ON f.mime_type_id = m.id JOIN entity e ON f.uploaded_by = e.id WHERE f.ref_key = $1 and f.file_class = $2; $$ language sql; COMMENT ON FUNCTION file__list_by(in_ref_key int, in_file_class int) IS $$ Returns a list of files attached to a database object. No content is retrieved.$$; CREATE OR REPLACE FUNCTION file__get(in_id int, in_file_class int) RETURNS file_base AS $$ SELECT * FROM file_base where id = $1 and file_class = $2; $$ language sql; COMMENT ON FUNCTION file__get(in_id int, in_file_class int) IS $$ Retrieves the file information specified including content.$$; DROP VIEW IF EXISTS file_order_links CASCADE; DROP VIEW IF EXISTS file_tx_links CASCADE; DROP VIEW IF EXISTS file_links CASCADE; DELETE FROM file_view_catalog WHERE file_class in (1, 2); CREATE OR REPLACE view file_tx_links AS SELECT file_id, ref_key, gl.reference, gl.type, dest_class, source_class, sl.ref_key as dest_ref FROM file_secondary_attachment sl JOIN (select id, reference, 'gl' as type FROM gl UNION SELECT id, invnumber, case when invoice then 'is' else 'ar' end as type FROM ar UNION SELECT id, invnumber, case when invoice then 'ir' else 'ap' end as type FROM ap) gl ON sl.ref_key = gl.id and sl.source_class = 1; -- view of links FROM transactions INSERT INTO file_view_catalog (file_class, view_name) VALUES (1, 'file_tx_links'); CREATE OR REPLACE view file_order_links AS SELECT file_id, ref_key, oe.ordnumber as reference, oc.oe_class, dest_class, source_class, sl.ref_key as dest_ref FROM file_secondary_attachment sl JOIN oe ON sl.ref_key = oe.id JOIN oe_class oc ON oe.oe_class_id = oc.id WHERE sl.source_class = 2; -- view of links FROM orders INSERT INTO file_view_catalog (file_class, view_name) VALUES (2, 'file_order_links'); CREATE OR REPLACE FUNCTION file_links_vrebuild() RETURNS bool AS $$ DECLARE viewline file_view_catalog%rowtype; stmt text; BEGIN stmt := ''; FOR viewline IN select * from file_view_catalog LOOP IF stmt = '' THEN stmt := 'SELECT * FROM ' || quote_ident(viewline.view_name) || ' '; ELSE stmt := stmt || ' UNION SELECT * FROM '|| quote_ident(viewline.view_name) || ' '; END IF; END LOOP; EXECUTE 'CREATE OR REPLACE VIEW file_links AS ' || stmt; RETURN TRUE; END; $$ LANGUAGE PLPGSQL; select * from file_links_vrebuild(); CREATE OR REPLACE FUNCTION file__list_links(in_ref_key int, in_file_class int) RETURNS setof file_links AS $$ select * from file_links where ref_key = $1 and dest_class = $2; $$ language sql; COMMENT ON FUNCTION file__list_links(in_ref_key int, in_file_class int) IS $$ This function retrieves a list of file attachments on a specified object.$$; COMMIT; ledgersmb/sql/modules/Assets.sql0000644000000000000000000013405411734571616015774 0ustar rootrootBEGIN; CREATE OR REPLACE FUNCTION asset_dep__straight_line_base (in_base_life numeric, in_life numeric, in_used numeric, in_basis numeric, in_dep_to_date numeric) returns numeric as $$ SELECT CASE WHEN $3/$1 * $4 < $4 - $5 THEN $3/$1 * $4 ELSE $4 - $5 END; $$ language sql; COMMENT ON FUNCTION asset_dep__straight_line_base (in_base_life numeric, in_life numeric, in_used numeric, in_basis numeric, in_dep_to_date numeric) IS $$ This function is a basic function which does the actual calculation for straight line depreciation.$$; CREATE OR REPLACE FUNCTION asset_dep__used_months (in_last_dep date, in_dep_date date, in_usable_life numeric) RETURNS numeric AS $$ select CASE WHEN extract('MONTHS' FROM (date_trunc('day', $2) - date_trunc('day', $1))) > $3 THEN $3 ELSE extract('MONTHS' FROM (date_trunc('day', $2) - date_trunc('day', $1)))::numeric END; $$ language sql; COMMENT ON FUNCTION asset_dep__used_months (in_last_dep date, in_dep_date date, in_usable_life numeric) IS $$ This checks the interval between the two dates, and if longer than the usable life, returns the months in that interval. Otherwise returns the usable life.$$; CREATE OR REPLACE FUNCTION asset_dep_get_usable_life_yr (in_usable_life numeric, in_start_date date, in_dep_date date) returns numeric as $$ SELECT CASE WHEN $3 IS NULL or get_fractional_year($2, $3) > $1 then $1 WHEN get_fractional_year($2, $3) < 0 THEN 0 ELSE get_fractional_year($2, $3) END; $$ language sql; COMMENT ON FUNCTION asset_dep_get_usable_life_yr (in_usable_life numeric, in_start_date date, in_dep_date date) IS $$If the interval is less than 0 then 0. If the interval is greater than the usable life, then the usable life. Otherwise, return the interval as a fractional year.$$; CREATE OR REPLACE FUNCTION months_passed (in_start timestamp, in_end timestamp) returns int as $$ -- The addition of one day is so that it will return '1' when run on the end -- day of consecutive months. select (extract (months from age($2 + '1 day', $1 + '1 day')) + extract (years from age($2, $1)) * 12)::int; $$ language sql; COMMENT ON FUNCTION months_passed (in_start timestamp, in_end timestamp) IS $$ Returns the number of months between in_start and in_end.$$; CREATE OR REPLACE FUNCTION asset_dep_straight_line_yr_d (in_asset_ids int[], in_report_date date, in_report_id int) RETURNS bool AS $$ INSERT INTO asset_report_line (asset_id, report_id, amount, department_id, warehouse_id) SELECT ai.id, $3, asset_dep__straight_line_base( ai.usable_life, -- years ai.usable_life - get_fractional_year(coalesce(max(report_date), start_depreciation, purchase_date), coalesce(start_depreciation, purchase_date)), get_fractional_year(coalesce(max(report_date), start_depreciation, purchase_date), $2), purchase_value - salvage_value, coalesce(sum(l.amount), 0)), ai.department_id, ai.location_id FROM asset_item ai LEFT JOIN asset_report_line l ON (l.asset_id = ai.id) LEFT JOIN asset_report r ON (l.report_id = r.id) WHERE ai.id = ANY($1) GROUP BY ai.id, ai.start_depreciation, ai.purchase_date, ai.purchase_value, ai.salvage_value, ai.department_id, ai.location_id, ai.usable_life; UPDATE asset_report SET report_class = 1 WHERE id = $3; select true; $$ language sql; CREATE OR REPLACE FUNCTION asset_dep_straight_line_yr_m (in_asset_ids int[], in_report_date date, in_report_id int) RETURNS bool AS $$ INSERT INTO asset_report_line (asset_id, report_id, amount, department_id, warehouse_id) SELECT ai.id, $3, asset_dep__straight_line_base( ai.usable_life * 12, ai.usable_life * 12 --months - months_passed(coalesce(start_depreciation, purchase_date), coalesce(max(report_date), start_depreciation, purchase_date)), months_passed(coalesce(max(report_date), start_depreciation, purchase_date), $2), purchase_value - salvage_value, coalesce(sum(l.amount), 0)), ai.department_id, ai.location_id FROM asset_item ai LEFT JOIN asset_report_line l ON (l.asset_id = ai.id) LEFT JOIN asset_report r ON (l.report_id = r.id) WHERE ai.id = ANY($1) GROUP BY ai.id, ai.start_depreciation, ai.purchase_date, ai.purchase_value, ai.salvage_value, ai.department_id, ai.location_id, ai.usable_life; UPDATE asset_report SET report_class = 1 WHERE id = $3; select true; $$ language sql; COMMENT ON FUNCTION asset_dep_straight_line_yr_m (in_asset_ids int[], in_report_date date, in_report_id int) is $$ Performs straight line depreciation on a set of selected assets, selecting the depreciation values into a report. Assumes the usable life is measured in years, and is depreciated eavenly every month.$$; CREATE OR REPLACE FUNCTION asset_dep_straight_line_month (in_asset_ids int[], in_report_date date, in_report_id int) RETURNS bool AS $$ INSERT INTO asset_report_line (asset_id, report_id, amount, department_id, warehouse_id) SELECT ai.id, $3, asset_dep__straight_line_base( ai.usable_life, ai.usable_life --months - months_passed(coalesce(start_depreciation, purchase_date), coalesce(max(report_date), start_depreciation, purchase_date)), months_passed(coalesce(max(report_date), start_depreciation, purchase_date), $2), purchase_value - salvage_value, coalesce(sum(l.amount), 0)), ai.department_id, ai.location_id FROM asset_item ai LEFT JOIN asset_report_line l ON (l.asset_id = ai.id) LEFT JOIN asset_report r ON (l.report_id = r.id) WHERE ai.id = ANY($1) GROUP BY ai.id, ai.start_depreciation, ai.purchase_date, ai.purchase_value, ai.salvage_value, ai.department_id, ai.location_id, ai.usable_life; UPDATE asset_report SET report_class = 1 WHERE id = $3; select true; $$ language sql; COMMENT ON FUNCTION asset_dep_straight_line_month (in_asset_ids int[], in_report_date date, in_report_id int) IS $$ Performs straight line depreciation, selecting depreciation amounts, etc. into a report for further review and approval. Usable life is in months, and depreciation is an equal amount every month.$$; CREATE OR REPLACE FUNCTION asset_report__generate_gl(in_report_id int, in_accum_account_id int) RETURNS INT AS $$ DECLARE t_report_dept record; t_dep_amount numeric; Begin INSERT INTO gl (reference, description, transdate, approved) SELECT setting_increment('glnumber'), 'Asset Report ' || asset_report.id, report_date, false FROM asset_report JOIN asset_report_line ON (asset_report.id = asset_report_line.report_id) JOIN asset_item ON (asset_report_line.asset_id = asset_item.id) WHERE asset_report.id = in_report_id GROUP BY asset_report.id, asset_report.report_date; INSERT INTO acc_trans (trans_id, chart_id, transdate, approved, amount) SELECT gl.id, a.exp_account_id, r.report_date, true, sum(amount) * -1 FROM asset_report r JOIN asset_report_line l ON (r.id = l.report_id) JOIN asset_item a ON (l.asset_id = a.id) JOIN gl ON (gl.description = 'Asset Report ' || l.report_id) WHERE r.id = in_report_id GROUP BY gl.id, r.report_date, a.exp_account_id; INSERT INTO acc_trans (trans_id, chart_id, transdate, approved, amount) SELECT gl.id, a.dep_account_id, r.report_date, true, sum(amount) FROM asset_report r JOIN asset_report_line l ON (r.id = l.report_id) JOIN asset_item a ON (l.asset_id = a.id) JOIN gl ON (gl.description = 'Asset Report ' || l.report_id) WHERE r.id = in_report_id GROUP BY gl.id, a.dep_account_id, r.report_date, a.tag, a.description; RETURN in_report_id; END; $$ language plpgsql; COMMENT ON FUNCTION asset_report__generate_gl (in_report_id int, in_accum_account_id int) IS $$ Generates a GL transaction when the Asset report is approved. Currently this creates GL drafts, not approved transctions $$; CREATE OR REPLACE FUNCTION asset_class__get (in_id int) RETURNS asset_class AS $$ DECLARE ret_val asset_class; BEGIN SELECT * INTO ret_val FROM asset_class WHERE id = in_id; RETURN ret_val; END; $$ language plpgsql; COMMENT ON FUNCTION asset_class__get (in_id int) IS $$ returns the row from asset_class identified by in_id.$$; CREATE OR REPLACE FUNCTION asset_class__list() RETURNS SETOF asset_class AS $$ SELECT * FROM asset_class ORDER BY label; $$ LANGUAGE SQL; COMMENT ON FUNCTION asset_class__list() is $$ Returns an alphabetical list of asset classes.$$; DROP TYPE IF EXISTS asset_class_result CASCADE; CREATE TYPE asset_class_result AS ( id int, asset_account_id int, asset_accno text, asset_description text, dep_account_id int, dep_accno text, dep_description text, method text, method_id int, label text ); CREATE OR REPLACE FUNCTION asset_class__search (in_asset_account_id int, in_dep_account_id int, in_method int, in_label text) RETURNS SETOF asset_class_result AS $$ DECLARE out_var asset_class_result; BEGIN FOR out_var IN SELECT ac.id, ac.asset_account_id, aa.accno, aa.description, ad.accno, ad.description, m.method, ac.method, ac.label FROM asset_class ac JOIN account aa ON (aa.id = ac.asset_account_id) JOIN account ad ON (ad.id = ac.dep_account_id) JOIN asset_dep_method m ON (ac.method = m.id) WHERE (in_asset_account_id is null or in_asset_account_id = ac.asset_account_id) AND (in_dep_account_id is null OR in_dep_account_id = ac.dep_account_id) AND (in_method is null OR in_method = ac.method) AND (in_label IS NULL OR ac.label LIKE '%' || in_label || '%') ORDER BY label LOOP RETURN NEXT out_var; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION asset_class__search (in_asset_account_id int, in_dep_account_id int, in_method int, in_label text) IS $$ Returns a list of matching asset classes. The account id's are exact matches as is the method, but the label is a partial match. NULL's match all.$$; CREATE OR REPLACE FUNCTION asset_class__get_dep_methods() RETURNS SETOF asset_dep_method as $$ SELECT * FROM asset_dep_method ORDER BY method; $$ LANGUAGE sql; COMMENT ON FUNCTION asset_class__get_dep_methods() IS $$ Returns a set of asset_dep_methods ordered by the method label.$$; CREATE OR REPLACE FUNCTION asset_class__save (in_id int, in_asset_account_id int, in_dep_account_id int, in_method int, in_label text, in_unit_label text) RETURNS asset_class AS $$ DECLARE ret_val asset_class; BEGIN UPDATE asset_class SET asset_account_id = in_asset_account_id, dep_account_id = in_dep_account_id, method = in_method, label = in_label WHERE id = in_id; IF FOUND THEN SELECT * INTO ret_val FROM asset_class where id = in_id; RETURN ret_val; END IF; INSERT INTO asset_class (asset_account_id, dep_account_id, method, label) VALUES (in_asset_account_id, in_dep_account_id, in_method, in_label); SELECT * INTO ret_val FROM asset_class WHERE id = currval('asset_class_id_seq'); RETURN ret_val; END; $$ language plpgsql; COMMENT ON FUNCTION asset_class__save (in_id int, in_asset_account_id int, in_dep_account_id int, in_method int, in_label text, in_unit_label text) IS $$ Saves this data as an asset_class record. If in_id is NULL or is not found in the table, inserts a new row. Returns the row saved.$$; CREATE OR REPLACE FUNCTION asset__get (in_id int, in_tag text) RETURNS asset_item AS $$ DECLARE ret_val asset_item; BEGIN SELECT * into ret_val from asset_item WHERE id = in_id OR in_tag = tag ORDER BY id desc limit 1; return ret_val; END; $$ language plpgsql; COMMENT ON FUNCTION asset__get (in_id int, in_tag text) IS $$ Retrieves a given asset either by id or tag. Both are complete matches. Note that the behavior is undefined if both id and tag are provided.$$; CREATE OR REPLACE FUNCTION asset__search (in_asset_class int, in_description text, in_tag text, in_purchase_date date, in_purchase_value numeric, in_usable_life numeric, in_salvage_value numeric) RETURNS SETOF asset_item AS $$ DECLARE out_val asset_item; BEGIN FOR out_val IN SELECT * FROM asset_item WHERE (in_asset_class is null or asset_class_id = in_asset_class) AND (in_description is null or description LIKE '%' || in_description || '%') and (in_tag is not null or tag like '%'||in_tag||'%') AND (in_purchase_date is null or purchase_date = in_purchase_date) AND (in_purchase_value is null or in_purchase_value = purchase_value) AND (in_usable_life is null or in_usable_life = usable_life) AND (in_salvage_value is null OR in_salvage_value = salvage_value) LOOP RETURN NEXT out_val; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION asset__search (in_asset_class int, in_description text, in_tag text, in_purchase_date date, in_purchase_value numeric, in_usable_life numeric, in_salvage_value numeric) IS $$Searches for assets. Nulls match all records. Asset class is exact, as is purchase date, purchase value, and salvage value. Tag and description are partial matches.$$; CREATE OR REPLACE FUNCTION asset_class__get_asset_accounts() RETURNS SETOF account AS $$ SELECT * FROM account WHERE id IN (select account_id from account_link where description = 'Fixed_Asset') ORDER BY accno; $$ LANGUAGE SQL; COMMENT ON FUNCTION asset_class__get_asset_accounts() IS $$ Returns a list of fixed asset accounts, ordered by account number$$; CREATE OR REPLACE FUNCTION asset_class__get_dep_accounts() RETURNS SETOF account AS $$ SELECT * FROM account WHERE id IN (select account_id from account_link where description = 'Asset_Dep') ORDER BY accno; $$ LANGUAGE SQL; COMMENT ON FUNCTION asset_class__get_dep_accounts() IS $$ Returns a list of asset depreciation accounts, ordered by account number$$; CREATE OR REPLACE FUNCTION asset__save (in_id int, in_asset_class int, in_description text, in_tag text, in_purchase_date date, in_purchase_value numeric, in_usable_life numeric, in_salvage_value numeric, in_start_depreciation date, in_warehouse_id int, in_department_id int, in_invoice_id int, in_asset_account_id int, in_dep_account_id int, in_exp_account_id int) returns asset_item AS $$ DECLARE ret_val asset_item; BEGIN UPDATE asset_item SET asset_class_id = in_asset_class, description = in_description, tag = in_tag, purchase_date = in_purchase_date, purchase_value = in_purchase_value, usable_life = in_usable_life, location_id = in_warehouse_id, department_id = in_department_id, invoice_id = in_invoice_id, salvage_value = in_salvage_value, asset_account_id = in_asset_account_id, exp_account_id = in_exp_account_id, start_depreciation = coalesce(in_start_depreciation, in_purchase_date), dep_account_id = in_dep_account_id WHERE id = in_id; IF FOUND THEN SELECT * INTO ret_val FROM asset_item WHERE id = in_id; return ret_val; END IF; INSERT INTO asset_item (asset_class_id, description, tag, purchase_date, purchase_value, usable_life, salvage_value, department_id, location_id, invoice_id, asset_account_id, dep_account_id, start_depreciation, exp_account_id) VALUES (in_asset_class, in_description, in_tag, in_purchase_date, in_purchase_value, in_usable_life, in_salvage_value, in_department_id, in_warehouse_id, in_invoice_id, in_asset_account_id, in_dep_account_id, coalesce(in_start_depreciation, in_purchase_date), in_exp_account_id); SELECT * INTO ret_val FROM asset_item WHERE id = currval('asset_item_id_seq'); RETURN ret_val; END; $$ language plpgsql; COMMENT ON FUNCTION asset__save (in_id int, in_asset_class int, in_description text, in_tag text, in_purchase_date date, in_purchase_value numeric, in_usable_life numeric, in_salvage_value numeric, in_start_depreciation date, in_warehouse_id int, in_department_id int, in_invoice_id int, in_asset_account_id int, in_dep_account_id int, in_exp_account_id int) IS $$ Saves the asset with the information provided. If the id is provided, overwrites the record with the id. Otherwise, or if that record is not found, inserts. Returns the row inserted or updated. $$; CREATE OR REPLACE FUNCTION asset_item__search (in_id int, in_asset_class int, in_description text, in_tag text, in_purchase_date date, in_purchase_value numeric, in_usable_life numeric, in_salvage_value numeric, in_start_depreciation date, in_warehouse_id int, in_department_id int, in_invoice_id int, in_asset_account_id int, in_dep_account_id int) returns setof asset_item as $$ DECLARE retval asset_item; BEGIN FOR retval IN SELECT * FROM asset_item WHERE (id = in_id or in_id is null) and (asset_class_id = in_asset_class or in_asset_class is null) and (description like '%'||in_description||'%' or in_description is null) and (tag like '%' || in_tag || '%' or in_tag is null) and (purchase_value = in_purchase_value or in_purchase_value is null) and (in_purchase_date = purchase_date or in_purchase_date is null) and (start_depreciation = in_start_depreciation or in_start_depreciation is null) and (in_warehouse_id = location_id OR in_warehouse_id is null) and (department_id = in_department_id or in_department_id is null) and (in_invoice_id = invoice_id OR in_invoice_id IS NULL) and (asset_account_id = in_asset_account_id or in_asset_account_id is null) and (dep_account_id = in_dep_account_id or in_dep_account_id is null) LOOP return next retval; end loop; END; $$ language plpgsql; COMMENT ON FUNCTION asset_item__search (in_id int, in_asset_class int, in_description text, in_tag text, in_purchase_date date, in_purchase_value numeric, in_usable_life numeric, in_salvage_value numeric, in_start_depreciation date, in_warehouse_id int, in_department_id int, in_invoice_id int, in_asset_account_id int, in_dep_account_id int) IS $$ Returns a list of matching asset items. Nulls match all records. Tag and description allow for partial match. All other matches are exact.$$; CREATE OR REPLACE FUNCTION asset_class__get_dep_method (in_asset_class int) RETURNS asset_dep_method AS $$ SELECT * from asset_dep_method WHERE id = (select method from asset_class where id = $1); $$ language sql; COMMENT ON FUNCTION asset_class__get_dep_method (in_asset_class int) IS $$Returns the depreciation method associated with the asset class.$$; CREATE OR REPLACE FUNCTION asset_report__save (in_id int, in_report_date date, in_report_class int, in_asset_class int, in_submit bool) RETURNS asset_report AS $$ DECLARE ret_val asset_report; item record; method_text text; BEGIN UPDATE asset_report set asset_class = in_asset_class, report_class = in_report_class, report_date = in_report_date, submitted = (in_submit or submitted) WHERE id = in_id; IF FOUND THEN SELECT * INTO ret_val FROM asset_report WHERE id = in_id; ELSE INSERT INTO asset_report(report_class, asset_class, report_date, submitted) values (in_report_class, in_asset_class, in_report_date, coalesce(in_submit, true)); SELECT * INTO ret_val FROM asset_report WHERE id = currval('asset_report_id_seq'); END IF; RETURN ret_val; END; $$ language plpgsql; COMMENT ON FUNCTION asset_report__save (in_id int, in_report_date date, in_report_class int, in_asset_class int, in_submit bool) IS $$ Creates or updates an asset report with the information presented. Note that approval values are not set here, and that one cannot unsubmit a report though this function.$$; CREATE OR REPLACE FUNCTION asset_report__dispose (in_id int, in_asset_id int, in_amount numeric, in_dm int, in_percent_disposed numeric) returns bool AS $$ BEGIN INSERT INTO asset_report_line (report_id, asset_id, amount) values (in_id, in_asset_id, in_amount); INSERT INTO asset_rl_to_disposal_method (report_id, asset_id, disposal_method_id, percent_disposed) VALUES (in_id, in_asset_id, in_dm, in_percent_disposed); RETURN TRUE; END; $$ language PLPGSQL; COMMENT ON FUNCTION asset_report__dispose (in_id int, in_asset_id int, in_amount numeric, in_dm int, in_percent_disposed numeric) IS $$ Disposes of an asset. in_dm is the disposal method id.$$; DROP TYPE IF EXISTS asset_disposal_report_line CASCADE; CREATE TYPE asset_disposal_report_line AS ( id int, tag text, description text, start_dep date, disposed_on date, dm char(1), purchase_value numeric, accum_depreciation numeric, disposal_amt numeric, adj_basis numeric, gain_loss numeric ); CREATE OR REPLACE FUNCTION asset_report__get_disposal (in_id int) returns setof asset_disposal_report_line AS $$ SELECT ai.id, ai.tag, ai.description, ai.start_depreciation, r.report_date, dm.short_label, ai.purchase_value, sum (CASE WHEN pr.report_class in (1,3) THEN prl.amount ELSE 0 END) as accum_dep, l.amount, ai.purchase_value - sum(CASE WHEN pr.report_class in (1,3) THEN prl.amount ELSE 0 END) as adjusted_basis, l.amount - ai.purchase_value + sum(CASE WHEN pr.report_class in (1,3) THEN prl.amount ELSE 0 END) as gain_loss FROM asset_item ai JOIN asset_report_line l ON (l.report_id = $1 AND ai.id = l.asset_id) JOIN asset_report r ON (l.report_id = r.id) LEFT JOIN asset_rl_to_disposal_method adm USING (report_id, asset_id) JOIN asset_disposal_method dm ON (adm.disposal_method_id = dm.id) LEFT JOIN asset_report_line prl ON (prl.report_id <> $1 AND ai.id = prl.asset_id) LEFT JOIN asset_report pr ON (prl.report_id = pr.id) GROUP BY ai.id, ai.tag, ai.description, ai.start_depreciation, r.report_date, ai.purchase_value, l.amount, dm.short_label ORDER BY ai.id, ai.tag; $$ language sql; COMMENT ON FUNCTION asset_report__get_disposal (in_id int) IS $$ Returns a set of lines of disposed assets in a disposal report, specified by the report id.$$; DROP TYPE IF EXISTS asset_nbv_line CASCADE; CREATE TYPE asset_nbv_line AS ( id int, tag text, description text, begin_depreciation date, method text, remaining_life numeric, basis numeric, salvage_value numeric, through_date date, accum_depreciation numeric, net_book_value numeric ); CREATE OR REPLACE FUNCTION asset_nbv_report () returns setof asset_nbv_line AS $$ SELECT ai.id, ai.tag, ai.description, coalesce(ai.start_depreciation, ai.purchase_date), adm.short_name, ai.usable_life - months_passed(coalesce(ai.start_depreciation, ai.purchase_date), coalesce(max(r.report_date), ai.start_depreciation, ai.purchase_date))/ 12, ai.purchase_value - ai.salvage_value, ai.salvage_value, max(r.report_date), sum(rl.amount), ai.purchase_value - sum(rl.amount) FROM asset_item ai JOIN asset_class ac ON (ai.asset_class_id = ac.id) JOIN asset_dep_method adm ON (adm.id = ac.method) LEFT JOIN asset_report_line rl ON (ai.id = rl.asset_id) LEFT JOIN asset_report r on (rl.report_id = r.id) WHERE r.id IS NULL OR r.approved_at IS NOT NULL GROUP BY ai.id, ai.tag, ai.description, ai.start_depreciation, ai.purchase_date, adm.short_name, ai.usable_life, ai.purchase_value, salvage_value HAVING (NOT 2 = ANY(as_array(r.report_class))) AND (NOT 4 = ANY(as_array(r.report_class))) OR max(r.report_class) IS NULL ORDER BY ai.id, ai.tag, ai.description; $$ language sql; COMMENT ON FUNCTION asset_nbv_report () IS $$ Returns the current net book value report.$$; DROP TYPE IF EXISTS partial_disposal_line CASCADE; CREATE TYPE partial_disposal_line AS ( id int, tag text, begin_depreciation date, purchase_value numeric, description text, disposal_date date, percent_disposed numeric, disposed_acquired_value numeric, percent_remaining numeric, remaining_aquired_value numeric ); CREATE OR REPLACE FUNCTION asset_report_partial_disposal_details(in_id int) RETURNS SETOF PARTIAL_DISPOSAL_LINE AS $$ SELECT ai.id, ai.tag, ai.start_depreciation, ai.purchase_value, ai.description, ar.report_date, arld.percent_disposed, (arld.percent_disposed / 100) * ai.purchase_value, 100 - arld.percent_disposed, ((100 - arld.percent_disposed)/100) * ai.purchase_value FROM asset_item ai JOIN asset_report_line l ON (ai.id = l.asset_id) JOIN asset_report ar ON (ar.id = l.report_id) JOIN asset_rl_to_disposal_method arld ON ((arld.report_id, arld.asset_id) = (l.report_id, l.asset_id)) WHERE ar.id = $1; $$ LANGUAGE SQL; COMMENT ON FUNCTION asset_report_partial_disposal_details(in_id int) IS $$ Returns the partial disposal details for a partial disposal report.$$; CREATE OR REPLACE FUNCTION asset_report__approve (in_id int, in_expense_acct int, in_gain_acct int, in_loss_acct int) RETURNS asset_report AS $$ DECLARE ret_val asset_report; BEGIN UPDATE asset_report SET approved_at = now(), approved_by = person__get_my_entity_id() where id = in_id; SELECT * INTO ret_val FROM asset_report WHERE id = in_id; if ret_val.dont_approve is not true then if ret_val.report_class = 1 THEN PERFORM asset_report__generate_gl(in_id, in_expense_acct); ELSIF ret_val.report_class = 2 THEN PERFORM asset_report__disposal_gl( in_id, in_gain_acct, in_loss_acct); ELSIF ret_val.report_class = 4 THEN PERFORM asset_disposal__approve(in_id, in_gain_acct, in_loss_acct, (select asset_account_id from asset_class where id = ret_val.asset_class) ); ELSE RAISE EXCEPTION 'Invalid report class'; END IF; end if; SELECT * INTO ret_val FROM asset_report WHERE id = in_id; RETURN ret_val; end; $$ language plpgsql; revoke execute on function asset_report__approve(int, int, int, int) from public; COMMENT ON function asset_report__approve(int, int, int, int) is $$ This function approves an asset report (whether depreciation or disposal). Also generates relevant GL drafts for review and posting.$$; CREATE OR REPLACE FUNCTION asset_report__disposal_gl (in_id int, in_gain_acct int, in_loss_acct int) RETURNS bool AS $$ INSERT INTO gl (reference, description, transdate, approved) SELECT setting_increment('glnumber'), 'Asset Report ' || asset_report.id, report_date, false FROM asset_report JOIN asset_report_line ON (asset_report.id = asset_report_line.report_id) JOIN asset_item ON (asset_report_line.asset_id = asset_item.id) WHERE asset_report.id = $1 GROUP BY asset_report.id, asset_report.report_date; INSERT INTO acc_trans (chart_id, trans_id, amount, approved, transdate) SELECT a.dep_account_id, currval('id')::int, sum(r.accum_depreciation) * -1, TRUE, r.disposed_on FROM asset_report__get_disposal($1) r JOIN asset_item a ON (r.id = a.id) GROUP BY a.dep_account_id, r.disposed_on; -- GAIN is negative since it is a debit INSERT INTO acc_trans (chart_id, trans_id, amount, approved, transdate) SELECT case when sum(r.gain_loss) > 0 THEN $3 else $2 end, currval('id')::int, sum(r.gain_loss), TRUE, r.disposed_on FROM asset_report__get_disposal($1) r JOIN asset_item ai ON (r.id = ai.id) GROUP BY r.disposed_on; INSERT INTO acc_trans (chart_id, trans_id, amount, approved, transdate) SELECT a.asset_account_id, currval('id')::int, sum(r.purchase_value), TRUE, r.disposed_on FROM asset_report__get_disposal($1) r JOIN asset_item a ON (r.id = a.id) GROUP BY a.asset_account_id, r.disposed_on; SELECT TRUE; $$ language sql; COMMENT ON FUNCTION asset_report__disposal_gl (in_id int, in_gain_acct int, in_loss_acct int) IS $$ Generates GL transactions for ful disposal reports.$$; CREATE OR REPLACE FUNCTION asset_item__add_note(in_id int, in_subject text, in_note text) RETURNS asset_note AS $$ INSERT INTO asset_note (ref_key, subject, note) values ($1, $2, $3); SELECT * FROM asset_note WHERE id = currval('note_id_seq'); $$ language sql; COMMENT ON FUNCTION asset_item__add_note(in_id int, in_subject text, in_note text) IS $$ Adds a note to an asset item$$; CREATE OR REPLACE FUNCTION asset_report__get_expense_accts() RETURNS SETOF account AS $$ SELECT * FROM account__get_by_link_desc('asset_expense'); $$ language sql; COMMENT ON FUNCTION asset_report__get_expense_accts() IS $$ Lists all asset expense reports.$$; CREATE OR REPLACE FUNCTION asset_report__get_gain_accts() RETURNS SETOF account AS $$ SELECT * FROM account__get_by_link_desc('asset_gain'); $$ language sql; COMMENT ON FUNCTION asset_report__get_gain_accts() IS $$ Returns a list of gain accounts for asset depreciation and disposal reports. $$; CREATE OR REPLACE FUNCTION asset_report__get_loss_accts() RETURNS SETOF account AS $$ SELECT * FROM account__get_by_link_desc('asset_loss'); $$ language sql; COMMENT ON FUNCTION asset_report__get_loss_accts() IS $$ Returns a list of loss accounts for asset depreciation and disposal reports. $$; CREATE OR REPLACE FUNCTION asset_report__get(in_id int) RETURNS asset_report AS $$ select * from asset_report where id = $1; $$ language sql; COMMENT ON FUNCTION asset_report__get(in_id int) IS $$ Returns the asset_report line identified by id.$$; DROP TYPE IF EXISTS asset_report_line_result CASCADE; CREATE TYPE asset_report_line_result AS( tag text, start_depreciation date, purchase_value numeric, method_short_name text, usable_life numeric, basis numeric, prior_through date, prior_dep numeric, dep_this_time numeric, dep_ytd numeric, dep_total numeric, description text, purchase_date date ); CREATE OR REPLACE FUNCTION asset_report__get_lines(in_id int) RETURNS SETOF asset_report_line_result as $$ select ai.tag, coalesce(ai.start_depreciation, ai.purchase_date), ai.purchase_value, m.short_name, ai.usable_life, ai.purchase_value - ai.salvage_value, max(pr.report_date), sum(case when pr.report_date < r.report_date then prl.amount else 0 end), rl.amount, sum (case when extract(year from pr.report_date) = extract(year from r.report_date) AND pr.report_date < r.report_date then prl.amount else 0 end), sum(prl.amount), ai.description, ai.purchase_date FROM asset_item ai JOIN asset_class c ON (ai.asset_class_id = c.id) JOIN asset_dep_method m ON (c.method = m.id) JOIN asset_report_line rl ON (rl.asset_id = ai.id) JOIN asset_report r ON (rl.report_id = r.id) LEFT JOIN asset_report_line prl ON (prl.asset_id = ai.id) LEFT JOIN asset_report pr ON (prl.report_id = pr.id) WHERE rl.report_id = $1 GROUP BY ai.tag, ai.start_depreciation, ai.purchase_value, m.short_name, ai.usable_life, ai.salvage_value, r.report_date, rl.amount, ai.description, ai.purchase_date; $$ language sql; COMMENT ON FUNCTION asset_report__get_lines(in_id int) IS $$ Returns the lines of an asset depreciation report.$$; DROP TYPE IF EXISTS asset_report_result CASCADE; CREATE TYPE asset_report_result AS ( id int, report_date date, gl_id bigint, asset_class bigint, report_class int, entered_by bigint, approved_by bigint, entered_at timestamp, approved_at timestamp, depreciated_qty numeric, dont_approve bool, submitted bool, total numeric ); CREATE OR REPLACE FUNCTION asset_report__search (in_start_date date, in_end_date date, in_asset_class int, in_approved bool, in_entered_by int) returns setof asset_report_result AS $$ SELECT r.id, r.report_date, r.gl_id, r.asset_class, r.report_class, r.entered_by, r.approved_by, r.entered_at, r.approved_at, r.depreciated_qty, r.dont_approve, r.submitted, sum(l.amount) FROM asset_report r JOIN asset_report_line l ON (l.report_id = r.id) where ($1 is null or $1 <= report_date) and ($2 is null or $2 >= report_date) and ($3 is null or $3 = asset_class) and ($4 is null or ($4 is true and approved_by is not null) or ($4 is false and approved_by is null)) and ($5 is null or $5 = entered_by) GROUP BY r.id, r.report_date, r.gl_id, r.asset_class, r.report_class, r.entered_by, r.approved_by, r.entered_at, r.approved_at, r.depreciated_qty, r.dont_approve, r.submitted; $$ language sql; COMMENT ON FUNCTION asset_report__search (in_start_date date, in_end_date date, in_asset_class int, in_approved bool, in_entered_by int) IS $$ Searches for asset reports. Nulls match all rows. Approved, asset class, and entered_by are exact matches. Start_date and end_date define the beginning and end of the search date. $$; CREATE OR REPLACE FUNCTION asset_report__generate (in_depreciation bool, in_asset_class int, in_report_date date) RETURNS SETOF asset_item AS $$ SELECT ai.* FROM asset_item ai JOIN asset_class ac ON (ai.asset_class_id = ac.id) LEFT JOIN asset_report_line arl ON (arl.asset_id = ai.id) LEFT JOIN asset_report ar ON (arl.report_id = ar.id) WHERE COALESCE(ai.start_depreciation, ai.purchase_date) <= $3 AND ac.id = $2 AND obsolete_by IS NULL GROUP BY ai.id, ai.tag, ai.description, ai.purchase_value, ai.usable_life, ai.purchase_date, ai.location_id, ai.invoice_id, ai.asset_account_id, ai.dep_account_id, ai.asset_class_id, ai.start_depreciation, ai.salvage_value, ai.department_id, ai.exp_account_id, ai.obsolete_by HAVING (count(ar.report_class) = 0 OR (2 <> ALL(as_array(ar.report_class)) and 4 <> ALL(as_array(ar.report_class)))) AND ((ai.purchase_value - coalesce(sum(arl.amount), 0) > ai.salvage_value) and ai.obsolete_by is null) OR $1 is not true; $$ language sql; COMMENT ON FUNCTION asset_report__generate (in_depreciation bool, in_asset_class int, in_report_date date) IS $$ Generates lines to select/deselect for the asset report (depreciation or disposal).$$; CREATE OR REPLACE FUNCTION asset_report__begin_import (in_asset_class int, in_report_date date) returns asset_report as $$ INSERT INTO asset_report (asset_class, report_date, entered_at, entered_by, report_class, dont_approve) VALUES ($1, $2, now(), person__get_my_entity_id(), 3, true); SELECT * FROM asset_report where id = currval('asset_report_id_seq'); $$ language sql; COMMENT ON FUNCTION asset_report__begin_import (in_asset_class int, in_report_date date) IS $$Creates the outline of an asset import report$$; CREATE OR REPLACE FUNCTION asset_report__import( in_description text, in_tag text, in_purchase_value numeric, in_salvage_value numeric, in_usable_life numeric, in_purchase_date date, in_start_depreciation date, in_location_id int, in_department_id int, in_asset_account_id int, in_dep_account_id int, in_exp_account_id int, in_asset_class_id int, in_invoice_id int, in_dep_report_id int, in_accum_dep numeric, in_obsolete_other bool ) RETURNS bool AS $$ SET CONSTRAINTS asset_item_obsolete_by_fkey DEFERRED; -- This fails a deferrable fkey constraint but avoids a partial unique index -- so in this case, the foreign key is deferred for the duration of this -- specific stored proc call. UPDATE asset_item SET obsolete_by = -1 WHERE tag = $2 and $17 is true; INSERT INTO asset_report_line (report_id, asset_id, amount, department_id, warehouse_id) select $15, id, $16, department_id, location_id from asset__save (NULL, $13, $1, $2, $6, $3, $5, coalesce($4, 0), $7, $8, $9, $14, $10, $11, $12); UPDATE asset_item SET obsolete_by = currval('asset_item_id_seq') WHERE obsolete_by = -1; -- enforce fkeys now and raise exception if fail SET CONSTRAINTS asset_item_obsolete_by_fkey IMMEDIATE; SELECT true; $$ language sql; COMMENT ON FUNCTION asset_report__import( in_description text, in_tag text, in_purchase_value numeric, in_salvage_value numeric, in_usable_life numeric, in_purchase_date date, in_start_depreciation date, in_location_id int, in_department_id int, in_asset_account_id int, in_dep_account_id int, in_exp_account_id int, in_asset_class_id int, in_invoice_id int, in_dep_report_id int, in_accum_dep numeric, in_obsolete_other bool ) IS $$ Imports an asset with the supplied information. If in_obsolete_other is false, this creates a new depreciable asset. If it is true, it sets up the other asset as obsolete. This is the way partial disposal reports are handled. $$; CREATE OR REPLACE FUNCTION asset_report__begin_disposal (in_asset_class int, in_report_date date, in_report_class int) returns asset_report as $$ DECLARE retval asset_report; begin INSERT INTO asset_report (asset_class, report_date, entered_at, entered_by, report_class) VALUES (in_asset_class, in_report_date, now(), person__get_my_entity_id(), in_report_class); SELECT * INTO retval FROM asset_report where id = currval('asset_report_id_seq'); return retval; end; $$ language plpgsql; COMMENT ON FUNCTION asset_report__begin_disposal (in_asset_class int, in_report_date date, in_report_class int) IS $$ Creates the asset report recofd for the asset disposal report.$$; create or replace function asset_report__record_approve(in_id int) returns asset_report as $$ UPDATE asset_report set approved_by = person__get_my_entity_id(), approved_at = now() where id = $1; select * from asset_report where id = $1; $$ language sql; COMMENT ON FUNCTION asset_report__record_approve(in_id int) IS $$Marks the asset_report record approved. Not generally recommended to call directly.$$; create or replace function asset_depreciation__approve(in_report_id int, in_expense_acct int) returns asset_report as $$ declare retval asset_report; begin retval := asset_report__record_approve(in_report_id); INSERT INTO gl (reference, description, approved) select 'Asset Report ' || in_id, 'Asset Depreciation Report for ' || report_date, false FROM asset_report where id = in_id; INSERT INTO acc_trans (amount, chart_id, transdate, approved, trans_id) SELECT l.amount, a.dep_account_id, r.report_date, true, currval('id') FROM asset_report r JOIN asset_report_line l ON (r.id = l.report_id) JOIN asset_item a ON (a.id = l.asset_id) WHERE r.id = in_id; INSERT INTO acc_trans (amount, chart_id, transdate, approved, trans_id) SELECT sum(l.amount) * -1, in_expense_acct, r.report_date, approved, currval('id') FROM asset_report r JOIN asset_report_line l ON (r.id = l.report_id) JOIN asset_item a ON (a.id = l.asset_id) WHERE r.id = in_id GROUP BY r.report_date; return retval; end; $$ language plpgsql; COMMENT ON function asset_depreciation__approve (in_report_id int, in_expense_acct int) IS $$Approves an asset depreciation report and creats the GL draft.$$; CREATE OR REPLACE FUNCTION asset_report__get_disposal_methods() RETURNS SETOF asset_disposal_method as $$ SELECT * FROM asset_disposal_method order by label; $$ language sql; COMMENT ON FUNCTION asset_report__get_disposal_methods() IS $$ Returns a list of asset_disposal_method items ordered by label.$$; CREATE OR REPLACE FUNCTION asset_disposal__approve (in_id int, in_gain_acct int, in_loss_acct int, in_asset_acct int) returns asset_report as $$ DECLARE retval asset_report; iter record; t_disposed_percent numeric; begin -- this code is fairly opaque and needs more documentation that would be -- otherwise optimal. This is mostly due to the fact that we have fairly -- repetitive insert/select routines and the fact that the accounting -- requirements are not immediately intuitive. Inserts marked functionally along -- with typical debit/credit designations. Note debits are always negative. retval := asset_report__record_approve(in_id); if retval.report_class = 2 then t_disposed_percent := 100; end if; INSERT INTO gl (reference, description, approved, transdate) select 'Asset Report ' || in_id, 'Asset Disposal Report for ' || report_date, false, report_date FROM asset_report where id = in_id; -- REMOVING ASSETS FROM ACCOUNT (Credit) insert into acc_trans (trans_id, chart_id, amount, approved, transdate) SELECT currval('id'), a.asset_account_id, a.purchase_value * (coalesce(t_disposed_percent, m.percent_disposed)/100), true, r.report_date FROM asset_item a JOIN asset_report_line l ON (l.asset_id = a.id) JOIN asset_report r ON (r.id = l.report_id) JOIN asset_rl_to_disposal_method m ON (l.report_id = m.report_id and l.asset_id = m.asset_id) WHERE r.id = in_id; -- REMOVING ACCUM DEP. (Debit) INSERT into acc_trans (trans_id, chart_id, amount, approved, transdate) SELECT currval('id'), a.dep_account_id, sum(dl.amount) * -1 * (coalesce(t_disposed_percent, m.percent_disposed)/100), true, r.report_date FROM asset_item a JOIN asset_report_line l ON (l.asset_id = a.id) JOIN asset_report r ON (r.id = l.report_id) JOIN asset_report_line dl ON (l.asset_id = dl.asset_id) JOIN asset_rl_to_disposal_method m ON (l.report_id = m.report_id and l.asset_id = m.asset_id) JOIN asset_report dr ON (dl.report_id = dr.id and dr.report_class = 1 and dr.approved_at is not null) WHERE r.id = in_id group by a.dep_account_id, m.percent_disposed, r.report_date; -- INSERT asset/proceeds (Debit, credit for negative values) INSERT INTO acc_trans (trans_id, chart_id, amount, approved, transdate) SELECT currval('id'), in_asset_acct, coalesce(l.amount, 0) * -1, true, r.report_date FROM asset_item a JOIN asset_report_line l ON (l.asset_id = a.id) JOIN asset_report r ON (r.id = l.report_id) JOIN asset_rl_to_disposal_method m ON (l.report_id = m.report_id and l.asset_id = m.asset_id) WHERE r.id = in_id; -- INSERT GAIN/LOSS (Credit for gain, debit for loss) INSERT INTO acc_trans(trans_id, chart_id, amount, approved, transdate) select currval('id'), CASE WHEN sum(amount) > 0 THEN in_loss_acct else in_gain_acct END, sum(amount) * -1 , true, retval.report_date FROM acc_trans WHERE trans_id = currval('id'); IF retval.report_class = 4 then PERFORM asset__import_from_disposal(retval.id); end if; return retval; end; $$ language plpgsql; COMMENT ON FUNCTION asset_disposal__approve (in_id int, in_gain_acct int, in_loss_acct int, in_asset_acct int) IS $$ This approves the asset_report for disposals, creating relevant GL drafts. If the report is a partial disposal report, imports remaining percentages as new asset items.$$; CREATE OR REPLACE FUNCTION asset__import_from_disposal(in_id int) RETURNS BOOL AS $$ DECLARE t_report asset_report; t_import asset_report; BEGIN SELECT * INTO t_report from asset_report where id = in_id; if t_report.report_class <> 4 THEN RETURN FALSE; END IF; SELECT * INTO t_import FROM asset_report__begin_import (t_report.asset_class::int, t_report.report_date); PERFORM asset_report__import( ai.description, ai.tag, ai.purchase_value * rld.percent_disposed / 100, ai.salvage_value * rld.percent_disposed / 100, ai.usable_life, ai.purchase_date, ai.start_depreciation, ai.location_id, ai.department_id, ai.asset_account_id, ai.dep_account_id, ai.exp_account_id, ai.asset_class_id, ai.invoice_id, t_import.id, r.accum_depreciation * rld.percent_disposed / 100, TRUE) FROM asset_item ai JOIN asset_report__get_disposal(t_report.id) r ON (ai.id = r.id) JOIN asset_report_line rl ON (rl.asset_id = ai.id AND rl.report_id = in_id) join asset_rl_to_disposal_method rld ON (rl.report_id = rld.report_id and ai.id = rld.asset_id) where rld.percent_disposed is null or percent_disposed < 100; RETURN TRUE; END; $$ language plpgsql; COMMENT ON FUNCTION asset__import_from_disposal(in_id int) IS $$ Imports items from partial disposal reports. This function should not be called dirctly by programmers but rather through the other disposal approval api's.$$; --' -- needed to go here because dependent on other functions in other modules. --CT alter table asset_report alter column entered_by set default person__get_my_entity_id(); COMMIT; ledgersmb/sql/modules/README0000644000000000000000000000157111233114714014650 0ustar rootrootThis set of files is just for initial testing and proof of concept purposes. They will be moved out of here into appropriate upgrade scripts as necessary and are intended only for collaborative development purposes. For people trying to get 1.3 up and running manually, the following load order should work. Note that many of these scripts declare types, so if you want to redefine functions, you will need to drop the types and reload the scripts. The load order for the files is documented in sql/modules/LOADORDER Note that the Roles.sql is special and must be preprocessed to get it to work. A command like: sed -e 's//[dbname]/g' Roles.sql > [dbname]_roles.sql would work where [dbname] represents the name of the database you are installing into. Also Roles.sql MUST be run last because portions of it depend on function declarations in the other scripts. ledgersmb/sql/modules/Payment.sql0000644000000000000000000016611011774017356016145 0ustar rootrootBEGIN; CREATE OR REPLACE FUNCTION payment_type__list() RETURNS SETOF payment_type AS $$ DECLARE out_row payment_type%ROWTYPE; BEGIN FOR out_row IN SELECT * FROM payment_type LOOP RETURN NEXT out_row; END LOOP; END; $$ LANGUAGE PLPGSQL; DROP TYPE IF EXISTS payment_vc_info CASCADE; CREATE TYPE payment_vc_info AS ( id int, name text, entity_class int, discount int, meta_number character varying(32) ); CREATE OR REPLACE FUNCTION payment_type__get_label(in_payment_type_id int) RETURNS SETOF payment_type AS $$ DECLARE out_row payment_type%ROWTYPE; BEGIN FOR out_row IN SELECT * FROM payment_type where id=in_payment_type_id LOOP RETURN NEXT out_row; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION payment_type__get_label(in_payment_type_id int) IS $$ Returns all information on a payment type by the id. This should be renamed to account for its behavior in future versions.$$; -- ### To be dropped in 1.4: it's imprecise -- to return a set of entity accounts based on their names, -- if we're going to use them for discount calculations... CREATE OR REPLACE FUNCTION payment_get_entity_accounts (in_account_class int, in_vc_name text, in_vc_idn text) returns SETOF payment_vc_info AS $$ DECLARE out_entity payment_vc_info; BEGIN FOR out_entity IN SELECT ec.id, cp.legal_name || coalesce(':' || ec.description,'') as name, e.entity_class, ec.discount_account_id, ec.meta_number FROM entity_credit_account ec JOIN entity e ON (ec.entity_id = e.id) JOIN company cp ON (cp.entity_id = e.id) WHERE ec.entity_class = in_account_class AND (cp.legal_name ilike coalesce('%'||in_vc_name||'%','%%') OR cp.tax_id = in_vc_idn) LOOP RETURN NEXT out_entity; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION payment_get_entity_accounts (in_account_class int, in_vc_name text, in_vc_idn text) IS $$ Returns a minimal set of information about customer or vendor accounts as needed for discount calculations and the like.$$; CREATE OR REPLACE FUNCTION payment_get_entity_account_payment_info (in_entity_credit_id int) RETURNS payment_vc_info AS $$ SELECT ec.id, cp.legal_name || coalesce(':' || ec.description,'') as name, e.entity_class, ec.discount_account_id, ec.meta_number FROM entity_credit_account ec JOIN entity e ON (ec.entity_id = e.id) JOIN company cp ON (cp.entity_id = e.id) WHERE ec.id = $1; $$ LANGUAGE SQL; COMMENT ON FUNCTION payment_get_entity_account_payment_info (in_entity_credit_id int) IS $$ Returns payment information on the entity credit account as required to for discount calculations and payment processing. $$; -- payment_get_open_accounts and the option to get all accounts need to be -- refactored and redesigned. -- CT CREATE OR REPLACE FUNCTION payment_get_open_accounts(in_account_class int) returns SETOF entity AS $$ DECLARE out_entity entity%ROWTYPE; BEGIN FOR out_entity IN SELECT ec.id, cp.legal_name as name, e.entity_class, e.created FROM entity e JOIN entity_credit_account ec ON (ec.entity_id = e.id) JOIN company cp ON (cp.entity_id = e.id) WHERE ec.entity_class = in_account_class AND CASE WHEN in_account_class = 1 THEN ec.id IN (SELECT entity_credit_account FROM acc_trans JOIN chart ON (acc_trans.chart_id = chart.id) JOIN ap ON (acc_trans.trans_id = ap.id) WHERE link = 'AP' GROUP BY chart_id, trans_id, entity_credit_account HAVING SUM(acc_trans.amount) <> 0) WHEN in_account_class = 2 THEN ec.id IN (SELECT entity_credit_account FROM acc_trans JOIN chart ON (acc_trans.chart_id = chart.id) JOIN ar ON (acc_trans.trans_id = ar.id) WHERE link = 'AR' GROUP BY chart_id, trans_id, entity_credit_account HAVING SUM(acc_trans.amount) <> 0) END LOOP RETURN NEXT out_entity; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION payment_get_open_accounts(int) IS $$ This function takes a single argument (1 for vendor, 2 for customer as always) and returns all entities with open accounts of the appropriate type. $$; CREATE OR REPLACE FUNCTION payment_get_all_accounts(in_account_class int) RETURNS SETOF entity AS $$ DECLARE out_entity entity%ROWTYPE; BEGIN FOR out_entity IN SELECT ec.id, e.name, e.entity_class, e.created FROM entity e JOIN entity_credit_account ec ON (ec.entity_id = e.id) WHERE e.entity_class = in_account_class LOOP RETURN NEXT out_entity; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION payment_get_all_accounts(int) IS $$ This function takes a single argument (1 for vendor, 2 for customer as LOOP RETURN NEXT out_entity; END LOOP; $$; COMMENT ON FUNCTION payment_get_all_accounts(int) IS $$ This function takes a single argument (1 for vendor, 2 for customer as always) and returns all entities with accounts of the appropriate type. $$; DROP TYPE IF EXISTS payment_invoice CASCADE; CREATE TYPE payment_invoice AS ( invoice_id int, invnumber text, invoice bool, invoice_date date, amount numeric, amount_fx numeric, discount numeric, discount_fx numeric, due numeric, due_fx numeric, exchangerate numeric ); CREATE OR REPLACE FUNCTION payment_get_open_invoices (in_account_class int, in_entity_credit_id int, in_curr char(3), in_datefrom date, in_dateto date, in_amountfrom numeric, in_amountto numeric, in_department_id int) RETURNS SETOF payment_invoice AS $$ DECLARE payment_inv payment_invoice; BEGIN FOR payment_inv IN SELECT a.id AS invoice_id, a.invnumber AS invnumber,a.invoice AS invoice, a.transdate AS invoice_date, a.amount AS amount, a.amount/ (CASE WHEN a.curr = (SELECT * from defaults_get_defaultcurrency()) THEN 1 ELSE (CASE WHEN in_account_class = 2 THEN ex.buy ELSE ex.sell END) END) as amount_fx, (CASE WHEN c.discount_terms < extract('days' FROM age(a.transdate)) THEN 0 ELSE (coalesce(ac.due, a.amount)) * coalesce(c.discount, 0) / 100 END) AS discount, (CASE WHEN c.discount_terms < extract('days' FROM age(a.transdate)) THEN 0 ELSE (coalesce(ac.due, a.amount)) * coalesce(c.discount, 0) / 100 END)/ (CASE WHEN a.curr = (SELECT * from defaults_get_defaultcurrency()) THEN 1 ELSE (CASE WHEN in_account_class = 2 THEN ex.buy ELSE ex.sell END) END) as discount_fx, ac.due - (CASE WHEN c.discount_terms < extract('days' FROM age(a.transdate)) THEN 0 ELSE (coalesce(ac.due, a.amount)) * coalesce(c.discount, 0) / 100 END) AS due, (ac.due - (CASE WHEN c.discount_terms < extract('days' FROM age(a.transdate)) THEN 0 ELSE (coalesce(ac.due, a.amount)) * coalesce(c.discount, 0) / 100 END))/ (CASE WHEN a.curr = (SELECT * from defaults_get_defaultcurrency()) THEN 1 ELSE (CASE WHEN in_account_class = 2 THEN ex.buy ELSE ex.sell END) END) AS due_fx, (CASE WHEN a.curr = (SELECT * from defaults_get_defaultcurrency()) THEN 1 ELSE (CASE WHEN in_account_class = 2 THEN ex.buy ELSE ex.sell END) END) AS exchangerate --TODO HV prepare drop entity_id from ap,ar --FROM (SELECT id, invnumber, transdate, amount, entity_id, FROM (SELECT id, invnumber, invoice, transdate, amount, 1 as invoice_class, curr, entity_credit_account, department_id, approved FROM ap UNION --SELECT id, invnumber, transdate, amount, entity_id, SELECT id, invnumber, invoice, transdate, amount, 2 AS invoice_class, curr, entity_credit_account, department_id, approved FROM ar ) a JOIN (SELECT trans_id, chart_id, sum(CASE WHEN in_account_class = 1 THEN amount WHEN in_account_class = 2 THEN amount * -1 END) as due FROM acc_trans GROUP BY trans_id, chart_id) ac ON (ac.trans_id = a.id) JOIN chart ON (chart.id = ac.chart_id) LEFT JOIN exchangerate ex ON ( ex.transdate = a.transdate AND ex.curr = a.curr ) JOIN entity_credit_account c ON (c.id = a.entity_credit_account) -- OR (a.entity_credit_account IS NULL and a.entity_id = c.entity_id)) WHERE ((chart.link = 'AP' AND in_account_class = 1) OR (chart.link = 'AR' AND in_account_class = 2)) AND a.invoice_class = in_account_class AND c.entity_class = in_account_class AND c.id = in_entity_credit_id --### short term: ignore fractional cent differences AND a.curr = in_curr AND (a.transdate >= in_datefrom OR in_datefrom IS NULL) AND (a.transdate <= in_dateto OR in_dateto IS NULL) AND (a.amount >= in_amountfrom OR in_amountfrom IS NULL) AND (a.amount <= in_amountto OR in_amountto IS NULL) AND (a.department_id = in_department_id OR in_department_id IS NULL) AND due <> 0 AND a.approved = true GROUP BY a.invnumber, a.transdate, a.amount, amount_fx, discount, discount_fx, ac.due, a.id, c.discount_terms, ex.buy, ex.sell, a.curr, a.invoice LOOP RETURN NEXT payment_inv; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION payment_get_open_invoices(int, int, char(3), date, date, numeric, numeric, int) IS $$ This function is the base for get_open_invoice and returns all open invoices for the entity_credit_id it has a lot of options to enable filtering and use the same logic for entity_class_id and currency. $$; CREATE OR REPLACE FUNCTION payment_get_open_invoice (in_account_class int, in_entity_credit_id int, in_curr char(3), in_datefrom date, in_dateto date, in_amountfrom numeric, in_amountto numeric, in_department_id int, in_invnumber text) RETURNS SETOF payment_invoice AS $$ DECLARE payment_inv payment_invoice; BEGIN FOR payment_inv IN SELECT * from payment_get_open_invoices(in_account_class, in_entity_credit_id, in_curr, in_datefrom, in_dateto, in_amountfrom, in_amountto, in_department_id) WHERE (invnumber like in_invnumber OR in_invnumber IS NULL) LOOP RETURN NEXT payment_inv; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION payment_get_open_invoice(int, int, char(3), date, date, numeric, numeric, int, text) IS $$ This function is based on payment_get_open_invoices and returns only one invoice if the in_invnumber is set. if no in_invnumber is passed this function behaves the same as payment_get_open_invoices $$; DROP TYPE IF EXISTS payment_contact_invoice CASCADE; CREATE TYPE payment_contact_invoice AS ( contact_id int, econtrol_code text, eca_description text, contact_name text, account_number text, total_due numeric, invoices text[], has_vouchers int ); CREATE OR REPLACE FUNCTION payment_get_all_contact_invoices (in_account_class int, in_business_id int, in_currency char(3), in_date_from date, in_date_to date, in_batch_id int, in_ar_ap_accno text, in_meta_number text) RETURNS SETOF payment_contact_invoice AS $$ DECLARE payment_item payment_contact_invoice; BEGIN FOR payment_item IN SELECT c.id AS contact_id, e.control_code as econtrol_code, c.description as eca_description, e.name AS contact_name, c.meta_number AS account_number, sum( case when u.username IS NULL or u.username = SESSION_USER THEN coalesce(p.due::numeric, 0) - CASE WHEN c.discount_terms > extract('days' FROM age(a.transdate)) THEN 0 ELSE (coalesce(p.due::numeric, 0)) * coalesce(c.discount::numeric, 0) / 100 END ELSE 0::numeric END) AS total_due, compound_array(ARRAY[[ a.id::text, a.invnumber, a.transdate::text, a.amount::text, (a.amount - p.due)::text, (CASE WHEN c.discount_terms < extract('days' FROM age(a.transdate)) THEN 0 ELSE (coalesce(p.due, 0) * coalesce(c.discount, 0) / 100) END)::text, (coalesce(p.due, 0) - (CASE WHEN c.discount_terms < extract('days' FROM age(a.transdate)) THEN 0 ELSE (coalesce(p.due, 0)) * coalesce(c.discount, 0) / 100 END))::text, case when u.username IS NOT NULL and u.username <> SESSION_USER THEN 0::text ELSE 1::text END, COALESCE(u.username, 0::text) ]]), sum(case when a.batch_id = in_batch_id then 1 else 0 END), bool_and(lock_record(a.id, (select max(session_id) FROM "session" where users_id = ( select id from users WHERE username = SESSION_USER)))) FROM entity e JOIN entity_credit_account c ON (e.id = c.entity_id) JOIN (SELECT ap.id, invnumber, transdate, amount, entity_id, curr, 1 as invoice_class, entity_credit_account, on_hold, v.batch_id, approved, paid FROM ap LEFT JOIN (select * from voucher where batch_class = 1) v ON (ap.id = v.trans_id) WHERE in_account_class = 1 AND (v.batch_class = 1 or v.batch_id IS NULL) UNION SELECT ar.id, invnumber, transdate, amount, entity_id, curr, 2 as invoice_class, entity_credit_account, on_hold, v.batch_id, approved, paid FROM ar LEFT JOIN (select * from voucher where batch_class = 2) v ON (ar.id = v.trans_id) WHERE in_account_class = 2 AND (v.batch_class = 2 or v.batch_id IS NULL) ORDER BY transdate ) a ON (a.entity_credit_account = c.id) JOIN transactions t ON (a.id = t.id) JOIN (SELECT acc_trans.trans_id, sum(CASE WHEN in_account_class = 1 THEN amount WHEN in_account_class = 2 THEN amount * -1 END) AS due FROM acc_trans JOIN account coa ON (coa.id = acc_trans.chart_id) JOIN account_link al ON (al.account_id = coa.id) LEFT JOIN voucher v ON (acc_trans.voucher_id = v.id) WHERE ((al.description = 'AP' AND in_account_class = 1) OR (al.description = 'AR' AND in_account_class = 2)) AND (approved IS TRUE or v.batch_class IN (3, 6)) GROUP BY acc_trans.trans_id) p ON (a.id = p.trans_id) LEFT JOIN "session" s ON (s."session_id" = t.locked_by) LEFT JOIN users u ON (u.id = s.users_id) WHERE (a.batch_id = in_batch_id OR (a.invoice_class = in_account_class AND a.approved AND due <> 0 AND NOT a.on_hold AND a.curr = in_currency AND EXISTS (select trans_id FROM acc_trans WHERE trans_id = a.id AND chart_id = (SELECT id from account WHERE accno = in_ar_ap_accno) ))) AND (in_meta_number IS NULL OR in_meta_number = c.meta_number) GROUP BY c.id, e.name, c.meta_number, c.threshold, e.control_code, c.description HAVING (sum(p.due) >= c.threshold OR sum(case when a.batch_id = in_batch_id then 1 else 0 END) > 0) ORDER BY c.meta_number ASC LOOP RETURN NEXT payment_item; END LOOP; END; $$ LANGUAGE plpgsql; COMMENT ON FUNCTION payment_get_all_contact_invoices (in_account_class int, in_business_id int, in_currency char(3), in_date_from date, in_date_to date, in_batch_id int, in_ar_ap_accno text, in_meta_number text) IS $$ This function takes the following arguments (all prefaced with in_ in the db): account_class: 1 for vendor, 2 for customer business_type: integer of business.id. currency: char(3) of currency (for example 'USD') date_from, date_to: These dates are inclusive. batch_id: For payment batches, where fees are concerned. ar_ap_accno: The AR/AP account number. This then returns a set of contact information with a 2 dimensional array cnsisting of outstanding invoices. Note that the payment selection logic is that this returns all invoices which are either approved or in the batch_id specified. It also locks the invoices using the LedgerSMB discretionary locking framework, and if not possible, returns the username of the individual who has the lock. $$; DROP FUNCTION IF EXISTS payment_bulk_post (in_transactions numeric[], in_batch_id int, in_source text, in_total numeric, in_ar_ap_accno text, in_cash_accno text, in_payment_date date, in_account_class int, in_exchangerate numeric, in_curr text); CREATE OR REPLACE FUNCTION payment_bulk_post (in_transactions numeric[], in_batch_id int, in_source text, in_total numeric, in_ar_ap_accno text, in_cash_accno text, in_payment_date date, in_account_class int, in_exchangerate numeric, in_currency text) RETURNS int AS $$ DECLARE out_count int; t_voucher_id int; t_trans_id int; t_amount numeric; t_ar_ap_id int; t_cash_id int; t_currs text[]; t_exchangerate numeric; t_cash_sign int; BEGIN SELECT * INTO t_exchangerate FROM currency_get_exchangerate( in_currency, in_payment_date, in_account_class); IF in_batch_id IS NULL THEN -- t_voucher_id := NULL; RAISE EXCEPTION 'Bulk Post Must be from Batch!'; ELSE INSERT INTO voucher (batch_id, batch_class, trans_id) values (in_batch_id, (SELECT batch_class_id FROM batch WHERE id = in_batch_id), in_transactions[1][1]); t_voucher_id := currval('voucher_id_seq'); END IF; SELECT string_to_array(value, ':') into t_currs from defaults where setting_key = 'curr'; IF (in_currency IS NULL OR in_currency = t_currs[1]) THEN t_exchangerate := 1; ELSIF t_exchangerate IS NULL THEN t_exchangerate := in_exchangerate; PERFORM payments_set_exchangerate(in_account_class, in_exchangerate, in_currency, in_payment_date); ELSIF t_exchangerate <> in_exchangerate THEN RAISE EXCEPTION 'Exchange rate different than on file'; END IF; IF t_exchangerate IS NULL THEN RAISE EXCEPTION 'No exchangerate provided and not default currency'; END IF; CREATE TEMPORARY TABLE bulk_payments_in (id int, amount numeric, fxrate numeric, gain_loss_accno int); select id into t_ar_ap_id from chart where accno = in_ar_ap_accno; select id into t_cash_id from chart where accno = in_cash_accno; FOR out_count IN array_lower(in_transactions, 1) .. array_upper(in_transactions, 1) LOOP -- Fill the bulk payments table INSERT INTO bulk_payments_in(id, amount) VALUES (in_transactions[out_count][1], in_transactions[out_count][2]); END LOOP; IF in_account_class = 1 THEN t_cash_sign := 1; ELSE t_cash_sign := -1; END IF; IF (in_currency IS NULL OR in_currency = t_currs[1]) THEN UPDATE bulk_payments_in SET fxrate = 1; ELSE UPDATE bulk_payments_in SET fxrate = (SELECT CASE WHEN in_account_class = 1 THEN sell ELSE buy END FROM exchangerate e JOIN (SELECT transdate, id, curr FROM ar UNION SELECT transdate, id, curr FROM ap) a ON (e.transdate = a.transdate AND e.curr = a.curr) WHERE a.id = bulk_payments_in.id); UPDATE bulk_payments_in SET gain_loss_accno = (SELECT value::int FROM defaults WHERE setting_key = 'fxgain_accno_id') WHERE ((t_exchangerate - bulk_payments_in.fxrate) * t_cash_sign) < 0; UPDATE bulk_payments_in SET gain_loss_accno = (SELECT value::int FROM defaults WHERE setting_key = 'fxloss_accno_id') WHERE ((t_exchangerate - bulk_payments_in.fxrate) * t_cash_sign) > 0; -- explicitly leave zero gain/loss accno_id entries at NULL -- so we have an easy check for which END IF; -- Insert cash side INSERT INTO acc_trans (trans_id, chart_id, amount, approved, voucher_id, transdate, source) SELECT id, t_cash_id, amount * t_cash_sign * t_exchangerate/fxrate, CASE WHEN t_voucher_id IS NULL THEN true ELSE false END, t_voucher_id, in_payment_date, in_source FROM bulk_payments_in where amount <> 0; -- early payment discounts INSERT INTO acc_trans (trans_id, chart_id, amount, approved, voucher_id, transdate, source) SELECT bpi.id, eca.discount_account_id, amount * t_cash_sign * t_exchangerate/fxrate / (1 - discount::numeric/100) * (discount::numeric/100), CASE WHEN t_voucher_id IS NULL THEN true ELSE false END, t_voucher_id, in_payment_date, in_source FROM bulk_payments_in bpi JOIN (select entity_credit_account, id, transdate FROM ar WHERE in_account_class = 2 UNION SELECT entity_credit_account, id, transdate FROM ap WHERE in_account_class = 1) gl ON gl.id = bpi.id JOIN entity_credit_account eca ON gl.entity_credit_account = eca.id WHERE bpi.amount <> 0 AND extract('days' from age(gl.transdate)) < eca.discount_terms; INSERT INTO acc_trans (trans_id, chart_id, amount, approved, voucher_id, transdate, source) SELECT bpi.id, t_ar_ap_id, amount * t_cash_sign * -1 * t_exchangerate/fxrate / (1 - discount::numeric/100) * (discount::numeric/100), CASE WHEN t_voucher_id IS NULL THEN true ELSE false END, t_voucher_id, in_payment_date, in_source FROM bulk_payments_in bpi JOIN (select entity_credit_account, id, transdate FROM ar WHERE in_account_class = 2 UNION SELECT entity_credit_account, id, transdate FROM ap WHERE in_account_class = 1) gl ON gl.id = bpi.id JOIN entity_credit_account eca ON gl.entity_credit_account = eca.id WHERE bpi.amount <> 0 AND extract('days' from age(gl.transdate)) < eca.discount_terms; -- Insert ar/ap side INSERT INTO acc_trans (trans_id, chart_id, amount, approved, voucher_id, transdate, source) SELECT id, t_ar_ap_id, amount * -1 * t_cash_sign, CASE WHEN t_voucher_id IS NULL THEN true ELSE false END, t_voucher_id, in_payment_date, in_source FROM bulk_payments_in where amount <> 0; -- Insert fx gain/loss effects, if applicable INSERT INTO acc_trans (trans_id, chart_id, amount, approved, voucher_id, transdate, source) SELECT id, gain_loss_accno, amount * t_cash_sign * (1 - t_exchangerate/fxrate), CASE WHEN t_voucher_id IS NULL THEN true ELSE false END, t_voucher_id, in_payment_date, in_source FROM bulk_payments_in WHERE amount <> 0 AND gain_loss_accno IS NOT NULL; DROP TABLE bulk_payments_in; perform unlock_all(); return out_count; END; $$ language plpgsql; COMMENT ON FUNCTION payment_bulk_post (in_transactions numeric[], in_batch_id int, in_source text, in_total numeric, in_ar_ap_accno text, in_cash_accno text, in_payment_date date, in_account_class int, in_exchangerate numeric, in_currency text) IS $$ This posts the payments for large batch workflows. Note that in_transactions is a two-dimensional numeric array. Of each sub-array, the first element is the (integer) transaction id, and the second is the amount for that transaction. $$; CREATE OR REPLACE FUNCTION payment_post (in_datepaid date, in_account_class int, in_entity_credit_id int, in_curr char(3), in_notes text, in_department_id int, in_gl_description text, in_cash_account_id int[], in_amount numeric[], in_cash_approved bool[], in_source text[], in_memo text[], in_transaction_id int[], in_op_amount numeric[], in_op_cash_account_id int[], in_op_source text[], in_op_memo text[], in_op_account_id int[], in_ovp_payment_id int[], in_approved bool) RETURNS INT AS $$ DECLARE var_payment_id int; DECLARE var_gl_id int; DECLARE var_entry record; DECLARE var_entry_id int[]; DECLARE out_count int; DECLARE coa_id record; DECLARE var_employee int; DECLARE var_account_id int; DECLARE default_currency char(3); DECLARE current_exchangerate numeric; DECLARE old_exchangerate numeric; DECLARE fx_gain_loss_amount numeric; BEGIN IF array_upper(in_amount, 1) <> array_upper(in_cash_account_id, 1) THEN RAISE EXCEPTION 'Wrong number of accounts'; END IF; SELECT * INTO default_currency FROM defaults_get_defaultcurrency(); SELECT * INTO current_exchangerate FROM currency_get_exchangerate(in_curr, in_datepaid, in_account_class); SELECT INTO var_employee p.id FROM users u JOIN person p ON (u.entity_id=p.entity_id) WHERE username = SESSION_USER LIMIT 1; -- -- WE HAVE TO INSERT THE PAYMENT, USING THE GL INFORMATION -- THE ID IS GENERATED BY payment_id_seq -- INSERT INTO payment (reference, payment_class, payment_date, employee_id, currency, notes, department_id, entity_credit_id) VALUES ((CASE WHEN in_account_class = 1 THEN setting_increment('rcptnumber') -- I FOUND THIS ON sql/modules/Settings.sql ELSE -- and it is very usefull setting_increment('paynumber') END), in_account_class, in_datepaid, var_employee, in_curr, in_notes, in_department_id, in_entity_credit_id); SELECT currval('payment_id_seq') INTO var_payment_id; -- WE'LL NEED THIS VALUE TO USE payment_link table -- WE'LL NEED THIS VALUE TO JOIN WITH PAYMENT -- NOW COMES THE HEAVY PART, STORING ALL THE POSSIBLE TRANSACTIONS... -- -- FIRST WE SHOULD INSERT THE CASH ACCOUNTS -- -- WE SHOULD HAVE THE DATA STORED AS (ACCNO, AMOUNT), SO IF (array_upper(in_cash_account_id, 1) > 0) THEN FOR out_count IN array_lower(in_cash_account_id, 1) .. array_upper(in_cash_account_id, 1) LOOP INSERT INTO acc_trans (chart_id, amount, trans_id, transdate, approved, source, memo) VALUES (in_cash_account_id[out_count], CASE WHEN in_account_class = 1 THEN in_amount[out_count]*current_exchangerate ELSE (in_amount[out_count]*current_exchangerate)* - 1 END, in_transaction_id[out_count], in_datepaid, coalesce(in_approved, true), in_source[out_count], in_memo[out_count]); INSERT INTO payment_links VALUES (var_payment_id, currval('acc_trans_entry_id_seq'), 1); IF (in_ovp_payment_id IS NOT NULL AND in_ovp_payment_id[out_count] IS NOT NULL) THEN INSERT INTO payment_links VALUES (in_ovp_payment_id[out_count], currval('acc_trans_entry_id_seq'), 0); END IF; END LOOP; -- NOW LETS HANDLE THE AR/AP ACCOUNTS -- WE RECEIVED THE TRANSACTIONS_ID AND WE CAN OBTAIN THE ACCOUNT FROM THERE FOR out_count IN array_lower(in_transaction_id, 1) .. array_upper(in_transaction_id, 1) LOOP SELECT INTO var_account_id chart_id FROM acc_trans as ac JOIN chart as c ON (c.id = ac.chart_id) WHERE trans_id = in_transaction_id[out_count] AND ( c.link = 'AP' OR c.link = 'AR' ); -- We need to know the exchangerate of this transaction -- ### BUG: we don't have a guarantee that the transaction is -- the same currency as in_curr, so, we can't use -- current_exchangerate as the basis for fx gain/loss -- calculations IF (in_curr = default_currency) THEN old_exchangerate := 1; ELSIF (in_account_class = 2) THEN SELECT buy INTO old_exchangerate FROM exchangerate e JOIN ar a ON (a.transdate = e.transdate) AND (a.curr = e.curr) WHERE a.id = in_transaction_id[out_count]; ELSE SELECT sell INTO old_exchangerate FROM exchangerate e JOIN ap a ON (a.transdate = e.transdate) AND (a.curr = e.curr) WHERE a.id = in_transaction_id[out_count]; END IF; -- Now we post the AP/AR transaction INSERT INTO acc_trans (chart_id, amount, trans_id, transdate, approved, source, memo) VALUES (var_account_id, CASE WHEN in_account_class = 1 THEN (in_amount[out_count]*old_exchangerate) * -1 ELSE in_amount[out_count]*old_exchangerate END, in_transaction_id[out_count], in_datepaid, coalesce(in_approved, true), in_source[out_count], in_memo[out_count]); -- Lets set the gain/loss, if fx_gain_loss_amount equals zero then we dont need to post -- any transaction fx_gain_loss_amount := in_amount[out_count]*current_exchangerate - in_amount[out_count]*old_exchangerate; IF (in_account_class = 1) THEN -- in case of vendor invoices, the invoice amounts have been negated, do the same with the diff fx_gain_loss_amount := fx_gain_loss_amount * -1; END IF; IF (fx_gain_loss_amount < 0) THEN INSERT INTO acc_trans (chart_id, amount, trans_id, transdate, approved, source) VALUES ((select value::int from defaults WHERE setting_key = 'fxgain_accno_id'), fx_gain_loss_amount, in_transaction_id[out_count], in_datepaid, coalesce(in_approved, true), in_source[out_count]); ELSIF (fx_gain_loss_amount > 0) THEN INSERT INTO acc_trans (chart_id, amount, trans_id, transdate, approved, source) VALUES ((select value::int from defaults WHERE setting_key = 'fxloss_accno_id'), fx_gain_loss_amount, in_transaction_id[out_count], in_datepaid, coalesce(in_approved, true), in_source[out_count]); END IF; -- Now we set the links INSERT INTO payment_links VALUES (var_payment_id, currval('acc_trans_entry_id_seq'), 1); END LOOP; END IF; -- END IF -- -- WE NEED TO HANDLE THE OVERPAYMENTS NOW -- -- -- FIRST WE HAVE TO MAKE THE GL TO HOLD THE OVERPAYMENT TRANSACTIONS -- THE ID IS GENERATED BY gl_id_seq -- IF (array_upper(in_op_cash_account_id, 1) > 0) THEN INSERT INTO gl (reference, description, transdate, person_id, notes, approved, department_id) VALUES (setting_increment('glnumber'), in_gl_description, in_datepaid, var_employee, in_notes, in_approved, in_department_id); SELECT currval('id') INTO var_gl_id; -- -- WE NEED TO SET THE GL_ID FIELD ON PAYMENT'S TABLE -- UPDATE payment SET gl_id = var_gl_id WHERE id = var_payment_id; -- NOW COMES THE HEAVY PART, STORING ALL THE POSSIBLE TRANSACTIONS... -- -- FIRST WE SHOULD INSERT THE OVERPAYMENT CASH ACCOUNTS -- FOR out_count IN array_lower(in_op_cash_account_id, 1) .. array_upper(in_op_cash_account_id, 1) LOOP INSERT INTO acc_trans (chart_id, amount, trans_id, transdate, approved, source, memo) VALUES (in_op_cash_account_id[out_count], CASE WHEN in_account_class = 1 THEN in_op_amount[out_count] ELSE in_op_amount[out_count] * - 1 END, var_gl_id, in_datepaid, coalesce(in_approved, true), in_op_source[out_count], in_op_memo[out_count]); INSERT INTO payment_links VALUES (var_payment_id, currval('acc_trans_entry_id_seq'), 2); END LOOP; -- NOW LETS HANDLE THE OVERPAYMENT ACCOUNTS FOR out_count IN array_lower(in_op_account_id, 1) .. array_upper(in_op_account_id, 1) LOOP INSERT INTO acc_trans (chart_id, amount, trans_id, transdate, approved, source, memo) VALUES (in_op_account_id[out_count], CASE WHEN in_account_class = 1 THEN in_op_amount[out_count] * -1 ELSE in_op_amount[out_count] END, var_gl_id, in_datepaid, coalesce(in_approved, true), in_op_source[out_count], in_op_memo[out_count]); INSERT INTO payment_links VALUES (var_payment_id, currval('acc_trans_entry_id_seq'), 2); END LOOP; END IF; return var_payment_id; END; $$ LANGUAGE PLPGSQL; -- I HAVE TO MAKE A COMMENT ON THIS FUNCTION COMMENT ON FUNCTION payment_post (in_datepaid date, in_account_class int, in_entity_credit_id int, in_curr char(3), in_notes text, in_department_id int, in_gl_description text, in_cash_account_id int[], in_amount numeric[], in_cash_approved bool[], in_source text[], in_memo text[], in_transaction_id int[], in_op_amount numeric[], in_op_cash_account_id int[], in_op_source text[], in_op_memo text[], in_op_account_id int[], in_ovp_payment_id int[], in_approved bool) IS $$ Posts a payment. in_op_* arrays are cross-indexed with eachother. Other arrays are cross-indexed with eachother. This API will probably change in 1.4 as we start looking at using more custom complex types and arrays of those (requires Pg 8.4 or higher). $$; -- Move this to the projects module when we start on that. CT CREATE OR REPLACE FUNCTION project_list_open(in_date date) RETURNS SETOF project AS $$ DECLARE out_project project%ROWTYPE; BEGIN FOR out_project IN SELECT * from project WHERE startdate <= in_date AND enddate >= in_date AND completed = 0 LOOP return next out_project; END LOOP; END; $$ language plpgsql; comment on function project_list_open(in_date date) is $$ This function returns all projects that were open as on the date provided as the argument.$$; -- Move this to the projects module when we start on that. CT CREATE OR REPLACE FUNCTION department_list(in_role char) RETURNS SETOF department AS $$ DECLARE out_department department%ROWTYPE; BEGIN FOR out_department IN SELECT * from department WHERE role = coalesce(in_role, role) LOOP return next out_department; END LOOP; END; $$ language plpgsql; -- Move this into another module. comment on function department_list(in_role char) is $$ This function returns all department that match the role provided as the argument.$$; CREATE OR REPLACE FUNCTION payments_get_open_currencies(in_account_class int) RETURNS SETOF char(3) AS $$ DECLARE result char(3); BEGIN select min(curr) into result from ar WHERE in_account_class = 2 union select min(curr) from ap WHERE in_account_class = 1; LOOP EXIT WHEN result IS NULL; return next result; SELECT min(curr) INTO result from ar where in_account_class = 2 and curr > result union select min(curr) from ap WHERE in_account_class = 1 and curr > result LIMIT 1; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION payments_get_open_currencies(in_account_class int) IS $$ This does a sparse scan to find currencies attached to open invoices. It should scale per the number of currencies used rather than the size of the ar or ap tables. $$; CREATE OR REPLACE FUNCTION currency_get_exchangerate(in_currency char(3), in_date date, in_account_class int) RETURNS NUMERIC AS $$ DECLARE out_exrate exchangerate.buy%TYPE; default_currency char(3); BEGIN SELECT * INTO default_currency FROM defaults_get_defaultcurrency(); IF default_currency = in_currency THEN RETURN 1; END IF; IF in_account_class = 2 THEN SELECT buy INTO out_exrate FROM exchangerate WHERE transdate = in_date AND curr = in_currency; ELSE SELECT sell INTO out_exrate FROM exchangerate WHERE transdate = in_date AND curr = in_currency; END IF; RETURN out_exrate; END; $$ language plpgsql; COMMENT ON FUNCTION currency_get_exchangerate(in_currency char(3), in_date date, in_account_class int) IS $$ This function return the exchange rate of a given currency, date and exchange rate class (buy or sell). $$; -- -- payment_location_result has the same arch as location_result, except for one field -- This should be unified on the API when we get things working - David Mora -- DROP TYPE IF EXISTS payment_location_result CASCADE; CREATE TYPE payment_location_result AS ( id int, line_one text, line_two text, line_three text, city text, state text, mail_code text, country text, class text ); -- -- payment_get_vc_info has the same arch as company__list_locations, except for the filtering capabilities -- This should be unified on the API when we get things working - David Mora -- CREATE OR REPLACE FUNCTION payment_get_vc_info(in_entity_credit_id int, in_location_class_id int) RETURNS SETOF payment_location_result AS $$ DECLARE out_row payment_location_result; BEGIN FOR out_row IN SELECT l.id, l.line_one, l.line_two, l.line_three, l.city, l.state, l.mail_code, c.name, lc.class FROM location l JOIN company_to_location ctl ON (ctl.location_id = l.id) JOIN company cp ON (ctl.company_id = cp.id) JOIN location_class lc ON (ctl.location_class = lc.id) JOIN country c ON (c.id = l.country_id) JOIN entity_credit_account ec ON (ec.entity_id = cp.entity_id) WHERE ec.id = in_entity_credit_id AND lc.id = in_location_class_id ORDER BY lc.id, l.id, c.name LOOP RETURN NEXT out_row; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION payment_get_vc_info(in_entity_id int, in_location_class_id int) IS $$ This function returns vendor or customer info $$; DROP TYPE IF EXISTS payment_record CASCADE; CREATE TYPE payment_record AS ( amount numeric, meta_number text, credit_id int, company_paid text, accounts text[], source text, batch_control text, batch_description text, voucher_id int, date_paid date ); DROP FUNCTION IF EXISTS payment__search (in_source text, in_date_from date, in_date_to date, in_credit_id int, in_cash_accno text, in_account_class int); CREATE OR REPLACE FUNCTION payment__search (in_source text, in_date_from date, in_date_to date, in_credit_id int, in_cash_accno text, in_account_class int, in_currency char(3)) RETURNS SETOF payment_record AS $$ DECLARE out_row payment_record; BEGIN FOR out_row IN select sum(CASE WHEN c.entity_class = 1 then a.amount ELSE a.amount * -1 END), c.meta_number, c.id, co.legal_name, compound_array(ARRAY[ARRAY[ch.id::text, ch.accno, ch.description]]), a.source, b.control_code, b.description, a.voucher_id, a.transdate FROM entity_credit_account c JOIN ( select entity_credit_account, id, curr FROM ar WHERE in_account_class = 2 UNION SELECT entity_credit_account, id, curr FROM ap WHERE in_account_class = 1 ) arap ON (arap.entity_credit_account = c.id) JOIN acc_trans a ON (arap.id = a.trans_id) JOIN chart ch ON (ch.id = a.chart_id) JOIN company co ON (c.entity_id = co.entity_id) LEFT JOIN voucher v ON (v.id = a.voucher_id) LEFT JOIN batch b ON (b.id = v.batch_id) WHERE (ch.accno = in_cash_accno) AND (in_currency IS NULL OR in_currency = arap.curr) AND (c.id = in_credit_id OR in_credit_id IS NULL) AND (a.transdate >= in_date_from OR in_date_from IS NULL) AND (a.transdate <= in_date_to OR in_date_to IS NULL) AND (source = in_source OR in_source IS NULL) GROUP BY c.meta_number, c.id, co.legal_name, a.transdate, a.source, a.memo, b.id, b.control_code, b.description, voucher_id ORDER BY a.transdate, c.meta_number, a.source LOOP RETURN NEXT out_row; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION payment__search (in_source text, in_date_from date, in_date_to date, in_credit_id int, in_cash_accno text, in_account_class int, char(3)) IS $$This searches for payments. in_date_to and _date_from specify the acceptable date range. All other matches are exact except that null matches all values. Currently (and to support earlier data) we define a payment as a collection of acc_trans records against the same credit account and cash account, on the same day with the same source number, and optionally the same voucher id.$$; DROP FUNCTION IF EXISTS payment__reverse (in_source text, in_date_paid date, in_credit_id int, in_cash_accno text, in_date_reversed date, in_account_class int, in_batch_id int, in_voucher_id int); CREATE OR REPLACE FUNCTION payment__reverse (in_source text, in_date_paid date, in_credit_id int, in_cash_accno text, in_date_reversed date, in_account_class int, in_batch_id int, in_voucher_id int, in_exchangerate numeric, in_currency char(3)) RETURNS INT AS $$ DECLARE pay_row record; t_voucher_id int; t_voucher_inserted bool; t_currs text[]; t_rev_fx numeric; t_fxgain_id int; t_fxloss_id int; t_paid_fx numeric; BEGIN SELECT * INTO t_rev_fx FROM currency_get_exchangerate( in_currency, in_date_reversed, in_account_class); SELECT * INTO t_paid_fx FROM currency_get_exchangerate( in_currency, in_date_paid, in_account_class); select value::int INTO t_fxgain_id FROM setting_get('fxgain_accno_id'); select value::int INTO t_fxloss_id FROM setting_get('fxloss_accno_id'); SELECT string_to_array(value, ':') into t_currs from defaults where setting_key = 'curr'; IF in_currency IS NULL OR in_currency = t_currs[1] THEN t_rev_fx := 1; t_paid_fx := 1; ELSIF t_rev_fx IS NULL THEN t_rev_fx := in_exchangerate; PERFORM payments_set_exchangerate(in_account_class, in_exchangerate, in_currency, in_date_reversed); ELSIF t_rev_fx <> in_exchangerate THEN RAISE EXCEPTION 'Exchange rate different than on file'; END IF; IF t_rev_fx IS NULL THEN RAISE EXCEPTION 'No exchangerate provided and not default currency'; END IF; IF in_batch_id IS NOT NULL THEN t_voucher_id := nextval('voucher_id_seq'); t_voucher_inserted := FALSE; END IF; FOR pay_row IN SELECT a.*, c.ar_ap_account_id, arap.curr, arap.fxrate FROM acc_trans a JOIN (select id, curr, entity_credit_account, CASE WHEN curr = t_currs[1] THEN 1 ELSE buy END as fxrate FROM ar LEFT JOIN exchangerate USING (transdate, curr) WHERE in_account_class = 2 UNION SELECT id, curr, entity_credit_account, CASE WHEN curr = t_currs[1] THEN 1 ELSE sell END as fxrate FROM ap LEFT JOIN exchangerate USING (transdate, curr) WHERE in_account_class = 1 ) arap ON (a.trans_id = arap.id) JOIN entity_credit_account c ON (arap.entity_credit_account = c.id) JOIN account ch ON (a.chart_id = ch.id) WHERE a.source IS NOT DISTINCT FROM in_source AND a.transdate = in_date_paid AND in_credit_id = arap.entity_credit_account AND in_cash_accno = ch.accno and in_voucher_id IS NOT DISTINCT FROM voucher_id LOOP IF pay_row.curr = t_currs[1] THEN pay_row.fxrate = 1; END IF; IF in_batch_id IS NOT NULL AND t_voucher_inserted IS NOT TRUE THEN INSERT INTO voucher (id, trans_id, batch_id, batch_class) VALUES (t_voucher_id, pay_row.trans_id, in_batch_id, CASE WHEN in_account_class = 1 THEN 4 WHEN in_account_class = 2 THEN 7 END); t_voucher_inserted := TRUE; END IF; INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, source, memo, approved, voucher_id) VALUES (pay_row.trans_id, pay_row.chart_id, pay_row.amount / t_paid_fx * -1 * t_rev_fx, in_date_reversed, in_source, 'Reversing ' || COALESCE(in_source, ''), case when in_batch_id is not null then false else true end, t_voucher_id), (pay_row.trans_id, pay_row.ar_ap_account_id, pay_row.amount / t_paid_fx * pay_row.fxrate, in_date_reversed, in_source, 'Reversing ' || COALESCE(in_source, ''), case when in_batch_id is not null then false else true end, t_voucher_id), (pay_row.trans_id, case when pay_row.fxrate > t_rev_fx THEN t_fxloss_id ELSE t_fxgain_id END, pay_row.amount / t_paid_fx * (t_rev_fx - pay_row.fxrate), in_date_reversed, in_source, 'Reversing ' || COALESCE(in_source, ''), case when in_batch_id is not null then false else true end, t_voucher_id); END LOOP; RETURN 1; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION payment__reverse (in_source text, in_date_paid date, in_credit_id int, in_cash_accno text, in_date_reversed date, in_account_class int, in_batch_id int, in_voucher_id int, in_exchangerate numeric, char(3)) IS $$ Reverses a payment. All fields are mandatory except batch_id and voucher_id because they determine the identity of the payment to be reversed. $$; CREATE OR REPLACE FUNCTION payments_set_exchangerate(in_account_class int, in_exchangerate numeric, in_curr char(3), in_datepaid date ) RETURNS INT AS $$ DECLARE current_exrate exchangerate%ROWTYPE; BEGIN select * INTO current_exrate FROM exchangerate WHERE transdate = in_datepaid AND curr = in_curr; IF current_exrate.transdate = in_datepaid THEN IF in_account_class = 2 THEN UPDATE exchangerate set buy = in_exchangerate where transdate = in_datepaid; ELSE UPDATE exchangerate set sell = in_exchangerate where transdate = in_datepaid; END IF; RETURN 0; ELSE IF in_account_class = 2 THEN INSERT INTO exchangerate (curr, transdate, buy) values (in_curr, in_datepaid, in_exchangerate); ELSE INSERT INTO exchangerate (curr, transdate, sell) values (in_curr, in_datepaid, in_exchangerate); END IF; RETURN 0; END IF; END; $$ language plpgsql; COMMENT ON FUNCTION payments_set_exchangerate(in_account_class int, in_exchangerate numeric, in_curr char(3), in_datepaid date ) IS $$ 1.3 only. This will be replaced by a more generic function in 1.4. This sets the exchange rate for a class of transactions (payable, receivable) to a certain rate for a specific date.$$; DROP TYPE IF EXISTS payment_header_item CASCADE; CREATE TYPE payment_header_item AS ( payment_id int, payment_reference int, payment_date date, legal_name text, amount numeric, employee_first_name text, employee_last_name text, currency char(3), notes text ); -- I NEED TO PLACE THE COMPANY TELEPHONE AND ALL THAT STUFF CREATE OR REPLACE FUNCTION payment_gather_header_info(in_account_class int, in_payment_id int) RETURNS SETOF payment_header_item AS $$ DECLARE out_payment payment_header_item; BEGIN FOR out_payment IN SELECT p.id as payment_id, p.reference as payment_reference, p.payment_date, c.legal_name as legal_name, am.amount as amount, em.first_name, em.last_name, p.currency, p.notes FROM payment p JOIN entity_employee ent_em ON (ent_em.entity_id = p.employee_id) JOIN person em ON (ent_em.entity_id = em.entity_id) JOIN entity_credit_account eca ON (eca.id = p.entity_credit_id) JOIN company c ON (c.entity_id = eca.entity_id) JOIN payment_links pl ON (p.id = pl.payment_id) LEFT JOIN ( SELECT sum(a.amount) as amount FROM acc_trans a JOIN account acc ON (a.chart_id = acc.id) JOIN account_link al ON (acc.id =al.account_id) JOIN payment_links pl ON (pl.entry_id=a.entry_id) WHERE al.description in ('AP_paid', 'AP_discount', 'AR_paid', 'AR_discount') and ((in_account_class = 1 AND al.description like 'AP%') or (in_account_class = 2 AND al.description like 'AR%')) ) am ON (true) WHERE p.id = in_payment_id LOOP RETURN NEXT out_payment; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION payment_gather_header_info(int,int) IS $$ This function finds a payment based on the id and retrieves the record, it is usefull for printing payments :) $$; DROP TYPE IF EXISTS payment_line_item CASCADE; CREATE TYPE payment_line_item AS ( payment_id int, entry_id int, link_type int, trans_id int, invoice_number text, chart_id int, chart_accno text, chart_description text, chart_link text, amount numeric, trans_date date, source text, cleared bool, fx_transaction bool, project_id int, memo text, invoice_id int, approved bool, cleared_on date, reconciled_on date ); CREATE OR REPLACE FUNCTION payment_gather_line_info(in_account_class int, in_payment_id int) RETURNS SETOF payment_line_item AS $$ DECLARE out_payment_line payment_line_item; BEGIN FOR out_payment_line IN SELECT pl.payment_id, ac.entry_id, pl.type as link_type, ac.trans_id, a.invnumber as invoice_number, ac.chart_id, ch.accno as chart_accno, ch.description as chart_description, ch.link as chart_link, ac.amount, ac.transdate as trans_date, ac.source, ac.cleared_on, ac.fx_transaction, ac.project_id, ac.memo, ac.invoice_id, ac.approved, ac.cleared_on, ac.reconciled_on FROM acc_trans ac JOIN payment_links pl ON (pl.entry_id = ac.entry_id ) JOIN chart ch ON (ch.id = ac.chart_id) LEFT JOIN (SELECT id,invnumber FROM ar WHERE in_account_class = 2 UNION SELECT id,invnumber FROM ap WHERE in_account_class = 1 ) a ON (ac.trans_id = a.id) WHERE pl.payment_id = in_payment_id LOOP RETURN NEXT out_payment_line; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION payment_gather_line_info(int,int) IS $$ This function finds a payment based on the id and retrieves all the line records, it is usefull for printing payments and build reports :) $$; -- We will use a view to handle all the overpayments DROP VIEW IF EXISTS overpayments CASCADE; CREATE VIEW overpayments AS SELECT p.id as payment_id, p.reference as payment_reference, p.payment_class, p.closed as payment_closed, p.payment_date, ac.chart_id, c.accno, c.description as chart_description, p.department_id, abs(sum(ac.amount)) as available, cmp.legal_name, eca.id as entity_credit_id, eca.entity_id, eca.discount, eca.meta_number FROM payment p JOIN payment_links pl ON (pl.payment_id=p.id) JOIN acc_trans ac ON (ac.entry_id=pl.entry_id) JOIN chart c ON (c.id=ac.chart_id) JOIN entity_credit_account eca ON (eca.id = p.entity_credit_id) JOIN company cmp ON (cmp.entity_id=eca.entity_id) WHERE p.gl_id IS NOT NULL AND (pl.type = 2 OR pl.type = 0) AND c.link LIKE '%overpayment%' GROUP BY p.id, c.accno, p.reference, p.payment_class, p.closed, p.payment_date, ac.chart_id, chart_description, p.department_id, legal_name, eca.id, eca.entity_id, eca.discount, eca.meta_number; CREATE OR REPLACE FUNCTION payment_get_open_overpayment_entities(in_account_class int) returns SETOF payment_vc_info AS $$ DECLARE out_entity payment_vc_info; BEGIN FOR out_entity IN SELECT DISTINCT entity_credit_id, legal_name, e.entity_class, discount, o.meta_number FROM overpayments o JOIN entity e ON (e.id=o.entity_id) WHERE available <> 0 AND in_account_class = payment_class LOOP RETURN NEXT out_entity; END LOOP; END; $$ LANGUAGE PLPGSQL; CREATE OR REPLACE FUNCTION payment_get_unused_overpayment( in_account_class int, in_entity_credit_id int, in_chart_id int) returns SETOF overpayments AS $$ DECLARE out_overpayment overpayments%ROWTYPE; BEGIN FOR out_overpayment IN SELECT DISTINCT * FROM overpayments WHERE payment_class = in_account_class AND entity_credit_id = in_entity_credit_id AND available <> 0 AND (in_chart_id IS NULL OR chart_id = in_chart_id ) ORDER BY payment_date LOOP RETURN NEXT out_overpayment; END LOOP; END; $$ LANGUAGE PLPGSQL; CREATE OR REPLACE FUNCTION payment_get_unused_overpayment( in_account_class int, in_entity_credit_id int, in_chart_id int) returns SETOF overpayments AS $$ DECLARE out_overpayment overpayments%ROWTYPE; BEGIN FOR out_overpayment IN SELECT DISTINCT * FROM overpayments WHERE payment_class = in_account_class AND entity_credit_id = in_entity_credit_id AND available <> 0 AND (in_chart_id IS NULL OR chart_id = in_chart_id ) ORDER BY payment_date LOOP RETURN NEXT out_overpayment; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION payment_get_unused_overpayment( in_account_class int, in_entity_credit_id int, in_chart_id int) IS $$ Returns a list of available overpayments$$; DROP TYPE IF EXISTS payment_overpayments_available_amount CASCADE; CREATE TYPE payment_overpayments_available_amount AS ( chart_id int, accno text, description text, available numeric ); CREATE OR REPLACE FUNCTION payment_get_available_overpayment_amount( in_account_class int, in_entity_credit_id int) returns SETOF payment_overpayments_available_amount AS $$ DECLARE out_overpayment payment_overpayments_available_amount; BEGIN FOR out_overpayment IN SELECT chart_id, accno, chart_description, abs(sum(available)) FROM overpayments WHERE payment_class = in_account_class AND entity_credit_id = in_entity_credit_id AND available <> 0 GROUP BY chart_id, accno, chart_description LOOP RETURN NEXT out_overpayment; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION payment_get_unused_overpayment( in_account_class int, in_entity_credit_id int, in_chart_id int) IS $$ Returns a list of available overpayments$$; COMMIT; ledgersmb/sql/modules/Inventory.sql0000644000000000000000000000552611170503454016515 0ustar rootrootCREATE OR REPLACE FUNCTION inventory_get_item_at_day (in_transdate date, in_partnumber text) RETURNS parts AS $$ DECLARE out_row parts%ROWTYPE; t_parts_id int; BEGIN SELECT id INTO t_parts_id FROM parts WHERE (partnumber like in_partnumber|| ' %' or partnumber = in_partnumber) and obsolete is not true and assembly is not true; SELECT p.id, p.partnumber, p.description, p.unit, p.listprice, p.sellprice, p.lastcost, p.priceupdate, p.weight, sum(coalesce(c.multiplier, 1) * i.qty) * -1 AS onhand, p.notes, p.makemodel, p.assembly, p.alternate, p.rop, p.inventory_accno_id, p.income_accno_id, p.expense_accno_id, p.bin, p.obsolete, p.bom, p.image, p.microfiche, p.partsgroup_id, p.project_id INTO out_row FROM parts p LEFT JOIN ( SELECT product(qty) as multiplier, t_parts_id as part_used FROM assembly a JOIN parts p ON (a.id = p.id and p.volume_break = true) JOIN (SELECT *, t_parts_id as part_used FROM connectby('assembly', 'id', 'parts_id', 'id', t_parts_id, 0, ',') c(id integer, parent integer, "level" integer, path text, list_order integer) ) asm ON (asm.id = p.id) ) c ON (c.part_used = t_parts_id) JOIN invoice i ON (i.parts_id = p.id OR i.parts_id = c.part_used) JOIN (select id, transdate from ar UNION select id, transdate from ap) a ON (i.trans_id = a.id) WHERE (p.partnumber = in_partnumber or p.partnumber like in_partnumber || ' %') AND a.transdate <= in_transdate AND assembly IS FALSE AND obsolete IS NOT TRUE GROUP BY p.id, p.partnumber, p.description, p.unit, p.listprice, p.sellprice, p.lastcost, p.priceupdate, p.weight, p.onhand, p.notes, p.makemodel, p.assembly, p.alternate, p.rop, p.inventory_accno_id, p.income_accno_id, p.expense_accno_id, p.bin, p.obsolete, p.bom, p.image, p.microfiche, p.partsgroup_id, p.project_id, p.avgcost; RETURN out_row; END; $$ LANGUAGE PLPGSQL; CREATE FUNCTION product (numeric, numeric) RETURNS numeric AS $$ SELECT $1 * $2; $$ language sql; CREATE AGGREGATE product( basetype = numeric, sfunc = product, stype = numeric ); CREATE OR REPLACE FUNCTION inventory_create_report(in_transdate date) RETURNS int AS $$ BEGIN INSERT INTO inventory_report(entry_date) values (in_transdate); RETURN currval('inventory_report_id_seq'); END; $$ language plpgsql; CREATE OR REPLACE FUNCTION inventory_report__add_line (in_report_id int, in_parts_id int, in_onhand int, in_counted int) RETURNS int AS $$ BEGIN INSERT INTO inventory_report_line(report_id, parts_id, onhand, counted) VALUES (in_report_id, in_parts_id, in_onhand, in_counted); RETURN currval('inventory_report_line_id_seq'); end; $$ LANGUAGE plpgsql; ledgersmb/sql/modules/Report.sql0000644000000000000000000001156111613404762015773 0ustar rootroot-- Unused currently and untested. This is expected to be a basis for 1.4 work -- not recommended for current usage. Not documenting yet. --CT CREATE TYPE report_aging_item AS ( entity_id int, account_number varchar(24), name text, address1 text, address2 text, address3 text, city_province text, mail_code text, country text, contact_name text, email text, phone text, fax text, invnumber text, transdate date, till varchar(20), ordnumber text, ponumber text, notes text, c0 numeric, c30 numeric, c60 numeric, c90 numeric, duedate date, id int, curr varchar(3), exchangerate numeric, line_items text[][] ); CREATE OR REPLACE FUNCTION report_invoice_aging(in_entity_id int, in_entity_class int) RETURNS SETOF report_aging_item AS $$ DECLARE item report_aging_item; BEGIN IF in_entity_class = 1 THEN FOR item IN SELECT c.entity_id, c.meta_number, e.name, l.line_one as address1, l.line_two as address2, l.line_three as address3, l.city_province, l.mail_code, country.name as country, '' as contact_name, '' as email, '' as phone, '' as fax, a.invnumber, a.transdate, a.till, a.ordnumber, a.ponumber, a.notes, CASE WHEN EXTRACT(days FROM age(a.transdate)/30) = 0 THEN (a.amount - a.paid) ELSE 0 END as c0, CASE WHEN EXTRACT(days FROM age(a.transdate)/30) = 1 THEN (a.amount - a.paid) ELSE 0 END as c30, CASE WHEN EXTRACT(days FROM age(a.transdate)/30) = 2 THEN (a.amount - a.paid) ELSE 0 END as c60, CASE WHEN EXTRACT(days FROM age(a.transdate)/30) > 2 THEN (a.amount - a.paid) ELSE 0 END as c90, a.duedate, a.id, a.curr, COALESCE((SELECT sell FROM exchangerate ex WHERE a.curr = ex.curr AND ex.transdate = a.transdate), 1) AS exchangerate, (SELECT compound_array(ARRAY[[p.partnumber, i.description, i.qty::text]]) FROM parts p JOIN invoice i ON (i.parts_id = p.id) WHERE i.trans_id = a.id) AS line_items FROM ap a JOIN entity_credit_account c USING (entity_id) JOIN entity e ON (e.id = c.entity_id) CROSS JOIN location l JOIN country ON (country.id = l.country_id) WHERE a.entity_id like coalesce(in_entity_id::text, '%') AND l.id = (SELECT min(location_id) FROM company_to_location WHERE company_id = (select min(id) FROM company WHERE entity_id = c.entity_id)) ORDER BY entity_id, curr, transdate, invnumber LOOP return next item; END LOOP; ELSIF in_entity_class = 2 THEN FOR item IN SELECT c.entity_id, c.meta_number, e.name, l.line_one as address1, l.line_two as address2, l.line_three as address3, l.city_province, l.mail_code, country.name as country, '' as contact_name, '' as email, '' as phone, '' as fax, a.invnumber, a.transdate, a.till, a.ordnumber, a.ponumber, a.notes, CASE WHEN EXTRACT(days FROM age(a.transdate)/30) = 0 THEN (a.amount - a.paid) ELSE 0 END as c0, CASE WHEN EXTRACT(days FROM age(a.transdate)/30) = 1 THEN (a.amount - a.paid) ELSE 0 END as c30, CASE WHEN EXTRACT(days FROM age(a.transdate)/30) = 2 THEN (a.amount - a.paid) ELSE 0 END as c60, CASE WHEN EXTRACT(days FROM age(a.transdate)/30) > 2 THEN (a.amount - a.paid) ELSE 0 END as c90, a.duedate, a.id, a.curr, (SELECT buy FROM exchangerate ex WHERE a.curr = ex.curr AND ex.transdate = a.transdate) AS exchangerate, (SELECT compound_array(ARRAY[[p.partnumber, i.description, i.qty::text]]) FROM parts p JOIN invoice i ON (i.parts_id = p.id) WHERE i.trans_id = a.id) AS line_items FROM ar a JOIN entity_credit_account c USING (entity_id) JOIN entity e ON (e.id = c.entity_id) CROSS JOIN location l JOIN country ON (country.id = l.country_id) WHERE a.entity_id like coalesce(in_entity_id::text, '%') AND l.id = (SELECT min(location_id) FROM company_to_location WHERE company_id = (select min(id) FROM company WHERE entity_id = c.entity_id)) ORDER BY entity_id, curr, transdate, invnumber LOOP return next item; END LOOP; ELSE RAISE EXCEPTION 'Entity Class % unsupported in aging report', in_entity_class; END IF; END; $$ language plpgsql; ledgersmb/sql/modules/Company.sql0000644000000000000000000014311312006444227016122 0ustar rootroot -- Copyright (C) 2011 LedgerSMB Core Team. Licensed under the GNU General -- Public License v 2 or at your option any later version. -- Docstrings already added to this file. BEGIN; DROP TYPE IF EXISTS eca__pricematrix CASCADE; CREATE TYPE eca__pricematrix AS ( parts_id int, int_partnumber text, description text, credit_id int, pricebreak numeric, sellprice numeric, lastcost numeric, leadtime int, partnumber text, validfrom date, validto date, curr char(3), entry_id int ); DROP TYPE IF EXISTS company_search_result CASCADE; CREATE TYPE company_search_result AS ( entity_id int, entity_control_code text, company_id int, entity_credit_id int, meta_number text, credit_description text, entity_class int, legal_name text, sic_code text, business_type text, curr text ); DROP TYPE IF EXISTS eca_history_result CASCADE; create type eca_history_result as ( id int, name text, meta_number text, inv_id int, invnumber text, curr text, parts_id int, partnumber text, description text, qty numeric, unit text, sellprice numeric, discount numeric, delivery_date date, project_id int, projectnumber text, serialnumber text, exchngerate numeric, salesperson_id int, salesperson_name text ); CREATE OR REPLACE FUNCTION eca_history (in_name text, in_meta_number text, in_contact_info text, in_address_line text, in_city text, in_state text, in_zip text, in_salesperson text, in_notes text, in_country_id int, in_from_date date, in_to_date date, in_type char(1), in_start_from date, in_start_to date, in_account_class int, in_inc_open bool, in_inc_closed bool) RETURNS SETOF eca_history_result AS $$ SELECT eca.id, e.name, eca.meta_number, a.id as invoice_id, a.invnumber, a.curr::text, p.id AS parts_id, p.partnumber, i.description, i.qty, i.unit::text, i.sellprice, i.discount, i.deliverydate, pr.id as project_id, pr.projectnumber, i.serialnumber, case when $16 = 1 then xr.buy else xr.sell end as exchange_rate, ee.id as salesperson_id, ep.last_name || ', ' || ep.first_name as salesperson_name FROM (select * from entity_credit_account where meta_number = $2 UNION select * from entity_credit_account WHERE $2 is null ) eca -- broken into unions for performance join entity e on eca.entity_id = e.id JOIN (select invnumber, curr, transdate, entity_credit_account, id, person_id FROM ar where $16 = 2 and $13 = 'i' and (($17 and amount = paid) or ($18 and amount <> paid)) UNION select invnumber, curr, transdate, entity_credit_account, id, person_id FROM ap where $16 = 1 and $13 = 'i' and (($17 and amount = paid) or ($18 and amount <> paid)) union select ordnumber, curr, transdate, entity_credit_account, id, person_id from oe where ($16= 1 and oe.oe_class_id = 2 and $13 = 'o' and quotation is not true) and (($17 and not closed) or ($18 and closed)) union select ordnumber, curr, transdate, entity_credit_account, id, person_id from oe where ($16= 2 and oe.oe_class_id = 1 and $13 = 'o' and quotation is not true) and (($17 and not closed) or ($18 and closed)) union select quonumber, curr, transdate, entity_credit_account, id, person_id from oe where($16= 1 and oe.oe_class_id = 4 and $13 = 'q' and quotation is true) and (($17 and not closed) or ($18 and closed)) union select quonumber, curr, transdate, entity_credit_account, id, person_id from oe where($16= 2 and oe.oe_class_id = 4 and $13 = 'q' and quotation is true) and (($17 and not closed) or ($18 and closed)) ) a ON (a.entity_credit_account = eca.id) -- broken into unions -- for performance JOIN ( select trans_id, parts_id, qty, description, unit, discount, deliverydate, serialnumber, project_id, sellprice FROM invoice where $13 = 'i' union select trans_id, parts_id, qty, description, unit, discount, reqdate, serialnumber, project_id, sellprice FROM orderitems where $13 <> 'i' ) i on i.trans_id = a.id JOIN parts p ON (p.id = i.parts_id) LEFT JOIN exchangerate ex ON (ex.transdate = a.transdate) LEFT JOIN project pr ON (pr.id = i.project_id) LEFT JOIN entity ee ON (a.person_id = ee.id) LEFT JOIN person ep ON (ep.entity_id = ee.id) JOIN exchangerate xr ON a.transdate = xr.transdate -- these filters don't perform as well on large databases WHERE (e.name ilike '%' || $1 || '%' or $1 is null) and ($3 is null or eca.id in (select credit_id from eca_to_contact where contact ilike '%' || $3 || '%')) and (($4 is null and $5 is null and $6 is null and $7 is null) or eca.id in (select credit_id from eca_to_location where location_id in (select id from location where ($4 is null or line_one ilike '%' || $4 || '%' or line_two ilike '%' || $4 || '%') and ($5 is null or city ilike '%' || $5 || '%') and ($6 is null or state ilike '%' || $6 || '%') and ($7 is null or mail_code ilike '%' || $7 || '%') and ($10 is null or country_id = $10)) ) ) and (a.transdate >= $11 or $11 is null) and (a.transdate <= $12 or $12 is null) and (eca.startdate >= $14 or $14 is null) and (eca.startdate <= $15 or $15 is null) ORDER BY eca.meta_number; $$ LANGUAGE SQL; COMMENT ON FUNCTION eca_history (in_name text, in_meta_number text, in_contact_info text, in_address_line text, in_city text, in_state text, in_zip text, in_salesperson text, in_notes text, in_country_id int, in_from_date date, in_to_date date, in_type char(1), in_start_from date, in_start_to date, in_account_class int, in_inc_open bool, in_inc_closed bool) IS $$This produces a history detail report, i.e. a list of all products purchased by a customer over a specific date range. meta_number is an exact match, as are in_open and inc_closed. All other fields allow for partial matches. NULL matches all values.$$; CREATE OR REPLACE FUNCTION eca_history_summary (in_name text, in_meta_number text, in_contact_info text, in_address_line text, in_city text, in_state text, in_zip text, in_salesperson text, in_notes text, in_country_id int, in_from_date date, in_to_date date, in_type char(1), in_start_from date, in_start_to date, in_account_class int, in_inc_open bool, in_inc_closed bool) RETURNS SETOF eca_history_result AS $$ SELECT id, name, meta_number, null::int, null::text, curr, parts_id, partnumber, description, sum(qty), unit, null::numeric, null::numeric, null::date, null::int, null::text, null::text, null::numeric, null::int, null::text FROM eca_history($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18) group by id, name, meta_number, curr, parts_id, partnumber, description, unit order by meta_number; $$ LANGUAGE SQL; --HV coalesce(ec.entity_class,e.entity_class) in case entity but not yet entity_credit_account CREATE OR REPLACE FUNCTION company__search (in_account_class int, in_contact text, in_contact_info text[], in_meta_number text, in_address text, in_city text, in_state text, in_mail_code text, in_country text, in_date_from date, in_date_to date, in_business_id int, in_legal_name text, in_control_code text) RETURNS SETOF company_search_result AS $$ DECLARE out_row company_search_result; loop_count int; t_contact_info text[]; BEGIN t_contact_info = in_contact_info; FOR out_row IN SELECT e.id, e.control_code, c.id, ec.id, ec.meta_number, ec.description, ec.entity_class, c.legal_name, c.sic_code, b.description , ec.curr::text FROM (select * from entity where in_control_code = control_code union select * from entity where in_control_code is null) e JOIN (SELECT * FROM company WHERE legal_name ilike '%' || in_legal_name || '%' UNION ALL SELECT * FROM company WHERE in_legal_name IS NULL) c ON (e.id = c.entity_id) LEFT JOIN entity_credit_account ec ON (ec.entity_id = e.id) LEFT JOIN business b ON (ec.business_id = b.id) WHERE coalesce(ec.entity_class,e.entity_class) = in_account_class AND (c.id IN (select company_id FROM company_to_contact WHERE contact ILIKE ALL(t_contact_info)) OR '' ILIKE ALL(t_contact_info) OR t_contact_info IS NULL) AND (c.legal_name ilike '%' || in_legal_name || '%' OR in_legal_name IS NULL) AND ((in_address IS NULL AND in_city IS NULL AND in_state IS NULL AND in_country IS NULL) OR (c.id IN (select company_id FROM company_to_location WHERE location_id IN (SELECT id FROM location WHERE line_one ilike '%' || coalesce(in_address, '') || '%' AND city ILIKE '%' || coalesce(in_city, '') || '%' AND state ILIKE '%' || coalesce(in_state, '') || '%' AND mail_code ILIKE '%' || coalesce(in_mail_code, '') || '%' AND country_id IN (SELECT id FROM country WHERE name ILIKE '%' || in_country ||'%' OR short_name ilike in_country))))) AND (ec.business_id = coalesce(in_business_id, ec.business_id) OR (ec.business_id IS NULL AND in_business_id IS NULL)) AND (ec.startdate <= coalesce(in_date_to, ec.startdate) OR (ec.startdate IS NULL)) AND (ec.enddate >= coalesce(in_date_from, ec.enddate) OR (ec.enddate IS NULL)) AND (ec.meta_number = in_meta_number OR in_meta_number IS NULL) LOOP RETURN NEXT out_row; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION eca_history_summary (in_name text, in_meta_number text, in_contact_info text, in_address_line text, in_city text, in_state text, in_zip text, in_salesperson text, in_notes text, in_country_id int, in_from_date date, in_to_date date, in_type char(1), in_start_from date, in_start_to date, in_account_class int, in_inc_open bool, in_inc_closed bool) IS $$Creates a summary account (no quantities, just parts group by invoice). meta_number must match exactly or be NULL. inc_open and inc_closed are exact matches too. All other values specify ranges or may match partially.$$; CREATE OR REPLACE FUNCTION eca__get_taxes(in_credit_id int) returns setof customertax AS $$ select * from customertax where customer_id = $1 union select * from vendortax where vendor_id = $1; $$ language sql; COMMENT ON FUNCTION eca__get_taxes(in_credit_id int) IS $$ Returns a set of taxable account id's.$$; --' CREATE OR REPLACE FUNCTION eca__set_taxes(in_credit_id int, in_tax_ids int[]) RETURNS bool AS $$ DECLARE eca entity_credit_account; iter int; BEGIN SELECT * FROM entity_credit_account into eca WHERE id = in_credit_id; IF eca.entity_class = 1 then DELETE FROM vendortax WHERE vendor_id = in_credit_id; FOR iter in array_lower(in_tax_ids, 1) .. array_upper(in_tax_ids, 1) LOOP INSERT INTO vendortax (vendor_id, chart_id) values (in_credit_id, in_tax_ids[iter]); END LOOP; ELSIF eca.entity_class = 2 then DELETE FROM customertax WHERE customer_id = in_credit_id; FOR iter in array_lower(in_tax_ids, 1) .. array_upper(in_tax_ids, 1) LOOP INSERT INTO customertax (customer_id, chart_id) values (in_credit_id, in_tax_ids[iter]); END LOOP; ELSE RAISE EXCEPTION 'Wrong entity class or credit account not found!'; END IF; RETURN TRUE; end; $$ language plpgsql; comment on function eca__set_taxes(in_credit_id int, in_tax_ids int[]) is $$Sets the tax values for the customer or vendor. The entity credit account must exist before calling this function, and must have a type of either 1 or 2. $$; CREATE OR REPLACE FUNCTION entity__save_notes(in_entity_id int, in_note text, in_subject text) RETURNS INT AS $$ DECLARE out_id int; BEGIN -- TODO, change this to create vector too INSERT INTO entity_note (ref_key, note_class, entity_id, note, vector, subject) VALUES (in_entity_id, 1, in_entity_id, in_note, '', in_subject); SELECT currval('note_id_seq') INTO out_id; RETURN out_id; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION entity__save_notes (in_entity_id int, in_note text, in_subject text) IS $$ Saves an entity-level note. Such a note is valid for all credit accounts attached to that entity. Returns the id of the note. $$; CREATE OR REPLACE FUNCTION eca__save_notes(in_credit_id int, in_note text, in_subject text) RETURNS INT AS $$ DECLARE out_id int; BEGIN -- TODO, change this to create vector too INSERT INTO eca_note (ref_key, note_class, note, vector, subject) VALUES (in_credit_id, 3, in_note, '', in_subject); SELECT currval('note_id_seq') INTO out_id; RETURN out_id; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION eca__save_notes (in_entity_id int, in_note text, in_subject text) IS $$ Saves an entity credit account-level note. Such a note is valid for only one credit account. Returns the id of the note. $$; CREATE OR REPLACE FUNCTION entity_credit_get_id_by_meta_number (in_meta_number text, in_account_class int) returns int AS $$ DECLARE out_credit_id int; BEGIN SELECT id INTO out_credit_id FROM entity_credit_account WHERE meta_number = in_meta_number AND entity_class = in_account_class; RETURN out_credit_id; END; $$ LANGUAGE plpgsql; COMMENT ON FUNCTION entity_credit_get_id_by_meta_number (in_meta_number text, in_account_class int) is $$ Returns the credit id from the meta_number and entity_class.$$; CREATE OR REPLACE FUNCTION entity_credit__get(in_id int) RETURNS entity_credit_account AS $$ SELECT * FROM entity_credit_account WHERE id = $1; $$ language sql; COMMENT ON FUNCTION entity_credit__get(in_id int) IS $$ Returns the entity credit account info.$$; CREATE OR REPLACE FUNCTION entity_list_contact_class() RETURNS SETOF contact_class AS $$ DECLARE out_row RECORD; BEGIN FOR out_row IN SELECT * FROM contact_class ORDER BY id LOOP RETURN NEXT out_row; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION entity_list_contact_class() IS $$ Returns a list of contact classes ordered by ID.$$; DROP TYPE IF EXISTS entity_credit_search_return CASCADE; CREATE TYPE entity_credit_search_return AS ( legal_name text, id int, entity_id int, entity_control_code text, entity_class int, discount numeric, taxincluded bool, creditlimit numeric, terms int2, meta_number text, credit_description text, business_id int, language_code text, pricegroup_id int, curr char(3), startdate date, enddate date, ar_ap_account_id int, cash_account_id int, tax_id text, threshold numeric ); DROP TYPE IF EXISTS entity_credit_retrieve CASCADE; CREATE TYPE entity_credit_retrieve AS ( id int, entity_id int, entity_class int, discount numeric, discount_terms int, taxincluded bool, creditlimit numeric, terms int2, meta_number text, description text, business_id int, language_code text, pricegroup_id int, curr text, startdate date, enddate date, ar_ap_account_id int, cash_account_id int, discount_account_id int, threshold numeric, control_code text, credit_id int, pay_to_name text, taxform_id int ); COMMENT ON TYPE entity_credit_search_return IS $$ This may change in 1.4 and should not be relied upon too much $$; CREATE OR REPLACE FUNCTION entity_credit_get_id (in_entity_id int, in_entity_class int, in_meta_number text) RETURNS int AS $$ DECLARE out_var int; BEGIN SELECT id INTO out_var FROM entity_credit_account WHERE entity_id = in_entity_id AND in_entity_class = entity_class AND in_meta_number = meta_number; RETURN out_var; END; $$ language plpgsql; COMMENT ON FUNCTION entity_credit_get_id (in_entity_id int, in_entity_class int, in_meta_number text) IS $$ Returns an entity credit id, based on entity_id, entity_class, and meta_number. This is the preferred way to locate an account if all three of these are known$$; CREATE OR REPLACE FUNCTION entity__list_credit (in_entity_id int, in_entity_class int) RETURNS SETOF entity_credit_retrieve AS $$ DECLARE out_row entity_credit_retrieve; BEGIN FOR out_row IN SELECT c.id, e.id, ec.entity_class, ec.discount, ec.discount_terms, ec.taxincluded, ec.creditlimit, ec.terms, ec.meta_number, ec.description, ec.business_id, ec.language_code, ec.pricegroup_id, ec.curr, ec.startdate, ec.enddate, ec.ar_ap_account_id, ec.cash_account_id, ec.discount_account_id, ec.threshold, e.control_code, ec.id, ec.pay_to_name, ec.taxform_id FROM company c JOIN entity e ON (c.entity_id = e.id) JOIN entity_credit_account ec ON (c.entity_id = ec.entity_id) WHERE e.id = in_entity_id AND ec.entity_class = CASE WHEN in_entity_class = 3 THEN 2 WHEN in_entity_class IS NULL THEN ec.entity_class ELSE in_entity_class END LOOP RETURN NEXT out_row; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION entity__list_credit (in_entity_id int, in_entity_class int) IS $$ Returns a list of entity credit account entries for the entity and of the entity class.$$; CREATE OR REPLACE FUNCTION company_retrieve (in_entity_id int) RETURNS company AS $$ DECLARE t_company company; BEGIN SELECT * INTO t_company FROM company WHERE entity_id = in_entity_id; RETURN t_company; END; $$ language plpgsql; COMMENT ON FUNCTION company_retrieve (in_entity_id int) IS $$ Returns all attributes for the company attached to the entity.$$; CREATE OR REPLACE FUNCTION entity__get_by_cc (in_control_code text) RETURNS SETOF entity AS $$ SELECT * FROM entity WHERE control_code = $1 $$ language sql; COMMENT ON FUNCTION entity__get_by_cc (in_control_code text) IS $$ Returns the entity row attached to the control code. $$; create or replace function save_taxform (in_country_code int, in_taxform_name text) RETURNS bool AS $$ BEGIN INSERT INTO country_tax_form(country_id, form_name) values (in_country_code, in_taxform_name); RETURN true; END; $$ LANGUAGE PLPGSQL; COMMENT ON function save_taxform (in_country_code int, in_taxform_name text) IS $$ Saves tax form information. Returns true or raises exception.$$; CREATE OR REPLACE FUNCTION list_taxforms (in_entity_id int) RETURNS SETOF country_tax_form AS $$ DECLARE t_country_tax_form country_tax_form; BEGIN FOR t_country_tax_form IN SELECT * FROM country_tax_form where country_id in(SELECT country_id from entity where id=in_entity_id) LOOP RETURN NEXT t_country_tax_form; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION list_taxforms (in_entity_id int) IS $$Returns a list of tax forms for the entity's country.$$; --' DROP TYPE IF EXISTS company_billing_info CASCADE; CREATE TYPE company_billing_info AS ( legal_name text, meta_number text, control_code text, tax_id text, street1 text, street2 text, street3 text, city text, state text, mail_code text, country text ); CREATE OR REPLACE FUNCTION company_get_billing_info (in_id int) returns company_billing_info as $$ DECLARE out_var company_billing_info; t_id INT; BEGIN select coalesce(eca.pay_to_name, c.legal_name), eca.meta_number, e.control_code, c.tax_id, a.line_one, a.line_two, a.line_three, a.city, a.state, a.mail_code, cc.name into out_var FROM company c JOIN entity e ON (c.entity_id = e.id) JOIN entity_credit_account eca ON (eca.entity_id = e.id) LEFT JOIN eca_to_location cl ON (eca.id = cl.credit_id) LEFT JOIN location a ON (a.id = cl.location_id) LEFT JOIN country cc ON (cc.id = a.country_id) WHERE eca.id = in_id AND (location_class = 1 or location_class is null); RETURN out_var; END; $$ language plpgsql; COMMENT ON FUNCTION company_get_billing_info (in_id int) IS $$ Returns billing information (billing name and address) for a given credit account.$$; DROP FUNCTION IF EXISTS company_save(int, text, int, text, text, int, text, int); CREATE OR REPLACE FUNCTION company_save ( in_id int, in_control_code text, in_entity_class int, in_name text, in_tax_id TEXT, in_entity_id int, in_sic_code text,in_country_id int ) RETURNS INT AS $$ DECLARE t_entity_id INT; t_company_id INT; t_control_code TEXT; BEGIN t_company_id := in_id; IF in_control_code IS NULL THEN t_control_code := setting_increment('company_control'); ELSE t_control_code := in_control_code; END IF; UPDATE entity SET name = in_name, entity_class = in_entity_class, control_code = in_control_code WHERE id = in_entity_id; IF FOUND THEN t_entity_id = in_entity_id; ELSE INSERT INTO entity (name, entity_class, control_code,country_id) VALUES (in_name, in_entity_class, t_control_code,in_country_id); t_entity_id := currval('entity_id_seq'); END IF; UPDATE company SET legal_name = in_name, tax_id = in_tax_id, sic_code = in_sic_code WHERE id = t_company_id; IF NOT FOUND THEN INSERT INTO company(entity_id, legal_name, tax_id, sic_code) VALUES (t_entity_id, in_name, in_tax_id, in_sic_code); END IF; RETURN t_entity_id; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION company_save ( in_id int, in_control_code text, in_entity_class int, in_name text, in_tax_id TEXT, in_entity_id int, in_sic_code text,in_country_id int ) is $$ Saves a company. Returns the id number of the record stored.$$; CREATE OR REPLACE FUNCTION pricegroup__list() RETURNS SETOF pricegroup AS $$ SELECT * FROM pricegroup ORDER BY pricegroup; $$ LANGUAGE SQL; COMMENT ON FUNCTION pricegroup__list() IS $$ Returns an alphabetically ordered pricegroup list.$$; DROP FUNCTION IF EXISTS entity_credit_save ( in_credit_id int, in_entity_class int, in_entity_id int, in_description text, in_discount numeric, in_taxincluded bool, in_creditlimit numeric, in_discount_terms int, in_terms int, in_meta_number varchar(32), in_business_id int, in_language varchar(6), in_pricegroup_id int, in_curr char, in_startdate date, in_enddate date, in_threshold NUMERIC, in_ar_ap_account_id int, in_cash_account_id int, in_pay_to_name text, in_taxform_id int); DROP FUNCTION IF EXISTS entity_credit_save ( in_credit_id int, in_entity_class int, in_entity_id int, in_description text, in_discount numeric, in_taxincluded bool, in_creditlimit numeric, in_discount_terms int, in_terms int, in_meta_number varchar(32), in_business_id int, in_language_code varchar(6), in_pricegroup_id int, in_curr char, in_startdate date, in_enddate date, in_threshold NUMERIC, in_ar_ap_account_id int, in_cash_account_id int, in_pay_to_name text, in_taxform_id int); CREATE OR REPLACE FUNCTION entity_credit_save ( in_credit_id int, in_entity_class int, in_entity_id int, in_description text, in_discount numeric, in_taxincluded bool, in_creditlimit numeric, in_discount_terms int, in_terms int, in_meta_number varchar(32), in_business_id int, in_language_code varchar(6), in_pricegroup_id int, in_curr char, in_startdate date, in_enddate date, in_threshold NUMERIC, in_ar_ap_account_id int, in_cash_account_id int, in_pay_to_name text, in_taxform_id int, in_discount_account_id int ) returns INT as $$ DECLARE t_entity_class int; l_id int; t_meta_number text; t_mn_default_key text; BEGIN -- TODO: Move to mapping table. IF in_entity_class = 1 THEN t_mn_default_key := 'vendornumber'; ELSIF in_entity_class = 2 THEN t_mn_default_key := 'customernumber'; END IF; IF in_meta_number IS NULL THEN t_meta_number := setting_increment(t_mn_default_key); ELSE t_meta_number := in_meta_number; END IF; update entity_credit_account SET discount = in_discount, taxincluded = in_taxincluded, creditlimit = in_creditlimit, description = in_description, terms = in_terms, ar_ap_account_id = in_ar_ap_account_id, cash_account_id = in_cash_account_id, discount_account_id = in_discount_account_id, meta_number = t_meta_number, business_id = in_business_id, language_code = in_language_code, pricegroup_id = in_pricegroup_id, curr = in_curr, startdate = in_startdate, enddate = in_enddate, threshold = in_threshold, discount_terms = in_discount_terms, pay_to_name = in_pay_to_name, taxform_id = in_taxform_id where id = in_credit_id; IF FOUND THEN RETURN in_credit_id; ELSE INSERT INTO entity_credit_account ( entity_id, entity_class, discount, description, taxincluded, creditlimit, terms, meta_number, business_id, language_code, pricegroup_id, curr, startdate, enddate, discount_terms, threshold, ar_ap_account_id, pay_to_name, taxform_id, cash_account_id, discount_account_id ) VALUES ( in_entity_id, in_entity_class, in_discount, in_description, in_taxincluded, in_creditlimit, in_terms, t_meta_number, in_business_id, in_language_code, in_pricegroup_id, in_curr, in_startdate, in_enddate, in_discount_terms, in_threshold, in_ar_ap_account_id, in_pay_to_name, in_taxform_id, in_cash_account_id, in_discount_account_id ); RETURN currval('entity_credit_account_id_seq'); END IF; END; $$ language 'plpgsql'; COMMENT ON FUNCTION entity_credit_save ( in_credit_id int, in_entity_class int, in_entity_id int, in_description text, in_discount numeric, in_taxincluded bool, in_creditlimit numeric, in_discount_terms int, in_terms int, in_meta_number varchar(32), in_business_id int, in_language_code varchar(6), in_pricegroup_id int, in_curr char, in_startdate date, in_enddate date, in_threshold NUMERIC, in_ar_ap_account_id int, in_cash_account_id int, in_pay_to_name text, in_taxform_id int, in_discount_account_id int ) IS $$ Saves an entity credit account. Returns the id of the record saved. $$; CREATE OR REPLACE FUNCTION company__list_locations(in_entity_id int) RETURNS SETOF location_result AS $$ DECLARE out_row RECORD; BEGIN FOR out_row IN SELECT l.id, l.line_one, l.line_two, l.line_three, l.city, l.state, l.mail_code, c.id, c.name, lc.id, lc.class FROM location l JOIN company_to_location ctl ON (ctl.location_id = l.id) JOIN location_class lc ON (ctl.location_class = lc.id) JOIN country c ON (c.id = l.country_id) WHERE ctl.company_id = (select id from company where entity_id = in_entity_id) ORDER BY lc.id, l.id, c.name LOOP RETURN NEXT out_row; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION company__list_locations(in_entity_id int) IS $$ Lists all locations for an entity.$$; DROP TYPE IF EXISTS contact_list CASCADE; CREATE TYPE contact_list AS ( class text, class_id int, description text, contact text ); CREATE OR REPLACE FUNCTION company__list_contacts(in_entity_id int) RETURNS SETOF contact_list AS $$ DECLARE out_row contact_list; BEGIN FOR out_row IN SELECT cl.class, cl.id, c.description, c.contact FROM company_to_contact c JOIN contact_class cl ON (c.contact_class_id = cl.id) WHERE company_id = (select id FROM company WHERE entity_id = in_entity_id) LOOP return next out_row; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION company__list_contacts(in_entity_id int) IS $$ Lists all contact info for the entity.$$; CREATE OR REPLACE FUNCTION company__list_bank_account(in_entity_id int) RETURNS SETOF entity_bank_account AS $$ DECLARE out_row entity_bank_account%ROWTYPE; BEGIN FOR out_row IN SELECT * from entity_bank_account where entity_id = in_entity_id LOOP RETURN NEXT out_row; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION company__list_bank_account(in_entity_id int) IS $$ Lists all bank accounts for the entity.$$; CREATE OR REPLACE FUNCTION eca__save_bank_account (in_entity_id int, in_credit_id int, in_bic text, in_iban text, in_bank_account_id int) RETURNS int AS $$ DECLARE out_id int; BEGIN UPDATE entity_bank_account SET bic = in_bic, iban = in_iban WHERE id = in_bank_account_id; IF FOUND THEN out_id = in_bank_account_id; ELSE INSERT INTO entity_bank_account(entity_id, bic, iban) VALUES(in_entity_id, in_bic, in_iban); SELECT CURRVAL('entity_bank_account_id_seq') INTO out_id ; END IF; IF in_credit_id IS NOT NULL THEN UPDATE entity_credit_account SET bank_account = out_id WHERE id = in_credit_id; END IF; RETURN out_id; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION eca__save_bank_account (in_entity_id int, in_credit_id int, in_bic text, in_iban text, in_bank_account_id int) IS $$ Saves bank account to the credit account.$$; CREATE OR REPLACE FUNCTION entity__save_bank_account (in_entity_id int, in_bic text, in_iban text, in_bank_account_id int) RETURNS int AS $$ DECLARE out_id int; BEGIN UPDATE entity_bank_account SET bic = in_bic, iban = in_iban WHERE id = in_bank_account_id; IF FOUND THEN out_id = in_bank_account_id; ELSE INSERT INTO entity_bank_account(entity_id, bic, iban) VALUES(in_entity_id, in_bic, in_iban); SELECT CURRVAL('entity_bank_account_id_seq') INTO out_id ; END IF; RETURN out_id; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION entity__save_bank_account (in_entity_id int, in_bic text, in_iban text, in_bank_account_id int) IS $$Saves a bank account to the entity.$$; CREATE OR REPLACE FUNCTION company__delete_contact (in_company_id int, in_contact_class_id int, in_contact text) returns bool as $$ BEGIN DELETE FROM company_to_contact WHERE company_id = in_company_id and contact_class_id = in_contact_class_id and contact= in_contact; RETURN FOUND; END; $$ language plpgsql; COMMENT ON FUNCTION company__delete_contact (in_company_id int, in_contact_class_id int, in_contact text) IS $$ Returns true if at least one record was deleted. False if no records were affected.$$; CREATE OR REPLACE FUNCTION eca__delete_contact (in_credit_id int, in_contact_class_id int, in_contact text) returns bool as $$ BEGIN DELETE FROM eca_to_contact WHERE credit_id = in_credit_id and contact_class_id = in_contact_class_id and contact= in_contact; RETURN FOUND; END; $$ language plpgsql; COMMENT ON FUNCTION eca__delete_contact (in_credit_id int, in_contact_class_id int, in_contact text) IS $$ Returns true if at least one record was deleted. False if no records were affected.$$; CREATE OR REPLACE FUNCTION company__save_contact (in_entity_id int, in_contact_class int, in_description text, in_contact text) RETURNS INT AS $$ DECLARE out_id int; BEGIN INSERT INTO company_to_contact(company_id, contact_class_id, description, contact) SELECT id, in_contact_class, in_description, in_contact FROM company WHERE entity_id = in_entity_id; RETURN 1; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION company__save_contact (in_entity_id int, in_contact_class int, in_description text, in_contact text) IS $$ Saves company contact information. The return value is meaningless. $$; DROP TYPE IF EXISTS entity_note_list CASCADE; CREATE TYPE entity_note_list AS ( id int, note_class int, note text ); CREATE OR REPLACE FUNCTION company__list_notes(in_entity_id int) RETURNS SETOF entity_note AS $$ DECLARE out_row record; BEGIN FOR out_row IN SELECT * FROM entity_note WHERE ref_key = in_entity_id ORDER BY created LOOP RETURN NEXT out_row; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION company__list_notes(in_entity_id int) IS $$ Returns a set of notes (including content) attached to the entity.$$; CREATE OR REPLACE FUNCTION eca__list_notes(in_credit_id int) RETURNS SETOF note AS $$ DECLARE out_row record; t_entity_id int; BEGIN -- ALERT: security definer function. Be extra careful about EXECUTE -- in here. --CT SELECT entity_id INTO t_entity_id FROM entity_credit_account WHERE id = in_credit_id; FOR out_row IN SELECT * FROM note WHERE (note_class = 3 and ref_key = in_credit_id) or (note_class = 1 and ref_key = t_entity_id) ORDER BY created LOOP RETURN NEXT out_row; END LOOP; END; $$ LANGUAGE PLPGSQL SECURITY DEFINER; COMMENT ON FUNCTION eca__list_notes(in_credit_id int) IS $$Returns a list of notes attached to the entity credit account.$$; REVOKE EXECUTE ON FUNCTION eca__list_notes(INT) FROM public; CREATE OR REPLACE FUNCTION company__next_id() returns bigint as $$ select nextval('company_id_seq'); $$ language 'sql'; CREATE OR REPLACE FUNCTION company__location_save ( in_entity_id int, in_location_id int, in_location_class int, in_line_one text, in_line_two text, in_city TEXT, in_state TEXT, in_mail_code text, in_country_code int, in_created date ) returns int AS $$ BEGIN return _entity_location_save( in_entity_id, in_location_id, in_location_class, in_line_one, in_line_two, '', in_city , in_state, in_mail_code, in_country_code); END; $$ language 'plpgsql'; COMMENT ON FUNCTION company__location_save ( in_entity_id int, in_location_id int, in_location_class int, in_line_one text, in_line_two text, in_city TEXT, in_state TEXT, in_mail_code text, in_country_code int, in_created date ) IS $$ Saves a location to a company. Returns the location id.$$; create or replace function _entity_location_save( in_entity_id int, in_location_id int, in_location_class int, in_line_one text, in_line_two text, in_line_three text, in_city TEXT, in_state TEXT, in_mail_code text, in_country_code int ) returns int AS $$ DECLARE l_row location; l_id INT; t_company_id int; BEGIN SELECT id INTO t_company_id FROM company WHERE entity_id = in_entity_id; DELETE FROM company_to_location WHERE company_id = t_company_id AND location_class = in_location_class AND location_id = in_location_id; SELECT location_save(NULL, in_line_one, in_line_two, in_line_three, in_city, in_state, in_mail_code, in_country_code) INTO l_id; INSERT INTO company_to_location (company_id, location_class, location_id) VALUES (t_company_id, in_location_class, l_id); RETURN l_id; END; $$ language 'plpgsql'; COMMENT ON FUNCTION _entity_location_save( in_entity_id int, in_location_id int, in_location_class int, in_line_one text, in_line_two text, in_line_three text, in_city TEXT, in_state TEXT, in_mail_code text, in_country_code int ) IS $$ Private method for storing locations to an entity. Do not call directly. Returns the location id that was inserted or updated.$$; create or replace function eca__location_save( in_credit_id int, in_location_id int, in_location_class int, in_line_one text, in_line_two text, in_line_three text, in_city TEXT, in_state TEXT, in_mail_code text, in_country_code int, in_old_location_class int ) returns int AS $$ DECLARE l_row location; l_id INT; l_orig_id INT; BEGIN UPDATE eca_to_location SET location_class = in_location_class WHERE credit_id = in_credit_id AND location_class = in_old_location_class AND location_id = in_location_id; IF FOUND THEN SELECT location_save( in_location_id, in_line_one, in_line_two, in_line_three, in_city, in_state, in_mail_code, in_country_code ) INTO l_id; ELSE SELECT location_save( NULL, in_line_one, in_line_two, in_line_three, in_city, in_state, in_mail_code, in_country_code ) INTO l_id; INSERT INTO eca_to_location (credit_id, location_class, location_id) VALUES (in_credit_id, in_location_class, l_id); END IF; RETURN l_id; END; $$ language 'plpgsql'; COMMENT ON function eca__location_save( in_credit_id int, in_location_id int, in_location_class int, in_line_one text, in_line_two text, in_line_three text, in_city TEXT, in_state TEXT, in_mail_code text, in_country_code int, in_old_location_class int ) IS $$ Saves a location to an entity credit account. Returns id of saved record.$$; CREATE OR REPLACE FUNCTION eca__delete_location (in_credit_id int, in_location_id int, in_location_class int) RETURNS BOOL AS $$ BEGIN DELETE FROM eca_to_location WHERE credit_id = in_credit_id AND location_id = in_location_id AND location_class = in_location_class; RETURN FOUND; END; $$ language plpgsql; COMMENT ON FUNCTION eca__delete_location (in_credit_id int, in_location_id int, in_location_class int) IS $$ Deletes the record identified. Returns true if successful, false if no record found.$$; CREATE OR REPLACE FUNCTION company__delete_location (in_company_id int, in_location_id int, in_location_class int) RETURNS BOOL AS $$ BEGIN DELETE FROM eca_to_location WHERE company_id = in_company_id AND location_id = in_location_id AND location_class = in_location_class; RETURN FOUND; END; $$ language plpgsql; COMMENT ON FUNCTION company__delete_location (in_company_id int, in_location_id int, in_location_class int) IS $$ Deletes the record identified. Returns true if successful, false if no record found.$$; CREATE OR REPLACE FUNCTION eca__list_locations(in_credit_id int) RETURNS SETOF location_result AS $$ DECLARE out_row RECORD; BEGIN FOR out_row IN SELECT l.id, l.line_one, l.line_two, l.line_three, l.city, l.state, l.mail_code, c.id, c.name, lc.id, lc.class FROM location l JOIN eca_to_location ctl ON (ctl.location_id = l.id) JOIN location_class lc ON (ctl.location_class = lc.id) JOIN country c ON (c.id = l.country_id) WHERE ctl.credit_id = in_credit_id ORDER BY lc.id, l.id, c.name LOOP RETURN NEXT out_row; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION eca__list_locations(in_credit_id int) IS $$ Returns a list of locations attached to the credit account.$$; CREATE OR REPLACE FUNCTION eca__list_contacts(in_credit_id int) RETURNS SETOF contact_list AS $$ DECLARE out_row contact_list; BEGIN FOR out_row IN SELECT cl.class, cl.id, c.description, c.contact FROM eca_to_contact c JOIN contact_class cl ON (c.contact_class_id = cl.id) WHERE credit_id = in_credit_id LOOP return next out_row; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION eca__list_contacts(in_credit_id int) IS $$ Returns a list of contact info attached to the entity credit account.$$; CREATE OR REPLACE FUNCTION eca__save_contact (in_credit_id int, in_contact_class int, in_description text, in_contact text, in_old_contact text, in_old_contact_class int) RETURNS INT AS $$ DECLARE out_id int; BEGIN PERFORM * FROM eca_to_contact WHERE credit_id = in_credit_id AND contact_class_id = in_old_contact_class AND contact = in_old_contact; IF FOUND THEN UPDATE eca_to_contact SET contact = in_contact, description = in_description, contact_class_id = in_contact_class WHERE credit_id = in_credit_id AND contact_class_id = in_old_contact_class AND contact = in_old_contact; ELSE INSERT INTO eca_to_contact(credit_id, contact_class_id, description, contact) VALUES (in_credit_id, in_contact_class, in_description, in_contact); END IF; RETURN 1; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION eca__save_contact (in_credit_id int, in_contact_class int, in_description text, in_contact text, in_old_contact text, in_old_contact_class int) IS $$ Saves the contact record at the entity credit account level. Returns 1.$$; CREATE OR REPLACE FUNCTION company__get_all_accounts ( in_entity_id int, in_entity_class int ) RETURNS SETOF entity_credit_account AS $body$ SELECT * FROM entity_credit_account WHERE entity_id = $1 AND entity_class = $2; $body$ language SQL; COMMENT ON FUNCTION company__get_all_accounts ( in_entity_id int, in_entity_class int ) IS $$ Returns a list of all entity credit accounts attached to that entity.$$; -- pricematrix CREATE OR REPLACE FUNCTION eca__get_pricematrix_by_pricegroup(in_credit_id int) RETURNS SETOF eca__pricematrix AS $$ SELECT pc.parts_id, p.partnumber, p.description, pc.credit_id, pc.pricebreak, pc.sellprice, NULL::numeric, NULL::int, NULL::text, pc.validfrom, pc.validto, pc.curr, pc.entry_id FROM partscustomer pc JOIN parts p on pc.parts_id = p.id JOIN entity_credit_account eca ON pc.pricegroup_id = eca.pricegroup_id WHERE eca.id = $1 AND eca.entity_class = 2 $$ LANGUAGE SQL; CREATE OR REPLACE FUNCTION eca__get_pricematrix(in_credit_id int) RETURNS SETOF eca__pricematrix AS $$ SELECT pc.parts_id, p.partnumber, p.description, pc.credit_id, pc.pricebreak, pc.sellprice, NULL, NULL::int, NULL, pc.validfrom, pc.validto, pc.curr, pc.entry_id FROM partscustomer pc JOIN parts p on pc.parts_id = p.id JOIN entity_credit_account eca ON pc.credit_id = eca.id WHERE pc.credit_id = $1 AND eca.entity_class = 2 UNION SELECT pv.parts_id, p.partnumber, p.description, pv.credit_id, NULL, NULL, pv.lastcost, pv.leadtime::int, pv.partnumber, NULL, NULL, pv.curr, pv.entry_id FROM partsvendor pv JOIN parts p on pv.parts_id = p.id JOIN entity_credit_account eca ON pv.credit_id = eca.id WHERE pv.credit_id = $1 and eca.entity_class = 1 ORDER BY partnumber, validfrom $$ language sql; COMMENT ON FUNCTION eca__get_pricematrix(in_credit_id int) IS $$ This returns the pricematrix for the customer or vendor (entity_credit_account identified by in_id), orderd by partnumber, validfrom $$; CREATE OR REPLACE FUNCTION eca__delete_pricematrix (in_credit_id int, in_entry_id int) RETURNS BOOL AS $$ DECLARE retval bool; BEGIN retval := false; DELETE FROM partsvendor WHERE entry_id = in_entry_id AND credit_id = in_credit_id; retval := FOUND; DELETE FROM partscustomer WHERE entry_id = in_entry_id AND credit_id = in_credit_id; RETURN FOUND or retval; END; $$ language plpgsql; CREATE OR REPLACE FUNCTION eca__save_pricematrix (in_parts_id int, in_credit_id int, in_pricebreak numeric, in_price numeric, in_lead_time int2, in_partnumber text, in_validfrom date, in_validto date, in_curr char(3), in_entry_id int) RETURNS eca__pricematrix AS $$ DECLARE retval eca__pricematrix; t_insert bool; BEGIN t_insert := false; PERFORM * FROM entity_credit_account WHERE id = in_credit_id AND entity_class = 1; IF FOUND THEN -- VENDOR UPDATE partsvendor SET lastcost = in_price, leadtime = in_lead_time, partnumber = in_partnumber, curr = in_curr WHERE credit_id = in_credit_id AND entry_id = in_entry_id; IF NOT FOUND THEN INSERT INTO partsvendor (parts_id, credit_id, lastcost, leadtime, partnumber, curr) VALUES (in_parts_id, in_credit_id, in_price, in_leadtime::int2, in_partnumber, in_curr); END IF; SELECT pv.parts_id, p.partnumber, p.description, pv.credit_id, NULL, NULL, pv.lastcost, pv.leadtime::int, pv.partnumber, NULL, NULL, pv.curr, pv.entry_id INTO retval FROM partsvendor pv JOIN parts p ON p.id = pv.parts_id WHERE parts_id = in_parts_id and credit_id = in_credit_id; RETURN retval; END IF; PERFORM * FROM entity_credit_account WHERE id = in_credit_id AND entity_class = 2; IF FOUND THEN -- CUSTOMER UPDATE partscustomer SET pricebreak = in_pricebreak, sellprice = in_price, validfrom = in_validfrom, validto = in_validto, curr = in_curr WHERE entry_id = in_entry_id and credit_id = in_credit_id; IF NOT FOUND THEN INSERT INTO partscustomer (parts_id, credit_id, sellprice, validfrom, validto, curr) VALUES (in_parts_id, in_credit_id, in_price, in_validfrom, in_validto, in_curr); t_insert := true; END IF; SELECT pc.parts_id, p.partnumber, p.description, pc.credit_id, pc.pricebreak, pc.sellprice, NULL, NULL, NULL, pc.validfrom, pc.validto, pc.curr, pc.entry_id INTO retval FROM partscustomer pc JOIN parts p on pc.parts_id = p.id WHERE entry_id = CASE WHEN t_insert THEN currval('partscustomer_entry_id_seq') ELSE in_entry_id END; RETURN retval; END IF; RAISE EXCEPTION 'No valid entity credit account found'; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION eca__get_pricematrix(in_id int) IS $$ This returns the pricematrix for the customer or vendor (entity_credit_account identified by in_id), orderd by partnumber, validfrom $$; CREATE OR REPLACE FUNCTION eca__delete_pricematrix (in_credit_id int, in_entry_id int) RETURNS BOOL AS $$ DECLARE retval bool; BEGIN retval := false; DELETE FROM partsvendor WHERE entry_id = in_entry_id AND credit_id = in_credit_id; retval := FOUND; DELETE FROM partscustomer WHERE entry_id = in_entry_id AND credit_id = in_credit_id; RETURN FOUND or retval; END; $$ language plpgsql; CREATE OR REPLACE FUNCTION pricelist__save (in_parts_id int, in_credit_id int, in_pricebreak numeric, in_price numeric, in_lead_time int2, in_partnumber text, in_validfrom date, in_validto date, in_curr char(3), in_entry_id int) RETURNS eca__pricematrix AS $$ DECLARE retval eca__pricematrix; t_insert bool; t_entity_class int; BEGIN t_insert := false; SELECT entity_class INTO t_entity_class FROM entity_credit_account WHERE id = in_credit_id; IF t_entity_class = 1 THEN -- VENDOR UPDATE partsvendor SET lastcost = in_price, leadtime = in_lead_time, partnumber = in_partnumber, curr = in_curr WHERE credit_id = in_credit_id AND entry_id = in_entry_id; IF NOT FOUND THEN INSERT INTO partsvendor (parts_id, credit_id, lastcost, leadtime, partnumber, curr) VALUES (in_parts_id, in_credit_id, in_price, in_leadtime::int2, in_partnumber, in_curr); END IF; SELECT pv.parts_id, p.partnumber, p.description, pv.credit_id, NULL, NULL, pv.lastcost, pv.leadtime::int, pv.partnumber, NULL, NULL, pv.curr, pv.entry_id INTO retval FROM partsvendor pv JOIN parts p ON p.id = pv.parts_id WHERE parts_id = in_parts_id and credit_id = in_credit_id; RETURN retval; ELSIF t_entity_class = 2 THEN -- CUSTOMER UPDATE partscustomer SET pricebreak = in_pricebreak, sellprice = in_price, validfrom = in_validfrom, validto = in_validto, curr = in_curr WHERE entry_id = in_entry_id and credit_id = in_credit_id; IF NOT FOUND THEN INSERT INTO partscustomer (parts_id, credit_id, sellprice, validfrom, validto, curr) VALUES (in_parts_id, in_credit_id, in_price, in_validfrom, in_validto, in_curr); t_insert := true; END IF; SELECT pc.parts_id, p.partnumber, p.description, pc.credit_id, pc.pricebreak, pc.sellprice, NULL, NULL, NULL, pc.validfrom, pc.validto, pc.curr, pc.entry_id INTO retval FROM partscustomer pc JOIN parts p on pc.parts_id = p.id WHERE entry_id = CASE WHEN t_insert THEN currval('partscustomer_entry_id_seq') ELSE in_entry_id END; RETURN retval; ELSE RAISE EXCEPTION 'No valid entity credit account found'; END IF; END; $$ LANGUAGE PLPGSQL; CREATE OR REPLACE FUNCTION pricelist__delete(entry_id int, credit_id int) returns bool as $$ delete from partscustomer where entry_id = $1 and credit_id = $2; delete from partsvendor where entry_id = $1 and credit_id = $2; select true; $$ language sql; COMMIT; ledgersmb/sql/modules/Parts.sql0000644000000000000000000000063012007101511015564 0ustar rootrootBEGIN; CREATE OR REPLACE FUNCTION parts__search_lite (in_partnumber text, in_description text) RETURNS SETOF parts AS $$ SELECT * FROM parts WHERE ($1 IS NULL OR (partnumber like $1 || '%')) AND ($2 IS NULL OR (description @@ plainto_tsquery(get_default_lang()::regconfig, $2))) AND not obsolete ORDER BY partnumber; $$ LANGUAGE SQL; COMMIT; ledgersmb/sql/modules/Customer.sql0000644000000000000000000000311711311500705016304 0ustar rootrootCREATE OR REPLACE FUNCTION customer_location_save ( in_entity_id int, in_location_class int, in_line_one text, in_line_two text, in_line_three text, in_city TEXT, in_state text, in_mail_code text, in_country_id int ) returns int AS $$ BEGIN return _entity_location_save( in_entity_id, NULL, in_location_class, in_line_one, in_line_two, in_line_three, in_city, in_state, in_mail_code, in_country_id); END; $$ language 'plpgsql'; /* Disabling until we can work on this a little more. CREATE OR REPLACE FUNCTION customer_search(in_pattern TEXT) returns setof customer_search_return as $$ -- searches customer name, account number, street address, city, state, -- other location-based stuff declare v_row customer_search_return; query text; begin for v_row in select c.legal_name, v.* from customer v join company c on c.entity_id = v.entity_id join entity e on e.id = v.entity_id join company_to_location ctl on c.id = ctl.company_id join location l on l.id = ctl.location_id where l.line_one % in_pattern OR l.line_two % in_pattern OR l.line_three % in_pattern OR l.city_province % in_pattern OR c.legal_name % in_pattern OR e.name % in_pattern LOOP RETURN NEXT v_row; END LOOP; RETURN; end; $$ language 'plpgsql'; */ ledgersmb/sql/modules/Settings.sql0000644000000000000000000000573311612131412016310 0ustar rootroot-- VERSION 1.3.0 -- Copyright (C) 2011 LedgerSMB Core Team. Licensed under the GNU General -- Public License v 2 or at your option any later version. -- Docstrings already added to this file. CREATE OR REPLACE FUNCTION setting_set (in_key varchar, in_value varchar) RETURNS BOOL AS $$ BEGIN UPDATE defaults SET value = in_value WHERE setting_key = in_key; IF NOT FOUND THEN INSERT INTO defaults (setting_key, value) VALUES (in_setting_key, in_value); END IF; RETURN TRUE; END; $$ language plpgsql; COMMENT ON FUNCTION setting_set (in_key varchar, in_value varchar) IS $$ sets a value in the defaults thable and returns true if successful.$$; CREATE OR REPLACE FUNCTION setting_get (in_key varchar) RETURNS defaults AS $$ SELECT * FROM defaults WHERE setting_key = $1; $$ LANGUAGE sql; COMMENT ON FUNCTION setting_get (in_key varchar) IS $$ Returns the value of the setting in the defaults table.$$; CREATE OR REPLACE FUNCTION setting_get_default_accounts () RETURNS SETOF defaults AS $$ DECLARE account defaults%ROWTYPE; BEGIN FOR account IN SELECT * FROM defaults WHERE setting_key like '%accno_id' ORDER BY setting_key LOOP RETURN NEXT account; END LOOP; END; $$ LANGUAGE plpgsql; COMMENT ON FUNCTION setting_get_default_accounts () IS $$ Returns a set of settings for default accounts.$$; CREATE OR REPLACE FUNCTION setting_increment (in_key varchar) returns varchar AS $$ DECLARE base_value VARCHAR; raw_value VARCHAR; increment INTEGER; inc_length INTEGER; new_value VARCHAR; BEGIN SELECT value INTO raw_value FROM defaults WHERE setting_key = in_key FOR UPDATE; SELECT substring(raw_value from '(' || E'\\' || 'd*)(' || E'\\' || 'D*|<' || E'\\' || '?lsmb [^<>] ' || E'\\' || '?>)*$') INTO base_value; IF base_value like '0%' THEN increment := base_value::integer + 1; SELECT char_length(increment::text) INTO inc_length; SELECT overlay(base_value placing increment::varchar from (select char_length(base_value) - inc_length + 1) for inc_length) INTO new_value; ELSE new_value := base_value::integer + 1; END IF; SELECT regexp_replace(raw_value, base_value, new_value) INTO new_value; UPDATE defaults SET value = new_value WHERE setting_key = in_key; return new_value; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION setting_increment (in_key varchar) IS $$This function takes a value for a sequence in the defaults table and increments it. Leading zeroes and spaces are preserved as placeholders. Currently now() - (SELECT value FROM defaults WHERE setting_key = 'timeout')::interval AND users_id = (select id from users where username = SESSION_USER); IF FOUND THEN SELECT * INTO out_row FROM session WHERE session_id = in_session_id; ELSE DELETE FROM SESSION WHERE users_id IN (select id from users where username = SESSION_USER); -- the above query also releases all discretionary locks by the -- session IF NOT FOUND THEN PERFORM id FROM users WHERE username = SESSION_USER; IF NOT FOUND THEN RAISE EXCEPTION 'User Not Known'; END IF; END IF; INSERT INTO session(users_id, token, last_used) SELECT id, md5(random()::text), now() FROM users WHERE username = SESSION_USER; SELECT * INTO out_row FROM session WHERE session_id = currval('session_session_id_seq'); END IF; RETURN out_row; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION session_check(int, text) IS $$ Returns a session row. If no session exists, creates one. The row returned is the current, active session. $$; CREATE OR REPLACE FUNCTION unlock_all() RETURNS BOOL AS $$ BEGIN UPDATE transactions SET locked_by = NULL where locked_by IN (select session_id from session WHERE users_id = (SELECT id FROM users WHERE username = SESSION_USER)); RETURN FOUND; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION unlock_all() IS $$Releases all pessimistic locks against transactions. These locks are again only advisory, and the application may choose to handle them or not. Returns true if any transactions were unlocked, false otherwise.$$; CREATE OR REPLACE FUNCTION unlock(in_id int) RETURNS BOOL AS $$ BEGIN UPDATE transactions SET locked_by = NULL WHERE id = in_id AND locked_by IN (SELECT session_id FROM session WHERE users_id = (SELECT id FROM users WHERE username = SESSION_USER)); RETURN FOUND; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION unlock(in_id int) IS $$Releases a pessimistic locks against a transaction, if that transaciton, as identified by in_id exists, and if it is locked by the current session. These locks are again only advisory, and the application may choose to handle them or not. Returns true if the transaction was unlocked by this routine, false otherwise.$$; ledgersmb/sql/modules/Vendor.sql0000644000000000000000000000243611311500705015743 0ustar rootroot -- TODO: Move indexes to Pg-database /* Disabling until we can do some more refactoring here. CREATE OR REPLACE FUNCTION vendor_search(in_name TEXT, in_address TEXT, in_city_prov TEXT) RETURNS SETOF vendor_search_return AS $$ -- searches vendor name, account number, street address, city, state, -- other location-based stuff declare v_row vendor_search_return; query text; begin for v_row in select c.legal_name, v.* from vendor v join company c on c.entity_id = v.entity_id join entity e on e.id = v.entity_id join company_to_location ctl on c.id = ctl.company_id join location l on l.id = ctl.location_id where ( l.line_one % in_address OR l.line_two % in_address OR l.line_three % in_address ) OR l.city_province % in_city_prov OR ( c.legal_name % in_name OR e.name % in_name ) LOOP RETURN NEXT v_row; END LOOP; RETURN; end; $$ language 'plpgsql'; */ ledgersmb/sql/modules/Defaults.sql0000644000000000000000000000140311610161025016246 0ustar rootroot -- Copyright (C) 2011 LedgerSMB Core Team. Licensed under the GNU General -- Public License v 2 or at your option any later version. -- Docstrings already added to this file. -- Probably want to move this to the Settings module -CT CREATE OR REPLACE FUNCTION defaults_get_defaultcurrency() RETURNS SETOF char(3) AS $$ DECLARE defaultcurrency defaults.value%TYPE; BEGIN SELECT INTO defaultcurrency substr(value,1,3) FROM defaults WHERE setting_key = 'curr'; RETURN NEXT defaultcurrency; END; $$ language plpgsql; COMMENT ON FUNCTION defaults_get_defaultcurrency() IS $$ This function return the default currency asigned by the program. $$; ledgersmb/sql/modules/Location.sql0000644000000000000000000001217711605320012016256 0ustar rootroot-- VERSION 1.3.0 CREATE OR REPLACE FUNCTION location_list_class() RETURNS SETOF location_class AS $$ DECLARE out_row RECORD; BEGIN FOR out_row IN SELECT * FROM location_class ORDER BY id LOOP RETURN NEXT out_row; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION location_list_class() IS $$ Lists location classes, by default in order entered.$$; CREATE OR REPLACE FUNCTION location_list_country() RETURNS SETOF country AS $$ DECLARE out_row RECORD; BEGIN FOR out_row IN SELECT * FROM country ORDER BY name LOOP RETURN NEXT out_row; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION location_list_country() IS $$ Lists countries, by default in alphabetical order.$$; CREATE OR REPLACE FUNCTION location_save (in_location_id int, in_address1 text, in_address2 text, in_address3 text, in_city text, in_state text, in_zipcode text, in_country int) returns integer AS $$ DECLARE location_id integer; location_row RECORD; BEGIN IF in_location_id IS NULL THEN SELECT id INTO location_id FROM location WHERE line_one = in_address1 AND line_two = in_address2 AND line_three = in_address3 AND in_city = city AND in_state = state AND in_zipcode = mail_code AND in_country = country_id LIMIT 1; IF NOT FOUND THEN -- Straight insert. location_id = nextval('location_id_seq'); INSERT INTO location ( id, line_one, line_two, line_three, city, state, mail_code, country_id) VALUES ( location_id, in_address1, in_address2, in_address3, in_city, in_state, in_zipcode, in_country ); END IF; return location_id; ELSE RAISE NOTICE 'Overwriting location id %', in_location_id; -- Test it. SELECT * INTO location_row FROM location WHERE id = in_location_id; IF NOT FOUND THEN -- Tricky users are lying to us. RAISE EXCEPTION 'location_save called with nonexistant location ID %', in_location_id; ELSE -- Okay, we're good. UPDATE location SET line_one = in_address1, line_two = in_address2, line_three = in_address3, city = in_city, state = in_state, mail_code = in_zipcode, country_id = in_country WHERE id = in_location_id; return in_location_id; END IF; END IF; END; $$ LANGUAGE PLPGSQL; COMMENT ON function location_save (in_location_id int, in_address1 text, in_address2 text, in_address3 text, in_city text, in_state text, in_zipcode text, in_country int) IS $$ Note that this does NOT override the data in the database unless in_location_id is specified. Instead we search for locations matching the desired specifications and if none are found, we insert one. Either way, the return value of the location can be used for mapping to other things. This is necessary because locations are only loosly coupled with entities, etc.$$; CREATE OR REPLACE FUNCTION location__get (in_id integer) returns location AS $$ DECLARE out_location location%ROWTYPE; BEGIN SELECT * INTO out_location FROM location WHERE id = in_id; RETURN out_location; END; $$ language plpgsql; COMMENT ON FUNCTION location__get (in_id integer) IS $$ Returns the location specified by in_id.$$; CREATE OR REPLACE FUNCTION location_search (in_address1 varchar, in_address2 varchar, in_city varchar, in_state varchar, in_zipcode varchar, in_country varchar) RETURNS SETOF location AS $$ DECLARE out_location location%ROWTYPE; BEGIN FOR out_location IN SELECT * FROM location WHERE address1 ilike '%' || in_address1 || '%' AND address2 ilike '%' || in_address2 || '%' AND in_city ilike '%' || in_city || '%' AND in_state ilike '%' || in_state || '%' AND in_zipcode ilike '%' || in_zipcode || '%' AND in_country ilike '%' || in_country || '%' LOOP RETURN NEXT out_location; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION location_search (in_address1 varchar, in_address2 varchar, in_city varchar, in_state varchar, in_zipcode varchar, in_country varchar) IS $$ Returns matching locations. All matches may be partial.$$; CREATE OR REPLACE FUNCTION location_list_all () RETURNS SETOF location AS $$ DECLARE out_location location%ROWTYPE; BEGIN FOR out_location IN SELECT * FROM location ORDER BY country, state, city LOOP RETURN NEXT out_location; END LOOP; END; $$ LANGUAGE plpgsql; COMMENT ON FUNCTION location_list_all () is $$ Returns all locations, ordered by country, state, and city. $$; CREATE OR REPLACE FUNCTION location_delete (in_id integer) RETURNS VOID AS $$ BEGIN DELETE FROM location WHERE id = in_id; END; $$ language plpgsql; COMMENT ON FUNCTION location_delete (in_id integer) IS $$ DELETES the location specified by in_id. Does not return a value.$$; CREATE TYPE location_result AS ( id int, line_one text, line_two text, line_three text, city text, state text, mail_code text, country_id int, country text, class_id int, class text ); ledgersmb/sql/modules/admin.sql0000644000000000000000000005232612054276417015620 0ustar rootroot -- Copyright (C) 2011 LedgerSMB Core Team. Licensed under the GNU General -- Public License v 2 or at your option any later version. -- Docstrings already added to this file. -- README: This module is unlike most others in that it requires most functions -- to run as superuser. For this reason it is CRITICAL that the following -- practices are adhered to: -- 1: When using EXECUTE, all user-supplied information MUST be passed through -- quote_literal. -- 2: This file MUST be frequently audited to ensure the above rule is followed -- -- -CT -- work in progress, not documenting yet. CREATE OR REPLACE FUNCTION admin__add_user_to_role(in_username TEXT, in_role TEXT) returns INT AS $$ declare stmt TEXT; a_role name; a_user name; BEGIN -- Issue the grant select rolname into a_role from pg_roles where rolname = in_role; IF NOT FOUND THEN RAISE EXCEPTION 'Cannot grant permissions of a non-existant role.'; END IF; select rolname into a_user from pg_roles where rolname = in_username; IF NOT FOUND THEN RAISE EXCEPTION 'Cannot grant permissions to a non-existant user.'; END IF; stmt := 'GRANT '|| quote_ident(in_role) ||' to '|| quote_ident(in_username); EXECUTE stmt; insert into lsmb_roles (user_id, role) SELECT id, in_role from users where username = in_username; return 1; END; $$ language 'plpgsql' security definer; REVOKE EXECUTE ON FUNCTION admin__add_user_to_role(TEXT, TEXT) FROM PUBLIC; -- work in progress. Not documenting yet. CREATE OR REPLACE FUNCTION admin__remove_user_from_role(in_username TEXT, in_role TEXT) returns INT AS $$ declare stmt TEXT; a_role name; a_user name; BEGIN -- Issue the grant select rolname into a_role from pg_roles where rolname = in_role; IF NOT FOUND THEN RAISE EXCEPTION 'Cannot revoke permissions of a non-existant role.'; END IF; select rolname into a_user from pg_roles where rolname = in_username; IF NOT FOUND THEN RAISE EXCEPTION 'Cannot revoke permissions from a non-existant user.'; END IF; stmt := 'REVOKE '|| quote_ident(in_role) ||' FROM '|| quote_ident(in_username); EXECUTE stmt; return 1; END; $$ language 'plpgsql' SECURITY DEFINER; REVOKE EXECUTE ON FUNCTION admin__remove_user_from_role(TEXT, TEXT) FROM PUBLIC; -- work in progress. Not documenting yet. CREATE OR REPLACE FUNCTION admin__add_function_to_group(in_func TEXT, in_role TEXT) returns INT AS $$ declare stmt TEXT; a_role name; a_user name; BEGIN -- Issue the grant select rolname into a_role from pg_roles where rolname = in_role; IF NOT FOUND THEN RAISE EXCEPTION 'Cannot grant permissions of a non-existant role.'; END IF; select rolname into a_user from pg_roles where rolname = in_username; IF NOT FOUND THEN RAISE EXCEPTION 'Cannot grant permissions to a non-existant user.'; END IF; stmt := 'GRANT EXECUTE ON FUNCTION '|| quote_ident(in_func) ||' to '|| quote_ident(in_role); EXECUTE stmt; return 1; END; $$ language 'plpgsql' SECURITY DEFINER; REVOKE EXECUTE ON FUNCTION admin__add_function_to_group(TEXT, TEXT) FROM PUBLIC; -- work in progress, not documenting yet. CREATE OR REPLACE FUNCTION admin__remove_function_from_group(in_func TEXT, in_role TEXT) returns INT AS $$ declare stmt TEXT; a_role name; a_user name; BEGIN -- Issue the grant select rolname into a_role from pg_roles where rolname = in_role; IF NOT FOUND THEN RAISE EXCEPTION 'Cannot revoke permissions of non-existant role $.'; END IF; select rolname into a_user from pg_roles where rolname = in_username; IF NOT FOUND THEN RAISE EXCEPTION 'Cannot revoke permissions from a non-existant function.'; END IF; stmt := 'REVOKE EXECUTE ON FUNCTION '|| quote_ident(in_func) ||' FROM '|| quote_ident(in_role); EXECUTE stmt; return 1; END; $$ language 'plpgsql' SECURITY DEFINER; REVOKE EXECUTE ON FUNCTION admin__remove_function_from_group(text, text) FROM public; -- not even sure if these should be here --CT --CREATE OR REPLACE FUNCTION admin__add_table_to_group(in_table TEXT, in_role TEXT, in_perm TEXT) returns INT AS $$ -- Do we need this table stuff at the moment? CT -- declare -- stmt TEXT; -- a_role name; -- a_user name; -- BEGIN -- Issue the grant -- select rolname into a_role from pg_roles where rolname = in_role; -- IF NOT FOUND THEN -- RAISE EXCEPTION 'Cannot grant permissions of a non-existant role.'; -- END IF; -- select table_name into a_table from information_schema.tables -- where table_schema NOT IN ('information_schema','pg_catalog','pg_toast') -- and table_type='BASE TABLE' -- and table_name = in_table; -- IF NOT FOUND THEN -- RAISE EXCEPTION 'Cannot grant permissions to a non-existant table.'; -- END IF; -- if lower(in_perm) not in ('select','insert','update','delete') THEN -- raise exception 'Cannot add unknown permission'; -- END IF; -- stmt := 'GRANT '|| quote_ident(in_perm) || 'ON TABLE '|| quote_ident(in_table) ||' to '|| quote_ident(in_role); -- EXECUTE stmt; -- return 1; -- END; --$$ language 'plpgsql'; --CREATE OR REPLACE FUNCTION admin__remove_table_from_group(in_table TEXT, in_role TEXT) returns INT AS $$ -- do we need this table stuff at the moment? CT -- declare -- stmt TEXT; -- a_role name; -- a_table text; -- BEGIN -- Issue the grant -- select rolname into a_role from pg_roles where rolname = in_role; -- IF NOT FOUND THEN -- RAISE EXCEPTION 'Cannot revoke permissions of a non-existant role.'; -- END IF; -- -- select table_name into a_table from information_schema.tables -- where table_schema NOT IN ('information_schema','pg_catalog','pg_toast') -- and table_type='BASE TABLE' -- and table_name = in_table; -- IF NOT FOUND THEN -- RAISE EXCEPTION 'Cannot revoke permissions from a non-existant table.'; -- END IF; -- stmt := 'REVOKE '|| quote_literal(in_role) ||' FROM '|| quote_literal(in_user); -- EXECUTE stmt; -- return 1; -- END; --$$ language 'plpgsql'; CREATE OR REPLACE FUNCTION admin__get_user(in_user_id INT) returns setof users as $$ DECLARE a_user users; BEGIN select * into a_user from users where id = in_user_id; return next a_user; return; END; $$ language plpgsql; COMMENT ON FUNCTION admin__get_user(in_user_id INT) IS $$ Returns a set of (only one) user specified by the id.$$; CREATE OR REPLACE FUNCTION admin__get_roles_for_user(in_user_id INT) returns setof text as $$ declare u_role record; a_user users; begin select * into a_user from admin__get_user(in_user_id); FOR u_role IN select r.rolname from pg_roles r, (select m.roleid from pg_auth_members m, pg_roles b where m.member = b.oid and b.rolname = a_user.username ) as ar where r.oid = ar.roleid LOOP RETURN NEXT u_role.rolname::text; END LOOP; RETURN; end; $$ language 'plpgsql' SECURITY DEFINER; REVOKE EXECUTE ON FUNCTION admin__get_roles_for_user(in_user_id INT) from PUBLIC; COMMENT ON FUNCTION admin__get_roles_for_user(in_user_id INT) IS $$ Returns a set of roles that a user is a part of.$$; CREATE OR REPLACE FUNCTION user__check_my_expiration() returns interval as $$ DECLARE outval interval; BEGIN SELECT CASE WHEN isfinite(rolvaliduntil) is not true THEN '1 year'::interval ELSE rolvaliduntil - now() END AS expiration INTO outval FROM pg_roles WHERE rolname = SESSION_USER; RETURN outval; end; $$ language plpgsql security definer; COMMENT ON FUNCTION user__check_my_expiration() IS $$ Returns the time when password of the current logged in user is set to expire.$$; CREATE OR REPLACE FUNCTION user__expires_soon() RETURNS BOOL AS $$ SELECT user__check_my_expiration() < '1 week'; $$ language sql; COMMENT ON FUNCTION user__expires_soon() IS $$ Returns true if the password of the current logged in user is set to expire within on week.$$; CREATE OR REPLACE FUNCTION user__change_password(in_new_password text) returns int as $$ DECLARE t_expires timestamp; t_password_duration text; BEGIN SELECT value INTO t_password_duration FROM defaults WHERE setting_key = 'password_duration'; IF t_password_duration IS NULL or t_password_duration='' THEN t_expires := 'infinity'; ELSE t_expires := now() + (t_password_duration::numeric::text || ' days')::interval; END IF; UPDATE users SET notify_password = DEFAULT where username = SESSION_USER; EXECUTE 'ALTER USER ' || quote_ident(SESSION_USER) || ' with ENCRYPTED password ' || quote_literal(in_new_password) || ' VALID UNTIL '|| quote_literal(t_expires); return 1; END; $$ language plpgsql security definer; COMMENT ON FUNCTION user__change_password(in_new_password text) IS $$ Alloes a user to change his or her own password. The password is set to expire setting_get('password_duration') days after the password change.$$; CREATE OR REPLACE FUNCTION admin__save_user( in_id int, in_entity_id INT, in_username text, in_password TEXT, in_import BOOL ) returns int AS $$ DECLARE a_user users; v_user_id int; p_id int; l_id int; stmt text; t_is_role bool; t_is_user bool; BEGIN -- WARNING TO PROGRAMMERS: This function runs as the definer and runs -- utility statements via EXECUTE. -- PLEASE BE VERY CAREFUL ABOUT SQL-INJECTION INSIDE THIS FUNCTION. PERFORM rolname FROM pg_roles WHERE rolname = in_username; t_is_role := found; t_is_user := admin__is_user(in_username); IF t_is_role is true and t_is_user is false and in_import is false THEN RAISE EXCEPTION 'Duplicate user'; END IF; if t_is_role and in_password is not null then execute 'ALTER USER ' || quote_ident( in_username ) || ' WITH ENCRYPTED PASSWORD ' || quote_literal (in_password) || $e$ valid until $e$ || quote_literal(now() + '1 day'::interval); elsif in_import is false AND t_is_user is false AND in_password IS NULL THEN RAISE EXCEPTION 'No password'; elsif t_is_role is false and in_import IS FALSE THEN -- create an actual user execute 'CREATE USER ' || quote_ident( in_username ) || ' WITH ENCRYPTED PASSWORD ' || quote_literal (in_password) || $e$ valid until $e$ || quote_literal(now() + '1 day'::interval); END IF; select * into a_user from users lu where lu.id = in_id; IF FOUND THEN return a_user.id; ELSE -- Insert cycle --- The entity is expected to already BE created. See admin.pm. v_user_id := nextval('users_id_seq'); insert into users (id, username, entity_id) VALUES ( v_user_id, in_username, in_entity_id ); insert into user_preference (id) values (v_user_id); IF NOT exists(SELECT * FROM entity_employee WHERE entity_id = in_entity_id) THEN INSERT into entity_employee (entity_id) values (in_entity_id); END IF; -- Finally, issue the create user statement return v_user_id ; END IF; END; $$ language 'plpgsql' SECURITY DEFINER; COMMENT ON FUNCTION admin__save_user( in_id int, in_entity_id INT, in_username text, in_password TEXT, in_import BOOL ) IS $$ Creates a user and relevant records in LedgerSMB and PostgreSQL.$$; REVOKE EXECUTE ON FUNCTION admin__save_user( in_id int, in_entity_id INT, in_username text, in_password TEXT, in_import bool ) FROM public; create view role_view as select * from pg_auth_members m join pg_roles a ON (m.roleid = a.oid); -- work in progress, not for public docs yet create or replace function admin__is_group(in_group_name text) returns bool as $$ -- This needs some work. CT DECLARE existant_role pg_roles; stmt text; BEGIN select * into existant_role from pg_roles where rolname = in_group_name AND rolcanlogin is false; if not found then return 'f'::bool; else return 't'::bool; end if; END; $$ language 'plpgsql'; -- work in progress, not for public docs yet CREATE OR REPLACE FUNCTION admin__create_group(in_group_name TEXT) RETURNS int as $$ DECLARE stmt text; t_dbname text; BEGIN t_dbname := current_database(); stmt := 'create role lsmb_'|| quote_ident(t_dbname || '__' || in_group_name); execute stmt; return 1; END; $$ language 'plpgsql' SECURITY DEFINER; REVOKE EXECUTE ON FUNCTION admin__create_group(TEXT) FROM PUBLIC; -- not sure if this is exposed to the front end yet. --CT CREATE OR REPLACE FUNCTION admin__delete_user (in_username TEXT, in_drop_role bool) returns INT as $$ DECLARE stmt text; a_user users; BEGIN select * into a_user from users where username = in_username; IF NOT FOUND THEN raise exception 'User not found.'; ELSIF FOUND THEN IF in_drop_role IS TRUE then stmt := ' drop user ' || quote_ident(a_user.username); execute stmt; END IF; -- also gets user_connection delete from user_preference where id = ( select id from users where entity_id = a_user.entity_id); delete from users where entity_id = a_user.entity_id; return 1; END IF; END; $$ language 'plpgsql' SECURITY DEFINER; REVOKE EXECUTE ON FUNCTION admin__delete_user(in_username TEXT, in_drop_role bool) from public; comment on function admin__delete_user(text, bool) is $$ Drops the provided user, as well as deletes the user configuration data. It leaves the entity and person references. If in_drop_role is set, it drops the role too. $$; -- Work oin progress, not for ducmenting yet. CREATE OR REPLACE FUNCTION admin__delete_group (in_group_name TEXT) returns bool as $$ DECLARE stmt text; a_role role_view; t_dbname text; BEGIN t_dbname := current_database(); select * into a_role from role_view where rolname = in_group_name; if not found then return 'f'::bool; else stmt := 'drop role lsmb_' || quote_ident(t_dbname || '__' || in_group_name); execute stmt; return 't'::bool; end if; END; $$ language 'plpgsql' SECURITY DEFINER; REVOKE EXECUTE on function admin__delete_group(text) from public; comment on function admin__delete_group(text) IS $$ Deletes the input group from the database. Not designed to be used to remove a login-capable user. $$; CREATE OR REPLACE FUNCTION admin__list_roles(in_username text) RETURNS SETOF text AS $$ DECLARE out_rolename RECORD; BEGIN FOR out_rolename IN SELECT rolname FROM pg_roles WHERE oid IN (SELECT id FROM connectby ( '(SELECT m.member, m.roleid, r.oid FROM pg_roles r LEFT JOIN pg_auth_members m ON (r.oid = m.roleid)) a', 'oid', 'member', 'oid', '320461', '0', ',' ) c(id integer, parent integer, "level" integer, path text, list_order integer) ) LOOP RETURN NEXT out_rolename.rolname; END LOOP; END; $$ LANGUAGE PLPGSQL SECURITY DEFINER; REVOKE execute on function admin__list_roles(in_username text) from public; -- TODO: Add admin user --CREATE OR REPLACE FUNCTION admin_audit_log () returns int as $$ --$$ language plpgsql; create or replace function admin__is_user (in_user text) returns bool as $$ BEGIN PERFORM * from users where username = in_user; RETURN found; END; $$ language plpgsql; COMMENT ON function admin__is_user (in_user text) IS $$ Returns true if user is set up in LedgerSMB. False otherwise.$$; create or replace view user_listable as select u.id, u.username, e.created from entity e join users u on u.entity_id = e.id; create or replace function user__get_all_users () returns setof user_listable as $$ select * from user_listable; $$ language sql; create or replace function admin__get_roles () returns setof pg_roles as $$ DECLARE v_rol record; t_dbname text; BEGIN t_dbname := current_database(); FOR v_rol in SELECT * from pg_roles where rolname ~ ('^lsmb_' || t_dbname || '__') and rolcanlogin is false order by rolname ASC LOOP RETURN NEXT v_rol; END LOOP; END; $$ language plpgsql; create or replace function user__save_preferences( in_dateformat text, in_numberformat text, in_language text, in_stylesheet text, in_printer text ) returns bool as $$ BEGIN UPDATE user_preference SET dateformat = in_dateformat, numberformat = in_numberformat, language = in_language, stylesheet = in_stylesheet, printer = in_printer WHERE id = (select id from users where username = SESSION_USER); RETURN FOUND; END; $$ language plpgsql; COMMENT ON function user__save_preferences( in_dateformat text, in_numberformat text, in_language text, in_stylesheet text, in_printer text ) IS $$ Saves user preferences. Returns true if successful, false if no preferences were found to update.$$; create or replace function user__get_preferences (in_user_id int) returns setof user_preference as $$ declare v_row user_preference; BEGIN select * into v_row from user_preference where id = in_user_id; IF NOT FOUND THEN RAISE EXCEPTION 'Could not find user preferences for id %', in_user_id; ELSE return next v_row; END IF; END; $$ language plpgsql; COMMENT ON function user__get_preferences (in_user_id int) IS $$ Returns the preferences row for the user.$$; CREATE TYPE user_result AS ( id int, username text, first_name text, last_name text, ssn text, dob text ); CREATE OR REPLACE FUNCTION admin__search_users(in_username text, in_first_name text, in_last_name text, in_ssn text, in_dob date) RETURNS SETOF user_result AS $$ DECLARE t_return_row user_result; BEGIN FOR t_return_row IN SELECT u.id, u.username, p.first_name, p.last_name, e.ssn, e.dob FROM users u JOIN person p ON (u.entity_id = p.entity_id) JOIN entity_employee e ON (e.entity_id = p.entity_id) WHERE u.username LIKE '%' || coalesce(in_username,'') || '%' AND (p.first_name = in_first_name or in_first_name is null) AND (p.last_name = in_last_name or in_last_name is null) AND (in_ssn is NULL or in_ssn = e.ssn) AND (e.dob = in_dob::date or in_dob is NULL) LOOP RETURN NEXT t_return_row; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION admin__search_users(in_username text, in_first_name text, in_last_name text, in_ssn text, in_dob date) IS $$ Returns a list of users matching search criteria. Nulls match all values. only username is not an exact match.$$; CREATE TYPE session_result AS ( id int, username text, last_used timestamp, locks_active bigint ); CREATE OR REPLACE FUNCTION admin__list_sessions() RETURNS SETOF session_result AS $$ SELECT s.session_id, u.username, s.last_used, count(t.id) FROM "session" s JOIN users u ON (s.users_id = u.id) LEFT JOIN transactions t ON (t.locked_by = s.session_id) GROUP BY s.session_id, u.username, s.last_used ORDER BY u.username; $$ LANGUAGE SQL; COMMENT ON FUNCTION admin__list_sessions() IS $$ Lists all active sessions.$$; CREATE OR REPLACE FUNCTION admin__drop_session(in_session_id int) RETURNS bool AS $$ BEGIN DELETE FROM "session" WHERE session_id = in_session_id; RETURN FOUND; END; $$ language plpgsql; COMMENT ON FUNCTION admin__drop_session(in_session_id int) IS $$ Drops the session identified, releasing all locks held.$$; ledgersmb/sql/modules/chart.sql0000644000000000000000000001453311614456207015625 0ustar rootroot-- TODO: Merge with account.sql -CT CREATE TYPE trial_balance_line AS ( chart_id int, accno text, description text, beginning_balance numeric, credits numeric, debits numeric, ending_balance numeric ); CREATE OR REPLACE FUNCTION report_trial_balance (in_datefrom date, in_dateto date, in_department_id int, in_project_id int, in_gifi bool) RETURNS setof trial_balance_line AS $$ DECLARE out_row trial_balance_line; BEGIN IF in_department_id IS NULL THEN FOR out_row IN SELECT c.id, c.accno, c.description, SUM(CASE WHEN ac.transdate < in_datefrom AND c.category IN ('I', 'L', 'Q') THEN ac.amount ELSE ac.amount * -1 END), SUM(CASE WHEN ac.transdate >= in_date_from AND ac.amount > 0 THEN ac.amount ELSE 0 END), SUM(CASE WHEN ac.transdate >= in_date_from AND ac.amount < 0 THEN ac.amount ELSE 0 END) * -1, SUM(CASE WHEN ac.transdate >= in_date_from AND c.charttype IN ('I') THEN ac.amount WHEN ac.transdate >= in_date_from AND c.category IN ('I', 'L', 'Q') THEN ac.amount ELSE ac.amount * -1 END) FROM acc_trans ac JOIN (select id, approved FROM ap UNION ALL select id, approved FROM gl UNION ALL select id, approved FROM ar) g ON (g.id = ac.trans_id) JOIN chart c ON (c.id = ac.chart_id) WHERE ac.transdate <= in_date_to AND ac.approved AND g.approved AND (in_project_id IS NULL OR in_project_id = ac.project_id) GROUP BY c.id, c.accno, c.description ORDER BY c.accno LOOP RETURN NEXT out_row; END LOOP; ELSE FOR out_row IN SELECT 1 LOOP RETURN NEXT out_row; END LOOP; END IF; END; $$ language plpgsql; COMMENT ON FUNCTION report_trial_balance (in_datefrom date, in_dateto date, in_department_id int, in_project_id int, in_gifi bool) IS $$ This is a simple routine to generate trial balances for the full company, for a project, or for a department.$$; CREATE OR REPLACE FUNCTION chart_list_all() RETURNS SETOF chart AS $$ DECLARE out_row chart%ROWTYPE; BEGIN FOR out_row IN SELECT * FROM chart ORDER BY accno LOOP RETURN next out_row; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION chart_list_all() IS $$ Generates a list of chart view entries.$$; CREATE OR REPLACE FUNCTION chart_get_ar_ap(in_account_class int) RETURNS SETOF chart AS $$ DECLARE out_row chart%ROWTYPE; BEGIN IF in_account_class NOT IN (1, 2) THEN RAISE EXCEPTION 'Bad Account Type'; END IF; FOR out_row IN SELECT * FROM chart WHERE link = CASE WHEN in_account_class = 1 THEN 'AP' WHEN in_account_class = 2 THEN 'AR' END ORDER BY accno LOOP RETURN NEXT out_row; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION chart_get_ar_ap(in_account_class int) IS $$ This function returns the cash account acording with in_account_class which must be 1 or 2. If in_account_class is 1 then it returns a list of AP accounts, and if in_account_class is 2, then a list of AR accounts.$$; CREATE OR REPLACE FUNCTION chart_list_search(in_search text, in_link_desc text) RETURNS SETOF account AS $$ DECLARE out_row account%ROWTYPE; BEGIN FOR out_row IN SELECT * FROM account WHERE (accno ~* ('^'||in_search) OR description ~* ('^'||in_search)) AND (in_link_desc IS NULL or id in (select account_id from account_link where description = in_link_desc)) ORDER BY accno LOOP RETURN next out_row; END LOOP; END;$$ LANGUAGE 'plpgsql'; COMMENT ON FUNCTION chart_list_search(in_search text, in_link_desc text) IS $$ This returns a list of account entries where the description or account number begins with in_search. If in_link_desc is provided, the list is further filtered by which accounts are set to an account_link.description equal to that provided.$$; CREATE OR REPLACE FUNCTION chart_list_overpayment(in_account_class int) RETURNS SETOF chart AS $$ DECLARE resultrow record; link_string text; BEGIN IF in_account_class = 1 THEN link_string := '%AP_overpayment%'; ELSE link_string := '%AR_overpayment%'; END IF; FOR resultrow IN SELECT * FROM chart WHERE link LIKE link_string ORDER BY accno LOOP return next resultrow; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION chart_list_overpayment(in_account_class int) is $$ Returns a list of AP_overpayment accounts if in_account_class is 1 Otherwise it returns a list of AR_overpayment accounts.$$; CREATE OR REPLACE FUNCTION chart_list_cash(in_account_class int) returns setof chart as $$ DECLARE resultrow record; link_string text; BEGIN IF in_account_class = 1 THEN link_string := '%AP_paid%'; ELSE link_string := '%AR_paid%'; END IF; FOR resultrow IN SELECT * FROM chart WHERE link LIKE link_string ORDER BY accno LOOP return next resultrow; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION chart_list_cash(in_account_class int) IS $$ This function returns the overpayment accounts acording with in_account_class which must be 1 or 2. If in_account_class is 1 it returns a list of AP cash accounts and if 2, AR cash accounts.$$; CREATE OR REPLACE FUNCTION chart_list_discount(in_account_class int) RETURNS SETOF chart AS $$ DECLARE resultrow record; link_string text; BEGIN IF in_account_class = 1 THEN link_string := '%AP_discount%'; ELSE link_string := '%AR_discount%'; END IF; FOR resultrow IN SELECT * FROM chart WHERE link LIKE link_string ORDER BY accno LOOP return next resultrow; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION chart_list_discount(in_account_class int) IS $$ This function returns the discount accounts acording with in_account_class which must be 1 or 2. If in_account_class is 1, returns AP discount accounts, if 2, AR discount accounts.$$; ledgersmb/sql/modules/LOADORDER0000644000000000000000000000065611732342557015245 0ustar rootroot# This is a simple list of files to be loaded from sql/modules in the order # they shall be loaded. Drafts.sql chart.sql Account.sql Session.sql Business_type.sql Location.sql Company.sql Customer.sql Date.sql Defaults.sql Settings.sql Employee.sql Entity.sql Payment.sql Person.sql Report.sql Voucher.sql admin.sql Reconciliation.sql TaxForm.sql 1099_reports.sql EndOfYear.sql Util.sql Assets.sql Files.sql Parts.sql Fixes.sql ledgersmb/sql/modules/Entity.sql0000644000000000000000000000661011610163343015765 0ustar rootroot-- -- Copyright (C) 2011 LedgerSMB Core Team. Licensed under the GNU General -- Public License v 2 or at your option any later version. -- Docstrings already added to this file. CREATE OR REPLACE FUNCTION entity_save( in_entity_id int, in_name text, in_entity_class INT ) RETURNS INT AS $$ DECLARE e entity; e_id int; BEGIN select * into e from entity where id = in_entity_id; update entity SET name = in_name, entity_class = in_entity_class WHERE id = in_entity_id; IF NOT FOUND THEN -- do the insert magic. e_id = nextval('entity_id_seq'); insert into entity (id, name, entity_class) values (e_id, in_name, in_entity_class ); return e_id; END IF; return in_entity_id; END; $$ language 'plpgsql'; COMMENT ON FUNCTION entity_save( in_entity_id int, in_name text, in_entity_class INT ) IS $$ Currently unused. Left in because it is believed it may be helpful. This saves an entity, with the control code being the next available via the defaults table.$$; CREATE OR REPLACE FUNCTION entity__list_classes () RETURNS SETOF entity_class AS $$ DECLARE out_row entity_class; BEGIN FOR out_row IN SELECT * FROM entity_class WHERE active ORDER BY id LOOP RETURN NEXT out_row; END LOOP; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION entity__list_classes () IS $$ Returns a list of entity classes, ordered by assigned ids$$; CREATE OR REPLACE FUNCTION entity__get_entity ( in_entity_id int ) RETURNS setof entity AS $$ declare v_row entity; BEGIN -- Removing the exception when not found handling. Applications are -- perfectly capable of handling whether an entity was not found. No need -- for a database-level exception here. Moreover such results may be useful -- --CT SELECT * INTO v_row FROM entity WHERE id = in_entity_id; return next v_row; END; $$ language plpgsql; COMMENT ON FUNCTION entity__get_entity ( in_entity_id int ) IS $$ Returns a set of (only one) entity record with the entity id.$$; CREATE OR REPLACE FUNCTION eca__get_entity ( in_credit_id int ) RETURNS setof entity AS $$ declare v_row entity; BEGIN SELECT entity.* INTO v_row FROM entity_credit_account JOIN entity ON entity_credit_account.entity_id = entity.id WHERE entity_credit_account.id = in_credit_id; IF NOT FOUND THEN raise exception 'Could not find entity with ID %', in_credit_id; ELSE return next v_row; END IF; END; $$ language plpgsql; COMMENT ON FUNCTION eca__get_entity ( in_credit_id int ) IS $$ Returns a set of (only one) entity to which the entity credit account is attached.$$; CREATE OR REPLACE FUNCTION entity__delete_bank_account (in_entity_id int, in_id int) RETURNS bool AS $$ BEGIN UPDATE entity_credit_account SET bank_account = NULL WHERE entity_id = in_entity_id AND bank_account = in_id; DELETE FROM entity_bank_account WHERE id = in_id AND entity_id = in_entity_id; RETURN FOUND; END; $$ LANGUAGE plpgsql; COMMENT ON FUNCTION entity__delete_bank_account(in_entity_id int, in_id int) IS $$ Deletes the bank account identitied by in_id if it is attached to the entity identified by entity_id. Returns true if a record is deleted, false if not.$$; ledgersmb/sql/modules/EndOfYear.sql0000644000000000000000000001555511717060742016344 0ustar rootrootCREATE OR REPLACE FUNCTION eoy_create_checkpoint(in_end_date date) RETURNS int AS $$ DECLARE ret_val int; approval_check int; cp_date date; BEGIN IF in_end_date > now()::date THEN RAISE EXCEPTION 'Invalid date: Must be earlier than present'; END IF; SELECT count(*) into approval_check FROM acc_trans ac JOIN ( select id, approved, transdate FROM ar UNION SELECT id, approved, transdate FROM gl UNION SELECT id, approved, transdate FROM ap ) gl ON (gl.id = ac.trans_id) WHERE (ac.approved IS NOT TRUE AND ac.transdate <= in_end_date) OR (gl.approved IS NOT TRUE AND gl.transdate <= in_end_date); if approval_check > 0 THEN RAISE EXCEPTION 'Unapproved transactions in closed period'; END IF; SELECT max(end_date) INTO cp_date FROM account_checkpoint WHERE end_date < in_end_date; INSERT INTO account_checkpoint (end_date, account_id, amount, debits, credits) SELECT in_end_date, COALESCE(a.chart_id, cp.account_id), COALESCE(SUM (a.amount),0) + coalesce(MAX (cp.amount), 0), COALESCE(SUM (CASE WHEN (a.amount < 0) THEN a.amount ELSE 0 END), 0) + COALESCE( MIN (cp.debits), 0), COALESCE(SUM (CASE WHEN (a.amount > 0) THEN a.amount ELSE 0 END), 0) + COALESCE( MAX (cp.credits), 0) FROM (SELECT * FROM acc_trans WHERE transdate <= in_end_date AND transdate > COALESCE(cp_date, '1200-01-01')) a FULL OUTER JOIN ( select account_id, end_date, amount, debits, credits from account_checkpoint WHERE end_date = cp_date ) cp on (a.chart_id = cp.account_id) group by COALESCE(a.chart_id, cp.account_id); SELECT count(*) INTO ret_val FROM account_checkpoint where end_date = in_end_date; return ret_val; END; $$ language plpgsql; COMMENT ON FUNCTION eoy_create_checkpoint(in_end_date date) IS $$Creates checkpoints for each account at a specific date. Books are considered closed when they occur before the latest checkpoint timewise. This means that balances (and credit/debit amounts) can be calculated starting at a checkpoint and moving forward (thus providing a mechanism for expunging old data while keeping balances correct at some future point).$$; CREATE OR REPLACE FUNCTION eoy_zero_accounts (in_end_date date, in_reference text, in_description text, in_retention_acc_id int) RETURNS int AS $$ DECLARE ret_val int; BEGIN INSERT INTO gl (transdate, reference, description, approved) VALUES (in_end_date, in_reference, in_description, true); INSERT INTO yearend (trans_id, transdate) values (currval('id'), in_end_date); INSERT INTO acc_trans (transdate, chart_id, trans_id, amount) SELECT in_end_date, a.chart_id, currval('id'), (sum(a.amount) + coalesce(max(cp.amount), 0)) * -1 FROM acc_trans a LEFT JOIN ( select account_id, end_date, amount from account_checkpoint WHERE end_date = (select max(end_date) from account_checkpoint where end_date < in_end_date) ) cp on (a.chart_id = cp.account_id) JOIN account acc ON (acc.id = a.chart_id) WHERE a.transdate <= in_end_date AND a.transdate > coalesce(cp.end_date, a.transdate - 1) AND acc.category IN ('I', 'E') GROUP BY a.chart_id; INSERT INTO acc_trans (transdate, trans_id, chart_id, amount) SELECT in_end_date, currval('id'), in_retention_acc_id, coalesce(sum(amount) * -1, 0) FROM acc_trans WHERE trans_id = currval('id'); SELECT count(*) INTO ret_val from acc_trans where trans_id = currval('id'); RETURN ret_val; end; $$ language plpgsql; COMMENT ON FUNCTION eoy_zero_accounts (in_end_date date, in_reference text, in_description text, in_retention_acc_id int) IS $$ Posts a transaction which zeroes the income and expense accounts, moving the net balance there into a retained earnings account identified by in_retention_acc_id.$$; CREATE OR REPLACE FUNCTION eoy_close_books (in_end_date date, in_reference text, in_description text, in_retention_acc_id int) RETURNS bool AS $$ BEGIN IF eoy_zero_accounts(in_end_date, in_reference, in_description, in_retention_acc_id) > 0 THEN PERFORM eoy_create_checkpoint(in_end_date); RETURN TRUE; ELSE RETURN FALSE; END IF; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION eoy_close_books (in_end_date date, in_reference text, in_description text, in_retention_acc_id int) IS $$ Zeroes accounts and then creates a checkpoint. in_end_date is the date when the books are to be closed, in_reference and in_description become the reference and description of the gl transaction, and in_retention_acc_id is the retained earnings account id.$$; CREATE OR REPLACE FUNCTION eoy_reopen_books(in_end_date date) RETURNS bool AS $$ BEGIN PERFORM count(*) FROM account_checkpoint WHERE end_date = in_end_date; IF NOT FOUND THEN RETURN FALSE; END IF; DELETE FROM account_checkpoint WHERE end_date = in_end_date; PERFORM count(*) FROM yearend WHERE transdate = in_end_date and reversed is not true; IF FOUND THEN INSERT INTO gl (reference, description, approved) SELECT 'Reversing ' || reference, 'Reversing ' || description, true FROM gl WHERE id = (select trans_id from yearend where transdate = in_end_date and reversed is not true); INSERT INTO acc_trans (chart_id, amount, transdate, trans_id, approved) SELECT chart_id, amount * -1, currval('id'), true FROM acc_trans where trans_id = (select trans_id from yearend where transdate = in_end_date and reversed is not true); UPDATE yearend SET reversed = true where transdate = in_end_date and reversed is not true; END IF; DELETE FROM account_checkpoint WHERE end_date = in_end_date; RETURN TRUE; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION eoy_reopen_books(in_end_date date) IS $$ Removes checkpoints and reverses yearend transactions on in_end_date$$; CREATE OR REPLACE FUNCTION account__obtain_balance (in_transdate date, in_account_id int) RETURNS numeric AS $$ DECLARE balance numeric; BEGIN SELECT coalesce(sum(ac.amount) + cp.amount, sum(ac.amount)) INTO balance FROM acc_trans ac JOIN (select id, approved from ar union select id, approved from ap union select id, approved from gl) a ON (a.id = ac.trans_id) LEFT JOIN (select account_id, end_date, amount from account_checkpoint WHERE account_id = in_account_id AND end_date < in_transdate ORDER BY end_date desc limit 1 ) cp ON (cp.account_id = ac.chart_id) WHERE ac.chart_id = in_account_id AND ac.transdate > coalesce(cp.end_date, ac.transdate - '1 day'::interval) and ac.approved and a.approved and ac.transdate <= in_transdate GROUP BY cp.amount, ac.chart_id; RETURN balance; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION account__obtain_balance (in_transdate date, in_account_id int) is $$Returns the account balance at a given point in time, calculating forward from most recent check point.$$; CREATE OR REPLACE FUNCTION eoy_earnings_accounts() RETURNS setof account AS $$ SELECT * FROM account WHERE category = 'Q' ORDER BY accno; $$ language sql; COMMENT ON FUNCTION eoy_earnings_accounts() IS $$ Lists equity accounts for the retained earnings dropdown.$$; ledgersmb/sql/modules/Employee.sql0000644000000000000000000001761511726617575016322 0ustar rootroot-- VERSION 1.3.0 -- Copyright (C) 2011 LedgerSMB Core Team. Licensed under the GNU General -- Public License v 2 or at your option any later version. -- Docstrings already added to this file. CREATE OR REPLACE FUNCTION employee__save (in_entity_id int, in_start_date date, in_end_date date, in_dob date, in_role text, in_ssn text, in_sales bool, in_manager_id int, in_employee_number text) RETURNS int AS $$ DECLARE out_id INT; BEGIN UPDATE entity_employee SET startdate = coalesce(in_start_date, now()::date), enddate = in_end_date, dob = in_dob, role = in_role, ssn = in_ssn, manager_id = in_manager_id, employeenumber = in_employee_number WHERE entity_id = in_entity_id; out_id = in_entity_id; IF NOT FOUND THEN INSERT INTO entity_employee (startdate, enddate, dob, role, ssn, manager_id, employeenumber, entity_id) VALUES (coalesce(in_start_date, now()::date), in_end_date, in_dob, in_role, in_ssn, in_manager_id, in_employee_number, in_entity_id); RETURN in_entity_id; END IF; RETURN out_id; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION employee__save (in_entity_id int, in_start_date date, in_end_date date, in_dob date, in_role text, in_ssn text, in_sales bool, in_manager_id int, in_employee_number text) IS $$ Saves an employeerecord with the specified information.$$; CREATE OR REPLACE FUNCTION employee__get_user(in_entity_id int) RETURNS SETOF users AS $$SELECT * FROM users WHERE entity_id = $1;$$ language sql; COMMENT ON FUNCTION employee__get_user(in_entity_id int) IS $$ Returns username, user_id, etc. information if the employee is a user.$$; create view employees as select s.salutation, p.first_name, p.last_name, ee.* FROM person p JOIN entity_employee ee USING (entity_id) LEFT JOIN salutation s ON (p.salutation_id = s.id); GRANT select ON employees TO public; DROP TYPE IF EXISTS employee_result CASCADE; CREATE TYPE employee_result AS ( entity_id int, person_id int, salutation text, first_name text, middle_name text, last_name text, startdate date, enddate date, role varchar(20), ssn text, sales bool, manager_id int, manager_first_name text, manager_last_name text, employeenumber varchar(32), dob date, country_id int ); CREATE OR REPLACE FUNCTION employee__all_managers() RETURNS setof employee_result AS $$ SELECT p.entity_id, p.id, s.salutation, p.first_name, p.middle_name, p.last_name, ee.startdate, ee.enddate, ee.role, ee.ssn, ee.sales, ee.manager_id, mp.first_name, mp.last_name, ee.employeenumber, ee.dob, e.country_id FROM person p JOIN entity_employee ee on (ee.entity_id = p.entity_id) JOIN entity e ON (p.entity_id = e.id) LEFT JOIN salutation s on (p.salutation_id = s.id) LEFT JOIN person mp ON ee.manager_id = p.entity_id WHERE ee.role = 'manager' ORDER BY ee.employeenumber; $$ LANGUAGE SQL; CREATE OR REPLACE FUNCTION employee__get (in_entity_id integer) returns employee_result as $$ SELECT p.entity_id, p.id, s.salutation, p.first_name, p.middle_name, p.last_name, ee.startdate, ee.enddate, ee.role, ee.ssn, ee.sales, ee.manager_id, mp.first_name, mp.last_name, ee.employeenumber, ee.dob, e.country_id FROM person p JOIN entity_employee ee on (ee.entity_id = p.entity_id) JOIN entity e ON (p.entity_id = e.id) LEFT JOIN salutation s on (p.salutation_id = s.id) LEFT JOIN person mp ON ee.manager_id = p.entity_id WHERE p.entity_id = $1; $$ language sql; COMMENT ON FUNCTION employee__get (in_entity_id integer) IS $$ Returns an employee_result tuple with information specified by the entity_id. $$; CREATE OR REPLACE FUNCTION employee__search (in_employeenumber text, in_startdate_from date, in_startdate_to date, in_first_name text, in_middle_name text, in_last_name text, in_notes text) RETURNS SETOF employee_result as $$ SELECT p.entity_id, p.id, s.salutation, p.first_name, p.middle_name, p.last_name, ee.startdate, ee.enddate, ee.role, ee.ssn, ee.sales, ee.manager_id, mp.first_name, mp.last_name, ee.employeenumber, ee.dob, e.country_id FROM person p JOIN entity e ON p.entity_id = e.id JOIN entity_employee ee on (ee.entity_id = p.entity_id) LEFT JOIN salutation s on (p.salutation_id = s.id) LEFT JOIN person mp ON ee.manager_id = p.entity_id WHERE ($7 is null or p.entity_id in (select ref_key from entity_note WHERE note ilike '%' || $7 || '%')) and ($1 is null or $1 = ee.employeenumber) and ($2 is null or $2 <= ee.startdate) and ($3 is null or $3 >= ee.startdate) and ($4 is null or p.first_name ilike '%' || $4 || '%') and ($5 is null or p.middle_name ilike '%' || $5 || '%') and ($6 is null or p.last_name ilike '%' || $6 || '%'); $$ language sql; COMMENT ON FUNCTION employee__search (in_employeenumber text, in_startdate_from date, in_startdate_to date, in_first_name text, in_middle_name text, in_last_name text, in_notes text) IS $$ Returns a list of employee_result records matching the search criteria. employeenumber is an exact match. stardate_from and startdate_to specify the start dates for employee searches All others are partial matches. NULLs match all values.$$; CREATE OR REPLACE FUNCTION employee__list_managers (in_id integer) RETURNS SETOF employees as $$ DECLARE emp employees%ROWTYPE; BEGIN FOR emp IN SELECT e.salutation, e.first_name, e.last_name, ee.* FROM entity_employee ee JOIN entity e on e.id = ee.entity_id WHERE ee.sales = 't'::bool AND ee.role='manager' AND ee.entity_id <> coalesce(in_id, -1) ORDER BY name LOOP RETURN NEXT emp; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION employee__list_managers (in_id integer) IS $$ Returns a list of managers, that is employees with the 'manager' role set.$$; -- as long as we need the datatype, might as well get some other use out of it! -- -- % type is pg_trgm comparison. CREATE INDEX notes_idx ON entity_note USING gist(note gist_trgm_ops); --Testing this more before replacing employee__search with it. -- Consequently not to be publically documented yet, --CT CREATE OR REPLACE VIEW employee_search AS SELECT e.*, em.name AS manager, emn.note, en.name as name FROM entity_employee e LEFT JOIN entity en on (e.entity_id = en.id) LEFT JOIN entity_employee m ON (e.manager_id = m.entity_id) LEFT JOIN entity em on (em.id = m.entity_id) LEFT JOIN entity_note emn on (emn.ref_key = em.id); CREATE OR REPLACE FUNCTION employee_search (in_startdatefrom date, in_startdateto date, in_name varchar, in_notes text, in_enddateto date, in_enddatefrom date, in_sales boolean) RETURNS SETOF employee_search AS $$ DECLARE emp employee_search%ROWTYPE; BEGIN FOR emp IN SELECT * FROM employee_search WHERE coalesce(startdate, 'infinity'::timestamp) >= coalesce(in_startdateto, '-infinity'::timestamp) AND coalesce(startdate, '-infinity'::timestamp) <= coalesce(in_startdatefrom, 'infinity'::timestamp) AND coalesce(enddate, '-infinity'::timestamp) <= coalesce(in_enddateto, 'infinity'::timestamp) AND coalesce(enddate, 'infinity'::timestamp) >= coalesce(in_enddatefrom, '-infinity'::timestamp) AND (name % in_name OR note % in_notes) AND (sales = 't' OR coalesce(in_sales, 'f') = 'f') LOOP RETURN NEXT emp; END LOOP; return; END; $$ language plpgsql; -- I don't like this. Wondering if we should unify this to another function. -- person__location_save should be cleaner. Not documenting yet, but not -- removing because user management code uses it. --CT create or replace function employee_set_location (in_employee int, in_location int) returns void as $$ INSERT INTO person_to_location (person_id,location_id) VALUES ($1, $2); $$ language 'sql'; ledgersmb/sql/modules/reload_modules.sh0000644000000000000000000000054211641407646017333 0ustar rootroot#!/bin/bash if test -z "$1" then echo "Usage: $0 COMPANY" echo "\"COMPANY\" is the name of the company database, such as the name given" echo "to --company when using the prepare-company-database.sh script." exit 1 fi for a in `sed -e 's/^\s*//' -e 's/\s*$//' -e 's/#.*$//' LOADORDER | grep -v '^$'` do psql -f "$a" -U postgres $1 done ledgersmb/sql/modules/Drafts.sql0000644000000000000000000000752411706262315015746 0ustar rootrootCREATE TYPE draft_search_result AS ( id int, transdate date, reference text, description text, amount numeric ); CREATE OR REPLACE FUNCTION draft__search(in_type text, in_with_accno text, in_from_date date, in_to_date date, in_amount_le numeric, in_amount_ge numeric) returns setof draft_search_result AS $$ DECLARE out_row RECORD; BEGIN FOR out_row IN SELECT trans.id, trans.transdate, trans.reference, trans.description, sum(case when lower(in_type) = 'ap' AND chart.link = 'AP' THEN line.amount WHEN lower(in_type) = 'ar' AND chart.link = 'AR' THEN line.amount * -1 WHEN lower(in_type) = 'gl' AND line.amount > 0 THEN line.amount ELSE 0 END) as amount FROM ( SELECT id, transdate, reference, description, approved from gl WHERE lower(in_type) = 'gl' UNION SELECT id, transdate, invnumber as reference, (SELECT name FROM eca__get_entity(entity_credit_account)), approved from ap WHERE lower(in_type) = 'ap' UNION SELECT id, transdate, invnumber as reference, description, approved from ar WHERE lower(in_type) = 'ar' ) trans JOIN acc_trans line ON (trans.id = line.trans_id) JOIN chart ON (line.chart_id = chart.id and charttype = 'A') LEFT JOIN voucher v ON (v.trans_id = trans.id) WHERE (in_from_date IS NULL or trans.transdate >= in_from_date) AND (in_to_date IS NULL or trans.transdate <= in_to_date) AND trans.approved IS FALSE AND v.id IS NULL GROUP BY trans.id, trans.transdate, trans.description, trans.reference HAVING (in_with_accno IS NULL or in_with_accno = ANY(as_array(chart.accno))) ORDER BY trans.reference LOOP RETURN NEXT out_row; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION draft__search(in_type text, in_with_accno text, in_from_date date, in_to_date date, in_amount_le numeric, in_amount_ge numeric) IS $$ Searches for drafts. in_type may be any of 'ar', 'ap', or 'gl'.$$; CREATE OR REPLACE FUNCTION draft_approve(in_id int) returns bool as $$ declare t_table text; begin SELECT table_name into t_table FROM transactions where id = in_id; IF (t_table = 'ar') THEN UPDATE ar set approved = true where id = in_id; ELSIF (t_table = 'ap') THEN UPDATE ap set approved = true where id = in_id; ELSIF (t_table = 'gl') THEN UPDATE gl set approved = true where id = in_id; ELSE raise exception 'Invalid table % in draft_approve for transaction %', t_table, in_id; END IF; IF NOT FOUND THEN RETURN FALSE; END IF; UPDATE transactions SET approved_by = (select entity_id FROM users WHERE username = SESSION_USER), approved_at = now() WHERE id = in_id; RETURN TRUE; END; $$ LANGUAGE PLPGSQL SECURITY DEFINER; COMMENT ON FUNCTION draft_approve(in_id int) IS $$ Posts draft to the books. in_id is the id from the ar, ap, or gl table.$$; CREATE OR REPLACE FUNCTION draft_delete(in_id int) returns bool as $$ declare t_table text; begin DELETE FROM ac_tax_form WHERE entry_id IN (SELECT entry_id FROM acc_trans WHERE trans_id = in_id); DELETE FROM acc_trans WHERE trans_id = in_id; SELECT lower(table_name) into t_table FROM transactions where id = in_id; IF t_table = 'ar' THEN DELETE FROM ar WHERE id = in_id AND approved IS FALSE; ELSIF t_table = 'ap' THEN DELETE FROM ap WHERE id = in_id AND approved IS FALSE; ELSIF t_table = 'gl' THEN DELETE FROM gl WHERE id = in_id AND approved IS FALSE; ELSE raise exception 'Invalid table % in draft_delete for transaction %', t_table, in_id; END IF; IF NOT FOUND THEN RAISE EXCEPTION 'Invalid transaction id %', in_id; END IF; RETURN TRUE; END; $$ LANGUAGE PLPGSQL SECURITY DEFINER; COMMENT ON FUNCTION draft_approve(in_id int) is $$ Deletes the draft from the book. Only will delete unapproved transactions. Otherwise an exception is raised and the transaction terminated.$$; ledgersmb/sql/modules/Account.sql0000644000000000000000000002173312047135177016121 0ustar rootroot-- VERSION 1.3.0 CREATE OR REPLACE FUNCTION account__get_from_accno(in_accno text) returns account as $$ select * from account where accno = $1; $$ language sql; COMMENT ON FUNCTION account__get_from_accno(in_accno text) IS $$ Returns the account where the accno field matches (excatly) the in_accno provided.$$; CREATE OR REPLACE FUNCTION account__is_recon(in_accno text) RETURNS BOOL AS $$ SELECT count(*) > 0 FROM cr_coa_to_account c2a JOIN account ON account.id = c2a.chart_id WHERE accno = $1; $$ LANGUAGE SQL; COMMENT ON FUNCTION account__is_recon(in_accno text) IS $$ Returns true if account is set up for reconciliation, false otherwise. Note that returns false on invalid account number too$$; CREATE OR REPLACE FUNCTION account__get_taxes() RETURNS setof account AS $$ SELECT * FROM account WHERE tax is true ORDER BY accno; $$ language sql; COMMENT ON FUNCTION account__get_taxes() IS $$ Returns set of accounts where the tax attribute is true.$$; CREATE OR REPLACE FUNCTION account_get (in_id int) RETURNS setof chart AS $$ SELECT * from chart where id = $1 and charttype = 'A'; $$ LANGUAGE sql; COMMENT ON FUNCTION account_get(in_id int) IS $$Returns an entry from the chart view which matches the id requested, and which is an account, not a heading.$$; CREATE OR REPLACE FUNCTION account_heading_get (in_id int) RETURNS chart AS $$ DECLARE account chart%ROWTYPE; BEGIN SELECT * INTO account FROM chart WHERE id = in_id AND charttype = 'H'; RETURN account; END; $$ LANGUAGE plpgsql; COMMENT ON FUNCTION account_heading_get(in_id int) IS $$Returns an entry from the chart view which matches the id requested, and which is a heading, not an account.$$; CREATE OR REPLACE FUNCTION account_has_transactions (in_id int) RETURNS bool AS $$ BEGIN PERFORM trans_id FROM acc_trans WHERE chart_id = in_id LIMIT 1; IF FOUND THEN RETURN true; ELSE RETURN false; END IF; END; $$ LANGUAGE plpgsql; COMMENT ON FUNCTION account_has_transactions (in_id int) IS $$ Checks to see if any transactions use this account. If so, returns true. If not, returns false.$$; CREATE OR REPLACE FUNCTION account_save (in_id int, in_accno text, in_description text, in_category char(1), in_gifi_accno text, in_heading int, in_contra bool, in_tax bool, in_link text[]) RETURNS int AS $$ DECLARE t_heading_id int; t_link record; t_id int; t_tax bool; BEGIN SELECT count(*) > 0 INTO t_tax FROM tax WHERE in_id = chart_id; t_tax := t_tax OR in_tax; -- check to ensure summary accounts are exclusive -- necessary for proper handling by legacy code FOR t_link IN SELECT description FROM account_link_description WHERE summary='t' LOOP IF t_link.description = ANY (in_link) and array_upper(in_link, 1) > 1 THEN RAISE EXCEPTION 'Invalid link settings: Summary'; END IF; END LOOP; -- heading settings IF in_heading IS NULL THEN SELECT id INTO t_heading_id FROM account_heading WHERE accno < in_accno order by accno desc limit 1; ELSE t_heading_id := in_heading; END IF; -- don't remove custom links. DELETE FROM account_link WHERE account_id = in_id and description in ( select description from account_link_description where custom = 'f'); UPDATE account SET accno = in_accno, description = in_description, category = in_category, gifi_accno = in_gifi_accno, heading = t_heading_id, contra = in_contra, tax = t_tax WHERE id = in_id; IF FOUND THEN t_id := in_id; ELSE INSERT INTO account (accno, description, category, gifi_accno, heading, contra, tax) VALUES (in_accno, in_description, in_category, in_gifi_accno, t_heading_id, in_contra, in_tax); t_id := currval('account_id_seq'); END IF; FOR t_link IN select in_link[generate_series] AS val FROM generate_series(array_lower(in_link, 1), array_upper(in_link, 1)) LOOP INSERT INTO account_link (account_id, description) VALUES (t_id, t_link.val); END LOOP; RETURN t_id; END; $$ language plpgsql; COMMENT ON FUNCTION account_save (in_id int, in_accno text, in_description text, in_category char(1), in_gifi_accno text, in_heading int, in_contra bool, in_tax bool, in_link text[]) IS $$ This deletes existing account_link entries, where the account_link.description is not designated as a custom one in the account_link_description table. If no account heading is provided, the account heading which has an accno field closest to but prior (by collation order) is used. Then it saves the account information, and rebuilds the account_link records based on the in_link array. $$; CREATE OR REPLACE FUNCTION account_heading_list() RETURNS SETOF account_heading AS $$ SELECT * FROM account_heading order by accno; $$ language sql; COMMENT ON FUNCTION account_heading_list() IS $$ Lists all existing account headings.$$; CREATE OR REPLACE FUNCTION account_heading_save (in_id int, in_accno text, in_description text, in_parent int) RETURNS int AS $$ BEGIN UPDATE account_heading SET accno = in_accno, description = in_description, parent_id = in_parent WHERE id = in_id; IF FOUND THEN RETURN in_id; END IF; INSERT INTO account_heading (accno, description, parent_id) VALUES (in_accno, in_description, in_parent); RETURN currval('account_heading_id_seq'); END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION account_heading_save (in_id int, in_accno text, in_description text, in_parent int) IS $$ Saves an account heading. $$; CREATE OR REPLACE RULE chart_i AS ON INSERT TO chart DO INSTEAD SELECT CASE WHEN new.charttype='H' THEN account_heading_save(new.id, new.accno, new.description, NULL) ELSE account_save(new.id, new.accno, new.description, new.category, new.gifi_accno, NULL, -- should these be rewritten as coalesces? --CT CASE WHEN new.contra IS NULL THEN FALSE ELSE new.contra END, CASE WHEN new.tax IS NULL THEN FALSE ELSE new.tax END, string_to_array(new.link, ':')) END; CREATE OR REPLACE FUNCTION cr_coa_to_account_save(in_accno text, in_description text) RETURNS void AS $BODY$ DECLARE v_chart_id int; BEGIN -- Check for existence of the account already PERFORM * FROM cr_coa_to_account WHERE account = in_accno; IF NOT FOUND THEN -- This is a new account. Insert the relevant data. SELECT id INTO v_chart_id FROM chart WHERE accno = in_accno; INSERT INTO cr_coa_to_account (chart_id, account) VALUES (v_chart_id, in_accno||'--'||in_description); END IF; -- Already found, no need to do anything. =) END; $BODY$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION cr_coa_to_account_save(in_accno text, in_description text) IS $$ Provides default rules for setting reconciliation labels. Currently saves a label of accno ||'--' || description.$$; CREATE OR REPLACE FUNCTION account__get_by_link_desc(in_description text) RETURNS SETOF account AS $$ SELECT * FROM account WHERE id IN (SELECT account_id FROM account_link WHERE description = $1); $$ language sql; COMMENT ON FUNCTION account__get_by_link_desc(in_description text) IS $$ Gets a list of accounts with a specific link description set. For example, for a dropdown list.$$; CREATE OR REPLACE FUNCTION get_link_descriptions() RETURNS SETOF account_link_description AS $$ SELECT * FROM account_link_description; $$ LANGUAGE SQL; COMMENT ON FUNCTION get_link_descriptions() IS $$ Gets a set of all valid account_link descriptions.$$; CREATE OR REPLACE FUNCTION account_heading__list() RETURNS SETOF account_heading AS $$ SELECT * FROM account_heading order by accno; $$ language sql; COMMENT ON FUNCTION account_heading__list() IS $$ Returns a list of all account headings, currently ordered by account number. $$; DROP FUNCTION IF EXISTS account__save_tax (in_chart_id int, in_validto date, in_rate numeric, in_taxnumber text, in_pass int, in_taxmodule_id int, in_old_validto date); CREATE OR REPLACE FUNCTION account__save_tax (in_chart_id int, in_validto date, in_rate numeric, in_minvalue numeric, in_maxvalue numeric, in_taxnumber text, in_pass int, in_taxmodule_id int, in_old_validto date) returns bool as $$ BEGIN UPDATE tax SET validto = in_validto, rate = in_rate, minvalue = in_minvalue, maxvalue = in_maxvalue, taxnumber = in_taxnumber, pass = in_pass, taxmodule_id = in_taxmodule_id WHERE chart_id = in_chart_id and validto = in_old_validto; IF FOUND THEN return true; END IF; INSERT INTO tax(chart_id, validto, rate, minvalue, maxvalue, taxnumber, pass, taxmodule_id) VALUES (in_chart_id, in_validto, in_rate, in_minvalue, in_maxvalue, in_taxnumber, in_pass, in_taxmodule_id); RETURN TRUE; END; $$ language plpgsql; COMMENT ON FUNCTION account__save_tax (in_chart_id int, in_validto date, in_rate numeric, in_minvalue numeric, in_maxvalue numeric, in_taxnumber text, in_pass int, in_taxmodule_id int, in_old_validto date) IS $$ This saves tax rates.$$; ledgersmb/sql/modules/1099_reports.sql0000644000000000000000000002411211670357423016700 0ustar rootroot-- First a couple of notes about this file and what will probably change in the -- future. -- -- The current generation here of reports assumes that we are providing -- reporting of purchases or sales to one country only. If this ever changes -- we will need an abstraction layer like we use with fixed assets. I suspect -- we will go that way anyway since it will make some things easier. -- -- This file provides 1099 reporting (MISC and INT). It does NOT provide 1099-K -- and we'd need an abstraction layer for that. --CT BEGIN; DROP TYPE IF EXISTS tax_form_report_item CASCADE; CREATE TYPE tax_form_report_item AS ( credit_id integer, legal_name text, entity_id integer, entity_class integer, control_code text, meta_number character varying(32), acc_sum numeric, invoice_sum numeric, total_sum numeric); DROP TYPE IF EXISTS tax_form_report_detail_item CASCADE; CREATE TYPE tax_form_report_detail_item AS ( credit_id integer, legal_name text, entity_id integer, entity_class integer, control_code text, meta_number character varying(32), acc_sum numeric, invoice_sum numeric, total_sum numeric, invnumber text, duedate text, invoice_id int); CREATE OR REPLACE FUNCTION tax_form_summary_report(in_tax_form_id int, in_begin date, in_end date) RETURNS SETOF tax_form_report_item AS $BODY$ DECLARE out_row tax_form_report_item; BEGIN FOR out_row IN SELECT entity_credit_account.id, company.legal_name, company.entity_id, entity_credit_account.entity_class, entity.control_code, entity_credit_account.meta_number, sum(CASE WHEN gl.amount = 0 THEN 0 WHEN relation = 'acc_trans' THEN ac.reportable_amount * pmt.amount / gl.amount ELSE 0 END * CASE WHEN gl.class = 'ap' THEN -1 else 1 end), sum(CASE WHEN gl.amount = 0 THEN 0 WHEN relation = 'invoice' THEN ac.reportable_amount * pmt.amount / gl.amount ELSE 0 END * CASE WHEN gl.class = 'ar' THEN -1 else 1 end), sum(CASE WHEN gl.amount = 0 THEN 0 ELSE ac.reportable_amount * pmt.amount / gl.amount END * CASE WHEN gl.class = 'ap' THEN -1 else 1 end * CASE WHEN ac.relation = 'invoice' then -1 else 1 end) FROM (select id, transdate, entity_credit_account, invoice, amount, 'ar' as class FROM ar UNION select id, transdate, entity_credit_account, invoice, amount, 'ap' as class from ap ) gl JOIN (select trans_id, 'acc_trans' as relation, sum(amount) as amount, sum(case when atf.reportable then amount else 0 end) as reportable_amount FROM acc_trans LEFT JOIN ac_tax_form atf ON (acc_trans.entry_id = atf.entry_id) GROUP BY trans_id UNION select trans_id, 'invoice' as relation, sum(sellprice * qty) as amount, sum(case when itf.reportable then sellprice * qty else 0 end) as reportable_amount FROM invoice LEFT JOIN invoice_tax_form itf ON (invoice.id = itf.invoice_id) GROUP BY trans_id ) ac ON (ac.trans_id = gl.id AND ((gl.invoice is true and ac.relation='invoice') OR (gl.invoice is false and ac.relation='acc_trans'))) JOIN (SELECT ac.trans_id, sum(ac.amount) as amount, as_array(entry_id) as entry_ids, as_array(chart_id) as chart_ids, count(*) as num FROM acc_trans ac where chart_id in (select account_id from account_link where description like '%paid') AND transdate BETWEEN in_begin AND in_end group by ac.trans_id ) pmt ON (pmt.trans_id = gl.id) JOIN entity_credit_account ON (gl.entity_credit_account = entity_credit_account.id) JOIN entity ON (entity.id = entity_credit_account.entity_id) JOIN company ON (entity.id = company.entity_id) JOIN country_tax_form ON (entity_credit_account.taxform_id = country_tax_form.id) WHERE country_tax_form.id = in_tax_form_id GROUP BY legal_name, meta_number, company.entity_id, entity_credit_account.entity_class, entity.control_code, entity_credit_account.id LOOP RETURN NEXT out_row; END LOOP; END; $BODY$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION tax_form_summary_report (in_tax_form_id int, in_begin date, in_end date) IS $$This provides the total reportable value per vendor. As per 1099 forms, these are cash-basis documents and show amounts paid.$$; CREATE OR REPLACE FUNCTION tax_form_details_report(in_tax_form_id int, in_begin date, in_end date, in_meta_number text) RETURNS SETOF tax_form_report_detail_item AS $BODY$ DECLARE out_row tax_form_report_detail_item; BEGIN FOR out_row IN SELECT entity_credit_account.id, company.legal_name, company.entity_id, entity_credit_account.entity_class, entity.control_code, entity_credit_account.meta_number, sum(CASE WHEN gl.amount = 0 then 0 when relation = 'acc_trans' THEN ac.reportable_amount * pmt.amount / gl.amount ELSE 0 END * CASE WHEN gl.class = 'ap' THEN -1 else 1 end), sum(CASE WHEN gl.amount = 0 then 0 WHEN relation = 'invoice' THEN ac.reportable_amount * pmt.amount / gl.amount ELSE 0 END * CASE WHEN gl.class = 'ar' THEN -1 else 1 end), SUM(CASE WHEN gl.amount = 0 THEN 0 ELSE ac.reportable_amount * pmt.amount / gl.amount END * CASE WHEN gl.class = 'ap' THEN -1 else 1 end * CASE WHEN relation = 'invoice' THEN -1 ELSE 1 END), gl.invnumber, gl.duedate::text, gl.id FROM (select id, entity_credit_account, invnumber, duedate, amount, transdate, 'ar' as class FROM ar UNION select id, entity_credit_account, invnumber, duedate, amount, transdate, 'ap' as class FROM ap ) gl JOIN (select trans_id, 'acc_trans' as relation, sum(amount) as amount, sum(case when atf.reportable then amount else 0 end) as reportable_amount FROM acc_trans LEFT JOIN ac_tax_form atf ON (acc_trans.entry_id = atf.entry_id) GROUP BY trans_id UNION select trans_id, 'invoice' as relation, sum(sellprice * qty) as amount, sum(case when itf.reportable then sellprice * qty else 0 end) as reportable_amount FROM invoice LEFT JOIN invoice_tax_form itf ON (invoice.id = itf.invoice_id) GROUP BY trans_id ) ac ON (ac.trans_id = gl.id) JOIN entity_credit_account ON (gl.entity_credit_account = entity_credit_account.id) JOIN entity ON (entity.id = entity_credit_account.entity_id) JOIN company ON (entity.id = company.entity_id) JOIN country_tax_form ON (entity_credit_account.taxform_id = country_tax_form.id) JOIN (SELECT ac.trans_id, sum(ac.amount) as amount, as_array(entry_id) as entry_ids, as_array(chart_id) as chart_ids, count(*) as num FROM acc_trans ac where chart_id in (select account_id from account_link where description like '%paid') AND transdate BETWEEN in_begin AND in_end group by ac.trans_id ) pmt ON (pmt.trans_id = gl.id) WHERE country_tax_form.id = in_tax_form_id AND meta_number = in_meta_number GROUP BY legal_name, meta_number, company.entity_id, entity_credit_account.entity_class, entity.control_code, gl.invnumber, gl.duedate, gl.id, entity_credit_account.id LOOP RETURN NEXT out_row; END LOOP; END; $BODY$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION tax_form_details_report (in_tax_form_id int, in_begin date, in_end date, in_meta_number text) IS $$ This provides a list of invoices and transactions that a report hits. This is intended to allow an organization to adjust what is reported on the 1099 before printing them.$$; COMMIT; ledgersmb/sql/modules/TaxForm.sql0000644000000000000000000000370711615026155016101 0ustar rootrootCREATE OR REPLACE FUNCTION tax_form__save(in_id int, in_country_id int, in_form_name text, in_default_reportable bool) RETURNS int AS $$ BEGIN UPDATE country_tax_form SET country_id = in_country_id, form_name =in_form_name, default_reportable = coalesce(in_default_reportable,false) WHERE id = in_id; IF FOUND THEN RETURN in_id; END IF; insert into country_tax_form(country_id,form_name, default_reportable) values (in_country_id, in_form_name, coalesce(in_default_reportable, false)); RETURN currval('country_tax_form_id_seq'); END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION tax_form__save(in_id int, in_country_id int, in_form_name text, in_default_reportable bool) IS $$Saves tax form information to the database.$$; CREATE OR REPLACE FUNCTION tax_form__get(in_form_id int) returns country_tax_form as $$ SELECT * FROM country_tax_form where id = $1; $$ language sql; COMMENT ON FUNCTION tax_form__get(in_form_id int) IS $$ Retrieves specified tax form information from the database.$$; CREATE OR REPLACE FUNCTION tax_form__list_all() RETURNS SETOF country_tax_form AS $BODY$ SELECT * FROM country_tax_form ORDER BY country_id, id; $BODY$ LANGUAGE SQL; COMMENT ON FUNCTION tax_form__list_all() IS $$ Returns a set of all tax forms, ordered by country_id and id$$; CREATE TYPE taxform_list AS ( id int, form_name text, country_id int, country_name text, default_reportable bool ); CREATE OR REPLACE function tax_form__list_ext() RETURNS SETOF taxform_list AS $BODY$ SELECT t.id, t.form_name, t.country_id, c.name, t.default_reportable FROM country_tax_form t JOIN country c ON c.id = t.country_id ORDER BY c.name, t.form_name; $BODY$ language sql; COMMENT ON function tax_form__list_ext() IS $$ Returns a list of tax forms with an added field, country_name, to specify the name of the country.$$; ledgersmb/sql/modules/Fixes.sql0000644000000000000000000004712412033242737015601 0ustar rootroot-- SQL Fixes for upgrades. These must be safe to run repeatedly, or they must -- fail transactionally. Please: one transaction per fix. -- -- Chris Travers BEGIN; -- 1.3.4, fix for menu-- David Bandel update menu_attribute set value = 'receive_order' where value = 'consolidate_sales_order' and node_id = '65'; update menu_attribute set id = '149' where value = 'receive_order' and node_id = '65'; update menu_attribute set value = 'consolidate_sales_order' where value = 'receive_order' and node_id = '64'; update menu_attribute set id = '152' where value = 'consolidate_sales_order' and node_id = '64'; -- fix for bug 3430820 update menu_attribute set value = 'pricegroup' where node_id = '83' and attribute = 'type'; update menu_attribute set value = 'partsgroup' where node_id = '82' and attribute = 'type'; UPDATE menu_attribute SET value = 'partsgroup' WHERE node_id = 91 and attribute = 'type'; UPDATE menu_attribute SET value = 'pricegroup' WHERE node_id = 92 and attribute = 'type'; -- Very restrictive because some people still have Asset handling installed from -- Addons and so the node_id and id values may not match. Don't want to break -- what is working! --CT UPDATE menu_attribute SET value = 'begin_import' WHERE id = 631 and value = 'import' and node_id = '235'; -- Getting rid of System/Backup menu since this is broken DELETE FROM menu_acl WHERE node_id BETWEEN 133 AND 135; DELETE FROM menu_attribute WHERE node_id BETWEEN 133 AND 135; DELETE FROM menu_node WHERE id BETWEEN 133 AND 135; -- bad batch type for receipt batches update menu_attribute set value = 'receipt' where node_id = 203 and attribute='batch_type'; COMMIT; BEGIN; ALTER TABLE entity_credit_account drop constraint "entity_credit_account_language_code_fkey"; COMMIT; BEGIN; ALTER TABLE entity_credit_account ADD FOREIGN KEY (language_code) REFERENCES language(code); COMMIT; BEGIN; UPDATE menu_attribute SET value = 'invoice' WHERE node_id = 117 AND attribute = 'type'; UPDATE menu_attribute SET value = 'sales_order' WHERE node_id = 118 AND attribute = 'type'; COMMIT; BEGIN; ALTER TABLE entity_bank_account DROP CONSTRAINT entity_bank_account_pkey; ALTER TABLE entity_bank_account ALTER COLUMN bic DROP NOT NULL; ALTER TABLE entity_bank_account ADD UNIQUE(bic,iban); CREATE UNIQUE INDEX eba_iban_null_bic_u ON entity_bank_account(iban) WHERE bic IS NULL; COMMIT; BEGIN; -- Data fixes for 1.2-1.3 upgrade. Will fail otherwise --Chris T UPDATE parts SET income_accno_id = (SELECT account.id FROM account JOIN lsmb12.chart USING (accno) WHERE chart.id = income_accno_id), expense_accno_id = (SELECT account.id FROM account JOIN lsmb12.chart USING (accno) WHERE chart.id = expense_accno_id), inventory_accno_id = (SELECT account.id FROM account JOIN lsmb12.chart USING (accno) WHERE chart.id = inventory_accno_id) WHERE id IN (SELECT id FROM lsmb12.parts op WHERE op.id = parts.id AND (op.income_accno_id = parts.income_accno_id OR op.inventory_accno_id = parts.inventory_accno_id or op.expense_accno_id = parts.expense_accno_id)); COMMIT; BEGIN; -- Fix menu Shipping -> Ship to actually point to the shipping interface -- used to point to sales order consolidation UPDATE menu_attribute SET value = 'ship_order' WHERE attribute='type' AND node_id = (SELECT id FROM menu_node WHERE label = 'Ship'); COMMIT; BEGIN; -- fix for non-existant role handling in menu_generate() and related CREATE OR REPLACE FUNCTION menu_generate() RETURNS SETOF menu_item AS $$ DECLARE item menu_item; arg menu_attribute%ROWTYPE; BEGIN FOR item IN SELECT n.position, n.id, c.level, n.label, c.path, to_args(array[ma.attribute, ma.value]) FROM connectby('menu_node', 'id', 'parent', 'position', '0', 0, ',') c(id integer, parent integer, "level" integer, path text, list_order integer) JOIN menu_node n USING(id) JOIN menu_attribute ma ON (n.id = ma.node_id) WHERE n.id IN (select node_id FROM menu_acl JOIN (select rolname FROM pg_roles UNION select 'public') pgr ON pgr.rolname = role_name WHERE pg_has_role(CASE WHEN coalesce(pgr.rolname, 'public') = 'public' THEN current_user ELSE pgr.rolname END, 'USAGE') GROUP BY node_id HAVING bool_and(CASE WHEN acl_type ilike 'DENY' THEN FALSE WHEN acl_type ilike 'ALLOW' THEN TRUE END)) or exists (select cn.id, cc.path FROM connectby('menu_node', 'id', 'parent', 'position', '0', 0, ',') cc(id integer, parent integer, "level" integer, path text, list_order integer) JOIN menu_node cn USING(id) WHERE cn.id IN (select node_id FROM menu_acl JOIN (select rolname FROM pg_roles UNION select 'public') pgr ON pgr.rolname = role_name WHERE pg_has_role(CASE WHEN coalesce(pgr.rolname, 'public') = 'public' THEN current_user ELSE pgr.rolname END, 'USAGE') GROUP BY node_id HAVING bool_and(CASE WHEN acl_type ilike 'DENY' THEN false WHEN acl_type ilike 'ALLOW' THEN TRUE END)) and cc.path like c.path || ',%') GROUP BY n.position, n.id, c.level, n.label, c.path, c.list_order ORDER BY c.list_order LOOP RETURN NEXT item; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION menu_generate() IS $$ This function returns the complete menu tree. It is used to generate nested menus for the web interface. $$; CREATE OR REPLACE FUNCTION menu_children(in_parent_id int) RETURNS SETOF menu_item AS $$ declare item menu_item; arg menu_attribute%ROWTYPE; begin FOR item IN SELECT n.position, n.id, c.level, n.label, c.path, to_args(array[ma.attribute, ma.value]) FROM connectby('menu_node', 'id', 'parent', 'position', in_parent_id, 1, ',') c(id integer, parent integer, "level" integer, path text, list_order integer) JOIN menu_node n USING(id) JOIN menu_attribute ma ON (n.id = ma.node_id) WHERE n.id IN (select node_id FROM menu_acl JOIN (select rolname FROM pg_roles UNION select 'public') pgr ON pgr.rolname = role_name WHERE pg_has_role(CASE WHEN coalesce(pgr.rolname, 'public') = 'public' THEN current_user ELSE pgr.rolname END, 'USAGE') GROUP BY node_id HAVING bool_and(CASE WHEN acl_type ilike 'DENY' THEN FALSE WHEN acl_type ilike 'ALLOW' THEN TRUE END)) or exists (select cn.id, cc.path FROM connectby('menu_node', 'id', 'parent', 'position', '0', 0, ',') cc(id integer, parent integer, "level" integer, path text, list_order integer) JOIN menu_node cn USING(id) WHERE cn.id IN (select node_id FROM menu_acl JOIN (select rolname FROM pg_roles UNION select 'public') pgr ON pgr.rolname = role_name WHERE pg_has_role(CASE WHEN coalesce(pgr.rolname, 'public') = 'public' THEN current_user ELSE pgr.rolname END, 'USAGE') GROUP BY node_id HAVING bool_and(CASE WHEN acl_type ilike 'DENY' THEN false WHEN acl_type ilike 'ALLOW' THEN TRUE END)) and cc.path like c.path || ',%') GROUP BY n.position, n.id, c.level, n.label, c.path, c.list_order ORDER BY c.list_order LOOP return next item; end loop; end; $$ language plpgsql; COMMIT; BEGIN; -- Search Assets menu update menu_node set parent = 229 where id = 233; COMMIT; BEGIN; -- timecard additional info ALTER TABLE jcitems ADD total numeric NOT NULL DEFAULT 0; ALTER TABLE jcitems ADD non_billable numeric NOT NULL DEFAULT 0; UPDATE jcitems SET total = qty WHERE qty IS NOT NULL and total = 0; COMMIT; BEGIN; -- FX RECON ALTER TABLE cr_report ADD recon_fx bool default false; COMMIT; BEGIN; -- MIN VALUE FOR TAXES ALTER TABLE tax ADD minvalue numeric; ALTER TABLE tax ADD maxvalue numeric; COMMIT; BEGIN; ALTER TABLE mime_type ADD invoice_include bool default false; UPDATE mime_type SET invoice_include = 'true' where mime_type like 'image/%'; COMMIT; BEGIN; UPDATE menu_attribute SET value = 'sales_quotation' WHERE node_id = 169 AND attribute = 'template'; UPDATE menu_attribute SET value = 'request_quotation' WHERE node_id = 170 AND attribute = 'template'; COMMIT; BEGIN; -- fixes for menu taking a long time to render when few permissions are granted DROP TYPE IF EXISTS menu_item CASCADE; CREATE TYPE menu_item AS ( position int, id int, level int, label varchar, path varchar, parent int, args varchar[] ); CREATE OR REPLACE FUNCTION menu_generate() RETURNS SETOF menu_item AS $$ DECLARE item menu_item; arg menu_attribute%ROWTYPE; BEGIN FOR item IN WITH RECURSIVE tree (path, id, parent, level, positions) AS (select id::text as path, id, parent, 0 as level, position::text FROM menu_node where parent is null UNION select path || ',' || n.id::text, n.id, n.parent, t.level + 1, t.positions || ',' || n.position FROM menu_node n JOIN tree t ON t.id = n.parent) SELECT n.position, n.id, c.level, n.label, c.path, n.parent, to_args(array[ma.attribute, ma.value]) FROM tree c JOIN menu_node n USING(id) JOIN menu_attribute ma ON (n.id = ma.node_id) WHERE n.id IN (select node_id FROM menu_acl acl LEFT JOIN pg_roles pr on pr.rolname = acl.role_name WHERE CASE WHEN role_name ilike 'public' THEN true WHEN rolname IS NULL THEN FALSE ELSE pg_has_role(rolname, 'USAGE') END GROUP BY node_id HAVING bool_and(CASE WHEN acl_type ilike 'DENY' THEN FALSE WHEN acl_type ilike 'ALLOW' THEN TRUE END)) or exists (select cn.id, cc.path FROM tree cc JOIN menu_node cn USING(id) WHERE cn.id IN (select node_id FROM menu_acl acl LEFT JOIN pg_roles pr on pr.rolname = acl.role_name WHERE CASE WHEN rolname ilike 'public' THEN true WHEN rolname IS NULL THEN FALSE ELSE pg_has_role(rolname, 'USAGE') END GROUP BY node_id HAVING bool_and(CASE WHEN acl_type ilike 'DENY' THEN false WHEN acl_type ilike 'ALLOW' THEN TRUE END)) and cc.path::text like c.path::text || ',%') GROUP BY n.position, n.id, c.level, n.label, c.path, c.positions, n.parent ORDER BY string_to_array(c.positions, ',')::int[] LOOP RETURN NEXT item; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION menu_generate() IS $$ This function returns the complete menu tree. It is used to generate nested menus for the web interface. $$; CREATE OR REPLACE FUNCTION menu_children(in_parent_id int) RETURNS SETOF menu_item AS $$ SELECT * FROM menu_generate() where parent = $1; $$ language sql; COMMENT ON FUNCTION menu_children(int) IS $$ This function returns all menu items which are children of in_parent_id (the only input parameter). It is thus similar to menu_generate() but it only returns the menu items associated with nodes directly descendant from the parent. It is used for menues for frameless browsers.$$; CREATE OR REPLACE FUNCTION menu_insert(in_parent_id int, in_position int, in_label text) returns int AS $$ DECLARE new_id int; BEGIN UPDATE menu_node SET position = position * -1 WHERE parent = in_parent_id AND position >= in_position; INSERT INTO menu_node (parent, position, label) VALUES (in_parent_id, in_position, in_label); SELECT INTO new_id currval('menu_node_id_seq'); UPDATE menu_node SET position = (position * -1) + 1 WHERE parent = in_parent_id AND position < 0; RETURN new_id; END; $$ language plpgsql; comment on function menu_insert(int, int, text) is $$ This function inserts menu items at arbitrary positions. The arguments are, in order: parent, position, label. The return value is the id number of the menu item created. $$; DROP VIEW menu_friendly; CREATE VIEW menu_friendly AS WITH RECURSIVE tree (path, id, parent, level, positions) AS (select id::text as path, id, parent, 0 as level, position::text FROM menu_node where parent is null UNION select path || ',' || n.id::text, n.id, n.parent, t.level + 1, t.positions || ',' || n.position FROM menu_node n JOIN tree t ON t.id = n.parent) SELECT t."level", t.path, (repeat(' '::text, (2 * t."level")) || (n.label)::text) AS label, n.id, n."position" FROM tree t JOIN menu_node n USING (id) ORDER BY string_to_array(t.positions, ',')::int[]; COMMENT ON VIEW menu_friendly IS $$ A nice human-readable view for investigating the menu tree. Does not show menu attributes or acls.$$; COMMIT; BEGIN; -- Fix for menu anomilies DELETE FROM menu_acl where node_id in (select node_id from menu_attribute where attribute = 'menu'); COMMIT; BEGIN; -- fix primary key for make/model ALTER TABLE makemodel DROP CONSTRAINT makemodel_pkey; ALTER TABLE makemodel ADD PRIMARY KEY(parts_id, make, model); COMMIT; BEGIN; -- performance fix for all years list functions create index ac_transdate_year_idx on acc_trans(EXTRACT ('YEAR' FROM transdate)); COMMIT; BEGIN; -- RECEIPT REVERSAL broken: insert into batch_class (id,class) values (7,'receipt_reversal'); COMMIT; ledgersmb/sql/removal/0000755000000000000000000000000012060044550013760 5ustar rootrootledgersmb/sql/removal/drop-Location.sql0000644000000000000000000000005611637430315017223 0ustar rootroot-- Types: DROP TYPE location_result CASCADE; ledgersmb/sql/removal/drop-Company.sql0000644000000000000000000000047111637430315017062 0ustar rootroot-- Only dropping types for now. May want to add functions later. DROP TYPE company_search_result CASCADE; DROP TYPE entity_credit_search_return CASCADE; DROP TYPE entity_credit_retrieve CASCADE; DROP TYPE company_billing_info CASCADE; DROP TYPE contact_list CASCADE; DROP TYPE entity_note_list CASCADE; ledgersmb/sql/removal/drop-Payment.sql0000644000000000000000000000045211637430315017070 0ustar rootrootDROP TYPE payment_vc_info CASCADE; DROP TYPE payment_invoice CASCADE; DROP TYPE payment_contact_invoice CASCADE; DROP TYPE job__status CASCADE; DROP TYPE payment_location_result CASCADE; DROP TYPE payment_record CASCADE; DROP TYPE payment_header_item CASCADE; DROP TYPE payment_line_item CASCADE; ledgersmb/sql/coa/0000755000000000000000000000000012060044550013055 5ustar rootrootledgersmb/sql/coa/uk/0000755000000000000000000000000012060044550013474 5ustar rootrootledgersmb/sql/coa/uk/chart/0000755000000000000000000000000012060044550014575 5ustar rootrootledgersmb/sql/coa/uk/chart/General.sql0000755000000000000000000003113611726631300016705 0ustar rootrootbegin; -- sample COA for UK -- SELECT account_heading_save(NULL, '0000', 'Minimal heading', NULL); SELECT account_save(NULL,'0010','Freehold Property','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0011','Goodwill','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0012','Goodwill Amortisation','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0020','Plant and Machinery','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0021','Plant/Machinery Depreciation','A','', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'0030','Office Equipment','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0031','Office Equipment Depreciation','A','', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'0040','Furniture and Fixtures','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0041','Furniture/Fixture Depreciation','A','', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'0050','Motor Vehicles','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0051','Motor Vehicles Depreciation','A','', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'1001','Stock','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1002','Work in Progress','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1100','Debtors Control Account','A','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1102','Other Debtors','A','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1103','Prepayments','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1200','Bank Current Account','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1210','Bank Deposit Account','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1220','Building Society Account','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1230','Petty Cash','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1240','Company Credit Card','L','', NULL, false, false, string_to_array('', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno in ('1200', '1210', '1220', '1230', '1240'); SELECT account_save(NULL,'2100','Creditors Control Account','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'2102','Other Creditors','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'2109','Accruals','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2200','VAT - Standard rate','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2205','VAT - Reduced rate','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2209','VAT - Zero rate','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2210','P.A.Y.E. & National Insurance','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2220','Net Wages','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2250','Corporation Tax','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2300','Bank Loan','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2305','Directors loan account','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2310','Hire Purchase','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2330','Mortgages','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3000','Ordinary Shares','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3010','Preference Shares','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3100','Share Premium Account','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3200','Profit and Loss Account','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4000','Sales','I','', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'4010','Export Sales','I','', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'4009','Discounts Allowed','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4900','Miscellaneous Income','I','', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'4904','Rent Income','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4906','Interest received','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4920','Foreign Exchange Gain','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5000','Materials Purchased','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5001','Materials Imported','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5002','Opening Stock','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5003','Closing Stock','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5200','Packaging','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5201','Discounts Taken','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5202','Carriage','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5203','Import Duty','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5204','Transport Insurance','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5205','Equipment Hire','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5220','Foreign Exchange Loss','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6000','Productive Labour','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'6001','Cost of Sales Labour','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'6002','Sub-Contractors','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7000','Staff wages & salaries','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7002','Directors Remuneration','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7006','Employers N.I.','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7007','Employers Pensions','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7008','Recruitment Expenses','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7100','Rent','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7102','Water Rates','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7103','General Rates','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7104','Premises Insurance','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7200','Light & heat','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7300','Motor expenses','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7350','Travelling','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7400','Advertising','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7402','P.R. (Literature & Brochures)','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7403','U.K. Entertainment','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7404','Overseas Entertainment','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7500','Postage and Carriage','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7501','Office Stationery','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7502','Telephone','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7506','Web Site costs','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7600','Legal Fees','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7601','Audit and Accountancy Fees','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7603','Professional Fees','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7701','Office Machine Maintenance','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7710','Computer expenses','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7800','Repairs and Renewals','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7801','Cleaning','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7802','Laundry','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7900','Bank Interest Paid','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7901','Bank Charges','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7903','Loan Interest Paid','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7904','H.P. Interest','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8000','Depreciation','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8005','Goodwill Amortisation','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8100','Bad Debt Write Off','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8201','Subscriptions','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8202','Clothing Costs','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8203','Training Costs','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8204','Insurance','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8205','Refreshments','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8500','Dividends','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8600','Corporation Tax','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9999','Suspense Account','E','', NULL, false, false, string_to_array('', ':')); -- INSERT INTO tax (chart_id,rate) VALUES ((SELECT id FROM chart WHERE accno = '2200'),0.20); INSERT INTO tax (chart_id,rate) VALUES ((SELECT id FROM chart WHERE accno = '2205'),0.05); INSERT INTO tax (chart_id,rate) VALUES ((SELECT id FROM chart WHERE accno = '2209'),0.00); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (SELECT id FROM chart WHERE accno = '1001')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (SELECT id FROM chart WHERE accno = '4000')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (SELECT id FROM chart WHERE accno = '5000')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (SELECT id FROM chart WHERE accno = '4920')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (SELECT id FROM chart WHERE accno = '5220')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'GBP:USD:EUR'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/ve/0000755000000000000000000000000012060044550013467 5ustar rootrootledgersmb/sql/coa/ve/chart/0000755000000000000000000000000012060044550014570 5ustar rootrootledgersmb/sql/coa/ve/chart/General.sql0000755000000000000000000002061011726631300016673 0ustar rootrootbegin; -- Venezuela General COA -- modify as needed -- -- ACTIVO SELECT account_heading_save(NULL,'1000','ACTIVO', NULL); SELECT account_save(NULL,'1050','Caja','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1100','Banesco APD','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1110','Provincial','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1120','Venezuela','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1130','Banesco JD','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno in ('1050', '1100', '1110', '1120', '1130'); SELECT account_save(NULL,'1200','Cuentas por Cobrar','A','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1205','Provisión Cuentas Incobrables','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'1500','INVENTARIO', NULL); SELECT account_save(NULL,'1520','Mercancía en Almacén','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1530','Mercancía en Consignación','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL,'1800','ACTIVOS CAPITALES', NULL); SELECT account_save(NULL,'1820','Mobiliario y Equipo','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1825','Amort. Acum. -Inv. y Equip.','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1840','Vehículo','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1845','Amort. Acum. -Vehículo','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1850','Edificio','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1855','Amort. Acum. -Edificio','A','', NULL, false, false, string_to_array('', ':')); -- PASIVO SELECT account_heading_save(NULL,'2000','PASIVO CORTO PLAZO', NULL); SELECT account_save(NULL,'2100','Cuentas por Pagar','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_heading_save(NULL,'2600','PASIVO LARGO PLAZO', NULL); SELECT account_save(NULL,'2620','Préstamos Bancarios','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2680','Préstamos de Accionistas','L','', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_heading_save(NULL,'2700','APARTADOS', NULL); SELECT account_save(NULL,'2710','Apartados Indem. Laborales','L','', NULL, false, false, string_to_array('', ':')); -- CAPITAL SELECT account_heading_save(NULL,'3300','CAPITAL ACCIONARIO', NULL); SELECT account_save(NULL,'3350','Acciones Comunes','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'3400','RESERVAS', NULL); SELECT account_save(NULL,'3410','Reserva Legal','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3420','Reserva Voluntaria','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'3500','UTILIDADES RETENIDAS', NULL); SELECT account_save(NULL,'3590','Utilidades Retenidas - años anteriores','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3600','Ganancia del Ejercicio','Q','', NULL, false, false, string_to_array('', ':')); -- INGRESO SELECT account_heading_save(NULL,'4000','INGRESOS PRINCIPALES', NULL); SELECT account_save(NULL,'4020','Ventas Autopartes','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL,'4400','OTROS INGRESOS', NULL); SELECT account_save(NULL,'4430','Shipping & Handling','I','', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'4440','Intereses','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4450','Ganancia en Paridad Cambiaria','I','', NULL, false, false, string_to_array('', ':')); -- EGRESO SELECT account_heading_save(NULL,'5000','COSTO DE VENTA', NULL); SELECT account_save(NULL,'5010','Compras','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5020','COSTO DE VENTA: Autopartes','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5100','Flete','E','', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); -- HR SELECT account_heading_save(NULL,'5400','GASTO DE PERSONAL', NULL); SELECT account_save(NULL,'5405','Sueldos Directivo y Administradores','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5410','Sueldos Empleados','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5415','Comisiones Vendedores','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5420','Vacaciones','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5425','Bono Vacacional','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5430','Utilidades','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5435','Indemnizaciones','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5440','Movilizaciones y Traslados','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5445','Gastos de Representación','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5450','Instrucción y Mejoramiento','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5600','GASTOS GENERALES', NULL); SELECT account_save(NULL,'5610','Honorarios Profesionales','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5615','Propaganda','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5660','Gasto de Amortización','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5685','Seguros','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5690','Intereses y Gastos Bancarios','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5700','Artículos de Oficina','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5760','Alquileres','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5765','Reparación y Mantenimiento','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5780','Teléfono','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5785','Viajes y Entretenimiento','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5790','Servicios','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5795','Patentes','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5810','Pérdidas Paridad Cambiaria','E','', NULL, false, false, string_to_array('', ':')); -- SELECT account_save(NULL,'2150','IVA','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'5510','ISRL','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5530','Derecho de Frente','E','', NULL, false, false, string_to_array('', ':')); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '2150'),0.16); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '1520')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '4020')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '5020')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '4450')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '5810')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'VEB:USD'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/lv/0000755000000000000000000000000012060044550013476 5ustar rootrootledgersmb/sql/coa/lv/chart/0000755000000000000000000000000012060044550014577 5ustar rootrootledgersmb/sql/coa/lv/chart/General.sql0000755000000000000000000007531611730345473016727 0ustar rootrootbegin; -- Latvian COA -- prepared by Kaspars Melkis -- Sept. 14, 2003 -- checked and edited Sept. 20, 2003, D. Simader -- SELECT account_heading_save(NULL, '1', 'Ilgtermiòa ieguldîjumi', NULL); SELECT account_heading_save(NULL, '2', 'Apgrozâmie lîdzekïi', NULL); SELECT account_heading_save(NULL, '11', 'Nemateriâlie ieguldîjumi', NULL); SELECT account_heading_save(NULL, '12', 'Pamatlîdzekïi', NULL); SELECT account_save(NULL,'1210','Zemes gabali, çkas, bûves, ilggadîgie stâdîjumi un citi nekustamâ îpaðuma objekti','','A', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1290','Pamatlîdzekïu nolietojums (pasîvâ)','','A', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL, '13', 'Ilgtermiòa finansu ieguldîjumi', NULL); SELECT account_heading_save(NULL, '21', 'Krâjumi', NULL); SELECT account_save(NULL,'2130','Gatavâs preces pârdoðanai','','A', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'2310','Norçíini ar pircçjiem un pasûtîtâjiem','','L', NULL, false, false, string_to_array('AP', ':')); SELECT account_heading_save(NULL, '23', 'Norçíini par prasîbâm (ar debitoriem)', NULL); SELECT account_save(NULL,'2350','Norçíini ar citiem debitoriem','','A', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_heading_save(NULL, '26', 'Naudas lîdzekïi', NULL); SELECT account_save(NULL,'2610','Kase','','A', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1380','Aizdevumi uzòçmuma dalîbniekiem un valdei','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1310','Lîdzdalîba meitas uzòçmumu kapitâlâ','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1340','Aizdevumi saistîtajiem uzòçmumiem','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1350','Pârçjie vçrtspapîri','','A', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '5', 'Kreditori', NULL); SELECT account_save(NULL,'1370','Paðu akcijas un daïas','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2210','Pieauguðie produktîvie lopi','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3350','Statûtos paredzçtâs rezerves','','Q', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2220','Jaunlopi un sîkie dzîvnieki','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2320','Par piegâdçm un pasûtîjumiem saòemtie vekseïi','','A', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'2140','Nepabeigtie pasûtîjumi','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2370','Îstermiòa aizdevumi sabiedrîbâm dalîbniekiem un vadîbai','','A', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'1360','Pârçjie aizdevumi','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2120','Nepabeigtie raþojumi','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2330','Meitas uzòçmumu parâdi','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2340','Saistîto uzòçmumu parâdi','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2380','Norçíini par prasîbâm pret personâlu un îstermiòa aizdevumi personâlam','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2410','Nâkamo periodu izdevumi','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2420','Akciju emisijas nocenojums (disagio)','','A', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '25', 'Vçrtspapîri apgrozâmo lîdzekïu sastâvâ un îstermiòa lîdzdalîba kapitâlos', NULL); SELECT account_save(NULL,'2510','Meitas uzòçmuma akcijas un daïas ','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2520','Saistîto uzòçmuma akcijas un daïas ','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2530','Paðu uzòçmuma akcijas un daïas ','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2540','Pârçjie vçrtspapîri un lîdzdalîba kapitâlos','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2640','Akreditîvi, èeki un îpaðu norçíina formu konti','','A', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'2650','Citi konti bankâs','','A', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'2670','Pârçjie naudas lîdzekïi','','A', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '3', 'Paðu kapitâls', NULL); SELECT account_save(NULL,'3130','Ilgtermiòa ieguldîjuma pârvçrtçðanas rezerve','','Q', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3120','Akciju emisijas uzcenojums (agio)','','Q', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '32', 'Privâtkonti', NULL); SELECT account_save(NULL,'3210','Privâtiem nolûkiem izòemtie lîdzekïi','','Q', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '33', 'Rezerves ', NULL); SELECT account_save(NULL,'3310','Rezerves kapitâls','','Q', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3330','Citas likumâ paredzçtâs rezerves','','Q', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3340','Rezerves paðu akcijâm un daïâm','','Q', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3360','Pârçjâs rezerves','','Q', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '34', 'Nesadalîtâ peïòa vai nesegtie zaudçjumi', NULL); SELECT account_save(NULL,'3410','Pârskata gada nesadalîtâ peïòa','','Q', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3420','Iepriekðçjo gadu nesadalîtâ peïòa','','Q', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '4', 'Uzkrâjumi', NULL); SELECT account_save(NULL,'4110','Uzkrâjumi pensijâm pielîdzinâtâm saistîbâm','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4310','Citi uzkrâjumi','','L', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '41', 'Uzkrâjumi pensijâm pielîdzinâmâtâm saistîbâm', NULL); SELECT account_heading_save(NULL, '43', 'Citi uzkrâjumi', NULL); SELECT account_heading_save(NULL, '42', 'Uzkrâjumi paredzamiem nodokïiem', NULL); SELECT account_heading_save(NULL, '51', 'Norçíini par aizòçmumiem', NULL); SELECT account_save(NULL,'5110','Aizòçmumi pret obligâcijâm','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5120','Akcijâs pârvçðamie aizòçmumi','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5130','Aizòçmumi ar lîdzdalîbu peïòâ','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5140','Citi aizòçmumi','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5150','Îstermiòa aizòçmumi no kredîtiestâdçm','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5160','Ilgtermiòa aizòçmumi no kredîtiestâdçm','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5170','Aizòçmumi no kredîtiestâdçm bez norâdîtâ termiòa','','L', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '52', 'Norçíini par saòemtajiem avansiem', NULL); SELECT account_save(NULL,'5210','Norçíini par saòemtiem avansiem','','L', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '54', 'Maksâjamie vekseïi', NULL); SELECT account_heading_save(NULL, '53', 'Norçíini par piegâdâtâjiem un darbuzòçmçjiem', NULL); SELECT account_save(NULL,'5310','Norçíini par piegâdâtâjiem un darbuzòçmçjiem','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5410','Norçíini par paðu izdotajiem vekseïiem','','L', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'5510','Norçíini par parâdiem meitas uzòçmumiem','','L', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'5540','Norçíini par parâdiem citiem uzòçmumiem un dalîbniekiem','','L', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'5550','Norçíini par parâdiem personâlam','','L', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'5520','Norçíini par parâdiem saistîtiem uzòçmumiem','','L', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'5530','Norçíini par parâdiem uzòçmumiem, ar kuriem ir lîgums par lîdzdalîbu','','L', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_heading_save(NULL, '57', 'Norçíini par nodokïiem', NULL); SELECT account_heading_save(NULL, '58', 'Norçíini par dividendçm', NULL); SELECT account_heading_save(NULL, '61', 'Ieòçmumi no pârdoðanas, kas apliekami ar nodokïiem vispârçjâ kârtîbâ', NULL); SELECT account_heading_save(NULL, '62', 'Ieòçmumi no pârdoðanas, kas citâdi apliekami ar nodokïiem', NULL); SELECT account_save(NULL,'6220','Ar îpaðiem nodokïiem apliekamie pârdoðanas ieòçmumi','','I', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL, '63', 'Komisijas, starpniecîbas un citi ieòçmumi', NULL); SELECT account_save(NULL,'6310','Komisijas un starpniecîbas ieòçmumi','','I', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'6320','Ieòçmumi no atkritumu pârstrâdes un realizâcijas','','I', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'6330','Ieòçmumi no taras realizâcijas','','I', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'6340','Ar nodokïiem neapliekamie apgrozîjumi','','I', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL, '64', 'Ieòçmumus samazinoðas atlaides', NULL); SELECT account_save(NULL,'6410','Pieðíirtâs skonto atlaides','','I', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'6420','Pieðíirtie bonusi','','I', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '59', 'Nâkamo periodu ieòçmumi', NULL); SELECT account_heading_save(NULL, '65', 'Pârçjie uzòçmuma ieòçmumi', NULL); SELECT account_save(NULL,'6510','Ieòçmumi no vçrtspapîru kursa paaugstinâðanâs','','I', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'6530','Ieòçmumi no zemes gabalu iznomâðanas','','I', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'6540','Ieòçmumi no apgrozâmo lîdzekïu pârdoðanas','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6550','Ieòçmumi no pamatlîdzekïu iznomâðanas','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6560','Ieòçmumos pârskaitîtais rezervju un uzkrâjumu samazinâjums','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6570','Iepriekðçjo gadu nodokïu samazinâjums','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6580','Papildus ieguldîjumi un citi ieòçmumi','','I', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'6590','Paðu uzòçmuma kapitâlieguldîjumiem izpildîtie darbi','','I', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_heading_save(NULL, '67', 'Citu periodu ieòçmumi, kas attiecas uz pârskata periodu', NULL); SELECT account_save(NULL,'6710','Citu periodu ieòçmumi, kas attiecas uz pârskata periodu','','I', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_heading_save(NULL, '69', 'Sociâlâs infrastruktûras iestâþu un pasâkumu ieòçmumi', NULL); SELECT account_save(NULL,'6930','Sadzîves paklpojumu ieòçmumi','','I', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'6920','Komunâlâs saimniecîbas ieòçmumi','','I', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_heading_save(NULL, '66', 'Gatavâs produkcijas un nepabeigto raþojumu krâjumu un vçrtîbas izmaiòas', NULL); SELECT account_save(NULL,'6610','Gatavâs produkcijas krâjumu un vçrtîbas izmaiòas','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6620','Nepabeigto raþojumu krâjumu un vçrtîbas izmaiòas','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6630','Nepabeigto pasûtîjumu atlikumu un vçtîbas izmaiòas','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6640','Produktîvo un darba dzîvnieku ganâmpulka vçrtîbas izmaiòas','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6940','Sabiedriskâs çdinâðanas ieòçmumi','','I', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'6950','Izglîtîbas iestâþu ieòçmumi','','I', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'6960','Medicînas iestâþu ieòçmumi','','I', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'6970','Kultûras un sporta ietâþu un pasâkumu ieòçmumi','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6980','Pârçjie sociâlâs infrastruktûras iestâþu un pasâkumu ieòçmumi','','I', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '7', 'Saimnieciskâs darbîbas izdevumi', NULL); SELECT account_heading_save(NULL, '71', 'Izdevumi izejvielu, materiâlu un preèu iepirkðanai', NULL); SELECT account_save(NULL,'7110','Izejvielu un materiâlu iepirkðanas un piegâdes izdevumi','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7120','Preèu iepirkðanas un piegâdes izdevumi','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7130','Saòemtâs atlaides','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7140','Taras izdevumi','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7150','Muitas un ievednodevas','','E', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'7160','Pârçjie ârçjie izdevumi','','E', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'7170','Samaksa par darbiem un pakalpojumiem no ârienes','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7190','Pirkto materiâlu un preèu krâjumu un vçrtîbas izmaiòas','','E', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '72', 'Personâla izmaksas', NULL); SELECT account_save(NULL,'7210','Strâdnieku algas','','E', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'7230','Sociâlâs infrastruktûras iestâþu un pasâkumu darbinieku algas','','E', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '73', 'Sociâlâs nodevas un izmaksas', NULL); SELECT account_save(NULL,'7320','Pârçjâs sociâlâs izmaksas','','E', NULL, false, false, string_to_array('AP_tax', ':')); SELECT account_heading_save(NULL, '74', 'Pamatlîdzekïu nolietojums un citu ieguldîjumu vçrtîbas norakstîjumi', NULL); SELECT account_save(NULL,'7410','Nemateriâlo ieguldîjumu vçrtîbas norakstîðana','','E', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '75', 'Pârçjie saimnieciskâs darbîbas izdevumi', NULL); SELECT account_save(NULL,'7510','Dabas aizsardzîbas izdevumi','','E', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'7530','Nodevas par raþoðanâ izmantotiem zemes gabaliem','','E', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'7440','Apgrozâmo lîdzekïu vçrtîbas norakstîðana','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7540','Apdroðinnâðanas maksâjumi (izòemot darbinieku apdroðinâðanu)','','E', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'7550','Pârçjie saimnieciskâs darbîbas izdevumi','','E', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'7560','Strâdnieku vervçðanas un apmâcîbas izdevumi','','E', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_heading_save(NULL, '76', 'Preèu pârdoðanas izdevumi', NULL); SELECT account_save(NULL,'7610','Iesaiòojamais materiâls, tara','','E', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'7620','Preèu transporta izdevumi','','E', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'7630','Preèu transporta apdroðinâðana','','E', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'7640','Samaksâtâs komisijas naudas','','E', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'7650','Citi pârdoðanas izdevumi','','E', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_heading_save(NULL, '77', 'Administrâcijas izdevumi', NULL); SELECT account_save(NULL,'7710','Sakaru izdevumi','','E', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'7720','Kantora (biroja) izdevumi','','E', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'7730','Juristu pakalpojumu apmaksa','','E', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'7740','Gada pârskata un revîzijas izdevumi','','E', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'7750','Naudas apgrozîjuma blakus izdevumi','','E', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'7760','Transporta izdevumi administrâcijas vajadzîbâm','','E', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'7770','Citi vadîðanas un administrâcijas izdevumi','','E', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_heading_save(NULL, '78', 'Pârskata periodâ iekïaujamie iepriekðçjo periodu izdevumi', NULL); SELECT account_save(NULL,'7810','Pârskata periodâ iekïaujamie iepriekðçjo periodu izdevumi','','E', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_heading_save(NULL, '79', 'Sociâlâs infrastruktûras uzturçðanas izdevumi', NULL); SELECT account_save(NULL,'7920','Komuâlâs saimniecîbas izdevumi','','E', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'7940','Sabiedriskâs çdinâðanas izdevumi','','E', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'7950','Izglîtîbas iestâþu izdevumi','','E', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_heading_save(NULL, '8', 'Daþâdi ieòçmumi un izdevumi, peïòa un zaudçjumi', NULL); SELECT account_heading_save(NULL, '81', 'Daþâdi ieòçmumi', NULL); SELECT account_save(NULL,'8110','Ieòçmumi no lîdzdalîbas, vçrtspapîriem un aizdevumiem','','I', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'8120','Pârçjie ieòçmumi no procentiem un tiem pielîdzinâmi ieòçmumi','','I', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'7910','Dzîvokïu saimniecîbas izdevumi','','E', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'8130','Vekseïu diskonta ieòçmumi','','I', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'8150','Ienâkumi no valûtas kursa paaugstinâðanâs','','I', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'8160','Saòemtâs soda naudas un lîgumsodi','','I', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'8170','Peïòa no ârzemju valûtas pârdoðanas vai pirkðanas','','I', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'8190','Citi ieòçmumi','','I', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_heading_save(NULL, '82', 'Daþâdi izdevumi', NULL); SELECT account_save(NULL,'8210','Îstermiòa finansu ieguldîjumu vçrtîbas norakstîðana','','E', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'8220','Samaksâtie procenti un tiem pielîdzinâmie izdevumi','','E', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'8230','Vekseïu diskonta izmaksas','','E', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'8240','Ilgtermiòa aizdevumu procentu samaksa','','E', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'8260','Samaksâtâs soda naudas un lîgumsodi','','E', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'8270','Zaudçjumi no ârzemju valûtas pirkðanas un pârdoðanas','','E', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'8290','Citi izdevumi','','E', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_heading_save(NULL, '83', 'Ârkârtas ieòçmumi', NULL); SELECT account_save(NULL,'8310','Ârkârtas ieòçmumi','','I', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_heading_save(NULL, '84', 'Ârkârtas izdevumi', NULL); SELECT account_save(NULL,'8410','Ârkârtas izdevumi','','E', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_heading_save(NULL, '86', 'Peïòa vai zaudçjumi', NULL); SELECT account_save(NULL,'8610','Peïòa vai zaudçjumi','','I', NULL, false, false, string_to_array('IC_income:IC_expense', ':')); SELECT account_save(NULL,'3220','Privâtie ieguldîjumi','','Q', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6110','Ieòçmumi no pamatdarbîbas produkcijas un pakalpojumu pârdoðanas','','I', NULL, false, false, string_to_array('AR_paid', ':')); SELECT account_save(NULL,'1220','Tehnoloìiskâs iekârtas un maðînas','','A', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1240','Pamatlîdzekïu izveidoðana un nepabeigto celtniecîbas objektu izmaksas','','A', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1320','Aizdevumi meitas uzòçmumam','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2110','Izejvielas un materiâli','','A', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'2190','Avansa maksâjumi par precçm','','A', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1130','Uzòçmuma nemateriâlâ vçrtîba','','A', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1180','Avansa maksâjumi par nemateriâliem aktîviem','','A', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1190','Nemateriâlo ieguldîjumu vçrtîbas norakstîtâ daïa (pasîvâ)','','A', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL, '22', 'Produktîvie un darba dzîvnieki', NULL); SELECT account_save(NULL,'2230','Darba lopi','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2290','Darba lopu norakstîtâ vçrtîba (pasîvâ)','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2360','Norçíini par parakstîtâ sabiedrîbas kapitâlâ neiemaksâtâm summâm','','A', NULL, false, false, string_to_array('AR_paid', ':')); SELECT account_heading_save(NULL, '24', 'Nâkamo periodu izdevumi', NULL); SELECT account_save(NULL,'2620','Norçíinu konti bankâ','','A', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'3110','Pamatkapitâls vai lîdzdalîbas kapitâls','','Q', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '55', 'Norçíini ar uzòçmumiem, dalîbniekiem un personâlu', NULL); SELECT account_heading_save(NULL, '56', 'Norçíini par darba samaksu un ieturçjumiem (izòemot nodokïus)', NULL); SELECT account_save(NULL,'5610','Norçíini par darba algu','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5620','Norçíini par ieturçjumiem no darba algas (izòemot nodokïus)','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5820','Norçíini par iepriekðçjo gadu neizmaksâtajâm dividendçm','','L', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'5810','Norçíini par pârskata gada dividendçm','','L', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'5910','Nâkamo periodu ieòçmumi','','I', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '6', 'Ieòçmumi no uzòçmuma saimnieciskâs darbîbas', NULL); SELECT account_save(NULL,'6210','Ar nodokïiem neapliekamie pârdoðanas ieòçmumi','','I', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'6430','Pieðíirtie rabati un citas tirdzniecîbas atlaides','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6910','Dzîvokïu saimniecîbas ieòçmumi','','I', NULL, false, false, string_to_array('AR_paid', ':')); SELECT account_save(NULL,'7180','Pârçjie materiâlie izdevumi (nodoklis par dabas resursu izmantoðanu, celmu nauda u.c.)','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7240','Pârçjâs personâla izmaksas','','E', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'7220','Pârvaldes personâla un administratîvâ personâla algas','','E', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'7420','Pamatlîdzekïu nolietojums','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7570','Komandçjuma izdevumi','','E', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'7930','Sadzîves pakalpojumu izdevumi','','E', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'7960','Medicîniskâs apkalpoðanas izdevumi','','E', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'7970','Kultûras un sporta iestâþu un pasâkumu izdevumi','','E', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'8140','Ziedojumi un citi tiem pielîdzinâmi ieòçmumi','','I', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'8250','Zaudçjumi no valûtu kursa pazeminâðanâs','','E', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'7980','Pârçjie sociâlâs infrastruktûras uzturçðanas izdevumi','','E', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '87', 'Peïòas izlietojums (bez nodokïiem)', NULL); SELECT account_heading_save(NULL, '88', 'Nodoïi no peïòas un citi saimnieciskâs darbîbas izdevumos neiekïaujamie nodokïi', NULL); SELECT account_save(NULL,'1110','Pçtniecîbas un uzòçmuma attîstîbas izmaksas','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1120','Koncesijas, patenti, licences, tirdzniecîbas zîmes un lîdzîgas tiesîbas; datoru programmas','','A', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1230','Pârçjie pamatlîdzekïi un inventârs','','A', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'5710','Norçíini par peïòas nodokli','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2390','Pârmaksâtie nodokïi, iepriekð samaksâtie nodokïi','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4210','Uzkrâjumi paredzamiem nodokïiem','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5720','Norçíini par citiem nodokïiem, nodevâm un maksâjumiem budþetam','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7310','Sociâlais nodoklis','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8710','Peïòas izlietojums','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8830','Nodoklis par zemi','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8840','Citi saimnieciskâs darbîbas izmaksâs neiekïaujamie nodokïi','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8820','Nodoklis par dabas resursu izmantoðanu no peïòas maksâjamâ daïâ','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8810','Nodoklis no peïòas','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1330','Lîdzdalîbas saistîto uzòçmumu kapitâlâ','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2354','PVN samaksâts 18%','','E', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2352','PVN ieòemtais 18%','','L', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE id IN (select account_id FROM account_link WHERE description = 'AP_paid'); -- INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart where accno = '2352'),'0.18',''); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart where accno = '2354'),'0.18',''); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '1230')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '6010')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '7110')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '8170')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '8270')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'LVL'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/br/0000755000000000000000000000000012060044550013460 5ustar rootrootledgersmb/sql/coa/br/chart/0000755000000000000000000000000012060044550014561 5ustar rootrootledgersmb/sql/coa/br/chart/General.sql0000755000000000000000000001736011726630426016704 0ustar rootrootbegin; -- General Brazilien Portuguese COA -- sample only SELECT account_heading_save(NULL, '1000', 'RECURSOS ATUAIS', NULL); SELECT account_save(NULL,'1060','Checando Cliente','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1065','Caixa Baixo','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno in ('1060', '1065'); SELECT account_save(NULL,'1200','Contas a Receber','A','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1205','Provisão para devedors duvidosos','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '1500', 'INVENTÁRIO DE CLIENTES', NULL); SELECT account_save(NULL,'1520','Inventário / Geral','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1530','Inventário / Mercado Secundário','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1540','Inventário / Computer Parts','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL, '1800', 'CAPITAL ASSETS', NULL); SELECT account_save(NULL,'1820','Escritório Móvel & Equipamentos','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1825','Accum. Amort. -Móvel. & Equip.','A','', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'1840','Veículo','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1845','Accum. Amort. -Veículo','A','', NULL, true, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '2000', 'BALANÇO ATUAL', NULL); SELECT account_save(NULL,'2100','Contas a Pagar','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'2170','Taxas federais','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2310','VAT (7%)','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2320','VAT (8%)','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2380','Contas a pagar de férias','L','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '2400', 'DEDUÇÕES DE FOLHA DE PAGAMENTO', NULL); SELECT account_save(NULL,'2450','Imposto de Renda Devido','L','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '2600', 'Passivi exigível a longo prazo', NULL); SELECT account_save(NULL,'2620','Empréstimo bancário','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2680','Empréstimo de Acionistas','L','', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_heading_save(NULL, '3300', 'DIVISÃO DE CAPITAL', NULL); SELECT account_save(NULL,'3350','Divisão comum','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '4000', 'VENDAS RECEITAS', NULL); SELECT account_save(NULL,'4020','Vendas Gerais','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'4030','Partes para mercado secundário','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'4040','Parte Computacional','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL, '4300', 'CONSULTANDO FONTES DE RENDA', NULL); SELECT account_save(NULL,'4320','Consultando','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'4330','Programando','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'4340','Loja','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL, '4400', 'OUTRAS RENDAS', NULL); SELECT account_save(NULL,'4430','Transporte & Taxa','I','', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'4440','Juros Acumulados','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4450','Ganho de câmbio estrangeiro','I','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '5000', 'CUSTO DE VENDAS DE PRODUTOS', NULL); SELECT account_save(NULL,'5010','Compras','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5050','Mercado Secundário','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5060','Parte Computacional','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5100','Frete','E','', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL, '5400', 'DESPESAS E FOLHA DE PAGAMENTO', NULL); SELECT account_save(NULL,'5410','Salários','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '5600', 'GERAL E DESPESAS ADMINISTRATIVAS', NULL); SELECT account_save(NULL,'5610','Contabilidade & Leis','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5615','Publicidade & Promoções','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5620','Balanço','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5660','Amortização','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5680','Imposto de Renda','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5685','Seguro','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5690','Interesses & Encargos Bancários','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5700','Materiais de Escritório','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5760','Aluguel','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5765','Manutenção & Reparos','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5780','Telefone','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5785','Cursos & Entretenimentos','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5790','Serviços Públicos','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5800','Licenciamento para exportações','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5810','Troca com Estrangeiro','E','', NULL, false, false, string_to_array('', ':')); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '2310'),0.07); insert into tax (chart_id,rate) values ((select id from chart where accno = '2320'),0.08); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '1520')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '4020')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '5010')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '4450')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '5810')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'R :EUR:USD'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); -- commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/at/0000755000000000000000000000000012060044550013461 5ustar rootrootledgersmb/sql/coa/at/gifi/0000755000000000000000000000000012060044550014377 5ustar rootrootledgersmb/sql/coa/at/gifi/General.sql0000755000000000000000000007022310573160304016507 0ustar rootrootbegin; -- Österreichischer Einheitskontenrahmen / Kontenplan (ÖSV Österreichischer Steuerverein) -- INSERT INTO gifi (accno, description) VALUES ('0', 'Anlagevermögen und Aufwendungen für das Ingangsetzen und Erweitern eines Betriebes'); -- INSERT INTO gifi (accno, description) VALUES ('00', 'Aufwendungen für das Ingangsetzen und Erweitern eines Betriebes'); INSERT INTO gifi (accno, description) VALUES ('001', 'Aufwendungen für das Ingangsetzen und Erweitern eines Betriebes'); INSERT INTO gifi (accno, description) VALUES ('009', 'Kumulierte Abschreibungen'); -- INSERT INTO gifi (accno, description) VALUES ('01', 'Immaterielle Vermögensgegenstände'); INSERT INTO gifi (accno, description) VALUES ('010', 'Konzessionen'); INSERT INTO gifi (accno, description) VALUES ('011', 'Patentrechte und Lizenzen'); INSERT INTO gifi (accno, description) VALUES ('012', 'Datenverarbeitungsprogramme'); INSERT INTO gifi (accno, description) VALUES ('013', 'Marken, Warenzeichen und Musterschutzrechte, sonstige Urheberrechte'); INSERT INTO gifi (accno, description) VALUES ('014', 'Pacht- und Mietrechte'); INSERT INTO gifi (accno, description) VALUES ('015', 'Geschäfts(Firmen)wert'); INSERT INTO gifi (accno, description) VALUES ('018', 'Geleistete Anzahlungen'); INSERT INTO gifi (accno, description) VALUES ('019', 'Kumulierte Abschreibungen'); -- INSERT INTO gifi (accno, description) VALUES ('02-03', 'Grundstücke, grundstücksgleiche Rechte und Bauten, einschließlich der Bauten auf fremden Grund'); INSERT INTO gifi (accno, description) VALUES ('020', 'Unbebaute Grundstücke'); INSERT INTO gifi (accno, description) VALUES ('021', 'Bebaute Grundstücke (Grundwert)'); INSERT INTO gifi (accno, description) VALUES ('022', 'Grundstücksgleiche Rechte'); INSERT INTO gifi (accno, description) VALUES ('030', 'Betriebs- und Geschäftsgebäude auf eigenem Grund'); INSERT INTO gifi (accno, description) VALUES ('031', 'Wohn- und Sozialgebäude auf eigenem Grund'); INSERT INTO gifi (accno, description) VALUES ('032', 'Betriebs- und Geschäftsgebäude auf fremdem Grund'); INSERT INTO gifi (accno, description) VALUES ('033', 'Wohn- und Sozialgebäude auf fremdem Grund'); INSERT INTO gifi (accno, description) VALUES ('034', 'Grundstückseinrichtungen auf eigenem Grund'); INSERT INTO gifi (accno, description) VALUES ('035', 'Grundstückseinrichtungen auf fremdem Grund'); INSERT INTO gifi (accno, description) VALUES ('036', 'Bauliche Investitionen in fremden (gepachteten) Betriebs- und Geschäftsgebäuden'); INSERT INTO gifi (accno, description) VALUES ('037', 'Bauliche Investitionen in fremden (gepachteten) Wohn- und Sozialgebäuden'); INSERT INTO gifi (accno, description) VALUES ('039', 'Kumulierte Abschreibungen'); -- INSERT INTO gifi (accno, description) VALUES ('04-05', 'Technische Anlagen und Maschinen'); INSERT INTO gifi (accno, description) VALUES ('040', 'Fertigungsmaschinen'); INSERT INTO gifi (accno, description) VALUES ('041', 'Antriebsmaschinen'); INSERT INTO gifi (accno, description) VALUES ('042', 'Energieversorgungsanlagen'); INSERT INTO gifi (accno, description) VALUES ('043', 'Transportanlagen'); INSERT INTO gifi (accno, description) VALUES ('044-049', 'Sonstige Maschinen und maschinelle Anlagen'); INSERT INTO gifi (accno, description) VALUES ('050', 'Maschinenwerkzeuge'); INSERT INTO gifi (accno, description) VALUES ('051', 'Allgemeine Werkzeuge und Handwerkzeuge'); INSERT INTO gifi (accno, description) VALUES ('052', 'Vorrichtungen, Formen und Modelle'); INSERT INTO gifi (accno, description) VALUES ('053', 'Andere Erzeugungshilfsmittel'); INSERT INTO gifi (accno, description) VALUES ('054', 'Hebezeuge und Montageanlagen'); INSERT INTO gifi (accno, description) VALUES ('055', 'Geringwertige Vermögensgegenstände, soweit im Erzeugungsprozeß verwendet'); -- INSERT INTO gifi (accno, description) VALUES ('06', 'Andere Anlagen, Betriebs- und Geschäftsausstattung'); INSERT INTO gifi (accno, description) VALUES ('060', 'Beheizungs- und Beleuchtungsanlagen'); INSERT INTO gifi (accno, description) VALUES ('061', 'Nachrichten- und Kontrollanlagen'); INSERT INTO gifi (accno, description) VALUES ('062', 'Büromaschinen, EDV-Anlagen'); INSERT INTO gifi (accno, description) VALUES ('063', 'PKW'); INSERT INTO gifi (accno, description) VALUES ('064', 'LKW'); INSERT INTO gifi (accno, description) VALUES ('065', 'Andere Beförderungsmittel'); INSERT INTO gifi (accno, description) VALUES ('066', 'Andere Betriebs- und Geschäftsausstattung'); INSERT INTO gifi (accno, description) VALUES ('067', 'Gebinde'); INSERT INTO gifi (accno, description) VALUES ('068', 'Geringwertige Vermögensgegenstände, soweit nicht im Erzeugungsprozeß verwendet'); INSERT INTO gifi (accno, description) VALUES ('069', 'Kumulierte Abschreibungen'); -- INSERT INTO gifi (accno, description) VALUES ('07', 'Geleistete Anzahlungen und Anlagen in Bau'); INSERT INTO gifi (accno, description) VALUES ('070', 'Geleistete Anzahlungen'); INSERT INTO gifi (accno, description) VALUES ('071', 'Anlagen in Bau'); INSERT INTO gifi (accno, description) VALUES ('079', 'Kumulierte Abschreibungen'); -- INSERT INTO gifi (accno, description) VALUES ('08-09', 'Finanzanlagen'); INSERT INTO gifi (accno, description) VALUES ('080', 'Anteile an verbundenen Unternehmen'); INSERT INTO gifi (accno, description) VALUES ('081', 'Beteiligungen an Gemeinschaftsunternehmen'); INSERT INTO gifi (accno, description) VALUES ('082', 'Beteiligungen an angeschlossenen (assoziierten) Unternehmen'); INSERT INTO gifi (accno, description) VALUES ('083', 'Sonstige Beteiligungen'); INSERT INTO gifi (accno, description) VALUES ('084', 'Ausleihungen an verbundene Unternehmen'); INSERT INTO gifi (accno, description) VALUES ('085', 'Ausleihungen an Unternehmen, mit denen ein Beteiligungsverhältnis besteht'); INSERT INTO gifi (accno, description) VALUES ('086', 'Sonstige Ausleihungen'); INSERT INTO gifi (accno, description) VALUES ('087', 'Anteile an Kapitalgesellschaften ohne Beteiligungscharakter'); INSERT INTO gifi (accno, description) VALUES ('088', 'Anteile an Personengesellschaften ohne Beteiligungscharakter'); INSERT INTO gifi (accno, description) VALUES ('090', 'Genossenschaftsanteile ohne Beteiligungscharakter'); INSERT INTO gifi (accno, description) VALUES ('091', 'Anteile an Investmentfonds'); INSERT INTO gifi (accno, description) VALUES ('092-093', 'Festverzinsliche Wertpapiere des Anlagevermögens'); INSERT INTO gifi (accno, description) VALUES ('094-097', 'Sonstige Finanzanlagen, Wertrechte'); INSERT INTO gifi (accno, description) VALUES ('098', 'Geleistete Anzahlungen'); INSERT INTO gifi (accno, description) VALUES ('099', 'Kumulierte Abschreibungen'); -- INSERT INTO gifi (accno, description) VALUES ('1', 'Vorräte'); INSERT INTO gifi (accno, description) VALUES ('100-109', 'Bezugsverrechnung'); INSERT INTO gifi (accno, description) VALUES ('110-119', 'Rohstoffe'); INSERT INTO gifi (accno, description) VALUES ('120-129', 'Bezogene Teile'); INSERT INTO gifi (accno, description) VALUES ('130-134', 'Hilfsstoffe'); INSERT INTO gifi (accno, description) VALUES ('135-139', 'Betriebsstoffe'); INSERT INTO gifi (accno, description) VALUES ('140-149', 'Unfertige Erzeugnisse'); INSERT INTO gifi (accno, description) VALUES ('150-159', 'Fertige Erzeugnisse'); INSERT INTO gifi (accno, description) VALUES ('160-169', 'Waren'); INSERT INTO gifi (accno, description) VALUES ('170-179', 'Noch nicht abrechenbare Leistungen'); INSERT INTO gifi (accno, description) VALUES ('180', 'Geleistete Anzahlungen'); INSERT INTO gifi (accno, description) VALUES ('190-199', 'Wertberichtigungen'); -- INSERT INTO gifi (accno, description) VALUES ('2', 'Sonstiges Umlaufvermögen, Rechnungsabgrenzungsposten'); INSERT INTO gifi (accno, description) VALUES ('20-21', 'Forderungen aus Lieferungen und Leistungen'); INSERT INTO gifi (accno, description) VALUES ('200-207', 'Forderungen aus Lieferungen und Leistungen Inland'); INSERT INTO gifi (accno, description) VALUES ('208', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Inland'); INSERT INTO gifi (accno, description) VALUES ('209', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Inland'); INSERT INTO gifi (accno, description) VALUES ('210-212', 'Forderungen aus Lieferungen und Leistungen Währungsunion'); INSERT INTO gifi (accno, description) VALUES ('213', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Währungsunion'); INSERT INTO gifi (accno, description) VALUES ('214', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Währungsunion'); INSERT INTO gifi (accno, description) VALUES ('215-217', 'Forderungen aus Lieferungen und Leistungen sonstiges Ausland'); INSERT INTO gifi (accno, description) VALUES ('218', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen sonstiges Ausland'); INSERT INTO gifi (accno, description) VALUES ('219', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen sonstiges Ausland'); -- INSERT INTO gifi (accno, description) VALUES ('22', 'Forderungen gegenüber verbundenen Unternehmen und Unternehmen, mit denen ein Beteiligungsverhältnis besteht'); INSERT INTO gifi (accno, description) VALUES ('220-222', 'Forderungen gegenüber verbundenen Unternehmen'); INSERT INTO gifi (accno, description) VALUES ('223', 'Einzelwertberichtigungen zu Forderungen gegenüber verbundenen Unternehmen'); INSERT INTO gifi (accno, description) VALUES ('224', 'Pauschalwertberichtigungen zu Forderungen gegenüber verbundenen Unternehmen'); INSERT INTO gifi (accno, description) VALUES ('225-227', 'Forderungen gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht'); INSERT INTO gifi (accno, description) VALUES ('228', 'Einzelwertberichtigungen zu Forderungen gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht'); INSERT INTO gifi (accno, description) VALUES ('229', 'Pauschalwertberichtigungen zu Forderungen gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht'); -- INSERT INTO gifi (accno, description) VALUES ('23-24', 'Sonstige Forderungen und Vermögensgegenstände'); INSERT INTO gifi (accno, description) VALUES ('230-246', 'Sonstige Forderungen und Vermögensgegenstände'); INSERT INTO gifi (accno, description) VALUES ('247', 'Eingeforderte, aber noch nicht eingezahlte Einlagen'); INSERT INTO gifi (accno, description) VALUES ('248', 'Einzelwertberichtigungen zu sonstigen Forderungen und Vermögensgegenständen'); INSERT INTO gifi (accno, description) VALUES ('249', 'Pauschalwertberichtigungen zu sonstigen Forderungen und Vermögensgegenständen'); -- INSERT INTO gifi (accno, description) VALUES ('25', 'Forderungen aus der Abgabenverrechnung'); INSERT INTO gifi (accno, description) VALUES ('250-259', 'Forderungen aus der Abgabenverrechnung'); -- INSERT INTO gifi (accno, description) VALUES ('26', 'Wertpapiere und Anteile'); INSERT INTO gifi (accno, description) VALUES ('260', 'Eigene Anteile'); INSERT INTO gifi (accno, description) VALUES ('261', 'Anteile an verbundenen Unternehmen'); INSERT INTO gifi (accno, description) VALUES ('262', 'Sonstige Anteile'); INSERT INTO gifi (accno, description) VALUES ('263-267', 'Sonstige Wertpapiere'); INSERT INTO gifi (accno, description) VALUES ('268', 'Besitzwechsel, soweit dem Unternehmen nicht die der Ausstellung zugrundeliegenden Forderungen zustehen'); INSERT INTO gifi (accno, description) VALUES ('269', 'Wertberichtigungen'); -- INSERT INTO gifi (accno, description) VALUES ('27-28', 'Kassenbestand, Schecks, Guthaben bei Kreditinstituten'); INSERT INTO gifi (accno, description) VALUES ('270-272', 'Kassenbestände in Inlandswährung'); INSERT INTO gifi (accno, description) VALUES ('273', 'Postwertzeichen'); INSERT INTO gifi (accno, description) VALUES ('274', 'Stempelmarken'); INSERT INTO gifi (accno, description) VALUES ('275-277', 'Kassenbestände in Fremdwährung'); INSERT INTO gifi (accno, description) VALUES ('278', 'Schecks in Inlandswährung'); INSERT INTO gifi (accno, description) VALUES ('280-288', 'Guthaben bei Kreditinstituten'); INSERT INTO gifi (accno, description) VALUES ('289', 'Wertberichtigungen'); -- INSERT INTO gifi (accno, description) VALUES ('29', 'Rechnungsabgrenzungsposten'); INSERT INTO gifi (accno, description) VALUES ('290', 'Aktive Rechnungsabgrenzungsposten'); INSERT INTO gifi (accno, description) VALUES ('295', 'Disagio'); INSERT INTO gifi (accno, description) VALUES ('296', 'Unterschiedsbetrag zur gebotenen Pensionsrückstellung'); INSERT INTO gifi (accno, description) VALUES ('297', 'Unterschiedsbetrag gem. Abschnitt XII Pensionskassengesetz'); INSERT INTO gifi (accno, description) VALUES ('298', 'Steuerabgrenzung'); -- INSERT INTO gifi (accno, description) VALUES ('3', 'Rückstellungen, Verbindlichkeiten und Rechnungsabgrenzungsposten'); -- INSERT INTO gifi (accno, description) VALUES ('30', 'Rückstellungen'); INSERT INTO gifi (accno, description) VALUES ('300', 'Rückstellungen für Abfertigungen'); INSERT INTO gifi (accno, description) VALUES ('301', 'Rückstellungen für Pensionen'); INSERT INTO gifi (accno, description) VALUES ('302-303', 'Steuerrückstellungen'); INSERT INTO gifi (accno, description) VALUES ('304-309', 'Sonstige Rückstellungen'); -- INSERT INTO gifi (accno, description) VALUES ('31', 'Anleihen, Verbindlichkeiten gegenüber Kreditinstituten und Finanzinstituten'); INSERT INTO gifi (accno, description) VALUES ('310', 'Anleihen (einschließlich konvertibler)'); INSERT INTO gifi (accno, description) VALUES ('311-317', 'Verbindlichkeiten gegenüber Kreditinstituten'); INSERT INTO gifi (accno, description) VALUES ('318-319', 'Verbindlichkeiten gegenüber Finanzinstituten'); -- INSERT INTO gifi (accno, description) VALUES ('32', 'Erhaltene Anzahlungen auf Bestellungen'); INSERT INTO gifi (accno, description) VALUES ('320', 'Erhaltene Anzahlungen auf Bestellungen'); INSERT INTO gifi (accno, description) VALUES ('321', 'Umsatzsteuer-Evidenzkonto für erhaltene Anzahlungen auf Bestellungen'); -- INSERT INTO gifi (accno, description) VALUES ('33', 'Verbindlichkeiten aus Lieferungen und Leistungen, Verbindlichkeiten aus der Annahme gezogener und der Ausstellung eigener Wechsel'); INSERT INTO gifi (accno, description) VALUES ('330-335', 'Verbindlichkeiten aus Lieferungen und Leistungen Inland'); INSERT INTO gifi (accno, description) VALUES ('336', 'Verbindlichkeiten aus Lieferungen und Leistungen Währungsunion'); INSERT INTO gifi (accno, description) VALUES ('337', 'Verbindlichkeiten aus Lieferungen und Leistungen sonstiges Ausland'); INSERT INTO gifi (accno, description) VALUES ('338-339', 'Verbindlichkeiten aus der Annahme gezogener Wechsel und der Ausstellung eigener Wechsel'); -- INSERT INTO gifi (accno, description) VALUES ('34', 'Verbindlichkeiten gegenüber verbundenen Unternehmen, gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht und gegenüber Gesellschaftern'); INSERT INTO gifi (accno, description) VALUES ('340-347', 'Verbindlichkeiten gegenüber verbundenen Unternehmen, Verbindlichkeiten gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht'); INSERT INTO gifi (accno, description) VALUES ('348', 'Verbindlichkeiten gegenüber Gesellschaftern'); -- INSERT INTO gifi (accno, description) VALUES ('35', 'Verbindlichkeiten aus Steuern'); INSERT INTO gifi (accno, description) VALUES ('350-359', 'Verbindlichkeiten aus Steuern'); -- INSERT INTO gifi (accno, description) VALUES ('36', 'Verbindlichkeiten im Rahmen der sozialen Sicherheit'); INSERT INTO gifi (accno, description) VALUES ('360-369', 'Verbindlichkeiten im Rahmen der sozialen Sicherheit'); -- INSERT INTO gifi (accno, description) VALUES ('37-38', 'Übrige sonstige Verbindlichkeiten'); INSERT INTO gifi (accno, description) VALUES ('370-389', 'Übrige sonstige Verbindlichkeiten'); -- INSERT INTO gifi (accno, description) VALUES ('39', 'Rechnungsabgrenzungsposten'); INSERT INTO gifi (accno, description) VALUES ('390-399', 'Passive Rechnungsabgrenzungsposten'); -- INSERT INTO gifi (accno, description) VALUES ('4', 'Betriebliche Erträge'); -- INSERT INTO gifi (accno, description) VALUES ('40-44', 'Brutto-Umsatzerlöse und Erlösschmälerungen'); INSERT INTO gifi (accno, description) VALUES ('400-439', 'Brutto-Umsatzerlöse'); INSERT INTO gifi (accno, description) VALUES ('440-449', 'Erlösschmälerungen'); -- INSERT INTO gifi (accno, description) VALUES ('45', 'Bestandsveränderungen und aktivierte Eigenleistungen'); INSERT INTO gifi (accno, description) VALUES ('450-457', 'Veränderungen des Bestandes an fertigen und unfertigen Erzeugnissen sowie an noch nicht abrechenbaren Leistungen'); INSERT INTO gifi (accno, description) VALUES ('458-459', 'andere aktivierte Eigenleistungen'); -- INSERT INTO gifi (accno, description) VALUES ('46-49', 'Sonstige betriebliche Erträge'); INSERT INTO gifi (accno, description) VALUES ('460-462', 'Erlöse aus dem Abgang vom Anlagevermögen, ausgenommen Finanzanlagen'); INSERT INTO gifi (accno, description) VALUES ('463-465', 'Erträge aus dem Abgang vom Anlagevermögen, ausgenommen Finanzanlagen'); INSERT INTO gifi (accno, description) VALUES ('466-467', 'Erträge aus der Zuschreibung zum Anlagevermögen, ausgenommen Finanzanlagen'); INSERT INTO gifi (accno, description) VALUES ('470-479', 'Erträge aus der Auflösung von Rückstellungen'); INSERT INTO gifi (accno, description) VALUES ('480-499', 'Übrige betriebliche Erträge'); -- INSERT INTO gifi (accno, description) VALUES ('5', 'Materialaufwand und sonstige bezogene Herstellungsleistungen'); INSERT INTO gifi (accno, description) VALUES ('500-509', 'Wareneinsatz'); INSERT INTO gifi (accno, description) VALUES ('510-519', 'Verbrauch von Rohstoffen'); INSERT INTO gifi (accno, description) VALUES ('520-529', 'Verbrauch von bezogenen Fertig- und Einzelteilen'); INSERT INTO gifi (accno, description) VALUES ('530-539', 'Verbrauch von Hilfsstoffen'); INSERT INTO gifi (accno, description) VALUES ('540-549', 'Verbrauch von Betriebsstoffen'); INSERT INTO gifi (accno, description) VALUES ('550-559', 'Verbrauch von Werkzeugen und anderen Erzeugungshilfsmitteln'); INSERT INTO gifi (accno, description) VALUES ('560-569', 'Verbrauch von Brenn- und Treibstoffen, Energie und Wasser'); INSERT INTO gifi (accno, description) VALUES ('570-579', 'Sonstige bezogene Herstellungsleistungen'); INSERT INTO gifi (accno, description) VALUES ('580', 'Skontoerträge auf Materialaufwand'); INSERT INTO gifi (accno, description) VALUES ('581', 'Skontoerträge auf sonstige bezogene Herstellungsleistungen'); INSERT INTO gifi (accno, description) VALUES ('590', 'Aufwandsstellenrechnung'); -- INSERT INTO gifi (accno, description) VALUES ('6', 'Personalaufwand'); INSERT INTO gifi (accno, description) VALUES ('600-619', 'Löhne'); INSERT INTO gifi (accno, description) VALUES ('620-639', 'Gehälter'); INSERT INTO gifi (accno, description) VALUES ('640-644', 'Aufwendungen für Abfertigungen'); INSERT INTO gifi (accno, description) VALUES ('645-649', 'Aufwendungen für Altersversorgung'); INSERT INTO gifi (accno, description) VALUES ('650-655', 'Gesetzlicher Sozialaufwand Arbeiter'); INSERT INTO gifi (accno, description) VALUES ('656-659', 'Gesetzlicher Sozialaufwand Angestellte'); INSERT INTO gifi (accno, description) VALUES ('660-665', 'Lohnabhängige Abgaben und Pflichtbeiträge'); INSERT INTO gifi (accno, description) VALUES ('666-669', 'Gehaltsabhängige Abgaben und Pflichtbeiträge'); INSERT INTO gifi (accno, description) VALUES ('670-689', 'Sonstige Sozialaufwendungen'); INSERT INTO gifi (accno, description) VALUES ('690', 'Aufwandsstellenrechnung'); -- INSERT INTO gifi (accno, description) VALUES ('7', 'Abschreibungen und sonstige betriebliche Aufwendunge'); -- INSERT INTO gifi (accno, description) VALUES ('70', 'Abschreibungen'); INSERT INTO gifi (accno, description) VALUES ('700', 'Abschreibungen auf aktivierte Aufwendungen für das Ingangsetzen und Erweitern eines Betriebes'); INSERT INTO gifi (accno, description) VALUES ('701-708', 'Abschreibungen auf das Anlagevermögen (ausgenommen Finanzanlagen)'); INSERT INTO gifi (accno, description) VALUES ('709', 'Abschreibungen vom Umlaufvermögen, soweit diese die im Unternehmen üblichen Abschreibungen übersteigen'); -- INSERT INTO gifi (accno, description) VALUES ('71', 'Sonstige Steuern'); INSERT INTO gifi (accno, description) VALUES ('710-719', 'Sonstige Steuern'); -- INSERT INTO gifi (accno, description) VALUES ('72-78', 'Übrige betriebliche Aufwendungen'); -- INSERT INTO gifi (accno, description) VALUES ('72', 'Instandhaltung und Reinigung durch Dritte, Entsorgung, Beleuchtung'); INSERT INTO gifi (accno, description) VALUES ('720-729', 'Instandhaltung und Reinigung durch Dritte, Entsorgung, Beleuchtung'); -- INSERT INTO gifi (accno, description) VALUES ('73', 'Transport-, Reise- und Fahrtaufwand, Nachrichtenaufwand'); INSERT INTO gifi (accno, description) VALUES ('730-731', 'Transporte durch Dritte'); INSERT INTO gifi (accno, description) VALUES ('732-733', 'Kfz-Aufwand'); INSERT INTO gifi (accno, description) VALUES ('734-735', 'Reise- und Fahrtaufwand'); INSERT INTO gifi (accno, description) VALUES ('736-737', 'Tag- und Nächtigungsgelder'); INSERT INTO gifi (accno, description) VALUES ('738-739', 'Nachrichtenaufwand'); -- INSERT INTO gifi (accno, description) VALUES ('74', 'Miet-, Pacht-, Leasing- und Lizenzaufwand'); INSERT INTO gifi (accno, description) VALUES ('740-743', 'Miet- und Pachtaufwand'); INSERT INTO gifi (accno, description) VALUES ('744-747', 'Leasingaufwand'); INSERT INTO gifi (accno, description) VALUES ('748-749', 'Lizenzaufwand'); -- INSERT INTO gifi (accno, description) VALUES ('75', 'Aufwand für beigestelltes Personal, Provisionen an Dritte, Aufsichtsratsvergütungen'); INSERT INTO gifi (accno, description) VALUES ('750-753', 'Aufwand für beigestelltes Personal'); INSERT INTO gifi (accno, description) VALUES ('754-757', 'Provisionen an Dritte'); INSERT INTO gifi (accno, description) VALUES ('758-759', 'Aufsichtsratsvergütungen'); -- INSERT INTO gifi (accno, description) VALUES ('76', 'Büro-, Werbe- und Repräsentationsaufwand'); INSERT INTO gifi (accno, description) VALUES ('760', 'Büromaterial und Drucksorten'); INSERT INTO gifi (accno, description) VALUES ('761-762', 'Druckerzeugnisse und Vervielfältigungen'); INSERT INTO gifi (accno, description) VALUES ('763', 'Fachliteratur und Zeitungen'); INSERT INTO gifi (accno, description) VALUES ('765-768', 'Werbung und Repräsentation'); INSERT INTO gifi (accno, description) VALUES ('769', 'Spenden und Trinkgelder'); -- INSERT INTO gifi (accno, description) VALUES ('77-78', 'Versicherungen, Übrige Aufwendungen'); INSERT INTO gifi (accno, description) VALUES ('770-774', 'Versicherungen'); INSERT INTO gifi (accno, description) VALUES ('775-776', 'Beratungs- und Prüfungsaufwand'); INSERT INTO gifi (accno, description) VALUES ('777', 'Aus- und Fortbildung'); INSERT INTO gifi (accno, description) VALUES ('778', 'Mitgliedsbeiträge'); INSERT INTO gifi (accno, description) VALUES ('779', 'Spesen des Geldverkehrs'); INSERT INTO gifi (accno, description) VALUES ('780-781', 'Schadensfälle'); INSERT INTO gifi (accno, description) VALUES ('782', 'Buchwert abgegangener Anlagen, ausgenommen Finanzanlagen'); INSERT INTO gifi (accno, description) VALUES ('783', 'Verluste aus dem Abgang vom Anlagevermögen, ausgenommen Finanzanlagen'); INSERT INTO gifi (accno, description) VALUES ('784-788', 'Verschiedene betriebliche Aufwendungen'); INSERT INTO gifi (accno, description) VALUES ('789', 'Skontoerträge auf sonstige betriebliche Aufwendungen'); -- INSERT INTO gifi (accno, description) VALUES ('79', 'Konten für das Umsatzkostenverfahren'); INSERT INTO gifi (accno, description) VALUES ('790', 'Aufwandsstellenrechnung'); INSERT INTO gifi (accno, description) VALUES ('791-799', 'Aufwandsstellen im Rahmen des Umsatzkostenverfahrens'); INSERT INTO gifi (accno, description) VALUES ('791-795', 'Aufwandsstellen der Herstellung'); INSERT INTO gifi (accno, description) VALUES ('796', 'Herstellungskosten der zur Erzielung der Umsatzerlöse erbrachten Leistungen'); INSERT INTO gifi (accno, description) VALUES ('797', 'Vertriebskosten'); INSERT INTO gifi (accno, description) VALUES ('798', 'Verwaltungskosten'); INSERT INTO gifi (accno, description) VALUES ('799', 'Sonstige betriebliche Aufwendungen'); -- INSERT INTO gifi (accno, description) VALUES ('8', 'Finanzerträge und Finanzaufwendungen, a.o. Erträge und a.o. Aufwendungen, Steuern vom Einkommen und vom Ertrag, Rücklagenbewegung'); -- INSERT INTO gifi (accno, description) VALUES ('80-83', 'Finanzerträge und Finanzaufwendungen'); INSERT INTO gifi (accno, description) VALUES ('800-804', 'Erträge aus Beteiligungen'); INSERT INTO gifi (accno, description) VALUES ('805-809', 'Erträge aus anderen Wertpapieren und Ausleihungen des Finanzanlagevermögens'); INSERT INTO gifi (accno, description) VALUES ('810-813', 'Sonstige Zinsen und ähnliche Erträge'); INSERT INTO gifi (accno, description) VALUES ('814', 'Erlöse aus dem Abgang von Beteiligungen'); INSERT INTO gifi (accno, description) VALUES ('815', 'Erlöse aus dem Abgang von sonstigen Finanzanlagen'); INSERT INTO gifi (accno, description) VALUES ('816', 'Erlöse aus dem Abgang von Wertpapieren des Umlaufvermögens'); INSERT INTO gifi (accno, description) VALUES ('817', 'Buchwert abgegangener Beteiligungen'); INSERT INTO gifi (accno, description) VALUES ('818', 'Buchwert abgegangener sonstiger Finanzanlagen'); INSERT INTO gifi (accno, description) VALUES ('819', 'Buchwert abgegangener Wertpapiere des Umlaufvermögens'); INSERT INTO gifi (accno, description) VALUES ('820', 'Erträge aus dem Abgang von und der Zuschreibung zu Finanzanlagen'); INSERT INTO gifi (accno, description) VALUES ('821', 'Erträge aus dem Abgang von und der Zuschreibung zu Wertpapieren des Umlaufvermögens'); INSERT INTO gifi (accno, description) VALUES ('822-825', 'Aufwendungen aus Beteiligungen'); INSERT INTO gifi (accno, description) VALUES ('826-827', 'Aufwendungen aus sonstigen Finanzanlagen und aus Wertpapieren des Umlaufvermögens'); INSERT INTO gifi (accno, description) VALUES ('828-834', 'Zinsen und ähnliche Aufwendungen'); INSERT INTO gifi (accno, description) VALUES ('835', 'Nicht ausgenützte Lieferantenskonti'); -- INSERT INTO gifi (accno, description) VALUES ('84', 'Außerordentliche Erträge und außerordentliche Aufwendungen'); INSERT INTO gifi (accno, description) VALUES ('840-844', 'Außerordentliche Erträge'); INSERT INTO gifi (accno, description) VALUES ('845-849', 'Außerordentliche Aufwendungen'); -- INSERT INTO gifi (accno, description) VALUES ('85', 'Steuern vom Einkommen und vom Ertrag'); INSERT INTO gifi (accno, description) VALUES ('850-859', 'Steuern vom Einkommen und vom Ertrag'); -- INSERT INTO gifi (accno, description) VALUES ('86-89', 'Rücklagenbewegung, Ergebnisüberrechnung'); INSERT INTO gifi (accno, description) VALUES ('860-869', 'Auflösung unversteuerter Rücklagen'); INSERT INTO gifi (accno, description) VALUES ('870-874', 'Auflösung von Kapitalrücklagen'); INSERT INTO gifi (accno, description) VALUES ('875-879', 'Auflösung von Gewinnrücklagen'); INSERT INTO gifi (accno, description) VALUES ('880-889', 'Zuweisung zu unversteuerten Rücklagen'); INSERT INTO gifi (accno, description) VALUES ('890-895', 'Zuweisung zu Gewinnrücklagen'); INSERT INTO gifi (accno, description) VALUES ('899', 'Gewinnabfuhr bzw. Verlustüberrechnung aus Ergebnisabführungsverträgen'); -- INSERT INTO gifi (accno, description) VALUES ('9', 'Eigenkapital, unversteuerte Rücklagen, Einlagen Stiller Gesellschafter, Abschluß- und Evidenzkonten'); -- INSERT INTO gifi (accno, description) VALUES ('900-918', 'Gezeichnetes bzw. gewidmetes Kapital'); INSERT INTO gifi (accno, description) VALUES ('919', 'Nicht eingeforderte ausstehende Einlagen'); INSERT INTO gifi (accno, description) VALUES ('920-929', 'Kapitalrücklagen'); INSERT INTO gifi (accno, description) VALUES ('930-938', 'Gewinnrücklagen'); INSERT INTO gifi (accno, description) VALUES ('939', 'Bilanzgewinn (-verlust)'); INSERT INTO gifi (accno, description) VALUES ('940-959', 'Bewertungsreserven und sonstige unversteuerte Rücklagen'); INSERT INTO gifi (accno, description) VALUES ('960-969', 'Privat- und Verrechnungskonten bei Einzelunternehmen und Personengesellschaften'); INSERT INTO gifi (accno, description) VALUES ('970-979', 'Einlagen Stiller Gesellschafter'); INSERT INTO gifi (accno, description) VALUES ('980', 'Eröffnungsbilanz'); INSERT INTO gifi (accno, description) VALUES ('985', 'Schlußbilanz'); INSERT INTO gifi (accno, description) VALUES ('989', 'Gewinn- und Verlustrechnung'); INSERT INTO gifi (accno, description) VALUES ('990-999', 'Evidenzkonten'); commit; ledgersmb/sql/coa/at/chart/0000755000000000000000000000000012060044550014562 5ustar rootrootledgersmb/sql/coa/at/chart/General.sql0000755000000000000000000003572211726633756016720 0ustar rootrootbegin; -- Kontoplan für Österreich -- Ferdinand Gassauer, Tue, 5 Feb 2002 -- checked and completed, Thu, 7 Feb 2002, Dieter Simader -- SELECT account_heading_save(NULL, '0000', 'AUFWENDUNGEN FÜR INGANGSETZEN UND ERWEITERN DES BETRIEBES', NULL); SELECT account_save(NULL,'0010','Firmenwert','A','015', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL, '0100', 'IMMATERIELLE VERMÖGENSGEGENSTÄNDE', NULL); SELECT account_save(NULL,'0110','Rechte','A','011', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL, '0200', 'GRUNDSTÜCKE', NULL); SELECT account_save(NULL,'0210','unbebaute Grundstücke','A','020', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0220','bebaute Grundstücke','A','021', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0229','kum. Abschreibung bebaute Grundstücke','A','039', NULL, true, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '0400', 'MASCHINEN', NULL); SELECT account_save(NULL,'0410','Maschinen','A','041', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0419','kum. Abschreibung Maschinen','A','069', NULL, true, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '0500', 'FAHRZEUGE', NULL); SELECT account_save(NULL,'0510','Fahrzeuge','A','063', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0519','kum. Abschreibung Fahrzeuge','A','069', NULL, true, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '0600', 'BETRIEBS- UND GESCHÄFTSAUSSTATTUNG', NULL); SELECT account_save(NULL,'0620','Büroeinrichtungen','A','066', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0625','kum. Abschreibung Betriebs- und Geschäftsausstattung','A','069', NULL, true, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '0700', 'GELEISTETE ANZAHLUNGEN', NULL); SELECT account_heading_save(NULL, '0800', 'FINANZANLAGEN', NULL); SELECT account_save(NULL,'0810','Beteiligungen','A','081', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0820','Wertpapiere','A','080', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL, '1100', 'ROHSTOFFE', NULL); SELECT account_save(NULL,'1120','Vorräte - Rohstoffe','A','110-119', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL, '1200', 'BEZOGENE TEILE', NULL); SELECT account_save(NULL,'1220','Vorräte - bezogene Teile','A','120-129', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL, '1300', 'HILFS- UND BETRIEBSSTOFFE', NULL); SELECT account_save(NULL,'1320','Hilfsstoffe','A','130-134', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1350','Betriebssstoffe','A','135-139', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL, '1400', 'UNFERTIGE ERZEUGNISSE', NULL); SELECT account_save(NULL,'1420','Vorräte - unfertige Erzeugnisse','A','140-149', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL, '1500', 'FERTIGE ERZEUGNISSE', NULL); SELECT account_save(NULL,'1520','Vorräte - Hardware','A','150-159', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1530','Vorräte - Software','A','150-159', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1540','Vorräte - Ersatzteile','A','150-159', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL, '1600', 'WAREN', NULL); SELECT account_heading_save(NULL, '1700', 'NOCH NICHT ABGERECHNETE LEISTUNGEN', NULL); SELECT account_heading_save(NULL, '1800', 'GELEISTETE ANZAHLUNGEN', NULL); SELECT account_heading_save(NULL, '1900', 'WERTBERICHTIGUNGEN', NULL); SELECT account_heading_save(NULL, '2000', 'FORDEUNGEN AUS LIEFERUNGEN UND LEISTUNGEN', NULL); SELECT account_save(NULL,'2010','Forderungen Lieferung & Leistung','A','200-207', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'2019','Wertberichtigung uneinbringliche Forderungen','A','20-21', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '2300', 'SONSTIGE FORDERUNGEN', NULL); SELECT account_save(NULL,'2320','sonstige Forderungen','A','23-24', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL, '2500', 'FORDERUNGEN AUS ABGABENVERRECHNUNG', NULL); SELECT account_save(NULL,'2520','sonstige Forderungen aus Abgebenverrechnung','A','25', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL, '2600', 'WERTPAPIERE UND ANTEILE', NULL); SELECT account_save(NULL,'2620','Wertpapiere Umlaufvermögen','A','26', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL, '2700', 'KASSABESTAND', NULL); SELECT account_save(NULL,'2701','Kassa','A','27-28', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_heading_save(NULL, '2800', 'SCHECKS, GUTHABEN BEI KREDITINSTITUTEN', NULL); SELECT account_save(NULL,'2810','Schecks','A','27-28', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'2820','Bankguthaben','A','280-288', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_heading_save(NULL, '3100', 'LANGFRISTIGE VERBINDLICHKEITEN', NULL); SELECT account_save(NULL,'3110','Bank Verbindlichkeiten','L','31', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3120','Kredite von Eigentümern','L','310', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_heading_save(NULL, '3300', 'VERBINDLICHKEITEN AUS LIEFERUNGEN UND LEISTUNGEN', NULL); SELECT account_save(NULL,'3310','Verbindlichkeiten aus Lieferungen und Leistungen','L','330-335', NULL, false, false, string_to_array('AP', ':')); SELECT account_heading_save(NULL, '3500', 'VERBINDLICHKEITEN FINANZAMT', NULL); SELECT account_save(NULL,'3510','Finanzamt Verrechnung Körperschaftssteuer','L','350-359', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3520','Finanzamt Verrechnung Umsatzsteuer','L','350-359', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3530','Mehrwertsteuer 0%','L','350-359', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'3531','Mehrwertsteuer 10%','L','350-359', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'3532','Mehrwertsteuer 20%','L','350-359', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'3540','Vorsteuer 0%','L','350-359', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'3541','Vorsteuer 10%','L','350-359', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'3542','Vorsteuer 20%','L','350-359', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_heading_save(NULL, '4000', 'UMSATZ', NULL); SELECT account_save(NULL,'4020','Verkauf - Hardware','I','40-44', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'4030','Verkauf - Software ','I','40-44', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'4040','Verkauf - Ersatzteile','I','40-44', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL, '4300', 'UMSATZ BERATUNG', NULL); SELECT account_save(NULL,'4320','Erlöse Beratung','I','40-44', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'4330','Erlöse Programmierung','I','40-44', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL, '4600', 'SONSTIGE ERLÖSE', NULL); SELECT account_save(NULL,'4630','Frachterlöse','I','46-49', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_heading_save(NULL, '5000', 'WARENEINSATZ', NULL); SELECT account_save(NULL,'5020','Wareneinsatz / Hardware','E','500-509', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5030','Wareneinsatz / Software','E','500-509', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5040','Wareneinsatz / Ersatzteile','E','520-529', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_heading_save(NULL, '5600', 'VERBRAUCH BRENN- UND TREIBSTOFFEN, ENERGIE UND WASSER', NULL); SELECT account_save(NULL,'5610','Energie, Wasser','E','560-569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL, '6000', 'LOHNAUFWAND', NULL); SELECT account_save(NULL,'6010','Lohn ','E','600-619', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '6200', 'GEAHLTSAUFWAND', NULL); SELECT account_save(NULL,'6210','Gehalt ','E','620-639', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '6500', 'GESETZLICHER SOZIALAUFWAND', NULL); SELECT account_save(NULL,'6510','Dienstgeberanteile','E','645-649', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '6700', 'FREIWILLIGER SOZIALAUFWAND', NULL); SELECT account_save(NULL,'6710','freiwilliger Sozialaufwand','E','660-665', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '7000', 'ABSCHREIBUNGEN', NULL); SELECT account_save(NULL,'7010','Abschreibungen','E','700', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7020','geringwertige Wirtschaftsgüter','E','701-708', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL, '7100', 'SONSTIGE STEUERN', NULL); SELECT account_save(NULL,'7110','Ertragssteuern','E','710-719', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7120','Grundsteuern','E','710-719', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '7200', 'INSTANDHALTUNGSAUFWAND', NULL); SELECT account_save(NULL,'7210','Reparatur und Instandhaltung','E','720-729', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL, '7300', 'TRANSPORTKOSTEN', NULL); SELECT account_save(NULL,'7310','Frachtaufwand','E','730-731', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL, '7400', 'MIET-,PACHT-,LEASING-, LIZENZAUFWAND', NULL); SELECT account_save(NULL,'7410','Miete','E','740-743', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7411','Lizenzen','E','748-749', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL, '7600', 'VERWALTUNGSKOSTEN', NULL); SELECT account_save(NULL,'7610','Beratungsaufwand','E','775-776', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7611','Büromaterialien','E','760', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7615','Werbung und Marketing','E','765-768', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7620','uneinbringliche Forderungen','E','799', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7630','Telephonkosten','E','738-739', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7631','Internetkosten','E','738-739', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'7632','Reise- und Repräsentationsaufwand','E','734-735', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7634','Registrierungsgebühren','E','748-749', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL, '7700', 'VERSICHERUNGEN', NULL); SELECT account_save(NULL,'7710','Versicherung','E','770-774', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL, '8000', 'FINANZERTRÄGE UND FINANZAUFWENDUNGEN', NULL); SELECT account_save(NULL,'8020','Bankzinsen und Gebühren','E','80-83', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '8100', 'BETEILIGUNGSERTRÄGE', NULL); SELECT account_save(NULL,'8110','Erträge aus Beteiligungen','I','800-804', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '9000', 'KAPITAL', NULL); SELECT account_save(NULL,'9010','Aktien, Geschäftsanteile','Q','900-918', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9020','nicht einbezahltes Kapital','Q','919', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '9200', 'KAPITALRÜCKLAGEN', NULL); SELECT account_save(NULL,'9210','freie Rücklage','Q','920-929', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '9300', 'GEWINN', NULL); SELECT account_save(NULL,'9310','Gewinnvortrag Vorjahr','Q','980', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9320','Jahresgewinn','Q','985', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '9400', 'RÜCKSTELLUNGEN', NULL); SELECT account_save(NULL,'9420','Abfertigungsrückstellung','L','300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9430','Urlaubsrückstellung','L','304-309', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '9700', 'EINLAGEN STILLER GESELLSCHAFTER', NULL); SELECT account_heading_save(NULL, '9800', 'EB,SB,G+V KONTEN', NULL); SELECT account_save(NULL,'4640','Devisengewinne','I','80-83', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8050','Devisenverluste','E','80-83', NULL, false, false, string_to_array('', ':')); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '3530'),0.00); insert into tax (chart_id,rate) values ((select id from chart where accno = '3531'),0.10); insert into tax (chart_id,rate) values ((select id from chart where accno = '3532'),0.20); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '1520')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '4020')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '7610')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '4640')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '8050')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'EUR:USD'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); -- commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno = '2810'; ledgersmb/sql/coa/es/0000755000000000000000000000000012060044550013464 5ustar rootrootledgersmb/sql/coa/es/chart/0000755000000000000000000000000012060044550014565 5ustar rootrootledgersmb/sql/coa/es/chart/ISO.sql0000755000000000000000000003367311603321674015766 0ustar rootrootbegin; -- Chart of Accounts for Spain (Cuadro del Plan de Contabilidad español) -- From: Federico Montesino Pouzols -- 23 Apr 2002 -- SELECT account_heading_save(NULL, '099999999', 'Grupo 1: financiación básica', NULL); SELECT account_save(NULL,'100000000','Capital','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'110000000','Reservas','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'120000000','Resultados pendientes de aplicación','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'130000000','Ingresos a distribuir en varios ejercicios','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'140000000','Provisiones para riesgos y gastos','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'150000000','Empréstitos y otras emisiones análogas','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'160000000','Deudas a largo plazo con empresas del grupo y asociadas','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'170000000','Deudas a largo plazo por prestamos recibidos y otros conceptos','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'180000000','Fianzas y depósitos recibidos a largo plazo','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'190000000','Situaciones transitorias de financiación','A','', NULL, false, false, string_to_array('', ':')); -- SELECT account_heading_save(NULL, '199999999', 'Grupo 2: inmovilizado', NULL); SELECT account_save(NULL,'200000000','Gastos de establecimiento','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'210000000','Inmovilizaciones inmateriales','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'220000000','Inmovilizaciones materiales','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'230000000','Inmovilizaciones materiales en curso','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'240000000','Inversiones financieras en empresas del grupo y asociadas','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'250000000','Otras inversiones financieras permanentes','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'260000000','Fianzas y depósitos constituidos a largo plazo','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'270000000','Gastos a distribuir en varios ejercicios','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'280000000','Amortización acumulada del inmovilizado','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'290000000','Provisiones de inmovilizado','A','', NULL, false, false, string_to_array('', ':')); -- SELECT account_heading_save(NULL, '299999999', 'Grupo 3: existencias', NULL); SELECT account_save(NULL,'300000000','Comerciales','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'310000000','Materias primas','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'320000000','Otros aprovisionamientos','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'330000000','Productos en curso','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'340000000','Productos semiterminados','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'350000000','Productos terminados','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'360000000','Subproductos, residuos y materiales recuperados','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'390000000','Provisiones por depreciación de existencias','A','', NULL, false, false, string_to_array('', ':')); -- SELECT account_heading_save(NULL, '399999999', 'Grupo 4: acreedores y deudores por operaciones de tráfico', NULL); SELECT account_save(NULL,'400000000','Proveedores','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'410000000','Acreedores varios','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'430000000','Clientes','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'431000000','Clientes, efectos comerciales a cobrar','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'440000000','Deudores varios','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'460000000','Personal','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'470000000','Administraciones públicas','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'472000000','Hacienda Pública, IVA soportado','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'472000001','IVA soportado 4%','P','', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'472000002','IVA soportado 7%','P','', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'472000003','IVA soportado 16%','P','', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'475100000','Hacienda Pública, acreedor por retenciones practicadas','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'473000000','Hacienda Pública, retenciones y pagos a cuenta','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'477000000','Hacienda Pública, IVA repercutido','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'477000001','IVA repercutido 4%','P','', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'477000002','IVA repercutido 7%','P','', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'477000003','IVA repercutido 16%','P','', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'480000000','Ajustes por periodificación','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'490000000','Provisiones por operaciones de tráfico','P','', NULL, false, false, string_to_array('', ':')); -- SELECT account_heading_save(NULL, '499999999', 'Grupo 5: cuentas financieras', NULL); SELECT account_save(NULL,'500000000','Empréstitos y otras emisiones análogas a corto plazo','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'510000000','Deudas a corto plazo con empresas del grupo y asociadas','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'520000000','Deudas a corto plazo por préstamos recibidos y otros conceptos','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'530000000','Inversiones financieras a corto plazo en empresas del grupo y asociadas','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'540000000','Otras inversiones financieras temporales','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'550000000','Otras cuentas no bancarias','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'560000000','Fianzas y depósitos recibidos y constituidos a corto plazo','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'569000000','Tesorería','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'570000000','Caja, euros','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'571000000','Caja, moneda extranjera','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'572000000','Bancos e instituciones de crédito, c/c. vista, euros','A','', NULL, false, false, string_to_array('AR_paid:AP_paid:AP_amount:AR_amount', ':')); SELECT account_save(NULL,'573000000','Bancos e instituciones de crédito, c/c. vista, moneda extranjera','A','', NULL, false, false, string_to_array('AR_paid:AP_paid:AP_amount:AR_amount', ':')); SELECT account_save(NULL,'574000000','Bancos e instituciones de crédito, cuentas de ahorro, euros','A','', NULL, false, false, string_to_array('AR_paid:AP_paid:AP_amount:AR_amount', ':')); SELECT account_save(NULL,'575000000','Bancos e instituciones de crédito, cuentas de ahorro, moneda extranjera','A','', NULL, false, false, string_to_array('AR_paid:AP_paid:AP_amount:AR_amount', ':')); SELECT account_save(NULL,'580000000','Ajustes por periodificación','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'590000000','Provisiones financieras','P','', NULL, false, false, string_to_array('', ':')); -- SELECT account_heading_save(NULL, '599999999', 'Grupo 6: compras y gastos', NULL); SELECT account_save(NULL,'600000000','Compras','E','', NULL, false, false, string_to_array('AP_expense:IC_cogs', ':')); SELECT account_save(NULL,'608000000','Devoluciones de compras y operaciones similares','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'610000000','Variación de existencias','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'620000000','Servicios exteriores','E','', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'630000000','Tributos','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'640000000','Gastos de personal','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'650000000','Otros gastos de gestión','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'660000000','Gastos financieros','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'665000000','Descuentos sobre ventas por pronto pago','E','', NULL, false, false, string_to_array('IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'668000000','Diferencias negativas de cambio','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'670000000','Pérdidas procedentes del inmovilizado y gastos excepcionales','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'680000000','Dotaciones para amortizaciones','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'690000000','Dotaciones a las provisiones','E','', NULL, false, false, string_to_array('', ':')); -- SELECT account_heading_save(NULL, '699999999', 'Grupo 7: ventas e ingresos', NULL); SELECT account_save(NULL,'700000000','Ventas de mercaderías, de producción propia, de servicios, etc.','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'708000000','Devoluciones de ventas y operaciones similares','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'710000000','Variación de existencias','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'730000000','Trabajos realizados para la empresa','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'740000000','Subvenciones a la explotación','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'750000000','Otros ingresos de gestión','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'760000000','Ingresos financieros','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'765000000','Descuentos sobre compras por pronto pago','I','', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'768000000','Diferencias positivas de cambio','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'770000000','Beneficios procedentes de inmovilizados e ingresos excepcionales','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'790000000','Excesos y aplicaciones de provisiones','I','', NULL, false, false, string_to_array('', ':')); -- -- Taxes in Spain -- -- IVA: 4, 7 or 16% -- IVA soportado INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '472000000'), 0.0); INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '472000001'), 0.04); INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '472000002'), 0.07); INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '472000003'), 0.16); -- IVA repercutido INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '477000000'), 0.0); INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '477000001'), 0.04); INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '477000002'), 0.07); INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '477000003'), 0.16); -- Recargo equivalente: 0.5, 1 or 4% -- update defaults -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '300000000')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '700000000')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '600000000')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '768000000')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '668000000')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'EUR'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'Kg'); -- commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/es/chart/General.sql0000755000000000000000000003370311603321674016703 0ustar rootrootbegin; -- Chart of Accounts for Spain (Cuadro del Plan de Contabilidad español) -- From: Federico Montesino Pouzols -- 23 Apr 2002 -- SELECT account_heading_save(NULL, '099999999','Grupo 1: financiación básica',NULL); SELECT account_save(NULL,'100000000','Capital','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'110000000','Reservas','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'120000000','Resultados pendientes de aplicación','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'130000000','Ingresos a distribuir en varios ejercicios','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'140000000','Provisiones para riesgos y gastos','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'150000000','Empréstitos y otras emisiones análogas','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'160000000','Deudas a largo plazo con empresas del grupo y asociadas','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'170000000','Deudas a largo plazo por prestamos recibidos y otros conceptos','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'180000000','Fianzas y depósitos recibidos a largo plazo','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'190000000','Situaciones transitorias de financiación','A','', NULL, false, false, string_to_array('', ':')); -- SELECT account_heading_save(NULL, '199999999','Grupo 2: inmovilizado', NULL); SELECT account_save(NULL,'200000000','Gastos de establecimiento','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'210000000','Inmovilizaciones inmateriales','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'220000000','Inmovilizaciones materiales','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'230000000','Inmovilizaciones materiales en curso','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'240000000','Inversiones financieras en empresas del grupo y asociadas','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'250000000','Otras inversiones financieras permanentes','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'260000000','Fianzas y depósitos constituidos a largo plazo','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'270000000','Gastos a distribuir en varios ejercicios','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'280000000','Amortización acumulada del inmovilizado','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'290000000','Provisiones de inmovilizado','A','', NULL, false, false, string_to_array('', ':')); -- SELECT account_heading_save(NULL,'299999999','Grupo 3: existencias',NULL); SELECT account_save(NULL,'300000000','Comerciales','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'310000000','Materias primas','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'320000000','Otros aprovisionamientos','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'330000000','Productos en curso','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'340000000','Productos semiterminados','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'350000000','Productos terminados','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'360000000','Subproductos, residuos y materiales recuperados','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'390000000','Provisiones por depreciación de existencias','A','', NULL, false, false, string_to_array('', ':')); -- SELECT account_heading_save (NULL, '399999999','Grupo 4: acreedores y deudores por operaciones de tráfico', NULL); SELECT account_save(NULL,'400000000','Proveedores','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'410000000','Acreedores varios','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'430000000','Clientes','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'431000000','Clientes, efectos comerciales a cobrar','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'440000000','Deudores varios','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'460000000','Personal','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'470000000','Administraciones públicas','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'472000000','Hacienda Pública, IVA soportado','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'472000001','IVA soportado 4%','P','', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'472000002','IVA soportado 7%','P','', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'472000003','IVA soportado 16%','P','', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'475100000','Hacienda Pública, acreedor por retenciones practicadas','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'473000000','Hacienda Pública, retenciones y pagos a cuenta','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'477000000','Hacienda Pública, IVA repercutido','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'477000001','IVA repercutido 4%','P','', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'477000002','IVA repercutido 7%','P','', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'477000003','IVA repercutido 16%','P','', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'480000000','Ajustes por periodificación','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'490000000','Provisiones por operaciones de tráfico','P','', NULL, false, false, string_to_array('', ':')); -- SELECT account_heading_save(NULL, '499999999','Grupo 5: cuentas financieras', NULL); SELECT account_save(NULL,'500000000','Empréstitos y otras emisiones análogas a corto plazo','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'510000000','Deudas a corto plazo con empresas del grupo y asociadas','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'520000000','Deudas a corto plazo por préstamos recibidos y otros conceptos','P','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'530000000','Inversiones financieras a corto plazo en empresas del grupo y asociadas','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'540000000','Otras inversiones financieras temporales','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'550000000','Otras cuentas no bancarias','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'560000000','Fianzas y depósitos recibidos y constituidos a corto plazo','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'569000000','Tesorería','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'570000000','Caja, euros','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'571000000','Caja, moneda extranjera','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'572000000','Bancos e instituciones de crédito, c/c. vista, euros','A','', NULL, false, false, string_to_array('AR_paid:AP_paid:AP_amount:AR_amount', ':')); SELECT account_save(NULL,'573000000','Bancos e instituciones de crédito, c/c. vista, moneda extranjera','A','', NULL, false, false, string_to_array('AR_paid:AP_paid:AP_amount:AR_amount', ':')); SELECT account_save(NULL,'574000000','Bancos e instituciones de crédito, cuentas de ahorro, euros','A','', NULL, false, false, string_to_array('AR_paid:AP_paid:AP_amount:AR_amount', ':')); SELECT account_save(NULL,'575000000','Bancos e instituciones de crédito, cuentas de ahorro, moneda extranjera','A','', NULL, false, false, string_to_array('AR_paid:AP_paid:AP_amount:AR_amount', ':')); SELECT account_save(NULL,'580000000','Ajustes por periodificación','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'590000000','Provisiones financieras','P','', NULL, false, false, string_to_array('', ':')); -- SELECT account_heading_save(NULL, '599999999','Grupo 6: compras y gastos', NULL); SELECT account_save(NULL,'600000000','Compras','E','', NULL, false, false, string_to_array('AP_expense:IC_cogs', ':')); SELECT account_save(NULL,'608000000','Devoluciones de compras y operaciones similares','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'610000000','Variación de existencias','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'620000000','Servicios exteriores','E','', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'630000000','Tributos','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'640000000','Gastos de personal','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'650000000','Otros gastos de gestión','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'660000000','Gastos financieros','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'665000000','Descuentos sobre ventas por pronto pago','E','', NULL, false, false, string_to_array('IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'668000000','Diferencias negativas de cambio','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'670000000','Pérdidas procedentes del inmovilizado y gastos excepcionales','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'680000000','Dotaciones para amortizaciones','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'690000000','Dotaciones a las provisiones','E','', NULL, false, false, string_to_array('', ':')); -- SELECT account_heading_save(NULL, '699999999','Grupo 7: ventas e ingresos', NULL); SELECT account_save(NULL,'700000000','Ventas de servicios y productos','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'708000000','Devoluciones de ventas y operaciones similares','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'710000000','Variación de existencias','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'730000000','Trabajos realizados para la empresa','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'740000000','Subvenciones a la explotación','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'750000000','Otros ingresos de gestión','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'760000000','Ingresos financieros','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'765000000','Descuentos sobre compras por pronto pago','I','', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'768000000','Diferencias positivas de cambio','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'770000000','Beneficios procedentes de inmovilizados e ingresos excepcionales','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'790000000','Excesos y aplicaciones de provisiones','I','', NULL, false, false, string_to_array('', ':')); -- -- Taxes in Spain -- -- IVA: 4, 7 or 16% -- IVA soportado INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '472000000'), 0.0); INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '472000001'), 0.04); INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '472000002'), 0.07); INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '472000003'), 0.16); -- Recargo equivalente: 0.5, 1 or 4% -- -- IVA repercutido INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '477000000'), 0.0); INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '477000001'), 0.04); INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '477000002'), 0.07); INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '477000003'), 0.16); -- Recargo equivalente: 0.5, 1 or 4% -- -- update defaults -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '300000000')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '700000000')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '600000000')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '768000000')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '668000000')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'EUR'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit' , 'Kg'); -- commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/se/0000755000000000000000000000000012060044550013464 5ustar rootrootledgersmb/sql/coa/se/gifi/0000755000000000000000000000000012060044550014402 5ustar rootrootledgersmb/sql/coa/se/gifi/General.sql0000755000000000000000000002141610573167253016524 0ustar rootrootbegin; -- Swedish-gifi.sql INSERT INTO gifi (accno,description) VALUES ('200','Kassa och bank '); INSERT INTO gifi (accno,description) VALUES ('202','Aktier och andelar '); INSERT INTO gifi (accno,description) VALUES ('203','Övriga kortfristiga placeringar'); INSERT INTO gifi (accno,description) VALUES ('204','Kundfordringar'); INSERT INTO gifi (accno,description) VALUES ('205','Förutbetalda kostnader och upplupna intäkter'); INSERT INTO gifi (accno,description) VALUES ('206','Övriga skattefordringar'); INSERT INTO gifi (accno,description) VALUES ('207','Momsfordran'); INSERT INTO gifi (accno,description) VALUES ('219','Varulager och pågående arbeten'); INSERT INTO gifi (accno,description) VALUES ('220','Övriga kortfristiga fordringar'); INSERT INTO gifi (accno,description) VALUES ('230','Aktier och andelar i svenska koncern- och intresseföretag '); INSERT INTO gifi (accno,description) VALUES ('231','Aktier och andelar i utländska koncern- och intresseföretag'); INSERT INTO gifi (accno,description) VALUES ('233','Finansiella anläggningstillgångar'); INSERT INTO gifi (accno,description) VALUES ('234','Immateriella anläggningstillgångar'); INSERT INTO gifi (accno,description) VALUES ('235','Mark och andra tillgångar som inte är avskrivningsbara (skattemässigt)'); INSERT INTO gifi (accno,description) VALUES ('236','Maskiner och inventarier'); INSERT INTO gifi (accno,description) VALUES ('237','Byggnader och övrig fast egendom'); INSERT INTO gifi (accno,description) VALUES ('241','Fordringar på koncern- och intresseföretag'); INSERT INTO gifi (accno,description) VALUES ('299','Summa tillgångar'); INSERT INTO gifi (accno,description) VALUES ('300','Leverantörsskulder'); INSERT INTO gifi (accno,description) VALUES ('301','Övriga skatteskulder'); INSERT INTO gifi (accno,description) VALUES ('302','Övriga avsättningar'); INSERT INTO gifi (accno,description) VALUES ('304','Avsättningar för garantier'); INSERT INTO gifi (accno,description) VALUES ('305','Upplupna kostnader och förutbetalda intäkter'); INSERT INTO gifi (accno,description) VALUES ('307','Momsskuld'); INSERT INTO gifi (accno,description) VALUES ('310','Förskott från kunder'); INSERT INTO gifi (accno,description) VALUES ('319','Övriga kortfristiga skulder'); INSERT INTO gifi (accno,description) VALUES ('320','Avsättningar för pensioner'); INSERT INTO gifi (accno,description) VALUES ('321','Lån från aktieägare (lång- och kortfristiga)'); INSERT INTO gifi (accno,description) VALUES ('329','Långfristiga skulder'); INSERT INTO gifi (accno,description) VALUES ('330','Ackumulerade överavskrivningar'); INSERT INTO gifi (accno,description) VALUES ('339','Övriga obeskattade reserver '); INSERT INTO gifi (accno,description) VALUES ('340','Periodiseringsfond vid 2000 års taxering'); INSERT INTO gifi (accno,description) VALUES ('341','Periodiseringsfond vid 2001 års taxering'); INSERT INTO gifi (accno,description) VALUES ('343','Periodiseringsfond vid 2003 års taxering'); INSERT INTO gifi (accno,description) VALUES ('344','Periodiseringsfond vid 2004 års taxering'); INSERT INTO gifi (accno,description) VALUES ('345','Periodiseringsfond vid 2005 års taxering'); INSERT INTO gifi (accno,description) VALUES ('342','Periodiseringsfond vid 2002 års taxering'); INSERT INTO gifi (accno,description) VALUES ('350','Aktiekapital/Insatskapital'); INSERT INTO gifi (accno,description) VALUES ('351','Övrigt bundet eget kapital'); INSERT INTO gifi (accno,description) VALUES ('354','Fritt eget kapital'); INSERT INTO gifi (accno,description) VALUES ('360','Ingående kapital (vid kapitalbrist anges minus)'); INSERT INTO gifi (accno,description) VALUES ('362','Delägarnas uttag'); INSERT INTO gifi (accno,description) VALUES ('363','Delägarnas tillskott'); INSERT INTO gifi (accno,description) VALUES ('364','Kontanta uttag'); INSERT INTO gifi (accno,description) VALUES ('365','Övriga uttag'); INSERT INTO gifi (accno,description) VALUES ('366','Kontanta tillskott'); INSERT INTO gifi (accno,description) VALUES ('367','Övriga tillskott'); INSERT INTO gifi (accno,description) VALUES ('368','Årets redovisade vinst'); INSERT INTO gifi (accno,description) VALUES ('369','Årets redovisade förlust'); INSERT INTO gifi (accno,description) VALUES ('370','Utgående kapital'); INSERT INTO gifi (accno,description) VALUES ('399','Summa eget kapital och skulder'); INSERT INTO gifi (accno,description) VALUES ('400','Rörelsens huvudintäkter (nettoomsättning)'); INSERT INTO gifi (accno,description) VALUES ('401','Övriga rörelseintäkter'); INSERT INTO gifi (accno,description) VALUES ('402','Aktiverat arbete för egen räkning'); INSERT INTO gifi (accno,description) VALUES ('500','Handelsvaror inkl. lagerförändring, råvaror, material m.m.'); INSERT INTO gifi (accno,description) VALUES ('501','Legoarbeten och underentreprenörer'); INSERT INTO gifi (accno,description) VALUES ('509','Förändring av lager (inte handelsvaror) och pågående arbeten (ökning)'); INSERT INTO gifi (accno,description) VALUES ('510','Förändring av lager (inte handelsvaror) och pågående arbeten (minskning)'); INSERT INTO gifi (accno,description) VALUES ('511','AMF-avgifter '); INSERT INTO gifi (accno,description) VALUES ('512','Löner och andra ersättningar'); INSERT INTO gifi (accno,description) VALUES ('514','Kostnadsersättningar och kostnader för förmåner till anställda'); INSERT INTO gifi (accno,description) VALUES ('520','Övriga sociala avgifter'); INSERT INTO gifi (accno,description) VALUES ('524','Pensionskostnader (inklusive ITP-avgifter)'); INSERT INTO gifi (accno,description) VALUES ('526','Reparation och underhåll av fastighet'); INSERT INTO gifi (accno,description) VALUES ('527','Övriga personalkostnader'); INSERT INTO gifi (accno,description) VALUES ('528','Övriga lokal- och fastighetskostnader'); INSERT INTO gifi (accno,description) VALUES ('529','Hyra av anläggningstillgångar'); INSERT INTO gifi (accno,description) VALUES ('530','Övriga kostnader'); INSERT INTO gifi (accno,description) VALUES ('531','Förbrukningsinventarier'); INSERT INTO gifi (accno,description) VALUES ('536','Bilkostnader (inkl. billeasing)'); INSERT INTO gifi (accno,description) VALUES ('538','Övriga transportmedels- kostnader och rese- kostnader '); INSERT INTO gifi (accno,description) VALUES ('541','Reklam och PR'); INSERT INTO gifi (accno,description) VALUES ('550','Vinst vid avyttring av värdepapper '); INSERT INTO gifi (accno,description) VALUES ('551','Förlust vid avyttring av värdepapper'); INSERT INTO gifi (accno,description) VALUES ('552','Vinst vid avyttring av anläggningstillgångar (ej finansiella) '); INSERT INTO gifi (accno,description) VALUES ('553','Nedskrivning av anläggningstillgångar (ej finansiella)'); INSERT INTO gifi (accno,description) VALUES ('554','Återföring av nedskrivning av anläggningstillgångar (ej finansiella)'); INSERT INTO gifi (accno,description) VALUES ('556','Förlust vid avyttring av anläggningstillgångar (ej finansiella)'); INSERT INTO gifi (accno,description) VALUES ('559','Maskiner och inventarier'); INSERT INTO gifi (accno,description) VALUES ('560','Byggnader och övrig fast egendom'); INSERT INTO gifi (accno,description) VALUES ('561','Immateriella anläggningstillgångar'); INSERT INTO gifi (accno,description) VALUES ('564','Utdelning på aktier och andelar i koncern- och intresseföretag'); INSERT INTO gifi (accno,description) VALUES ('565','Utdelning på aktier och andelar i övriga företag'); INSERT INTO gifi (accno,description) VALUES ('566','Valutakursvinster'); INSERT INTO gifi (accno,description) VALUES ('567','Valutakursförluster'); INSERT INTO gifi (accno,description) VALUES ('568','Ränteintäkter m.m.'); INSERT INTO gifi (accno,description) VALUES ('569','Räntekostnader m.m.'); INSERT INTO gifi (accno,description) VALUES ('570','Nedskrivning av finansiella tillgångar'); INSERT INTO gifi (accno,description) VALUES ('571','Återföring av nedskrivning av finansiella tillgångar'); INSERT INTO gifi (accno,description) VALUES ('578','Bokförd avskrivning utöver plan '); INSERT INTO gifi (accno,description) VALUES ('586','Avsättning till periodiseringsfond '); INSERT INTO gifi (accno,description) VALUES ('589','Återföring från periodiseringsfond '); INSERT INTO gifi (accno,description) VALUES ('590','Upplösning av ackumulerade överavskrivningar'); INSERT INTO gifi (accno,description) VALUES ('593','Övriga tillkommande bokslutsdispositioner m.m. '); INSERT INTO gifi (accno,description) VALUES ('594','Övriga avgående bokslutsdispositioner m.m.'); INSERT INTO gifi (accno,description) VALUES ('596','Redovisad förlust enligt bokföringen'); INSERT INTO gifi (accno,description) VALUES ('598','Skatter'); INSERT INTO gifi (accno,description) VALUES ('599','Redovisad vinst enligt bokföringen'); commit; ledgersmb/sql/coa/se/chart/0000755000000000000000000000000012060044550014565 5ustar rootrootledgersmb/sql/coa/se/chart/Agriculture.sql0000755000000000000000000046175411726633501017630 0ustar rootrootbegin; -- COA for Agriculture -- Johan Hambraeus -- May 7, 2006 -- SELECT account_heading_save(NULL, '075', 'Observationskonton', NULL); SELECT account_save(NULL,'0750','Uttagna förmåner ','L','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'0751','Bostadsförmåner ','A','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'0752','Kostförmåner ','A','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'0753','Fria resor tor arbete','A','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'0754','Fria arbetsresor ','A','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'0755','Bilförmån ','A','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'0756','Rtaförmån ','A','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'0759','Övr.förmåner ','A','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL, '1', 'Tillgångar ', NULL); SELECT account_heading_save(NULL, '10', 'Immater. anl.tillg', NULL); SELECT account_save(NULL,'1010','Balanserade utg','A','234', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1011','Bal.utg forskn/utv','A','234', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1012','Bal.utg dataprogram','A','234', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1019','Ack avskr bal.utg','C','234', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1020','Koncessioner m m ','A','234', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1029','Ack avskr koncess.','C','234', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1030','Patent ','A','234', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1039','Ack avskr på patent','C','234', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1040','Licenser ','A','234', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1049','Ack avskr licenser','C','234', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1050','Varumärken ','A','234', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1059','Ack avskr varumärken','C','234', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1060','Hyresrätter ','A','234', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1069','Ack avskr hyresr.','C','234', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1070','Goodwill ','A','234', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1079','Ack avskr på goodw.','C','234', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1080','Påg proj o försk','A','234', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1081','Påg f imm anl.tillg','A','234', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1088','Försk imm anl.tillg','A','234', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1090','Övr imm anl.tillg','A','234', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1099','Ack avskr ö im.an.t','C','234', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL,'11','Byggnader och mark', NULL); SELECT account_save(NULL,'1110','Byggnader','A','237', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1111','Byggnader egen mark','A','237', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1112','Byggnader ofri grund','A','237', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1119','Ack avskr byggnader','C','237', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1130','Mark','A','237', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1140','Tomter/obeb.mark','A','237', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1150','Markanläggning','A','237', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1159','Ack avskr markanl','C','237', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1180','Påg nyanl/förs byg/m','A','237', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1181','Pågående nybyggnad','A','237', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1182','Pågående tillbyggn','A','237', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1183','Pågående ombyggnad','A','237', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1188','Försk byggn/mark','A','237', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1190','Övr byggn/mark','A','237', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1199','Ack avskr övr.byggn','C','237', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL,'12','Maskiner och inv ', NULL); SELECT account_save(NULL,'1200','Maskiner och inv','A','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1209','Ack av. mask o inv','C','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1210','Mask.tekn.anläggnin','A','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1211','Maskiner','A','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1212','Byggnadsinventarier','A','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1213','Andra tekn anl','A','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1219','Ack avs mask/t.anl','C','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1220','Inv och verktyg','A','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1229','Ack avskr inv verkt','C','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1230','Installationer','A','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1231','Install.eg fastigh','A','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1232','Inst. annans fast','A','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1233','Förb.utg. an.fast','A','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1239','Ack avs install','C','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1240','Bilar o a trsp','A','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1249','Ack av bilar/trsp','C','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1250','Datorer','A','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1251','Datorer - företaget','A','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1257','Datorer - personal','A','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1259','Ack avskr datorer','C','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1260','Leasingavtal','A','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1269','Ack avs leasingavt','C','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1270','Anläggningsdjur','A','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1279','Ack avskr anl.djur','C','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1280','Påg nyanl o försk','A','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1281','Påg nyanläggningar','A','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1288','Förskott mask.o inv','A','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1290','Övr mask. o inv','A','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1291','Konst och likn','A','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1292','Inv.i annans fastig','A','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1299','Ack avs övr ma./inv','C','236', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL,'13','Finansiella anl.tillg', NULL); SELECT account_save(NULL,'1310','Akt/andel koncernf.','A','230', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1311','Akt/and sv.do.för.','A','230', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1312','Akt/and utl.do.för','A','231', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1313','Akt öv.sv.konc.för','A','230', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1314','Akt öv.utl.kon.för','A','231', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1319','Värderegl akt/and','A','230', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1320','Långfr fordr ko.f.','A','241/233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1321','Fordr moderföretag','A','241/234', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1322','Fordr dotterföretag','A','241/235', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1323','Fordr andra kon.för','A','241/236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1329','Värderegl långf.ford','A','241/233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1330','Akt/and intresseför','A','230', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1339','Värderegl akt/an i.f','A','230', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1340','Långfr ford intr.för','A','241/233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1349','Värderegl l.fr.fordr','A','241/233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1350','Akt/and/värdep öv.f','A','233/230', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1351','Aktier börsn. bolag','A','233/230', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1352','Övr aktier och andel','A','233/230', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1353','Andel bostadsrättsf','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1354','Obligationer','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1359','Värderegl öv.akt mm','A','233/230', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1380','Andra långfr fordr','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1381','Reversfordringar','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1382','Fordr hos anställda','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1383','Lämnade depositioner','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1384','Lån t närståen.pers','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1385','Värde av kap.försäk','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1386','Förutbet leasingavg','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1387','Långfr kontraktsfor','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1388','Olika långfr fordr','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1389','Värderegl långfr.f','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1390','Värder.värdep/l.fr.f','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'14','Lager och påg arb', NULL); SELECT account_save(NULL,'1400','Lager','A','219', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1401','Inneliggande lager','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1402','Varor på väg ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1403','Konsignationslager','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1404','Lager av värdepapper','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1409','För. av lager','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1410','Lag råvaror (förråd)','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1419','För. lag råvaror','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1420','Lager tills/förnöd','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1429','För lager t/förnöd','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1430','Lager halvfabrikat','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1431','Lager köpt halvfab','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1432','Lager egentillv.h.f','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1439','För. lag halvfab','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1440','Prod i arb - (PIA)','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1449','För. PIA','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1450','Lager färdiga varor','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1459','För. lager färd.v','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1460','Lager - Varulager','A','219', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1469','För. Varulager','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1470','Pågående arbeten','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1471','Påg arb, nedl.kostn','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1472','Oms.fastigheter ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1478','Påg.arb, fakturering','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1479','För. påg.arb','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1480','Försk.varor tjänst','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1481','Remburs ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1489','Övr.försk leverant','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1490','För. lag.påg.arb','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'15','Kundfordringar', NULL); SELECT account_save(NULL,'1500','Kundfordringar','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1510','Kundfordringar','A','204', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1512','Belånade kundfordr','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1515','Osäkra kundfordr','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1516','Tvistiga kundfordr','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1518','Ej reskontra kundf','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1519','Värderegl kundfordr','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1520','Växelfordr.','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1525','Osäkra växelfordr','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1529','Värder. osäk.växelf','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1530','Kontraktsfordringar','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1540','Belånade kontraktsf','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1541','Belånade kontraktsf','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1545','Osäkra kontraktsfor','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1550','Konsignationsfordr','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1560','Kundfordr koncernf','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1561','Kundfordr moderför','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1562','Kundfordr do.för.','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1563','Kundfordr öv.kon.f','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1569','Värderegl kundf.k.f','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1570','Kundfordr intr.för','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1575','Osäk kundf intr.f','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1579','Värderegl kundf','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1580','Kontokort och kup.','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1590','Värderegl kundfordr','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'16','Övr.kortfristiga fordringar', NULL); SELECT account_save(NULL,'1600','Övr kortfr fordr','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1610','Fordr anställda ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1611','Reseförskott ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1612','Kassaföskott ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1613','Övr.förskott','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1614','Tillf. lån t.anst','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1619','Övr fordr anst','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1630','Skattekontot ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1640','Skattefordringar','A','206', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1650','Momsfordringar','A','207', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1660','Fordr konc.för','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1661','Fordr moderför','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1662','Fordr dotterför','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1663','Fordr andra konc.f','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1670','Fordr intresseför','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1680','Andra kortfr fordr','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1681','Utlägg för kunder','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1682','Kortfr lånefordr','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1683','Fordr ej inb.akt.kap','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1684','Fordr hos leverant','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1685','Fordr närst. pers','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1686','Upparb ej fakt.int','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1687','Kortfr del l.fr.for','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1689','Övr kortfr fordr','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1690','Värderegl kortfr fordr','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'17','Förutbetalda kostn och upplupna int.', NULL); SELECT account_save(NULL,'1700','Förutb kost uppl int','A','205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1710','Förutb hyresutg','A','205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1711','Förutb arrendeutg','A','205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1720','Förutb leasingavg','A','205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1730','Förutb förs.prem','A','205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1740','Förutb ränteutg','A','205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1750','Upplupna hyresink','A','205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1760','Upplupna ink.ränt','A','205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1770','Tillg av kostn.natur','A','205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1780','Upplupna avtalsink','A','205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1790','Övr förutb.ko up.in','A','205', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'18','Kortfristiga placeringar', NULL); SELECT account_save(NULL,'1800','Kortfr placeringar','A','202', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1810','Aktier i börsnot bol','A','202', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1820','Obligationer ','A','203', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1830','Konvert skuldebrev','A','203', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1880','Öv kortfr placering','A','202', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1882','Egna aktier ','A','202', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1886','Aktier i koncernf','A','202', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1889','Aktier i övr för','A','202', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1890','Värdere. kortfr.plac','A','203', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'19','Kassa och Bank', NULL); SELECT account_save(NULL,'1900','Observationskonto','A','200', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1910','Kassa ','A','200', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1920','Plusgiro ','A','200', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1930','Checkräkningskonto','A','200', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1940','Bank och Övr bankkon','A','200', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno in ('1900', '1910', '1920', '1930', '1940'); SELECT account_save(NULL,'1950','Bankcertifikat ','A','200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1960','Koncernkont moderbol','A','200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1970','Särskilda bankkonton','A','200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1971','Allmänt invest.konto','A','200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1972','Upphovsmannakonto ','A','200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1973','Skogskonto ','A','200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1974','Spärrade bankmedel ','A','200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1979','Övr särsk bankkonton','A','200', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'2','Eget kapital och skulder', NULL); SELECT account_heading_save(NULL,'20','Eget kapital ', NULL); SELECT account_save(NULL,'2010','Eg kap ensk/deläg HB','Q','360/370', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2011','Egna varuuttag ','Q','362/364', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2012','skattekontot deläg 1','Q','362/365', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2013','Övr.egna uttag ','Q','362/365', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2014','Uppl e-avg.särs.l.sk','Q','362/365', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2017','Årets kap.tillskott','Q','363/366', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2018','Övr.egna insättn','Q','363/367', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2019','Årets res deläg 1 HB','Q','368/369', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2020','Eget kap deläg 2 HB','Q','360', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2021','Egna varuuttag ','Q','362', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2022','skattekontot deläg 2','Q','362', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2023','Övr.egna uttag ','Q','362', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2024','Uppl egavg s.l.sk','Q','362', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2027','Årets kap.tillskott','Q','363', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2028','Övr.egna insättn','Q','363', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2029','Årets res deläg 2 HB','Q','368/369', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2030','Eget kap deläg 3 HB','Q','360', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2031','Egna varuuttag ','Q','362', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2032','skattekontot deläg 3','Q','362', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2033','Övr.egna uttag ','Q','362', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2034','Uppl egavg s.l.sk','Q','362', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2037','Årets kap.tillsk','Q','363', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2038','Övr egna insättning','Q','363', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2039','Årets res deläg 3','Q','363/369', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2050','Avs expan.m ensk/HB1','Q','368/369', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2080','Bundet eg kapital','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2081','Aktiekapital ','Q','350', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2082','Ej reg aktiekapital ','Q','350', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2083','Inb.insats/stift.kap','Q','350', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2084','Överkursfond ','Q','351', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2085','Uppskrivningsfond ','Q','352', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2086','Res.f./v-säk.f stift','Q','351', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2090','Fritt eget kapital ','Q','354', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2091','Bal. vinst/förl','Q','354', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2092','Erh/lämn koncernbidr','Q','354', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2093','Erh aktieägtillsk','Q','354', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2098','Vinst/förl föreg år','Q','354', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2099','Årets resultat ','Q','354', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '21', 'Obeskattade reserver ', NULL); SELECT account_save(NULL,'2115','Per.fond 1995års tax','L','345/339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2150','Ack överavskr ','L','330', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2151','Ack ö-a im.anl.tillg','L','330', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2152','Ack ö-a byggn markan','L','330', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2153','Ack ö-a maskin o inv','L','330', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2160','Ersättningsfond ','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2161','Ers.fond för inv','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2162','Ers.f byg.markanl','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2163','Ers.fond för mark','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2164','Ers.fond djurlager','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2170','Avs allm inv.res.','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2171','Allmän inv.res','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2180','Obesk int. ','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2181','Obesk upphovsm.int','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2185','Obesk skogsint','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2190','Övr obesk res','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2191','Sk bokf/fakt pens.sk','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2195','Valutakursreserv ','L','337', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2196','Lagerreserv ','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2197','Skatteutj.SURV','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2199','Övr.obesk res','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'22','Avs.ar', NULL); SELECT account_save(NULL,'2210','Avs.ar pens','L','320', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2211','Avs. PRI-pens','L','320', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2219','Avs. övr pens','L','320', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2220','Avs garantier ','L','304', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2250','Avs för skatter ','L','329/302', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2251','Avs beräkn lat skatt','L','329/302', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2252','Avs tvistiga skatt','L','329/303', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2259','Avs övr skatter','L','329/304', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2290','Övr avsättningar ','L','302', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'23','Långfristiga skulder', NULL); SELECT account_save(NULL,'2310','Oblig- och förl.lån','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2320','Konvertibla lån ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2330','Checkräkningskredit','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2331','Checkräkn.kredit 1 ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2332','Checkräkn.kredit 2 ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2333','Utnyttj. ch.r.kred 1','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2334','Utnyttj. ch.r.kred 2','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2335','Bevilj checkr.kred 1','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2336','Bevilj checkr.kred 2','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2340','Byggn.kreditiv ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2350','Andr skuld kred.inst','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2351','Fastighetslån ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2355','Lån i utl valuta','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2359','Övr.långfr lån','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2360','Skulder t konc.för','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2361','Skulder t Mod.för','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2362','Skulder t.do.för','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2363','Skulder t övr konc.f','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2370','Skulder t intr.för','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2390','Övr.långfr skuld','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2391','Avbetalningskontrakt','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2392','Villkorliga skulder','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2393','Lån från närst pers','L','321', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2394','Långfr lev.kred','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2395','Andra lån utl.valuta','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2397','Mottagn depos.','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2399','Övr.långfr sk','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'24','Kortfristiga skulder t.kreditinstitut, kunder och leverantörer', NULL); SELECT account_save(NULL,'2410','Kortfristiga skulder','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2411','Kortfr lån f kr.inst','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2417','K-fr de l-fr sk kr.i','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2418','K-fr del checkr.kred','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2419','Övr kortfr t kred.in','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2420','Förskott från kunder','L','310', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2421','Ej inlös presentkort','L','310', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2429','Övr försk fr kunder','L','310', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2430','Pågående arbeten ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2431','Påg arb, fakturering','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2435','Fakt ej upparb int','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2438','Påg arb, nedl kostn','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3439','För. av påg arb','I','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2440','Leverantörsskulder ','L','300', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'2443','Konsignationsskulder','L','300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2445','Tvistiga lev.skulder ','L','300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2448','Ej r-kont.lev.skuld','L','300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2460','Lev.sk koncernför','L','300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2461','Lev.sk moderföretag','L','300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2462','Lev.sk dotterföretag','L','300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2463','Lev.sk andra kon.för','L','300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2470','Lev.sk intresseför','L','300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2490','Övr.kortfr skulder','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2491','Växelskulder ','L','300', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'25','Skatteskulder', NULL); SELECT account_save(NULL,'2510','Skatteskulder ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2511','Deb kvarskatt ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2512','Beräkn ink.skatt','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2513','Beräkn fastigh.skatt','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2514','Ber särs lönesk pens','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2515','Beräkn avkastn.skatt ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2518','Betald prel.skatt ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'26','Moms och särskilda punktskatter', NULL); SELECT account_save(NULL,'2610','Utgående moms,25%','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2611','Utg moms förs Sv 25%','L','307', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL, '2612','Utg moms egn ut 25%', 'L','307',NULL,false, false, '{}'); SELECT account_save(NULL,'2613','Utg moms - uthyr 25%','L','307', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2614','Ber u-mom tj.utl 25%','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2615','Ber u-mom va.EU, 25%','L','307', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2618','Vil utg moms, 25% ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2620','Utgående moms, 12% ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2621','Utg moms förs Sv 12%','L','307', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2622','Utg moms egna ut 12%','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2628','Vilande utg moms 12%','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2630','Utgående moms, 6% ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2631','Utg moms förs Sv 6%','L','307', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2632','Utg moms egna ut 6%','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2638','Vil utg moms 6% ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2640','Ing.moms ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2641','Deb ingående moms','L','307', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2642','Deb ing.m.friv.sk.sk','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2645','Ber ing.moms utl','L','307', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2648','Vilande ing moms','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2649','Ing moms - bl.verks ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2650','Redovisn.konto moms','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2660','Särsk. punktskatter ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2661','Reklamskatt ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2669','Övr.punktskatter ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'27','Personalens skatter, avg.och löneavdrag', NULL); SELECT account_save(NULL,'2710','Personalens källsk','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2711','Innehållen källsk','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2718','Betald källskatt','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2730','Soc avg/särs lönesk','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2731','Avr lagst.soc.avg','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2732','Avräkn särs.lönesk','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2738','Bet soc avg/lönesk','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2740','Avtalade soc.avg','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2741','Avräkn avt.soc.avg','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2748','Betalda avt.soc.avg','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2750','Utmätning i lön ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2760','Semesterkassa ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2790','Övr.löneavdrag ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2791','Person. intressekont','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2792','Lönsparande ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2793','Gruppförs.premier','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2794','Fackföreningsavg','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2795','Mätn-o granskn.arvod','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'28','Övr.kortfristiga skulder', NULL); SELECT account_save(NULL,'2810','Avräkning factoring ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2820','Skulder t anställda','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2821','Löneskulder ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2822','Reseräkningar ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2823','Tantiem, gratifikat','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2830','Avr.belån.kontr.ford','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2840','Kortfr låneskulder','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2841','Kortfr del långfr sk','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2849','Övr.kortfr lånesk','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2860','Skuld t koncernföret','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2861','Skuld t moderföretag','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2862','Skuld t dotterföret','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2863','Skuld t andr konc.f','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2870','Skuld t intresseför','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2890','Övr kortfr skulder ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2891','Skuld under indrivn','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2893','Skuld t närst pers','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2897','Mottagna depos','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2898','Outtagen vinstutd','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2899','Övr.kortfr skuld','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'29','Upplupna kostn och förutbetalda int.', NULL); SELECT account_save(NULL,'2900','Uppl.kost.förutb.int','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2910','Upplupna löner ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2911','Löneskulder ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2912','Ackordsöverskott','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2920','Uppl semesterlöner','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2921','Uppl semesterlöner','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2928','Bet semesterlöner','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2930','Uppl pensionskostn','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2931','Uppl pensionsutbet','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2940','Uppl soc.andr.avg','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2941','Beräkn uppl soc.avg','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2942','Beräkn uppl lönesk','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2943','Ber uppl särs.lönesk','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2944','B.uppl avkn.sk pens','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2950','Uppl avt soc avg','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2960','Upplupna utg.räntor','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2970','Förutbet hyresink','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2971','Förutbet arrendeink','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2972','Förutbet ink.räntor','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2980','Uppl avtalskostn ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2990','Öv uppl k.förutb.int','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2991','Beräkn arv bokslut','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2992','Beräkn arv revision','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'3','Rörelsens inkomster/int. ', NULL); SELECT account_heading_save(NULL,'30','Förs.av produkter ', NULL); SELECT account_heading_save(NULL,'300','Skomakeri ', NULL); SELECT account_save(NULL,'3000','Förs.läderarb seldon','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3002','Förs.läderarb sadlar','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3003','Förs.läder träns,mm','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3005','Förs.läderarb övrigt','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL,'301','Ull-arbeten mm ', NULL); SELECT account_heading_save(NULL,'3010','Förs.ull-arbeten mm ', NULL); SELECT account_save(NULL,'3011','Tovade saker ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3012','Stickade produkter ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3013','Förs.sömnader ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3015','Förs.ullprod övr','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3016','Herrkläder ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3017','Damkläder ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3018','Barnkläder ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3019','Sömnad Inredningsdet','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL,'302','Förs.övr produkter ', NULL); SELECT account_save(NULL,'3021','Träprodukter ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3022','Metallprodukter ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3023','Textilier ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3025','Övr.produkter ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL,'303','Mat och boende ', NULL); SELECT account_save(NULL,'3030','Frukost ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3031','Lunch eller middag ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3032','Fika, kaffebröd, mm','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3033','Måltidskorgar ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3034','Övr.förs.mat ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3035','Enbart övernattning ','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3036','Boende m frukost','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL,'3037','Bed and Box ', NULL); SELECT account_save(NULL,'3039','Övrigt boende ','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL,'304','Förs.och tj.över gränserna ', NULL); SELECT account_save(NULL,'3040','Förs.av tj. ','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3041','Förs.tj.i Sv.moms25%','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3042','Förs.tj.i Sv.moms12%','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3043','Förs.tj.i Sv.moms 6%','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3044','Förs.tj.i Sv.momsfri','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3045','Förs.av tj.t.utland','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3046','Förs.av tj.t.EU m25%','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3048','Förs.av tj.t.EU mfri','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3050','Förs.av varor ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3051','Förs.var.Sv.moms 25%','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3052','Förs.var.Sv.moms 12%','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3053','Förs.var.Sv.moms 6%','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3054','Förs.var.Sv.momsfri','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3055','Förs.var.t.utland','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3056','Förs.var.t.EUmoms25%','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3057','3p-förs.EU,mellanman','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3058','Förs.var.EUmomsfritt','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL,'306','Datatjänster', NULL); SELECT account_save(NULL,'3060','Förs.datatogram','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3062','Förs.datatjänst','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3068','Datautbildning','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL,'31','Växtodling mm ', NULL); SELECT account_heading_save(NULL,'310','Foder mm ', NULL); SELECT account_save(NULL,'3100','Förs.betesgång','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3102','Förs.hö','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3105','Förs.säd','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL,'3109','Förs.övr foder ', NULL); SELECT account_heading_save(NULL, '311', 'Mat mm ', NULL); SELECT account_save(NULL,'3110','Förs.potatis','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3111','Förs.grönsaker','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3112','Förs.bär','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3113','Förs.kryddor ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3119','Förs.övr växter ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL,'312','Förs.förädlade prod', NULL); SELECT account_save(NULL,'3120','Förs.förädlade gröns','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3121','Förs.förädlade krydd','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3129','Förs.övr förädl.prod','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3190','Förs.övr växtprod','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL,'32','Förs.djurprodukter', NULL); SELECT account_heading_save(NULL,'320','Fårskötsel ', NULL); SELECT account_save(NULL,'3200','Förs.livdjur ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3201','Lamm och fårkött ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3202','Päls och skinn ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3203','Ull, rå och kardad ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3209','Övr.prod från får ','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL,'321','Fågelproduktion ', NULL); SELECT account_save(NULL,'3210','Livdjur, fåglar ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3211','Förs.slaktdjur, kött','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3212','Förs.Ägg ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL,'3219','Övr.produkter fåglar', NULL); SELECT account_heading_save(NULL,'33','Häst och hästprodukter', NULL); SELECT account_heading_save(NULL,'330','Hästuppdrag ', NULL); SELECT account_save(NULL,'3300','Hästkörningar ','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3301','Rid-guidning ','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3309','Övr.hästuppdrag ','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL,'331','Hästutbildning ', NULL); SELECT account_save(NULL,'3310','Ridskola, kurser ','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3311','Ridläger mm ','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3315','Övrig ryttarutbildn','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3316','Tillridn av hästar ','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3317','Inkörning av hästar','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3319','Övrig hästutbildni','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL,'34','Förs.momsfria tj.', NULL); SELECT account_heading_save(NULL,'340','Sång och kultur ', NULL); SELECT account_save(NULL,'3400','Sångframträdanden ','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3401','Musikframträdanden','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3402','Lyrikframträdanden ','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3409','Övr.momsfria framtr','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL,'341','Sjukvård ', NULL); SELECT account_save(NULL,'3410','Patientint.läkarbes','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3411','Patientint.ej besök','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3412','Intyg t.pat','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3413','Intyg t.för./mynd','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3419','Övr.direkta sjukvård','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL,'342','Sjukvårdstj. ', NULL); SELECT account_save(NULL,'3420','Tjänster åt landst','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3421','Tjänster åt företag ','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3422','Tjänst åt smärtklin','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3429','Övr.sjukvårdstj. ','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL,'349','Lab och undersökn', NULL); SELECT account_save(NULL,'3490','Labprover, provtagn','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3491','Labprover, analyser','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3499','Övr.undersökningar ','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL,'35','Fakturerade kostn ', NULL); SELECT account_save(NULL,'3510','Fakturerat emballage','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3518','Returnerat emballage','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3520','Fakturerade frakter','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'3530','Fakt.tull/sped.kost','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'3540','Faktureringsavg.','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'3550','Fakturerade resekost','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'3570','Fakt. matrl.kostn','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'3590','Övr.fakt. kostn ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_heading_save(NULL,'36','Rörelsens sidoint. ', NULL); SELECT account_save(NULL,'3600','Rörelsens sidoint.','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'3610','Förs.av material ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'3611','Förs.av råmaterial','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'3612','Förs.av skrot ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'3613','Förs.förbrukn.matrl.','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'3619','Förs.av övrigt matrl','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'3620','Tillf.uth.personal ','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3630','Tillf.uth.trsp-medel','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3680','Management fees ','I','400', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3690','Övr.sidoint. ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_heading_save(NULL,'37','Intäktskorrigeringar ', NULL); SELECT account_save(NULL,'3700','Intäktskorrigeringar','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'3710','Ofördelade int.red.','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'3730','Lämnade rabatter ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'3731','Lämnade kassarab','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'3732','Lämn.mängdrab-bonus','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'3740','Öresutjämning ','I','400', NULL, false, false, string_to_array('AR_amount:AP_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'3750','Fakturerade punktsk.','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'3751','Fakt.pkt.sk.kr.kont','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'3752','Fakt.pkt-sk.debetkon','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'3790','Övr.intäktskorrigeringar ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_heading_save(NULL,'38','Aktiverat arbete för egen räkning ', NULL); SELECT account_save(NULL,'3800','Akt.arb.egen räkning','I','402', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3840','Aktiv.arb-material ','I','402', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3850','Aktiv.arb-omkostn ','I','402', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3870','Aktiv.arb- löner ','I','402', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL,'39','Övr.rörelseint. ', NULL); SELECT account_save(NULL,'3900','Övr.rörelseint.','I','401', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'3910','Hyres- o arrendeint','I','401', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3911','Hyresint. ','I','401', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3912','Arrendeint. ','I','401', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3920','Provis/licen/royalti','I','401', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3921','Provisionsint. ','I','401', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3922','Licensint.royalties','I','401', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3925','Franchiseint. ','I','401', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3950','Återv,t.avskr.kundf','I','401', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3960','Valuta kursvinst','I','401', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3970','Vinst förs.anl.tillg','I','552', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3971','V. förs.imm.an.tillg','I','552', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3972','Vinst förs.byggn/mar','I','552', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3973','Vinst förs mask/inv','I','552', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3974','Vinst förs.bilar','I','552', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3975','Vinst förs datorer','I','552', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3976','Vinst förs.anl.djur','I','552', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3980','Erhållna bidrag ','I','401', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3981','Erhållna EU-bidrag ','I','401', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3985','Erhållna statl bidr','I','401', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3987','Erh. kommunala bidr','I','401', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3989','Övr.erhållna bidrag ','I','401', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3990','Övr.ers.och int. ','I','401', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3991','Konfliktersättning ','I','401', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3992','Erhållna skadestånd ','I','401', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3993','Erh.donationer gåvor','I','401', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3994','Ofördelad förs.ers','I','401', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3995','Lånedat.nettolöneavd','I','401', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3998','Sjukpenning ','I','401', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'3999','Övr.rörelseint. ','I','401', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_heading_save(NULL,'4','Utgifter/kostn för varor, material och vissa köpta tj. ', NULL); SELECT account_heading_save(NULL,'40','Inköp av varor och material', NULL); SELECT account_heading_save(NULL,'400','Inköp lädermaterial mm ', NULL); SELECT account_save(NULL,'4000','Inköp läder/skinn mm','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4001','Beredn.kostn läd/sk','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4008','Kostn.komp.utv.skom.','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4009','Övr.inköp skomakeri','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'401','Inköp för ull och sömnadsproduktion ', NULL); SELECT account_save(NULL,'4010','Inköp ull ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4011','Inköp garn ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4012','Inköp tyg ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4018','Kostn.komp.utv.ull/s','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4019','Inköp övrigt t.ull/s','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'402','Inköp t.övr produkter','E','400', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4029','Inköp övr produkter ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'403','Inköp mat och boende ', NULL); SELECT account_save(NULL,'4030','Inköp matvaror ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4035','Inköp övr.matprod','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'4036','Kostn.besiktn.certif', NULL); SELECT account_save(NULL,'4038','Kostn.komp.utv.mat/b','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4039','Inköp garn ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4040','Inköp varor/mtrl Sv.','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4050','Inköp varor/mtrl utl','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4051','Inköp varor/mtrl utl','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4055','3p-förv.EU-mellanman','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4056','3p-förv.EU-moms 25% ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4058','3p-förv.EU-momsfri ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4060','Inköp närstående för','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'410','Växtodlingskostn ', NULL); SELECT account_save(NULL,'4100','Utsäde växtodling ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4101','Gödsel växtodling ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4109','Övr.kostn växtodling','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4110','Utsäde pot,gröns,kry','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4111','Gödsel,markförb odl','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4119','Övr.kostn odling ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'420','Kostn fårskötsel ', NULL); SELECT account_save(NULL,'4200','Inköp djur ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4201','Grovfoder får ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4202','Fodersäd, havre ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4203','Kraftfoder får ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4204','Mineralfoder ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4205','Fodertillskott ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4206','Klippning ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4207','Veterinärkostn ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4208','Komp.utv.fårskötsel','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4209','Övr.kostn får ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'421','Fjäderfä ', NULL); SELECT account_save(NULL,'4210','Inköp djur ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4211','Foderinköp ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4212','Mineraltills fjäderf','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4218','Komp.utv.fjäderfä','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4219','Övr.kostn fjäderfä','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'43','Kostn häst ', NULL); SELECT account_save(NULL,'4300','Grovfoder häst ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4301','Kraftfoder häst ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4302','Mineralfoder häst ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4303','Vaccinationer häst','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4304','Övr.foder mm ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4310','Hovbeslag,hovslagn','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4311','Hudvård mm ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4318','Veterinärkostn ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4319','Övr.kostn hästvård','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4329','Öv.k.sadel/seldonsvå','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4339','Öv.k.vagn/redsk häst','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4349','Övr.kostn ridleder ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4398','Komp.utv. häst ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4399','Övr.kostn häst ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'440','Sång och kultur ', NULL); SELECT account_save(NULL,'4400','Noter och material','E','500', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'4408','Komp.utv.sång kultur','E','500', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'4409','Öv.kostn sång,kultur','E','500', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL,'441','Sjukvårdstj. ', NULL); SELECT account_save(NULL,'4410','Inköp f sjukv.prod','E','500', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'4418','Komp.utv.sjukvård ','E','500', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'4419','Övr.kostn sjukvård','E','500', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL,'46','Legoarbeten - underentreprenader ', NULL); SELECT account_save(NULL,'4600','Legoarb/underentr','E','501', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'47','Reduktion av ink.pris', NULL); SELECT account_save(NULL,'4730','Red. av inköpspriser','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4731','Erh kassarabatter ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4732','Erh mängdrab/bonus','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4790','Övr.red.inköpspriser','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'48','Fri t.egna konton ', NULL); SELECT account_heading_save(NULL,'49','Lagerförändring, förändring av pågående arbeten samt garantiavsättningar ', NULL); SELECT account_save(NULL,'4900','Förändr av lager','E','509/510', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4910','Förändr.lager råv.','E','500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4920','Förändr.lag förnöd','E','500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4930','Förändr.lag halvfab','E','509/510', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4931','För.lag köpta ½fab','E','500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4932','För.lag egentv.½fab','E','509/509', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4940','För.lager - PIA ','E','509/510', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4950','För.lager färd.varor','E','509/510', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4960','För.lager handelsvar','E','500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4970','För.påg.arb.nedl.kos','E','509/510', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4974','För.påg.arb.mtrl','E','509/510', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4975','För.påg.arb.omk.','E','509/510', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4977','För.påg.arb.pers','E','509/510', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4990','För.lag o påg.arb','E','509/510', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5','Övr.externa rörelseutgifter/kostn ', NULL); SELECT account_heading_save(NULL,'50','Lokalkostn', NULL); SELECT account_save(NULL,'5000','Lokalkostn','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5010','Lokalhyra ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5011','Hyra av kontorslokal','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5012','Hyra för garage ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5013','Hyra för lagerlokal','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5014','Hyra för P-plats ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5015','Avg.för bostadsr.för','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5020','Elavg.för belysning','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5030','Värme ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5040','Vatten och avlopp ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5050','Lokaltillbehör ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5060','Städn. renhållning ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5061','Städning ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5062','Sophämtning ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5063','Hyra för sopcont.','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5064','Snöröjning ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5065','Trädgårdsskötsel ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5070','Rep.underhåll lokal','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5090','Övr.lokalkostn ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'51','Fastighetskostn', NULL); SELECT account_save(NULL,'5100','Fastighetskostn','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5110','Tomträttsavg/arrende','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5120','Elavg.belysning ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5130','Värme ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5131','Uppvärmning ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5132','Sotning ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5140','Vatten och avlopp ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5160','Städn o renhållning','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5161','Städning ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5162','Sophämtning ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5163','Hyra f sopcontainer','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5164','Snöröjning ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5165','Trädgårdsskötsel ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5170','Rep.o underhåll fast','E','526', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5190','Övr.fastighetskostn ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5191','Fastighetsskatt ','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5192','Fastigh.förs.premier','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5198','Ö.fast.kostn-ej avdr','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5199','Ö.fast.kostn-avdrag','E','528', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'52','Hyra av anläggningstillgångar ', NULL); SELECT account_save(NULL,'5200','Hyra av anl.tillg','E','529', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5210','Hyra mask/tekn.anl','E','529', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5211','Korthyra mask/te anl','E','529', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5212','Leasing mask/te anl','E','529', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5220','Hyra inv/verktyg ','E','529', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5221','Korthyra inv/verktyg','E','529', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5222','Leasing inv/verktyg','E','529', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5250','Hyra av datorer ','E','529', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5251','Korttidshyra datorer','E','529', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5252','Leasing av datorer ','E','529', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5290','Ö.hyresk. anl.tillg','E','529', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'53','Energikostn ', NULL); SELECT account_save(NULL,'5300','Energikostn','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5310','Elavg.för drift ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5320','Gas ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5330','Eldningsolja ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5340','Stenkol och koks ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5350','Torv,ved mm bränsle','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5360','Bensin,fotogen,diese','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5370','Fjärrvärme,kyla mm','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5380','Vatten ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5390','Övr.energikostn ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'54','Förbrukningsinventarier och förbrukningsmaterial ', NULL); SELECT account_save(NULL,'5400','Förbrukn.inv. mm','E','531', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5410','Förbrukn.inventarier','E','531', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5420','Dataprogram ','E','531', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5430','Transportinventarier','E','531', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5440','Förbrukn.emballage','E','531', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5460','Förbrukningsmaterial','E','531', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5480','Arbetskläder/skyddsm','E','531', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5490','Övr.förbr.inv.o.mtrl','E','531', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'55','Reparation och underhåll ', NULL); SELECT account_save(NULL,'5500','Repar. och underhåll','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5510','Rep.o underh.mask/ta','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5520','Rep.o underh.inv.','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5530','Rep.o underh inst.','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5550','Rep.o underh förbr','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5580','Underh/tvätt arb.kl','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5590','Övr.kostn rep/underh','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'56','Kostn för transportmedel', NULL); SELECT account_save(NULL,'5600','Kostn för transportm','E','538', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5610','Personbilskostn ','E','536', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5611','Drivmedel pers.bilar','E','536', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5612','Förs/skat pers.bilar','E','536', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5613','Rep/underh pers.bil','E','536', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5615','Leasingavg.pers.bil','E','536', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5619','Övr.personbilskostn','E','536', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5620','Lastbilskostn ','E','538', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5621','Drivmedel lastbilar ','E','538', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5622','Förs/sk lastbilar ','E','538', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5623','Rep/underh-lastbilar','E','538', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5625','Leasingavg.lastbilar','E','538', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5629','Övr.lastbilskostn ','E','538', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5630','Truckkostn ','E','538', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5650','Traktorkostn ','E','538', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5660','Motorcy/mop/skoterKo','E','538', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5670','Båtkostn ','E','538', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5680','Flygplan/helikopterk','E','538', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5690','Övr.kostn trsp-medel','E','538', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'57','Frakter och transporter ', NULL); SELECT account_save(NULL,'5700','Frakter och transp','E','538', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5710','Frakt,trsp varudistr','E','538', NULL, false, false, string_to_array('AP_amount:IC_expense:IC_cogs', ':')); SELECT account_save(NULL,'5720','Tull- och sped.kostn','E','538', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5730','Arbetstransporter ','E','538', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'58','Resekostn ', NULL); SELECT account_save(NULL,'5800','Resekostn','E','538', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5810','Biljetter ','E','538', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5820','Hyrbilskostn ','E','538', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5831','Kost och logi i Sv. ','E','538', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5832','Kost och logi i utl','E','538', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5890','Övr.resekostn ','E','538', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'59','Reklam och PR ', NULL); SELECT account_save(NULL,'5900','Reklam och PR','E','541', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5910','Annonsering ','E','541', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5920','Utomhus/trafikreklam','E','541', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5930','Reklamtr./direktrekl','E','541', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5940','Utställn. och mässor','E','541', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5950','Butiksreklam ','E','541', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5960','Varuprover,reklamgåv','E','541', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5970','Film-,radio- reklam','E','541', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5980','PR, sponsring ','E','541', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5985','Hemsidor datareklam','E','541', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5990','Övr.kostn rekl/PR','E','541', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5998','Erhållna reklambidr','E','541', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'6','Övr.externa rörelseutgifter/kostn', NULL); SELECT account_heading_save(NULL,'60','Övr.försäljningskostnader', NULL); SELECT account_save(NULL,'6000','Öv.försäljningskostn','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6010','Kataloger/prislistor','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6020','Egna facktidskrifter','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6030','Speciella orderkostn','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6040','Kontokortsavg.','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6050','Försäljningsprovis.','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6055','Franchiseavg.o dyl','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6060','Kreditförs.kostn','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6061','Kreditupplysning','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6062','Inkasso ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6070','Repr.','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6071','Repr.-avdragsgill','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6072','Repr.-ej avdragsgill','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6080','Bankgarantiavg.','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6090','Övr.försäljn.kostn','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'61','Kontorsmaterial och trycksaker', NULL); SELECT account_save(NULL,'6100','Kontorsmtrl o trycks','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6110','Kontorsmaterial ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6150','Trycksaker ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'62','Tele och post ', NULL); SELECT account_save(NULL,'6200','Tele och post','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6210','Telekommunikation ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6211','Telefon ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6212','Mobiltelefon ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6213','Mobilsökning ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6214','Fax ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6215','Telex ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6217','Telefonkonsult ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6230','Datakommunikation ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6250','Porto mm','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'63','Företagsförs och övr riskkostn', NULL); SELECT account_save(NULL,'6300','Föret.förs o ö r.kostn','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6310','Företagsförsäkringar ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6320','Självrisker ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6330','Förluster i påg.arb','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6350','Förluster på kundf','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6351','Konstat förl kundf','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6352','Befarad förl kundf','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6360','Garantikostn ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6361','Förl.garantiavs','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6362','Faktisk garantikostn','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6370','Kostn bevakn/larm','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6380','Förl övr kortfr.ford','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6390','Övr.riskkostn ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'64','Förvaltningskostn ', NULL); SELECT account_save(NULL,'6400','Förvaltningskostn ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6410','Styrelsearvoden ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6420','Revisionsarvoden ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6430','Management fees ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6440','Årsredov./delårsrapp','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6450','Bolagsstämma ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'65','Övr.externa tj. ', NULL); SELECT account_save(NULL,'6500','Övr.externa tj.','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6510','Mätningstj. ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6520','Ritn- o kopier.kostn','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6530','Redovisningstj. ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6540','IT-tj. ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6550','Konsultarvoden ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6560','Serviceavg.branschor','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6570','Bankkostn ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6580','Adv.o rättegångskost','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6590','Övr.externa tj. ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'66','Fri t.egna konton', NULL); SELECT account_heading_save(NULL,'67','Fri t.egna konton', NULL); SELECT account_heading_save(NULL,'68','Inhyrd personal ', NULL); SELECT account_save(NULL,'6800','Inhyrd personal','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6810','Inhyrd prod.pers','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6820','Inhyrd lagerpersonal','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6830','Inhyrd transportpers','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6840','Inh.kontor/ekonomipe','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6850','Inhyrd IT-personal ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6860','Inh.markn/försäljn.p','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6870','Inh.restau/butiksper','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6880','Inhyrd företagsled.','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6890','Övr inhyrd personal','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'69','Övr.externa kostn ', NULL); SELECT account_save(NULL,'6900','Övr.externa kostn','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6910','Licensavg./royalties','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6911','Stim- och Samiavg.','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6920','Patenkostn egna pat','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6921','Uppfinningskostn ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6930','Kostn varumärken mm','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6940','Kontr/provn/stämpela','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6941','Certifieringskostn ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6950','Tillsynsavg.myndigh','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6951','Miljöavg.','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6952','Förpackningsavg.','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6960','Franchiseavg.och dyl','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6970','Tidn/tidskr/facklitt','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6971','Tidningar och tidskr','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6972','Facklitteratur ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6980','Föreningsavg.','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6981','Föreningsavg-avdrags','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6982','För-avg-ej avdragsgi','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6990','Övr.externa kostn ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6991','Övr.ext.kostn-avdrag','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6992','Ö.ext.ko-ej avdragsg','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6993','Lämnade bidr o gåvor','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6995','Kostn.rta sk/soc.avg','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6998','Ing.moms-återbetaln','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6999','Ing.moms-bland.verks','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'7','Utgifter/kostn för personal, avskr m m ', NULL); SELECT account_heading_save(NULL,'70','Löner t.kollektivanst', NULL); SELECT account_save(NULL,'7000','Löner t.kollektivans','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7010','Löner t.kollektivans','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7011','Löner t.kollektivans','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7012','Vinstand t.koll.ans','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7015','Löneskatt koll.ans','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7016','Lönesk.vinstand.koll','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7017','Avg.vederl.koll.ans','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7018','Bruttolöneavdr koll','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7019','Uppl.lön.vinstan.kol','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7080','Lön ej arb tid koll','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7081','Sjuklöner kollektiva','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7082','Semesterlöner koll.','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7090','Förändr.sem.lönskuld','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'71','Fri t.egna konton', NULL); SELECT account_heading_save(NULL,'72','Löner t.tjänstemän och företagsledare ', NULL); SELECT account_save(NULL,'7200','Lön tj.män/för.led.','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7211','Löner t.tjänstemän ','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7212','Vinstand. t.tj.män','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7215','Löneskatt tjänstemän','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7216','Lönesk. vinstand tjm','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7217','Avg.vederl.t.tj.män','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7218','Bruttolönavdr-tj.män','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7219','Uppl.lön/vinstand.tj','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7220','Löner t.företagsled','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7221','Löner t.företagsled','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7222','Tantiem företagsled','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7223','Gratif. företagsled','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7227','Avg.ved.företagsled','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7228','Bruttolöneavdr.f-led','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7229','Uppl.lön/v-and.f-led','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7280','Lön ek arb tid tj/fl','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7281','Sjuklöner tjm/f-led','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7282','Semesterlöner tj/fl','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7290','Förändr.sem.lönskuld','E','512', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'73','Kostnadsers.och förmåner', NULL); SELECT account_save(NULL,'7300','Kostn.ers.och förmån','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7310','Kontanta extraers.','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7311','Ers för sammantr.mm','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7312','Ers förslagsv./uppfi','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7313','Bidrag bostadskostn','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7314','Bidrag måltidskostn','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7315','Bidrag resor tor arb','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7316','Bidrag arbetskläder','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7317','Bidrag arb.mtrl/vtyg','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7318','Felräkningspengar ','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7319','Övr.kont extraers.','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7320','Traktam.tj.resa ','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7321','Skattefri traktam-Sv','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7322','Skattepli traktam-Sv','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7323','Skattefri traktam-ut','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7324','Skattepli traktam-ut','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7330','Bilers.','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7331','Bilers.- skattefria ','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7332','Bilers.- skattepl','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7350','Ers föres.arb.kl','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7370','Repr.ersättningar','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7380','Kostn förm.anst','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7381','Kostn fri bostad','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7382','Kostn fria/subv målt','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7383','Kostn resor tor arb','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7384','Kostn fria/subv a.kl','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7385','Kostn för fri bil ','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7386','Subventionerad ränta','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7387','Personalrabatter ','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7389','Övr.kostn och förmån','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7390','Övr.kostners.förmån','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7398','Anst.nettolöneavdrag','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7399','Övr.kostners.förmån','E','514', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'74','Pens.kostn ', NULL); SELECT account_save(NULL,'7400','Pens.kostn','E','524', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7410','Pens.försäkr.premier','E','524', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7411','Prem.koll.pens.förs','E','524/511', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7412','Prem.indiv.pens.förs','E','524', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7420','Förändr.pens.skuld','E','524', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7430','Avdr.ränt.pens.kostn','E','524', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7440','Avs.t.pens.stiftelse','E','524', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7450','Avdr.gottg.pens.stif','E','524', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7460','Pens.utbetalningar ','E','524', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7461','Pens.utbet.koll.anst','E','524', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7462','Pens.utbet.tjänstem','E','524', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7463','Pens.utbet.för.led','E','524', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7470','Förvalt/kred.för.avg','E','524', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7490','Övr.pensionskostn ','E','524', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'75','Sociala och andra avg.enligt lag och avtal', NULL); SELECT account_save(NULL,'7500','Soc.avg.enl lag/avt','E','520', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7510','Lagstadgade soc.avg.','E','520', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7511','Soc.avg.löner/ers.','E','520', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7512','Soc.avg.förmånsvärd','E','520', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7515','Soc.avg.sk.pl.ers','E','520', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7516','Soc.avg.på arvoden','E','520', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7518','Soc.avg.bruttolönavd','E','520', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7519','Soc.av.sem/löneskuld','E','520', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7520','Egenavg.m m ','E','597', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7530','Löneskatt ','E','520', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7531','Löneskatt löner/ers','E','520', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7532','Löneskatt förmånsvär','E','520', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7533','Särs.lönesk.pens.kos','E','520', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7535','Lönesk.skattepl.ers.','E','520', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7536','Löneskatt på arvoden','E','520', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7538','Lönesk.bruttolöneavd','E','520', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7550','Avk.sk.pensionsmed','E','524', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7570','Premier AMF-försäkr','E','511', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7580','Gruppförsäkr.premier','E','520/511', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7581','Grupplivförs.premier','E','520/511', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7582','Gruppsjukförs.prem.','E','520', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7583','Gruppolycksfallsf.p','E','520', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7590','Ö.soc.o.a.avg.e.lag','E','520', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'76','Övr.personalkostn ', NULL); SELECT account_save(NULL,'7600','Övr.personalkostn','E','527', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7610','Utbildning ','E','527', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7620','Sjuk- och hälsovård','E','527', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7621','Sjuk/hälsov-avd.gill','E','527', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7622','Sjuk/hälsov-ej avdr','E','527', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7630','Personalrepr','E','527', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7631','Personalrepr-avdr.g','E','527', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7632','Personalrepr-ej av.g','E','527', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7650','Sjuklöneförsäkring ','E','527', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7670','Avs. t.personalst','E','527', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7680','Gottgör.f.pers.stift','E','527', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7690','Övr.pers.kostn/bidr','E','527', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7691','Personalrekrytering','E','527', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7692','Begravningshjälp ','E','527', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7693','Fritidsverksamhet ','E','527', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7698','Erh bidr o ers.pers','E','527', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7699','Övr.personalkostn ','E','527', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'77','Ns och återföring av nedskrivningar ', NULL); SELECT account_save(NULL,'7710','Ns im.anl.tillg','E','553', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7720','Ns byggn/mark','E','553', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7730','Ns mask/inv','E','553', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7740','Ns oms.tillg','E','553', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7760','Återf.nedskr.im.anlt','E','553', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7770','Återf nedskr.by/mark','E','553/554', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7780','Återf nedsk.mask/inv','E','553/554', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7790','Återf nedsk.oms.till','E','553/554', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'78','Avskr enligt plan ', NULL); SELECT account_save(NULL,'7810','Avskr im.anl.tillg','E','561', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7811','Avskr bal.utgifter','E','561', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7812','Avskr koncessioner','E','561', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7813','Avskr på patent ','E','561', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7814','Avskr på licenser ','E','561', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7815','Avskr på varumärken','E','561', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7816','Avskr på hyresrätter','E','561', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7817','Avskr på goodwill ','E','561', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7819','Avsk.ö.im.anl.tillg','E','561', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7820','Avskr byggn/markanl','E','560', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7821','Avskr byggnader ','E','560', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7824','Avskr markanläggning ','E','560', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7829','Avskr övr byggnader ','E','560', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7830','Avskr maskiner/inv','E','559', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7831','Avskr mask/tekn.anl','E','559', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7832','Avskr inv/verktyg ','E','559', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7833','Avskr installationer ','E','559', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7834','Avskr bil/trsp-medel','E','559', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7835','Avskr datorer ','E','559', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7836','Avskr leasingavtal ','E','559', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7837','Avskr anl.djur ','E','559', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7839','Avskr övr mask/inv','E','559', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'79','Poster av engångskaraktär och övr rörelsekostn ', NULL); SELECT account_save(NULL,'7910','Intäkt av engångskar','E','401', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'7920','Kostn av engångskar','E','530', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7960','Valutakursförlust','E','530', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7970','Förl.avytt.anl.tillg','E','556', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'7971','Förl.avytt.im.anl.ti','E','556', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'7972','Förl.avytt.byggn/mar','E','556', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'7973','Förl.avytt.mask/inv','E','556', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'7990','Övr.rörelsekostn ','E','530', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'8','Finansiella och andra inkomster/int. och utgifter/kostn ', NULL); SELECT account_heading_save(NULL,'80','Resultat från aktier och andelar i koncernföretag', NULL); SELECT account_save(NULL,'8010','Utdeln akt.and.koncf','E','564', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8012','Utdeln akt.and.do-fö','E','564', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8013','Utdeln akt.and.ö kf','E','564', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8020','Res förs.akt/and kf','E','550/551', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8022','Res förs.akt/and df','E','550/551', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8023','Res förs.akt/and ök','E','550/551', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8070','Ns långfr.fo.kf','E','553/570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8072','Ns akt/and do-f','E','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8073','Ns akt/and ö kf','E','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8076','Ns långfr.fo mo','E','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8077','Ns långfr.fo do','E','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8078','Ns långfr.fo ök','E','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8080','Åf ns långfr.fo kf','E','571', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8082','Åf ns akt/and do-fö','E','571', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8083','Åf ns akt/and ö kf','E','571', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8086','Åf ns långfr.fo.mo','E','571', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8087','Åf ns långfr.fo.do','E','571', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8088','Åf ns långfr.fo.kf','E','571', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'81','Resultat från aktier och andelar i intresseföretag ', NULL); SELECT account_save(NULL,'8110','Utd akt/and intr.fö','I','564', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8120','Res förs.akt/and ifö','I','550/551', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8170','Ns långfr.fo.intr.fö','I','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8171','Ns akt/andel intr.fö','I','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8172','Ns långfr fo intr.fö','I','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8180','Åf ns långfr fo ifö','I','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8181','Åf ns akt/and int.fö','I','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8182','Åf ns fordr intr.för','I','570', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'82','Resultat övr värdepapper och långfr fordr (anl.tillg) ', NULL); SELECT account_save(NULL,'8200','Rta int. anl.tillg.','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8210','Utd akt/and övr.för','I','565', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8220','Resu.förs.värdep afö','I','550/551', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8221','Res förs akt/and för','I','550/551', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8222','Res förs långfr fo.','I','550/551', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8223','Res förs övr värdep','I','550/551', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8230','Valutak.diff.l-fr.fo','I','566', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8231','Valutak.vinst l-fr.f','I','566', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8236','Valutak.förl.l-fr.fo','I','567', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8250','Rta l-fr fo.värdepap','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8251','Rta l-fr fordr.','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8252','Rta övr värdepapper','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8260','Rta l-fr fo.kon.för','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8261','Rta l-fr fo.moderför','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8262','Rta l-fr fo.dotterfö','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8263','Rta l-fr fo.and.ko-f','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8270','Ns and.l-fr fo.an.fö','I','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8271','Ns akt/and företag ','I','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8272','Ns l-fr fo.and.föret','I','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8273','Ns övr värdepapper','I','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8280','Åf ns and.l-fr fo af','I','571', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8281','Åf ns akt/and företa','I','571', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8282','Åf ns l-fr fo.an.fö','I','571', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8283','Åf ns värdepapper','I','571', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'83','Övr.ränteint. och liknande resultatposter ', NULL); SELECT account_save(NULL,'8300','Rta-int. oms.tillg','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8310','Rta-int. oms.tillg','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8311','Rta-int. från bank ','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8312','Rta-int.korts.plac','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8313','Rta-int.korts.fordr.','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8314','Skattefria ränteint. ','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8317','Rt-int. dold rt-komp','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8319','Ö.rta-int.oms.tillg','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8330','Valutakursvinster ','I','566', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8331','Valutakursvinster ','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8336','Valutakursförluster','I','567', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8340','Utd.kortfr.plac.','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8350','Res.förs.kortfr.plac','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8360','Övr.rt-int.konc.före','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8361','Övr.rt-int.moderföre','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8362','Övr.rt-int.dotterför','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8363','Övr.rt-int.övr ko.fö','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8370','Ns kortfr.placeringa','I','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8380','Åf ns k-fr.placering','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8390','Övr.finansiella int. ','I','568', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_heading_save(NULL,'84','Rtakostn och liknande resultatposter ', NULL); SELECT account_save(NULL,'8400','Rta-kostn','E','569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8410','Rta-ko långfr skuld','E','569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8411','Rta-ko obl/förl/konv','E','569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8412','Rta årets pens.kostn','E','569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8413','Rta checkräkningskr','E','569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8414','Rta byggnadskreditiv','E','569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8415','Rta öv.skuld.krediti','E','569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8417','Rta dold räntekomp','E','569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8418','Avdragspost räntesub','E','569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8419','Övr.rt-ko l-fr.skuld','E','569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8420','Rta-ko k-fr.skulder ','E','569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8421','Rta-ko kreditinstit','E','569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8422','Dröjsmålsrta lev.sku','E','569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8423','Kostn.rta skat/avg','E','569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8429','Övr.räntekostn ','E','569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8430','Valutakursdiff.skuld','E','566', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8431','Valutakursvins skuld','E','566', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8436','Valutakursförl skuld','E','567', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8440','Erhållna räntebidrag','E','569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8460','Rtakostn koncernför.','E','569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8461','Rtakostn moderföret.','E','569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8462','Rtakostn dotterför.','E','569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8463','Rtakostn öv.konc.för','E','569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8480','Aktiverade rt-kostn','E','569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8490','Övr.finans. kostn','E','569', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL,'85','Fri t.egna konton', NULL); SELECT account_heading_save(NULL,'86','Fri t.egna konton ', NULL); SELECT account_heading_save(NULL,'87','Extraordinära int. och kostn ', NULL); SELECT account_save(NULL,'8710','Extraordinära int. ','I','401', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'8750','Extraordinära kostn','E','530', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL,'88','Bokslutsdispositioner', NULL); SELECT account_save(NULL,'8810','Ändr.per.fond-HB-1','E','586/589', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8811','Avs. t.per.fond ','E','586/594', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8819','Återf per.fond ','I','589/593', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8820','Ändr.per.fond-HB-2','E','589/594', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8821','Avs.periodiseringsfo','E','589/595', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8829','Åf periodiseringsfon','E','589/596', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8830','Ändr.per.fond-HB-3','E','589/597', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8831','Avs. t.period.fond','E','589/598', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8839','Åf periodiseringsfon','E','589/599', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8850','Överavskrivning ','E','578/590', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8851','Ä.överavskr-im.a.t','E','578/590', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8852','Ä.överavskr-by/man','E','578/590', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8853','Ä.överavskr-ma/inv','E','578/590', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8860','För. av ers.fond ','E','593/594', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8861','Avs.ers.fond inv','E','594', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8862','Avs ers.fond by/m-an','E','594', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8863','Avs ers.fond mark ','E','594', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8864','Avs ers.fond djurlag','E','594', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8865','Från ers.fond f avsk','E','593', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8866','Från ers.fond ej avs','E','593', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8869','Återf från ers.fond ','E','593', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8870','Ändr.al.inv.reserv','E','593', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8871','Från al.inv.res f av','E','593', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8872','Från a.inv.res ej av','E','593', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8873','Av.anl.t.fr.a.inv.re','E','593', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8879','Åf allm.inv.reserv','E','593', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8880','Förändr.obesk.int.','E','593/594', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8881','Avsätn.upphovsmannak','E','594', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8882','Återf upphovsmannako','E','593', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8885','Avs. t.skogskonto ','E','594', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8886','Återf t.skogskonto','E','593', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8890','Övr.bokslutsdisp','E','593/594', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8891','Ä.s.bokf/fak p-skuld','E','593/594', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8892','Neds.konsolid.anl.ti','E','594', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8895','Föränd.valutakursres','E','593/594', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8896','Förändr.lagerreserv','E','593', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8897','Återf av SURV','E','591', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8899','Övr.bokslutsdisp','E','593', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_heading_save(NULL,'89','Skatter och årets resultat ', NULL); SELECT account_save(NULL,'8910','Skatt på årets resul','E','598', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8920','Skatt pga ändr taxer','E','598', NULL, false, false, string_to_array('AP_amount:AR_amount', ':')); SELECT account_save(NULL,'8930','Restituerad skatt','E','598', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8940','Latent skatt','E','598', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8980','Övr.skatter ','E','598', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8990','Resultat ','E','599/596', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8999','Årets resultat','E','599/596', NULL, false, false, string_to_array('', ':')); insert into tax (chart_id,rate) values ((select id from chart where accno = '2611'),0.25); insert into tax (chart_id,rate) values ((select id from chart where accno = '2613'),0.25); insert into tax (chart_id,rate) values ((select id from chart where accno = '2615'),0.25); insert into tax (chart_id,rate) values ((select id from chart where accno = '2621'),0.12); insert into tax (chart_id,rate) values ((select id from chart where accno = '2631'),0.06); insert into tax (chart_id,rate) values ((select id from chart where accno = '2641'),0.25); insert into tax (chart_id,rate) values ((select id from chart where accno = '2645'),0.25); INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno ='1400')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '3011')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '4010')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '3960')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '7960')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'SEK:EUR:USD'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/se/chart/General.sql0000755000000000000000000042443711726633501016714 0ustar rootrootbegin; -- May 7, 2006 -- Johan Hambraeus -- SELECT account_heading_save(NULL, '1', 'Tillgångar ', NULL); SELECT account_heading_save(NULL, '10', 'Immateriella anläggningstillgångar ', NULL); SELECT account_save(NULL,'1010','Balanserade utgifter ','A','234', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1011','Balanserade utgifter för forskning och utveckling ','A','234', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1012','Balanserade utgifter för dataprogram','A','234', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1019','Ackumulerade avskrivningar på balanserade utgifter','A','234', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1020','Koncessioner m m ','A','234', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1029','Ackumulerade avskrivningar på koncessioner','A','234', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1030','Patent ','A','234', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1039','Ackumulerade avskrivningar på patent ','A','234', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1040','Licenser ','A','234', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1049','Ackumulerade avskrivningar på licenser','A','234', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1050','Varumärken ','A','234', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1059','Ackumulerade avskrivningar på varumärken','A','234', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1060','Hyresrätter ','A','234', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1069','Ackumulerade avskrivningar på hyresrätter ','A','234', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1070','Goodwill ','A','234', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1079','Ackumulerade avskrivningar på goodwill','A','234', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1080','Pågående projekt och förskott för immateriella anläggningstillgångar','A','234', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1081','Pågående projekt och förskott för immateriella anläggningstillgångar ','A','234', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1088','Förskott för immateriella anläggningstillgångar','A','234', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1090','Övriga immateriella anläggningstillgångar','A','234', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1099','Ackumulerade avskrivningar på övriga immateriella anläggningstillgångar','A','234', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'11','Byggnader och mark', NULL); SELECT account_save(NULL,'1110','Byggnader','A','237', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1111','Byggnader på egen mark','A','237', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1112','Byggnader på ofri grund','A','237', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1119','Ackumulerade avskrivningar på byggnader','A','237', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1130','Mark','A','237', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1140','Tomter och obebyggda markområden','A','237', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1150','Markanläggning','A','237', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1159','Ackumulerade avskrivningar på markanläggning','A','237', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1180','Pågående nyanläggningar och förskott för byggnader och mark','A','237', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1181','Pågående nybyggnad','A','237', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1182','Pågående tillbyggnad','A','237', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1183','Pågående ombyggnad','A','237', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1188','Förskott för byggnader och mark','A','237', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1190','Övriga byggnader och mark','A','237', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1199','Ackumulerade avskrivningar på övriga byggnader','A','237', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'12','Maskiner och inventarier ', NULL); SELECT account_save(NULL,'1200','Maskiner och inventarier (gruppkonto)','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1209','Ackumulerade avskrivningar på maskiner och inventarier','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1210','Maskiner och andra tekniska anläggningar','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1211','Maskiner','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1212','Byggnadsinventarier','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1213','Andra tekniska anläggningar','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1219','Ackumulerade avskrivningar på maskiner och andra tekniska anläggningar','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1220','Inventarier och verktyg','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1229','Ackumulerade avskrivningar på inventarier och verktyg','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1230','Installationer','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1231','Installationer på egen fastighet','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1232','Installationer på annans fastighet','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1233','Förbättringsutgifter på annans fastighet','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1239','Ackumulerade avskrivningar på installationer','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1240','Bilar och andra transportmedel','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1249','Ackumulerade avskrivningar på bilar och andra transportmedel','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1250','Datorer','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1251','Datorer - företaget','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1257','Datorer - personal','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1259','Ackumulerade avskrivningar på datorer','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1260','Leasingavtal','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1269','Ackumulerade avskrivningar på leasingavtal','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1280','Pågående nyanläggningar och förskott','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1281','Pågående nyanläggningar','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1288','Förskott för maskiner och inventarier','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1290','Övriga maskiner och inventarier','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1291','Konst och liknande tillgångar','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1292','Inventarier i annans fastighet','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1299','Ackumulerade avskrivningar på övriga maskiner och inventarier','A','236', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'13','Finansiella anläggningstillgångar ', NULL); SELECT account_save(NULL,'1310','Aktier och andelar i koncernföretag','A','230', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1311','Aktier och andelar i svenska dotterföretag','A','230', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1312','Aktier och andelar i utländska dotterföretag','A','231', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1313','Aktier och andelar i andra svenska koncernföretag','A','230', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1314','Aktier och andelar i andra utländska koncernföretag','A','231', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1319','Värdereglering av aktier och andelar i koncernföretag','A','230', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1320','Långfristiga fordringar hos koncernföretag','A','241/233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1321','Fordringar hos moderföretag','A','241/234', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1322','Fordringar hos dotterföretag','A','241/235', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1323','Fordringar hos andra koncernföretag','A','241/236', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1329','Värdereglering av långfristiga fordringar hos koncernföretag','A','241/233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1330','Aktier och andelar i intresseföretag','A','230', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1339','Värdereglering av aktier och och andelar i intresseföretag','A','230', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1340','Långfristiga fordringar hos intresseföretag','A','241/233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1349','Värdereglering av långfristiga fordringar hos intresseföretag','A','241/233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1350','Aktier, andelar och värdepapper i andra företag','A','233/230', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1351','Aktier i börsnoterade bolag','A','233/230', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1352','Andra aktier och andelar','A','233/230', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1353','Andelar i bostadsrättsföreningar','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1354','Obligationer','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1359','Värdereglering av andra aktier, andelar och värdepapper','A','233/230', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1380','Andra långfristiga fordringar','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1381','Reversfordringar','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1382','Fordringar hos anställda','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1383','Lämnade depositioner','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1384','Lån till närstående personer','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1385','Värde av kapitalförsäkring','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1386','Förutbetalda leasingavgifter','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1387','Långfristiga kontraktsfordringar','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1388','Olika långfristiga fordringar','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1389','Värdereglering av andra långfristiga fordringar','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1390','Värdereglering av värdepapper och långfristiga fordringar (ofördelad)','A','233', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'14','Lager och pågående arbeten', NULL); SELECT account_save(NULL,'1400','Lager (gruppkonto) ','A','219', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1401','Inneliggande lager ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1402','Varor på väg ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1403','Konsignationslager ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1404','Lager av värdepapper ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1409','Förändring av lager ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1410','Lager av råvaror (förråd) ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1419','Förändring av lager av råvaror ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1420','Lager av tillsatsmaterial och förnödenheter ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1429','Förändring av lager av tillsatsmaterial och förnödenheter ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1430','Lager av halvfabrikat ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1431','Lager av köpta halvfabrikat ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1432','Lager av egentillverkde halvfabrikat ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1439','Förändring av lager av halvfabrikat ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1440','Produkter i arbete - (PIA) ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1449','Förändring av produkter i arbete ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1450','Lager av färdiga varor ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1459','Förändring av lager av färdiga varor ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1460','Lager av handelsvaror - Varulager ','A','219', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1469','Förändring av lager av handelsvaror - Varulager ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1470','Pågående arbeten ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1471','Pågående arbeten, nedlagda kostnader ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1472','Omsättningsfastigheter ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1478','Pågående arbeten, fakturering ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1479','Förändring av pågående arbeten ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1480','Förskott av varor och tjänster ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1481','Remburs ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1489','Övriga förskott till leverantörer ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1490','Förändring av lager pågående arbeten (ofördelad) ','A','219', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'15','Kundfordringar', NULL); SELECT account_save(NULL,'1500','Kundfordringar (gruppkonto) ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1510','Kundfordringar ','A','204', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1512','Belånade kundfordringar ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1515','Osäkra kundfordringar ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1516','Tvistiga kundfordringar ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1518','Ej reskontraförda kundfordringar ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1519','Värdereglering av kundfordringar ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1520','Växelfordringar ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1525','Osäkra växelfordringar ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1529','Värdereglering av osäkra växelfordringar ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1530','Kontraktsfordringar ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1540','Belånade kontraktsfordringar ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1541','Belånade kontraktsfordringar ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1545','Osäkra kontraktsfordringar ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1550','Konsignationsfordringar ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1560','Kundfordringar hos koncernföretag ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1561','Kundfordringar hos moderföretag ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1562','Kundfordringar hos dotternföretag ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1563','Kundfordringar hos andra koncernföretag ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1569','Värdereglering av kundfordringar hos koncernföretag ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1570','Kundfordringar hos intresseföretag ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1575','Osäkra kundfordringar hos intresseföretag ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1579','Värdereglering av kundfordringar ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1580','Kontokort och kuponger ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1590','Värdereglering av kundfordringar (ofördelad) ','A','204', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'16','Övriga kortfristiga fordringar', NULL); SELECT account_save(NULL,'1600','Övriga kortfristiga fordringar (gruppkonto) ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1610','Fordringar hos anställda ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1611','Reseförskott ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1612','Kassaföskott - (Fixkassa) ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1613','Övriga förskott ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1614','Tillfälliga lån till anställda ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1619','Övriga fordringar hos anställda ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1630','Avräkning för skatter och avgifter - (Skattekontot) ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1640','Skattefordringar ','A','206', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1650','Momsfordringar ','A','207', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1660','Fordringar hos koncernföretag ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1661','Fordringar hos moderföretag ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1662','Fordringar hos dotterföretag ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1663','Fordringar hos andra koncernföretag ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1670','Fordringar hos intresseföretag ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1680','Andra kortfristiga fordringar ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1681','Utlägg för kunder ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1682','Kortfristiga lånefordringar ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1683','Fordringar för tecknat men ej inbetalt aktiekapital ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1684','Fordringar hos leverantörer ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1685','Fordringar hos närstående personer ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1686','Upparbetad men ej fakturerad intäkt ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1687','Kortfristig del av långfristiga fordringar ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1689','Övriga kortfristiga fordringar ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1690','Värdereglering av kortfristiga fordringar (ofördelad) ','A','220', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'17','Förutbetalda kostnader och upplupna intäkter', NULL); SELECT account_save(NULL,'1700','Förutbetalda kostnader och upplupna intäkter (gruppkonto) ','A','205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1710','Förutbetalda hyresutgifter ','A','205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1711','Förutbetalda arrendeutgifter ','A','205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1720','Förutbetalda leasingavgifter ','A','205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1730','Förutbetalda försäkringspremier ','A','205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1740','Förutbetalda ränteutgifter ','A','205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1750','Upplupna hyresinkomster ','A','205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1760','Upplupna inkomsträntor ','A','205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1770','Tillgångar av kostnadsnatur ','A','205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1780','Upplupna avtalsinkomster ','A','205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1790','Övriga förutbetalda kostnader och upplupna intäkter ','A','205', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'18','Kortfristiga placeringar', NULL); SELECT account_save(NULL,'1800','Kortfristiga placeringar (gruppkonto) ','A','202', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1810','Aktier i börsnoterade bolag ','A','202', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1820','Obligationer ','A','203', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1830','Konvertibla skuldebrev ','A','203', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1880','Andra kortfristiga placeringar ','A','202', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1882','Egna aktier ','A','202', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1886','Aktier och andelar i koncernföretag ','A','202', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1889','Aktier och andelar i övriga företag ','A','202', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1890','Värdereglering av kortfristiga placeringar ','A','203', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'19','Kassa och Bank', NULL); SELECT account_save(NULL,'1900','Obsevationskonto ','A','200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1910','Kassa ','A','200', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1911','Huvudkassa ','A','200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1920','Postgiro ','A','200', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1930','Checkräkningskonto ','A','200', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1940','Bank och Övriga bankkonton ','A','200', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno in ('1910', '1920', '1930', '1940'); SELECT account_save(NULL,'1950','Bankcertifikat ','A','200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1960','Koncernkonto moderbolag ','A','200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1970','Särskilda bankkonton ','A','200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1971','Allmänt investeringskonto ','A','200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1972','Upphovsmannakonto ','A','200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1973','Skogskonto ','A','200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1974','Spärrade bankmedel ','A','200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1979','Övriga särskilda bankkonton ','A','200', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'2','Eget kapital och skulder', NULL); SELECT account_heading_save(NULL,'20','Eget kapital ', NULL); SELECT account_save(NULL,'2010','Eget kapital - för enskild firma och delägare 1 i ett Handelsbolag ','Q','360/370', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2011','Egna varuuttag ','Q','362/364', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2012','Avräkning för skatter och avgifter - skattekontot ','Q','362/365', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2013','Övriga egna uttag ','Q','362/365', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2014','Upplupna egenavgifer och särskild löneskatt ','Q','362/365', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2017','Årets kapitaltillskott ','Q','363/366', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2018','Övriga egna insättningar ','Q','363/367', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2019','Årets resultat - för enskild firma och delägare 1 i ett Handelsbolag ','Q','368/369', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2020','Eget kapital - delägare 2 i ett Handelsbolag ','Q','360', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2021','Egna varuuttag ','Q','362', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2022','Avräkning för skatter och avgifter - skattekontot ','Q','362', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2023','Övriga egna uttag ','Q','362', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2024','Upplupna egenavgifter och särskild löneskatt ','Q','362', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2027','Årets kapitaltillskott ','Q','363', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2028','Övriga egna insättningar ','Q','363', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2029','Årets resultat - delägare 2 ','Q','368/369', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2030','Eget kapital - delägare 3 i ett Handelsbolag ','Q','360', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2031','Egna varuuttag ','Q','362', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2032','Avräkning för skatter och avgifter - skattekontot ','Q','362', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2033','Övriga egna uttag ','Q','362', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2034','Upplupna egenavgifer och särskild löneskatt ','Q','362', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2037','Årets kapitaltillskott ','Q','363', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2038','Övriga egna insättningar ','Q','363', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2039','Årets resultat - delägare 3 ','Q','363/369', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2050','Avsättning till expansionsmedel - för enskild firma och delägare 1 i ett Handelsbolag ','Q','368/369', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2080','Bundet eget kapital - aktiebolag, ek,för och stiftelse ','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2081','Aktiekapital ','Q','350', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2082','Ej registrerat aktiekapital ','Q','350', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2083','Inbetalda insatser - stiftelsekapital i stiftelse ','Q','350', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2084','Överkursfond ','Q','351', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2085','Uppskrivningsfond ','Q','352', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2086','Reservfond - värdesäkringsfond i stiftelse ','Q','351', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2090','Fritt eget kapital ','Q','354', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2091','Balanserad vinst eller förlust ','Q','354', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2092','Erhållna/lämnade koncernbidrag ','Q','354', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2093','Erhållna aktieägartillskott ','Q','354', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2098','Vinst eller förlust från föregående år ','Q','354', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2099','Årets resultat ','Q','354', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'21','Obeskattade reserver ', NULL); SELECT account_heading_save(NULL,'2115','Periodiseringsfond vid 1995 års taxering ', NULL); SELECT account_heading_save(NULL,'2116','Periodiseringsfond vid 1996 års taxering ', NULL); SELECT account_heading_save(NULL,'2117','Periodiseringsfond vid 1997 års taxering ', NULL); SELECT account_heading_save(NULL,'2118','Periodiseringsfond vid 1998 års taxering ', NULL); SELECT account_heading_save(NULL,'2119','Periodiseringsfond vid 1999 års taxering ', NULL); SELECT account_save(NULL,'2150','Ackumulerade överavskrivningar ','L','330', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2151','Ackumulerade överavskrivningar på immateriella anläggningtillgångar ','L','330', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2152','Ackumulerade överavskrivningar på byggnader och markanläggningar ','L','330', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2153','Ackumulerade överavskrivningar på maskiner och inventarier ','L','330', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2160','Ersättningsfond ','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2161','Ersättningsfond för inventarier ','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2162','Ersättningsfond för byggnader och markanläggningar ','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2163','Ersättningsfond för mark ','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2164','Ersättningsfond för djurlager i jordbruk och renskötsel ','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2170','Avsättningar till allmän investeringsreserv eller liknande ','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2171','Allmän investeringsreserv ','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2180','Obeskattade intäkter ','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2181','Obeskattade upphovsmannaintäkter ','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2185','Obeskattade skogsintäkter ','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2190','Övriga obeskattade reserver ','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2191','Skillnad mellan bokförd och faktisk pensionsskuld ','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2195','Valutakursreserv ','L','337', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2196','Lagerreserv ','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2197','Skatteutjämningsreserv - SURV ','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2199','Övriga obeskattade reserver ','L','339', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'22','Avsättningar', NULL); SELECT account_save(NULL,'2210','Avsättningar för pensioner ','L','320', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2211','Avsättningar för PRI-pensioner ','L','320', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2219','Avsättningar för övriga pensioner ','L','320', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2220','Avsättningar för garantier ','L','304', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2250','Avsättningar för skatter ','L','329/302', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2251','Avsättningar för beräknad latent skatt ','L','329/302', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2252','Avsättningar för tvistiga skatter ','L','329/303', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2259','Avsättningar för övriga skatter ','L','329/304', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2290','Övriga avsättningar ','L','302', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'23','Långfristiga skulder', NULL); SELECT account_save(NULL,'2310','Obligations- och förlagslån ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2320','Konvertibla lån ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2330','Checkräkningskredit ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2340','Byggnadskreditiv ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2350','Andra skulder till kreditinstitut ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2351','Fastighetslån ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2355','Lån i utländsk valuta från kreditinstitut ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2359','Övriga långfristiga lån från kreditinstitut ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2360','Skulder till koncernföretag ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2361','Skulder till Moderföretag ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2362','Skulder till dotterföretag ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2363','Skulder till andra koncernföretag ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2370','Skulder till intresseföretag ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2390','Övriga långfristiga skulder ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2391','Avbetalningskontrakt ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2392','Villkorliga skulder ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2393','Lån från närstående personer ','L','321', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2394','Långfristiga leverantörskrediter ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2395','Andra lån i utländsk valuta ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2397','Mottagna depositioner ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2399','Övriga långfristiga skulder ','L','329', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'24','Kortfristiga skulder till kreditinstitut, kunder och leverantörer', NULL); SELECT account_save(NULL,'2410','Kortfristiga skulder till kreditinstitut ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2411','Kortfristiga lån från kreditinstitut ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2417','Kortfristig del av långfristiga skulder till kreditinstitut ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2418','Kortfristig del av checkräkningskredit ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2419','Övriga kortfristiga skulder till kreditinstitut ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2420','Förskott från kunder ','L','310', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2421','Ej inlösta presentkort ','L','310', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2429','Övriga förskott från kunder ','L','310', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2430','Pågående arbeten ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2431','Pågående arbeten, fakturering ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2435','Fakturerad men ej upparbetad intäkt ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2438','Pågående arbeten, nedlagda kostnader ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3439','Förändring av pågående arbeten ','I','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2440','Leverantörsskulder ','L','300', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'2443','Konsignationsskulder ','L','300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2445','Tvistiga leverantörsskulder ','L','300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2448','Ej reskontraförda leverantörsskulder ','L','300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2460','Leverantörsskulder till koncernföretag ','L','300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2461','Leverantörsskulder till moderföretag ','L','300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2462','Leverantörsskulder till dotterföretag ','L','300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2463','Leverantörsskulder till andra koncernföretag ','L','300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2470','Leverantörsskulder till intresseföretag ','L','300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2490','Övriga kortfristiga skulder till kreditinstitut, kunder och leverantörer ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2491','Växelskulder ','L','300', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'25','Skatteskulder', NULL); SELECT account_save(NULL,'2510','Skatteskulder ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2511','Debiterad kvarstående skatt ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2512','Beräknad inkomstskatt ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2513','Beräknad fastighetssskatt ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2514','Beräknad särskild löneskatt på pensionskostnader ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2515','Beräknad avkastningsskatt ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2518','Betald preliminärskatt ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'26','Moms och särskilda punktskatter', NULL); SELECT account_save(NULL,'2610','Utgående moms, 25% ','L','307', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2611','Utgående moms på försäljning inom Sverige, 25% ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2612','Utgående moms på egna uttag, 25% ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2613','Utgående moms - uthyrningsverksamhet, 25% ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2614','Beräknad utgående moms på tjänsteförvärv från utlandet, 25% ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2615','Beräknad utgående moms på varuförvärv från annat EU-land, 25% ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2618','Vilande utgående moms, 25% ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2620','Utgående moms, 12% ','L','307', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2621','Utgående moms på försäljning inom Sverige, 12% ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2622','Utgående moms på egna uttag, 12% ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2628','Vilande utgående moms, 12% ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2630','Utgående moms, 6% ','L','307', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2631','Utgående moms på försäljning inom Sverige, 6% ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2632','Utgående moms på egna uttag, 6% ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2638','Vilande utgående moms, 6% ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2640','Ingående moms ','L','307', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2641','Debiterad ingående moms ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2642','Debiterad ingående moms i anslutning till frivillig skattskyldighet ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2645','Beräknad ingående moms på förvärv från utlandet ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2648','Vilande ingående moms ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2649','Ingående moms - blandad verksamhet ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2650','Redovisningskonto för moms - Momsredovisning ','L','307', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2660','Särskilda punktskatter ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2661','Reklamskatt ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2669','Övriga punktskatter ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'27','Personalens skatter, avgifter och löneavdrag', NULL); SELECT account_save(NULL,'2710','Personalens källskatt ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2711','Innehållen källskatt ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2718','Betald källskatt ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2730','Lagstadgade sociala avgifter och särskild löneskatt ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2731','Avräkning lagstadgade sociala avgifter ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2732','Avräkning särskild löneskatt ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2738','Betalda lagstadgade sociala avgifter och särskild löneskatt ','L','301', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2740','Avtalade sociala avgifter ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2741','Avräkning avtalade sociala avgifter ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2748','Betalade avtalade sociala avgifter ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2750','Utmätning i lön ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2760','Semesterkassa ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2790','Övriga löneavdrag ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2791','Personalens intressekonto ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2792','Lönsparande ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2793','Gruppförsäkringspremier ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2794','Fackföreningsavgifter ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2795','Mätnings- och granskningsarvoden ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'28','Övriga kortfristiga skulder', NULL); SELECT account_save(NULL,'2810','Avräkning factoring ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2820','Skulder till anställda ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2821','Löneskulder ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2822','Reseräkningar ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2823','Tantiem, gratifikationer ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2830','Avräkning för belånade kontraktsfordringar ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2840','Kortfristiga låneskulder ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2841','Kortfristig del av långfristiga skulder ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2849','Övriga kortfristiga låneskulder ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2860','Skulder till koncernföretag ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2861','Skulder till moderföretag ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2862','Skulder till dotterföretag ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2863','Skulder till andra koncernföretag ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2870','Skulder till intresseföretag ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2890','Övriga kortfristiga skulder ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2891','Skulder under indrivning ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2893','Skulder till närstående personer ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2897','Mottagna depositioner ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2898','Outtagen vinstutdelning ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2899','Övriga kortfristiga skulder ','L','319', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'29','Upplupna kostnader och förutbetalda intäkter', NULL); SELECT account_save(NULL,'2900','Upplupna kostnader och förutbetalda intäkter (gruppkonto) ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2910','Upplupna löner ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2911','Löneskulder ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2912','Ackordsöverskott ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2920','Upplupna semesterlöner ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2928','Betalda semesterlöner ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2930','Upplupna pensionskostnader ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2931','Upplupna pensionsutbetalningar ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2940','Upplupna lagstadgade sociala och andra avgifter ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2941','Beräknade upplupna lagstadgade sociala avgifter ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2942','Beräknad upplupen löneskatt för löner ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2943','Beräknad upplupen särskild löneskatt ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2944','Beräknad upplupen avkastningsskatt på pensionskostnader ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2950','Upplupna avtalade sociala avgifter ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2960','Upplupna utgiftsräntor ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2970','Förutbetalda hyresinkomster ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2971','Förutbetalda arrendeinkomster ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2972','Förutbetalda inkomsträntor ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2980','Upplupna avtalskostnader ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2990','Övriga upplupna kostnader och förutbetalda intäkter ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2991','Beräknat arvode för bokslut ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2992','Beräknat arvode för revision ','L','305', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'3','Rörelsens inkomster/intäkter ', NULL); SELECT account_heading_save(NULL,'30','Huvudintäkter ', NULL); SELECT account_save(NULL,'3010','Försäljning eller arvoden/Utfört arbete ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'3040','Försäljning av tjänster ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3041','Försäljning av tjänster inom Sverige, moms 25% ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3042','Försäljning av tjänster inom Sverige, moms 12% ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3043','Försäljning av tjänster inom Sverige, moms 6% ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3044','Försäljning av tjänster inom Sverige, momsfri ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3045','Försäljning av tjänster till land utanför EU ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3046','Försäljning av tjänster till annat EU-land, moms 25% (ej VAT-nummer) ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3048','Försäljning av tjänster till annat EU-land, momsfri ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3050','Försäljning av varor ','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3051','Försäljning av varor inom Sverige, moms 25% ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3052','Försäljning av varor inom Sverige, moms 12% ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3053','Försäljning av varor inom Sverige, moms 6% ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3054','Försäljning av varor inom Sverige, momsfri ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3055','Försäljning av varor till land utanför EU ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3056','Försäljning av varor till annat EU-land, moms 25% (ej VAT-nummer) ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3057','Trepartsförsäljning av varor till annan EU-land, mellanman ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3058','Försäljning av varor till annat EU-land, momsfritt ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3060','Försäljning till närstående företag ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'31','Fri att använda till egna konton', NULL); SELECT account_heading_save(NULL,'32','Fri att använda till egna konton', NULL); SELECT account_heading_save(NULL,'33','Fri att använda till egna konton', NULL); SELECT account_heading_save(NULL,'34','Fri att använda till egna konton', NULL); SELECT account_heading_save(NULL,'35','Fakturerade kostnader ', NULL); SELECT account_save(NULL,'3510','Fakturerat emballage ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3518','Returnerat emballage ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3520','Fakturerade frakter ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3530','Fakturerade tull- och speditionskostnader m m ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3540','Faktureringsavgifter ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3550','Fakturerade resekostnader ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3560','Fakturerade kostnader till koncernföretag ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3590','Övriga fakturerade kostnader ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'36','Rörelsens sidointäkter ', NULL); SELECT account_save(NULL,'3600','Rörelsens sidointäkter (gruppkonto) ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3610','Försäljning av material ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3611','Försäljning av råmaterial ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3612','Försäljning av skrot ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3613','Försäljning av förbrukningsmaterial ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3619','Försäljning av övrigt material ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3620','Tillfällig uthyrning av personal ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3630','Tillfällig uthyrning av transportmedel ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3680','Management fees ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3690','Övriga sidointäkter ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'37','Intäktskorrigeringar ', NULL); SELECT account_save(NULL,'3700','Intäktskorrigeringar (gruppkonto) ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3710','Ofördelade intäktsreduktioner ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3730','Lämnade rabatter ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3731','Lämnade kassarabatter ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3732','Lämnade mängdrabatter - bonus ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3740','Öresutjämning ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3750','Fakturerade punktskatter ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3751','Fakturerade punktskatter - kreditkonto ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3752','Fakturerade punktskatter - debetkonto ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3790','Övriga intäktskorrigeringar ','I','400', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'38','Aktiverat arbete för egen räkning ', NULL); SELECT account_save(NULL,'3800','Aktiverat arbete för egen räkning (gruppkonto) ','I','402', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3840','Aktiverat arbete - material ','I','402', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3850','Aktiverat arbete - omkostnader ','I','402', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3870','Aktiverat arbete - löner ','I','402', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'39','Övriga rörelseintäkter ', NULL); SELECT account_save(NULL,'3900','Övriga rörelseintäkter (gruppkonto) ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3910','Hyres- och arrendeintäkter ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3911','Hyresintäkter ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3912','Arrendeintäkter ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3920','Provisionsintäkter, licensintäkter och royalties ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3921','Provisionsintäkter ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3922','Licensintäkter och royalties ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3925','Franchiseintäkter ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3950','Återvunna, tidigare avskrivna kundfordringar ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3960','Valutakursvinster på fordringar och skulder av rörelsekaraktär ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3970','Vinst vid avyttring av immateriella och immateriella anläggningstillgångar ','I','552', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3971','Vinst vid avyttring av immateriella anläggningstillgångar ','I','552', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3972','Vinst vid avyttring av byggnader och mark ','I','552', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3973','Vinst vid avyttring av maskiner och inventarier ','I','552', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3980','Erhållna bidrag ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3981','Erhållna EU-bidrag ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3985','Erhållna statliga bidrag ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3987','Erhållna kommunala bidrag ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3989','Övriga erhållna bidrag ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3990','Övriga ersättningar och intäkter ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3991','Konfliktersättning ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3992','Erhållna skadestånd ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3993','Erhållna donationer och gåvor ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3994','Ofördelad försäkringsersättning ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3995','Ersättning lånedatorer - nettolöneavdrag ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3998','Sjukpenning ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3999','Övriga rörelseintäkter ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'4','Utgifter/kostnader för varor, material och vissa köpta tjänster ', NULL); SELECT account_heading_save(NULL,'40','Inköp av varor och material', NULL); SELECT account_save(NULL,'4010','Inköp av varor och material inom Sverige ','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4050','Inköp av varor och material från utlandet ','E','500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4051','Inköp av varor och material utanför EU ','E','500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4055','Trepartsförvärv av varor från annat EU-land - mellanman ','E','500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4056','Trepartsförvärv av varor från annat EU-land - moms 25% ','E','500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4058','Trepartsförvärv av varor från annat EU-land - momsfri ','E','500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4060','Inköp från närstående företag ','E','500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'41 till 45','Fri till egna konton ','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'46','Legoarbeten - underentreprenader ', NULL); SELECT account_save(NULL,'4600','Legoarbeten - underentreprenader (gruppkonto) ','E','501', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'47','Reduktion av inköpspriser ', NULL); SELECT account_save(NULL,'4730','Reduktion av inköpspriser (gruppkonto) ','E','500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4731','Erhållna kassarabatter ','E','500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4732','Erhållna mängdrabatter - bonus ','E','500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4790','Övriga reduktioner av inköpspriser ','E','500', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'48','Fri till egna konton ', NULL); SELECT account_heading_save(NULL,'49','Lagerförändring, förändring av pågående arbeten samt garantiavsättningar ', NULL); SELECT account_save(NULL,'4900','Förändring av lager (gruppkonto) ','E','509/510', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4910','Förändring av lager av råvaror ','E','500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4920','Förändring av lager av tillsatsmaterial och fönödenheter ','E','500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4930','Förändring av lager av halvfabrikat ','E','509/510', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4931','Förändring av lager av köpta halvfabrikat ','E','500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4932','Förändring av lager av egentillverkade halvfabrikat ','E','509/509', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4940','Förändring av lager av produkter i arbete - PIA ','E','509/510', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4950','Förändring av lager av färdiga varor ','E','509/510', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4960','Förändring av lager av handelsvaror ','E','500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4970','Förändring av pågående arbeten, nedlagda kostnader ','E','509/510', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4974','Förändring av pågående arbeten, material och utlägg ','E','509/510', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4975','Förändring av pågående arbeten, omkostnader ','E','509/510', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4977','Förändring av pågående arbeten, personalkostnader ','E','509/510', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4990','Förändring av lager och pågående arbeten (ofördelad) ','E','509/510', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5','Övriga externa rörelseutgifter/kostnader ', NULL); SELECT account_heading_save(NULL,'50','Lokalkostnader', NULL); SELECT account_save(NULL,'5000','Lokalkostnader (gruppkonto) ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5010','Lokalhyra ','E','528', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5011','Hyra av kontorslokaler ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5012','Hyra för garage ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5013','Hyra för lagerlokaler ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5014','Hyra för P-plats ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5015','Avgifter för bostadsrättsförening ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5020','Elavgifter för belysning ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5030','Värme ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5040','Vatten och avlopp ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5050','Lokaltillbehör ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5060','Städning och renhållning ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5061','Städning ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5062','Sophämtning ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5063','Hyra för sopcontainer ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5064','Snöröjning ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5065','Trädgårdsskötsel ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5070','Reparation och underhåll av lokaler ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5090','Övriga lokalkostnader ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'51','Fastighetskostnader', NULL); SELECT account_save(NULL,'5100','Fastighetskostnader (gruppkonto) ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5110','Tomträttsavgäld - arrende ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5120','Elavgifter belysning ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5130','Värme ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5131','Uppvärmning ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5132','Sotning ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5140','Vatten och avlopp ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5160','Städning och renhållning ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5161','Städning ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5162','Sophämtning ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5163','Hyra för sopcontainer ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5164','Snöröjning ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5165','Trädgårdsskötsel ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5170','Reparation och underhåll av fastighet ','E','526', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5190','Övriga fastighetskostnader ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5191','Fastighetsskatt ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5192','Fastighetsförsäkringspremier ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5198','Övriga fatighetskostnader - ej avdragsgilla ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5199','Övriga fatighetskostnader - avdragsgilla ','E','528', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'52','Hyra av anläggningstillgångar ', NULL); SELECT account_save(NULL,'5200','Hyra av anläggningstillgångar (gruppkonto) ','E','529', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5210','Hyra av maskiner och andra tekniska anläggningar ','E','529', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5211','Korttidshyra av maskiner och tekniska anläggningar ','E','529', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5212','Leasing av maskiner och tekniska anläggningar ','E','529', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5220','Hyra av inventarier och verktyg ','E','529', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5221','Korttidshyra av inventarier och verktyg ','E','529', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5222','Leasing av inventarier och verktyg ','E','529', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5250','Hyra av datorer ','E','529', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5251','Korttidshyra av datorer ','E','529', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5252','Leasing av datorer ','E','529', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5290','Övriga hyreskostnader för anläggningstillgångar ','E','529', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'53','Energikostnader ', NULL); SELECT account_save(NULL,'5300','Energikostnader (gruppkonto) ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5310','Elavgifter för drift ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5320','Gas ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5330','Eldningsolja ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5340','Stenkol och koks ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5350','Torv, träkol, ved och annat trädbränsle ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5360','Bensin, fotogen och motorbrännolja ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5370','Fjärrvärme, kyla och ånga ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5380','Vatten ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5390','Övriga energikostnader ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'54','Förbrukningsinventarier och förbrukningsmaterial ', NULL); SELECT account_save(NULL,'5400','Förbrukningsinventarier och förbrukningsmaterial (gruppkonto) ','E','531', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5410','Förbrukningsinventarier ','E','531', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5420','Dataprogram ','E','531', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5430','Transportinventarier ','E','531', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5440','Förbrukningsemballage ','E','531', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5460','Förbrukningsmaterial ','E','531', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5480','Arbetskläder och skyddsmaterial ','E','531', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5490','Övriga förbrukningsinventarier och förbrukningsmaterial ','E','531', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'55','Reparation och underhåll ', NULL); SELECT account_save(NULL,'5500','Reparation och underhåll (gruppkonto) ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5510','Reparation och underhåll av maskiner och tekniska anläggningar ','E','530', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5520','Reparation och underhåll av inventarier, verktyg och datorer mm. ','E','530', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5530','Reparation och underhåll av installationer ','E','530', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5550','Reparation och underhåll av förbrukningsinventarier ','E','530', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5580','Underhåll och tvätt av arbetskläder ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5590','Övriga kostnader för reparation och underhåll ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'56','Kostnader för transportmedel ', NULL); SELECT account_save(NULL,'5600','Kostnader för transportmedel (gruppkonto) ','E','538', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5610','Personbilskostnad ','E','536', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5611','Drivmedel för personbilar ','E','536', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5612','Försäkring och skatt för personbilar ','E','536', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5613','Reparation och underhåll - personbilar ','E','536', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5615','Leasingavgifter för personbilar ','E','536', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5619','Övriga personbilskostnader ','E','536', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5620','Lastbilskostnad ','E','538', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5621','Drivmedel för lastbilar ','E','538', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5622','Försäkring och skatt för lastbilar ','E','538', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5623','Reparation och underhåll - lastbilar ','E','538', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5625','Leasingavgifter för lastbilar ','E','538', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5629','Övriga lastbilskostnader ','E','538', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5630','Truckkostnader ','E','538', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5650','Traktorkostnader ','E','538', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5660','Motorcykel-, moped- och skoterkostnader ','E','538', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5670','Båtkostnader ','E','538', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5680','Flygplans- och helikopterkostnader ','E','538', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5690','Övriga kostnader för transportmedel ','E','538', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'57','Frakter och transporter ', NULL); SELECT account_save(NULL,'5700','Frakter och transporter (gruppkonto) ','E','538', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5710','Frakter, transporter och försäkringar vid varudistribution ','E','538', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'5720','Tull- och speditionskostnader ','E','538', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5730','Arbetstransporter ','E','538', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'58','Resekostnader ', NULL); SELECT account_save(NULL,'5800','Resekostnader (gruppkonto) ','E','538', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5810','Biljetter ','E','538', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5820','Hyrbilskostnader ','E','538', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5831','Kost och logi i Sverige ','E','538', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5832','Kost och logi i utlandet ','E','538', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5890','Övriga resekostnader ','E','538', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'59','Reklam och PR ', NULL); SELECT account_save(NULL,'5900','Reklam och PR (gruppkonto) ','E','541', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5910','Annonsering ','E','541', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5920','Utomhus- och trafikreklam ','E','541', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5930','Reklamtrycksaker och direktreklam ','E','541', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5940','Utställningar och mässor ','E','541', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5950','Butiksreklam och återförsäljarreklam ','E','541', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5960','Varuprover, reklamgåvor, presentreklam och tävlingar ','E','541', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5970','Film-, radio- och TV-reklam ','E','541', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5980','PR, institutionell reklam och sponsring ','E','541', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5985','Hemsidor och övrig datareklam ','E','541', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5990','Övriga kostnader för reklam och PR ','E','541', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5998','Erhållna reklambidrag ','E','541', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'6','Övriga externa rörelseutgifter/kostnader', NULL); SELECT account_heading_save(NULL,'60','Övriga försäljningskostnader ', NULL); SELECT account_save(NULL,'6000','Övriga försäljningskostnader (gruppkonto) ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6010','Kataloger och prislistor ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6020','Egna facktidskrifter ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6030','Speciella orderkostnader ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6040','Kontokortsavgifter ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6050','Försäljningsprovisioner ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6055','Franchiseavgifter o ch dyl. ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6060','Kreditförsäljningskostnader ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6061','Kreditupplysning ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6062','Inkasso ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6070','Representation ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6071','Representation - avdragsgill ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6072','Representation - ej avdragsgill ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6080','Bankgarantiavgifter ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6090','Övriga försäljningskostnader ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'61','Kontorsmaterial och trycksaker', NULL); SELECT account_save(NULL,'6100','Kontorsmaterial och trycksaker (gruppkonto) ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6110','Kontorsmaterial ','E','530', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'6150','Trycksaker ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'62','Tele och post ', NULL); SELECT account_save(NULL,'6200','Tele och post (gruppkonto) ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6210','Telekommunikation ','E','530', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'6211','Telefon ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6212','Mobiltelefon ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6213','Mobilsökning ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6214','Fax ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6215','Telex ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6217','Telefonkonsult ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6230','Datakommunikation ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6250','Postbefordran, d v s frimärken mm ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'63','Företagsförsäkringar och övriga riskkostnader ', NULL); SELECT account_save(NULL,'6300','Företagsförsäkringar och övriga riskkostnader (gruppkonto) ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6310','Företagsförsäkringar ','E','530', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'6320','Självrisker ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6330','Förluster i pågående arbeten ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6350','Förluster på kundfordringar ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6351','Konstaterade förluster på kundfordringar ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6352','Befarade förluster på kundfordringar ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6360','Garantikostnader ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6361','Förändring av garantiavsättning ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6362','Faktiska garantikostnader ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6370','Kostnader för bevakning och larm ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6380','Förluster på övriga kortfristiga fordringar ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6390','Övriga riskkostnader ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'64','Förvaltningskostnader ', NULL); SELECT account_save(NULL,'6400','Förvaltningskostnader ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6410','Styrelsearvoden ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6420','Revisionsarvoden ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6430','Management fees ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6440','Årsredovisning och delårsrapporter ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6450','Bolagsstämma ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'65','Övriga externa tjänster ', NULL); SELECT account_save(NULL,'6500','Övriga externa tjänster (gruppkonto) ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6510','Mätningstjänster ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6520','Ritnings- och kopieringskostnader ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6530','Redovisningstjänster ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6540','IT-tjänster ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6550','Konsultarvoden ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6560','Serviceavgifter till branschorganisationer ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6570','Bankkostnader ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6580','Advokat- och rättegångskostnader ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6590','Övriga externa tjänster ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'66','Fri till egna konton', NULL); SELECT account_heading_save(NULL,'67','Fri till egna konton', NULL); SELECT account_heading_save(NULL,'68','Inhyrd personal ', NULL); SELECT account_save(NULL,'6800','Inhyrd personal (gruppkonto) ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6810','Inhyrs produktionspersonal ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6820','Inhyrd lagerpersonal ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6830','Inhyrd transportpersonal ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6840','Inhyrd kontors- och ekonomipersonal ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6850','Inhyrd IT-personal ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6860','Inhyrd marknads- och försäljningspersonal ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6870','Inhyrd restaurang- och butikspersonal ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6880','Inhyrd företagsledare ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6890','Övrig inhyrd personal ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'69','Övriga externa kostnader ', NULL); SELECT account_save(NULL,'6900','Övriga externa kostnader (gruppkonto) ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6910','Licensavgifter och royalties ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6911','Stim- och Samiavgifter ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6920','Patenkostnader för egna patent ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6921','Uppfinningskostnader ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6930','Kostnader för varumärken mm ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6940','Kontroll-, provnings- och stämpelavgifter ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6941','Certifieringskostnader ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6950','Tillsynsavgifter myndigheter ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6951','Miljöavgifter ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6952','Förpackningsavgifter ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6960','Franchiseavgifter och dyl. ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6970','Tidningar, tidskrifter och facklitteratur ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6971','Tidningar och tidskrifter ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6972','Facklitteratur ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6980','Föreningsavgifter ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6981','Föreningsavgifter - avdragsgilla ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6982','Föreningsavgifter - ej avdragsgilla ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6990','Övriga externa kostnader ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6991','Övriga externa kostnader - avdragsgilla ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6992','Övriga externa kostnader - ej avdragsgilla ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6993','Lämnade bidrag och gåvor ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6995','Kostnadsräntor för skatter och sociala avgifter ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6998','Ingående moms - återbetalning ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6999','Ingående moms - blandad verksamhet ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'7','Utgifter/kostnader för personal, avskrivningar m m ', NULL); SELECT account_heading_save(NULL,'70','Löner till kollektivanställda', NULL); SELECT account_save(NULL,'7000','Löner till kollektivanställda (gruppkonto) ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7010','Löner till kollektivanställda ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7011','Löner till kollektivanställda ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7012','Vinstandelar till kollektivanställda ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7015','Löner till kollektivanställda - löneskatt ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7016','Vinstandelar till kollektivanställda - löneskatt ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7017','Avgångsvederlag till kollektivanställda ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7018','Bruttolöneavdrag - kollektivanställda ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7019','Upplupna löner och vinstandelar till kollektivanställda ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7080','Löner till kollektivanställda för ej arbetad tid ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7081','Sjuklöner till kollektivanställda ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7082','Semesterlöner till kollektivanställda ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7090','Förändring av semesterlöneskuld ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'71','Fri till egna konton', NULL); SELECT account_heading_save(NULL,'72','Löner till tjänstemän och företagsledare ', NULL); SELECT account_save(NULL,'7200','Löner till tjänstemän och företagsledare (gruppkonto) ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7211','Löner till tjänstemän ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7212','Vinstandelar till tjänstemän ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7215','Löner till tjänstemän (löneskatt) ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7216','Vinstandelar till tjänstemän (löneskatt) ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7217','Avgångsvederlag till tjänstemän ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7218','Bruttolöneavdrag - tjänstemän ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7219','Upplupna löner och vinstandelar till tjänstemän ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7220','Löner till företagsledare ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7221','Löner till företagsledare ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7222','Tantiem till företagsledare ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7223','Gratifikationer till företagsledare ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7227','Avgångsvederlag till företagsledare ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7228','Bruttolöneavdrag - företagsledare ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7229','Upplupna löner och vinstandelar till företagsledning ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7280','Löner till tjänstemän och företagsledare för ej arbetad tid ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7281','Sjuklöner till tjänstemän och företagsledare ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7282','Semesterlöner till tjänstemän och företagsledare ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7290','Förändring av semesterlöneskuld ','E','512', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'73','Kostnadsersättningar och förmåner ', NULL); SELECT account_save(NULL,'7300','Kostnadsersättningar och förmåner (gruppkonto) ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7310','Kontanta extraersättningar ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7311','Ersättningar för sammanträden m m ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7312','Ersättningar för förslagsverksamhet och uppfinningar ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7313','Ersättningar för/bidrag till bostadskostnader ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7314','Ersättningar för/bidrag till måltidskostnader ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7315','Ersättningar för/bidrag till resor till och från arbetsplatsen ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7316','Ersättningar för/bidrag till arbetskläder ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7317','Ersättningar för/bidrag till arbetsmaterial och arbetsverktyg ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7318','Felräkningspengar ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7319','Övriga kontanta extraersättningar ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7320','Traktamenten vid tjänsteresa ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7321','Skattefria traktamenten - Sverige ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7322','Skattepliktiga traktamenten - Sverige ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7323','Skattefria traktamenten - utlandet ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7324','Skattepliktiga traktamenten - utlandet ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7330','Bilersättningar ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7331','Bilersättningar - skattefria ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7332','Bilersättningar - skattepliktiga ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7350','Ersättningar för föreskrivna arbetskläder ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7370','Representationserättningar ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7380','Kostnader för förmåner till anställda ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7381','Kostnader för fri bostad ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7382','Kostnader för fria eller subventionerade måltider ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7383','Kostnader för fria resor till och från arbetsplatsen ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7384','Kostnader för fria eller subventionerade arbetskläder ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7385','Kostnader för fri bil ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7386','Subventionerad ränta ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7387','Personalrabatter ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7389','Övriga kostnader och förmåner ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7390','Övriga kostnadsersättningar och förmåner ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7398','Anställdas ersättning för förmåner - nettolöneavdrag ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7399','Övriga kostnadsersättningar och förmåner ','E','514', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'74','Pensionskostnader ', NULL); SELECT account_save(NULL,'7400','Pensionskostnader (gruppkonto) ','E','524', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7410','Pensionsförsäkringspremier ','E','524', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7411','Premier för kollektiva pensionsförsäkringar ','E','524/511', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7412','Premier för individuella pensionsförsäkringar ','E','524', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7420','Förändring av pensionsskuld ','E','524', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7430','Avdrag för räntedel i pensionskostnad ','E','524', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7440','Avsättning till pensionsstiftelse ','E','524', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7450','Avdrag för gottgörelse från pensionsstiftelse ','E','524', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7460','Pensionsutbetalningar ','E','524', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7461','Pensionsutbetalningar till f d kollektivanställda ','E','524', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7462','Pensionsutbetalningar till f d tjänstemän ','E','524', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7463','Pensionsutbetalningar till f d företagsledare ','E','524', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7470','Förvaltnings- och kreditförsäkringsavgifter ','E','524', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7490','Övriga pensionskostnader ','E','524', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'75','Sociala och andra avgifter enligt lag och avtal', NULL); SELECT account_save(NULL,'7500','Sociala och andra avgifter enligt lag och avtal (gruppkonto) ','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7510','Lagstadgade sociala avgifter ','E','520', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7511','Sociala avgifter för löner och ersättningar ','E','520', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7512','Sociala avgifter för förmånsvärden ','E','520', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7515','Sociala avgifter för skattepliktiga kostnadsersättningar ','E','520', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7516','Sociala avgifter på arvoden ','E','520', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7518','Sociala avgifter för bruttolöneavdrag m m ','E','520', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7519','Sociala avgifter för semester- och löneskuld ','E','520', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7520','Egenavgifter m m ','E','597', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7530','Löneskatt ','E','520', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7531','Löneskatt för löner och ersättningar ','E','520', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7532','Löneskatt för förmånsvärden ','E','520', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7533','Särskild löneskatt för pensionskostnader ','E','520', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7535','Löneskatt på skattepliktiga kostnadsersättningar ','E','520', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7536','Löneskatt på arvoden ','E','520', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7538','Löneskatt på bruttolöneavdrag ','E','520', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7550','Avkastningsskatt på pensionsmedel ','E','524', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7570','Premier för AMF-försäkring ','E','511', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7580','Gruppförsäkringspremier ','E','520/511', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7581','Grupplivförsäkringspremier ','E','520/511', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7582','Gruppsjukförsäkringspremier ','E','520', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7583','Gruppolycksfallsförsäkringspremier ','E','520', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7590','Övriga sociala och andra avgifter enligt lag och avtal ','E','520', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'76','Övriga personalkostnader ', NULL); SELECT account_save(NULL,'7600','Övriga personalkostnader (gruppkonto) ','E','527', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7610','Utbildning ','E','527', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7620','Sjuk- och hälsovård ','E','527', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7621','Sjuk- och hälsovård - avdragsgill ','E','527', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7622','Sjuk- och hälsovård - ej avdragsgill ','E','527', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7630','Personalrepresentation ','E','527', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7631','Personalrepresentation - avdragsgill ','E','527', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7632','Personalrepresentation - ej avdragsgill ','E','527', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7650','Sjuklöneförsäkring ','E','527', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7670','Avsättning till personalstiftelse ','E','527', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7680','Gottgörelse från personalstiftelse ','E','527', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7690','Övriga personalkostnader och erhållna bidrag ','E','527', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7691','Personalrekrytering ','E','527', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7692','Begravningshjälp ','E','527', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7693','Fritidsverksamhet ','E','527', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7698','Erhållna bidrag och ersättningar för personal ','E','527', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7699','Övriga personalkostnader ','E','527', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'77','Nedskrivningar och återföring av nedskrivningar ', NULL); SELECT account_save(NULL,'7710','Nedskrivningar av immateriella anläggningstillgångar ','E','553', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7720','Nedskrivningar av byggnader och mark ','E','553', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7730','Nedskrivningar av maskiner och inventarier ','E','553', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7740','Nedskrivningar av vissa omsättningstillgångar ','E','553', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7760','Återföring av nedskrivningar av immateriella anläggningstillgångar ','E','553', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7770','Återföring av nedskrivningar av byggnader och mark ','E','553/554', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7780','Återföring av nedskrivningar av maskiner och inventarier ','E','553/554', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7790','Återföring av nedskrivningar av vissa omsättningstillgångar ','E','553/554', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'78','Avskrivningar enligt plan ', NULL); SELECT account_save(NULL,'7810','Avskrivningar på immateriella anläggningstillgångar ','E','561', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7811','Avskrivningar på balanserade utgifter ','E','561', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7812','Avskrivningar på koncessioner m m ','E','561', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7813','Avskrivningar på patent ','E','561', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7814','Avskrivningar på licenser ','E','561', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7815','Avskrivningar på varumärken ','E','561', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7816','Avskrivningar på hyresrätter ','E','561', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7817','Avskrivningar på goodwill ','E','561', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7819','Avskrivningar på övriga immateriella anläggningstillgångar ','E','561', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7820','Avskrivningar på byggnader och markanläggningar ','E','560', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7821','Avskrivningar på byggnader ','E','560', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7824','Avskrivningar på markanläggning ','E','560', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7829','Avskrivningar på övriga byggnader ','E','560', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7830','Avskrivningar på maskiner och inventarier ','E','559', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7831','Avskrivningar på maskiner och andra tekniska anläggningar ','E','559', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7832','Avskrivningar på inventarier och verktyg ','E','559', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7833','Avskrivningar på installationer ','E','559', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7834','Avskrivningar på bilar och andra transportmedel ','E','559', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7835','Avskrivningar på datorer ','E','559', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7836','Avskrivningar på leasingavtal ','E','559', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7839','Avskrivningar på övriga maskiner och inventarier ','E','559', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'79','Poster av engångskaraktär och övriga rörelsekostnader ', NULL); SELECT account_save(NULL,'7910','Intäkter av engångskaraktär ','E','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7920','Kostnader av engångskaraktär ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7960','Valutakursförluster på fordringar och skulder av rörelsekaraktär ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7970','Förlust vid avyttring av immateriella och materiella anläggningstillgångar ','E','556', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7971','Förlust vid avyttring av immateriella anläggningstillgångar ','E','556', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7972','Förlust vid avyttring av byggnader och mark ','E','556', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7973','Förlust vid avyttring av maskiner och inventarier ','E','556', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7990','Övriga rörelsekostnader ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'8','Finansiella och andra inkomster/intäkter och utgifter/kostnader ', NULL); SELECT account_heading_save(NULL,'80','Resultat från aktier och andelar i koncernföretag', NULL); SELECT account_save(NULL,'8010','Utdelning på aktier och andelar i koncernföretag ','E','564', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8012','Utdelning på aktier och andelar i dotterföretag ','E','564', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8013','Utdelning på aktier och andelar i andra koncernföretag ','E','564', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8020','Resultat vid försäljning av aktier och andelar i koncernföretag ','E','550/551', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8022','Resultat vid försäljning av aktier och andelar i dotterföretag ','E','550/551', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8023','Resultat vid försäljning av aktier och andelar i andra koncernföretag ','E','550/551', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8070','Nedskrivning av andelar i och långfristiga fordringar hos koncernföretag ','E','553/570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8072','Nedskrivning av aktier och andelar i dotterföretag ','E','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8073','Nedskrivning av aktier och andelar i andra koncernföretag ','E','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8076','Nedskrivning av långfristiga fordringar hos moderföretag ','E','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8077','Nedskrivning av långfristiga fordringar hos dotterföretag ','E','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8078','Nedskrivning av långfristiga fordringar hos andra koncernföretag ','E','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8080','Återföring av nedskrivning av andelar i och långfristiga fordringar hos koncernföretag ','E','571', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8082','Återföring av nedskrivning av aktier och andelar i dotterföretag ','E','571', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8083','Återföring av nedskrivning av aktier och andelar i andra koncernföretag ','E','571', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8086','Återföring av nedskrivning av långfristiga fordringar hos moderföretag ','E','571', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8087','Återföring av nedskrivning av långfristiga fordringar hos dotterföretag ','E','571', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8088','Återföring av nedskrivning av långfristiga fordringar hos andra koncernföretag ','E','571', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'81','Resultat från aktier och andelar i intresseföretag ', NULL); SELECT account_save(NULL,'8110','Utdelning på aktier och andelar i intresseföretag ','I','564', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8120','Resultat vid försäljning av aktier och andelar i intresseföretag ','I','550/551', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8170','Nedskrivning av andelar i och långfristiga fordringar hos intresseföretag ','I','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8171','Nedskrivning av aktier och andelar i intresseföretag ','I','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8172','Nedskrivning av långfristiga fordringar hos intresseföretag ','I','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8180','Återföring av nedskrivning av andelar i och långfristiga fordringar hos intresseföretag ','I','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8181','Återföring av nedskrivning av aktier och andelar i intresseföretag ','I','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8182','Återföring av nedskrivning av långfristiga fordringar hos intresseföretag ','I','570', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'82','Resultat från övriga värdepapper och långfristiga fordringar (anläggningstillgångar) ', NULL); SELECT account_save(NULL,'8200','Ränteintäkter från anläggningstillgångar (gruppkonto) ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8210','Utdelning på aktier och andelar i andra företag ','I','565', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8220','Resultat vid försäljning av värdepapper i och långfristiga fordringar hos andra företag ','I','550/551', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8221','Resultat vid försäljning av aktier och andelar i andra företag ','I','550/551', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8222','Resultat vid försäljning av långfristiga fordringar hos andra företag ','I','550/551', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8223','Resultat vid försäljning av övriga värdepapper i andra företag ','I','550/551', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8230','Valutakursdifferenser på långfristiga fordringar ','I','566', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8231','Valutakursvinster på långfristiga fordringar ','I','566', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8236','Valutakursförluster på långfristiga fordringar ','I','567', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8250','Ränteintäkter från långfristiga fordringar hos och värdepapper i andra företag ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8251','Ränteintäkter från långfristiga fordringar ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8252','Ränteintäkter från övriga värdepapper ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8260','Ränteintäkter från långfristiga fordringar hos koncernföretag ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8261','Ränteintäkter från långfristiga fordringar hos moderföretag ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8262','Ränteintäkter från långfristiga fordringar hos dotterföretag ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8263','Ränteintäkter från långfristiga fordringar hos andra koncernföretag ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8270','Nedskrivningar av innehav av andelar i och långfristiga fordringar hos andra företag ','I','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8271','Nedskrivning av aktier och andelar i andra företag ','I','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8272','Nedskrivning av långfristiga fordringar hos andra företag ','I','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8273','Nedskrivning av övriga värdepapper hos andra företag ','I','570', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8280','Återföring av nedskrivning av andelar i och långfristiga fordringar hos andra företag ','I','571', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8281','Återföring av nedskrivning av aktier och andelar i andra företag ','I','571', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8282','Återföring av nedskrivning av långfristiga fordringar hos andra företag ','I','571', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8283','Återföring av nedskrivning av övriga värdepapper i andra företag ','I','571', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'83','Övriga ränteintäkter och liknande resultatposter ', NULL); SELECT account_save(NULL,'8300','Ränteintäkter från omsättningstillgångar (gruppkonto) ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8310','Ränteintäkter från omsättningstillgångar ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8311','Ränteintäkter från bank ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8312','Ränteintäkter från kortsiktiga placeringar ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8313','Ränteintäkter från kortsiktiga fordringar ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8314','Skattefria ränteintäkter ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8317','Ränteintäkter från dold räntekompensation ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8319','Övriga ränteintäkter från omsättningstillgångar ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8330','Valutakursvinster på kortfristiga fordringar och placeringar ','I','566', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8331','Valutakursvinster på kortfristiga fordringar och placeringar ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8336','Valutakursförluster på kortfristiga fordringar och placeringar ','I','567', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8340','Utdelningar på kortfristiga placeringar ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8350','Resultat vid försäljning av kortfristiga placeringar ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8360','Övriga ränteintäkter från koncernföretag ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8361','Övriga ränteintäkter från moderföretag ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8362','Övriga ränteintäkter från dotterföretag ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8363','Övriga ränteintäkter från andra koncernföretag ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8370','Nedskrivning av kortfristiga placeringar ','I','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8380','Återföring av nedskrivning av kortfristiga placeringar ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8390','Övriga finansiella intäkter ','I','568', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'84','Räntekostnader och liknande resultatposter ', NULL); SELECT account_save(NULL,'8400','Räntekostnader (gruppkonto) ','E','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8410','Räntekostnader för långfristiga skulder ','E','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8411','Räntekostnader för obligations-, förlags- och konvertibla lån ','E','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8412','Räntedel i årets pensionskostnad ','E','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8413','Räntekostnader för checkräkningskredit ','E','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8414','Räntekostnader för byggnadskreditiv ','E','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8415','Räntekostnader för andra skulder till kreditinstitut ','E','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8417','Räntekostnader för dold räntekompensation m m ','E','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8418','Avdragspost för räntesubventioner ','E','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8419','Övriga räntekostnader för långfristiga skulder ','E','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8420','Räntekostnader för kortfristiga skulder ','E','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8421','Räntekostnader till kreditinstitut ','E','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8422','Dröjsmålsräntor för leverantörsskulder ','E','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8423','Kostnadsräntor för skatter och avgifter - skattekonto ','E','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8429','Övriga räntekostnader för kortfristiga skulder ','E','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8430','Valutakursdifferenser på skulder ','E','566', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8431','Valutakursvinster på skulder ','E','566', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8436','Valutakursförluster på skulder ','E','567', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8440','Erhållna räntebidrag ','E','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8460','Räntekostnader till koncernföretag ','E','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8461','Räntekostnader till moderföretag ','E','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8462','Räntekostnader till dotterföretag ','E','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8463','Räntekostnader till andra koncernföretag ','E','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8480','Aktiverade räntekostnader ','E','569', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8490','Övriga finansiella kostnader ','E','569', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'85','Fri till egna konton', NULL); SELECT account_heading_save(NULL,'86','Fri till egna konton ', NULL); SELECT account_heading_save(NULL,'87','Extraordinära intäkter och kostnader ', NULL); SELECT account_save(NULL,'8710','Extraordinära intäkter ','I','401', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8750','Extraordinära kostnader ','E','530', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'88','Bokslutsdispositioner ', NULL); SELECT account_save(NULL,'8810','Förändring av periodiseringsfond - enskild näringsidkare och delägare 1 i HB','E','586/589', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8811','Avsättning till periodiseringsfond ','E','586/594', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8819','Återföring från periodiseringsfond ','I','589/593', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8820','Förändring av periodiseringsfond - delägare 2 i HB','E','589/594', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8821','Avsättning till periodiseringsfond ','E','589/595', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8829','Återföring från periodiseringsfond ','E','589/596', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8830','Förändring av periodiseringsfond - delägare 3 i HB','E','589/597', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8831','Avsättning till periodiseringsfond ','E','589/598', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8839','Återföring från periodiseringsfond ','E','589/599', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8850','Skillnad mellan bokförda avskrivningar och avskrivningar enligt plan - överavskrivning ','E','578/590', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8851','Förändring av skillnad mellan bokförd och planenlig avskrivning - immateriella anläggningstillgångar ','E','578/590', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8852','Förändring av skillnad mellan bokförd och planenlig avskrivning - byggnader och markanläggningar ','E','578/590', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8853','Förändring av skillnad mellan bokförd och planenlig avskrivning - maskiner, inventarier och transportmedel ','E','578/590', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8860','Förändring av ersättningsfond ','E','593/594', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8861','Avsättning till ersättningsfond för inventarier','E','594', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8862','Avsättning till ersättningsfond för byggnader och markanläggningar','E','594', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8863','Avsättning till ersättningsfond för mark ','E','594', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8864','Avsättning till ersättningsfond för för djurlager i jordbruk och renskötsel ','E','594', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8865','Ianspråktagande av ersättningsfond för avskrivningar','E','593', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8866','Ianspråktagande av ersättningsfond för annat än avskrivningar ','E','593', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8869','Återföring från ersättningsfond ','E','593', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8870','Förändring av allmän investeringsreserv eller liknande','E','593', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8871','Ianspråktagande av allmän investeringsreserv eller liknande för avskrivningar ','E','593', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8872','Ianspråktagande av allmän investeringsreserv eller liknande för annat än avskrivningar ','E','593', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8873','Avskrivning av anläggningstillgångar med medel som tagits i anspråk frånallmän investeringsreserv eller liknande ','E','593', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8879','Återföring av allmän investeringsreserv eller liknande ','E','593', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8880','Förändring av obeskattade intäkter ','E','593/594', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8881','Avsättning till upphovsmannakonto','E','594', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8882','Återföring från upphovsmannakonto ','E','593', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8885','Avsättning till skogskonto ','E','594', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8886','Återföring till skogskonto','E','593', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8890','Övriga bokslutsdispositioner ','E','593/594', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8891','Förändring av skillnad mellan bokförd och faktisk pensionsskuld ','E','593/594', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8892','Nedskrivning av konsolideringskaraktär av anläggningstillgångar','E','594', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8895','Förändring av valutakursreserv ','E','593/594', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8896','Förändring av lagerreserv ','E','593', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8897','Återföring av skatteutjämningsreserv - SURV','E','591', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8899','Övriga bokslutsdispositioner ','E','593', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'89','Skatter och årets resultat ', NULL); SELECT account_save(NULL,'8910','Skatt på årets beskattningsbara resultat','E','598', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8920','Skatt på grund av ändrad taxering ','E','598', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8930','Restituerad skatt ','E','598', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8940','Latent skatt','E','598', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8980','Övriga skatter ','E','598', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8990','Resultat ','E','599/596', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8999','Årets resultat','E','599/596', NULL, false, false, string_to_array('', ':')); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '2610'),0.25); insert into tax (chart_id,rate) values ((select id from chart where accno = '2620'),0.12); insert into tax (chart_id,rate) values ((select id from chart where accno = '2630'),0.06); insert into tax (chart_id,rate) values ((select id from chart where accno = '2640'),0); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno ='1400')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '3010')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '4010')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '3960')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '7960')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'SEK:EUR:USD'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/se/chart/Church_Society.sql0000755000000000000000000006113311726633501020240 0ustar rootrootbegin; -- Johan Hambraeus -- May 7, 2006 -- SELECT account_heading_save(NULL, '1', 'Tillgångar', NULL); SELECT account_heading_save(NULL, '10', 'Immateriella anläggningstillgångar', NULL); SELECT account_save(NULL,'1010','Balanserade utgifter','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1019','Ack avskriningar balanserade utg','C','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1060','Hyresrätt','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1069','Ack avskrivn hyresrätt','C','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'11','Byggnader och mark', NULL); SELECT account_save(NULL,'1110','Byggnader','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1119','Ack avskrivn byggnader','C','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1130','Mark','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1140','Tomter, markomr obebyggda','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1150','Markanläggningar','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1159','Ack avskrivn markanläggn','C','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1190','Övriga byggnader och mark','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL,'12','Maskiner och inventarier', NULL); SELECT account_save(NULL,'1230','Installationer','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1238','Ack nedskrivn installationer','C','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1239','Ack avskrivn installationer','C','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1250','Datorer','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1259','Ack avskrivn datorer','C','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'13','Finansiella anläggningstillgångar', NULL); SELECT account_save(NULL,'1370','Uppskjuten skattefordran','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1380','Långfristiga fordringar','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1400','Fordran hos EFS Gafsele','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1405','Fordran hos EFS Hälla','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'15','Kundfordringar', NULL); SELECT account_save(NULL,'1500','Kundfordringar','A','', NULL, false, false, string_to_array('AR', ':')); SELECT account_heading_save(NULL,'16','Övriga kortfristiga fordringar', NULL); SELECT account_save(NULL,'1600','Övr kortfristiga fordr','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1710','Förutbetalda hyror','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1730','Förutbet försäkringspremier','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1740','Förutbet ränteutgifter','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1750','Upplupna hyresinkomster','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1760','Upplupna inkomsträntor','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1790','Övr interimsfordringar','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'19','Kassa och Bank', NULL); SELECT account_save(NULL,'1910','Kassa','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1920','Postgiro','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1930','Checkräkningskonto','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1940','Övriga bankkonto','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1941','Nordea värdepappersfond','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1942','Nordea girokapitalkonto','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno in ('1910', '1920', '1930', '1940', '1941', '1942'); SELECT account_heading_save(NULL,'2','Eget kapital och skulder', NULL); SELECT account_heading_save(NULL,'20','Eget kapital', NULL); SELECT account_save(NULL,'2000','Eget kapital EFS Åsele','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2005','Eget kapital EFS Gafsele','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2010','Eget kapital EFS Hälla','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2070','Ändamålsbestämda medel','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2091','Balanserad vinst/förlust','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2098','Vinst/förlust föreg år','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2099','Redovisat resultat','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'22','Avsättningar', NULL); SELECT account_save(NULL,'2250','Avsättning för skatter','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2290','Övriga avsättningar','L','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'23','Skulder', NULL); SELECT account_save(NULL,'2300','Skuld till EFS Gafsele','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2310','Skuld till EFS Hälla','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2320','Skuld till fam Norlin','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2330','Checkräkningskredit','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2399','Övr långfristiga skulder','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2440','Leverantörsskulder','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'2499','Övr kortfristiga skulder','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2960','Upplupna utgiftsräntor','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2971','Förutbetalda hyresintäkter','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2972','Förutbetalda medlemsavgifter','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2979','Övriga förutbetalda intäkter','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2990','Övr interimsskulder','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2999','Övr uppl kostn/förutbet intäkter','L','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'3','Intäkter', NULL); SELECT account_heading_save(NULL,'30','Allmänna gåvor', NULL); SELECT account_save(NULL,'3000','Gåvor via konto','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3005','Minnesgåvor','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3010','Gudstjänstkollekter','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3015','Fika/kaffe/fester - gåvor','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_heading_save(NULL,'31','Öronmärkta gåvor', NULL); SELECT account_save(NULL,'3100','Öronmärkta gåvor','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3101','Gåvor barnarbete','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3102','Gåvor körsång','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3103','Gåvor bönegrupper','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3104','Gåvor Alfa-grupper','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3105','Övrigt lokalt arbete','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3106','Gåvor till fastighet mm','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3109','Gåvor Åsele allkristna gemenskap','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3110','Gåvor EFS Västerbotten','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3111','Gåvor distriktskonferens','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3112','Gåvor Scoutverksamhet','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3120','Gåvor EFS riks','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3121','Gåvor EFS riks konferens','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3122','Gåvor EFS Inre mission','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3123','Gåvor EFS Yttre mission','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3130','Gåvor Barn i alla länder','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3131','Gåvor Johannelundsinsamling','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3132','Gåvor Påskinsamling','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3133','Gåvor Flodvågens offer','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_heading_save(NULL,'33','Försäljningsintäkter', NULL); SELECT account_save(NULL,'3300','Försäljning bokbordet','I','', NULL, false, false, string_to_array('IC_sale', ':')); SELECT account_save(NULL,'3350','Försäljning fika mm','I','', NULL, false, false, string_to_array('IC_sale', ':')); SELECT account_heading_save(NULL,'34','Medlemsavgifter', NULL); SELECT account_save(NULL,'3400','Medlemsavgifter','I','', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'3405','Medlemsavgifter Solglimten','I','', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_heading_save(NULL,'345','Hyresintäkter', NULL); SELECT account_save(NULL,'3450','Hyresintäkter, hyreskontrakt','I','', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'3460','Hyresintäkter, enstaka tillfälle','I','', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'3470','Hyresint Ersättning telefonkostnad','I','', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_heading_save(NULL,'35','Bidrag', NULL); SELECT account_save(NULL,'3510','Erhållna statliga bidrag','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3520','Erhållna kommunala bidrag','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3530','Bidrag Svenska kyrkan','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'3590','Övriga erhållna bidrag','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_heading_save(NULL,'36','Övriga intäkter', NULL); SELECT account_save(NULL,'3690','Övriga sidointäker','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3731','Kassarabatter','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3740','Öresutjämning','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3960','Valuta kursvinst','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3972','Vinst avyttr fastigheter','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3973','Vinst avyttr maskiner/inv','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3990','Övr ersättn och intäker','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3994','Försäkringsersättningar','I','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'4','Utgifter', NULL); SELECT account_save(NULL,'4000','Kostnad för predikant','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4050','Reskostnader för predikant','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL,'41','Utgifter öronmärkta gåvor', NULL); SELECT account_save(NULL,'4100','Kostnad öronmärkta gåvor','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4101','Kostnad barnarbete','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4102','Kostnad körer','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4103','Kostnad bönegrupper','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4104','Kostnad Alfa','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4105','Kostnad Övrigt lokalt arbete','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4106','Kostnad Fastighet (särskilt)','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4107','Kostnad scouting barnarbete','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4109','Åsele allkristna gemenskap','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4110','EFS Västerbotten','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4111','distriktskonferens','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4120','EFS riks','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4121','EFS riks konferensinsamling','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4122','EFS inre mission','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4123','EFS yttre mission','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4130','Barn i alla länder','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4131','Johannelundinsamling','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4132','Påskinsamling','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4133','Till Flodvågens offer','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL,'43','Inköpskostnader mm', NULL); SELECT account_save(NULL,'4300','Inköp bokbord','E','', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'4350','Inköp matr fika mm','E','', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'4400','Pren Vårt budskap (distr tidning)','E','', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'4600','Inhyrda predikanter/föreläsare','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4700','Tidningar, facklitteratur','E','', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'4900','Föreningsavgifter','E','', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_heading_save(NULL,'50','Lokalkostnader hyrd lokal', NULL); SELECT account_save(NULL,'5010','Lokalhyra','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5020','El','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5030','Värme hyrd lokal','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5050','Lokaltillbehör hyrd lokal','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5060','Städning, renhållning hyrd lokal','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5070','Reparationer hyrd lokal','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5090','Övr kostnader hyrd lokal','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'51','Lokalkostnader egen lokal', NULL); SELECT account_save(NULL,'5120','Belysning','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5130','Värme','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5132','Sotning','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5140','Vatten och avlopp','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5160','Renhålln och städning','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5170','Rep och underhåll fastighet','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5191','Fastighetsskatt','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5192','Försäkringsprem fastighet','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5193','Fastighetsskötsel och förvaltning','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5199','Övr fastighetskostnader','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'52','Övriga kostnader', NULL); SELECT account_save(NULL,'5210','Hyra arbetsmaskiner','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5220','Hyra inventarier','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5290','Övr hyreskostn anl tillg','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5390','Övriga bränslen','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5410','Förbrukningsinventarier','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5460','Förbrukningsmaterial','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5480','Arbetskläder o skyddsmtrl','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5500','Reparation och underhåll','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5710','Frakt och transport','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5800','Resekostnader','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5910','Annonsering','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5930','Reklamtrycksaker','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5990','Övrig reklam','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6110','Kontorsmaterial','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6150','Trycksaker','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6210','Telefon','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6250','Porto','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6310','Försäkringar','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6320','Självrisker','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6340','Lämnade skadestånd','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'64','Förvaltningskostnader', NULL); SELECT account_save(NULL,'6490','Övr förvaltningskostnader','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6530','Redovisningstjänster','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6540','IT-tjänster','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6550','Konsultarvoden','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'65','Bankkostnader', NULL); SELECT account_save(NULL,'6570','Bankkostnader, Nordea','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6571','Bankkostnader, Postgirot','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6572','Bankkostnader, Bankgiro','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6573','Bankkostnader, Föreningssparbank','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'658','Främmande tjänster', NULL); SELECT account_save(NULL,'6580','Advokatkostnader','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6590','Övr främmande tjänster','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'7','Avskrivningar och engångskostn', NULL); SELECT account_save(NULL,'7780','Avskrivningar enligt plan','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7811','Avskrivningar balanserade utgifter','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7820','Avskrivningar byggnader/mark','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7821','Avskrivn byggnader','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7822','Avskrivn byggnadsinv','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7824','Avskrivn markanläggn','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7829','Avskrivningar övr byggnader','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7832','Avskrivn inventarier','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7833','Avskrivningar installationer','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7835','Avskrivningar datorer','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7921','Kostn av engångskaraktär ','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7960','Valutakursförlust','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'8','Financiella intäkter o kostnader', NULL); SELECT account_heading_save(NULL,'83','Ränteintäkter', NULL); SELECT account_save(NULL,'8300','Ränteintäkter ','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8390','Övr finansiella intäkter','I','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'84','Räntekostnader', NULL); SELECT account_save(NULL,'8400','Räntekostnader','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8490','Övr finansiella kostnader','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'891','Skatter', NULL); SELECT account_save(NULL,'8910','Årets skattekostnad','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'899','Redovisat resultat', NULL); SELECT account_save(NULL,'8999','Redovisat resultat','E','', NULL, false, false, string_to_array('', ':')); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno ='1130')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '3400')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '4400')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '3960')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '7960')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'SEK:EUR:USD'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/tw/0000755000000000000000000000000012060044550013507 5ustar rootrootledgersmb/sql/coa/tw/chart/0000755000000000000000000000000012060044550014610 5ustar rootrootledgersmb/sql/coa/tw/chart/General.sql0000755000000000000000000002025111726631300016714 0ustar rootrootbegin; -- Default chart of accounts -- sample only SELECT account_heading_save(NULL,'1000','流動資產', NULL); SELECT account_heading_save(NULL,'1800','資本資產', NULL); SELECT account_heading_save(NULL,'2600','長期負債', NULL); SELECT account_heading_save(NULL,'3300','股份資本', NULL); SELECT account_heading_save(NULL,'3500','保留盈餘', NULL); SELECT account_heading_save(NULL,'4000','銷售盈餘', NULL); SELECT account_heading_save(NULL,'1500','存貨資產', NULL); SELECT account_heading_save(NULL,'4300','諮詢盈餘', NULL); SELECT account_heading_save(NULL,'4400','其它盈餘', NULL); SELECT account_heading_save(NULL,'5000','貨銷成本', NULL); SELECT account_heading_save(NULL,'5400','薪資支出', NULL); SELECT account_heading_save(NULL,'5600','日常及管理支出', NULL); SELECT account_save(NULL,'1205','呆帳備抵','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1825','累計分期付款 - 裝璜及設備.','A','', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'1845','累計分期付款 - 運輸工具','A','', NULL, true, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'2000','流動負債', NULL); SELECT account_save(NULL,'2190','應付所得稅','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2620','銀行借款','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3600','流動盈餘','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2160','應付公司稅','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3590','保留盈餘 - 去年度','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3350','普通股份','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5615','廣告行銷','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5790','工具','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5700','辦公用品','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5800','權利金','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5610','會計法務','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5685','保險','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5660','分期支出','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5620','壞帳','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5680','所得稅','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5690','利息及銀行手續費','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5410','薪資','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5420','保險支出','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5430','退休金支出','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5440','補償金支出','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5470','員工福利','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4030','銷售 / 軟體','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'4440','利息','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5100','運費','E','', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'5760','租金','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'1530','庫存 / 軟體','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1540','庫存 / 二級市場零件','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'4040','銷售 / 二級市場零件','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'5030','貨銷成本 / 軟體','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5010','採購','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5040','貨銷成本 / 二級市場零件','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'1065','零用金','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1820','辦公室裝璜及設備','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5785','旅費及娛樂','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2680','股東貸款','L','', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'5795','註冊費','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5780','電信費','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5781','網路連線費','E','', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'5765','維修管理費','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'2311','地方稅','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4430','運銷費','I','', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'1520','庫存 / 硬體','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'5020','貨銷成本 / 硬體','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'2100','應付帳款','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'1840','運輸工具','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4330','程式設計','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'4020','銷售 / 硬體','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'4320','諮詢','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'1200','應收帳款','A','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1061','支票戶頭','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno in ('1061', '1065'); SELECT account_save(NULL,'2310','商品服務稅','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); -- -- exchange rate SELECT account_save(NULL,'4450','Foreign Exchange Gain','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5810','Foreign Exchange Loss','E','', NULL, false, false, string_to_array('', ':')); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '2310'),0.07); insert into tax (chart_id,rate) values ((select id from chart where accno = '2311'),0.08); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '1520')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '4020')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '5010')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '4450')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '5810')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'USD'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); -- commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/co/0000755000000000000000000000000012060044550013456 5ustar rootrootledgersmb/sql/coa/co/gifi/0000755000000000000000000000000012060044550014374 5ustar rootrootledgersmb/sql/coa/co/gifi/PUC.sql0000755000000000000000000063074510573153206015574 0ustar rootrootbegin; -- -- -- Data for Plan Único de Cuentas (PUC) Gifi Table -- INSERT INTO gifi (accno,description) VALUES ('1', 'ACTIVO '); INSERT INTO gifi (accno,description) VALUES ('11', 'DISPONIBLE '); INSERT INTO gifi (accno,description) VALUES ('1105', 'CAJA '); INSERT INTO gifi (accno,description) VALUES ('110505', 'CAJA GENERAL '); INSERT INTO gifi (accno,description) VALUES ('110510', 'CAJAS MENORES '); INSERT INTO gifi (accno,description) VALUES ('110515', 'MONEDA EXTRANJERA '); INSERT INTO gifi (accno,description) VALUES ('1110', 'BANCOS '); INSERT INTO gifi (accno,description) VALUES ('111005', 'MONEDA NACIONAL '); INSERT INTO gifi (accno,description) VALUES ('111010', 'MONEDA EXTRANJERA '); INSERT INTO gifi (accno,description) VALUES ('1115', 'REMESAS EN TRANSITO '); INSERT INTO gifi (accno,description) VALUES ('111505', 'MONEDA NACIONAL '); INSERT INTO gifi (accno,description) VALUES ('111510', 'MONEDA EXTRANJERA '); INSERT INTO gifi (accno,description) VALUES ('1120', 'CUENTAS DE AHORRO '); INSERT INTO gifi (accno,description) VALUES ('112005', 'BANCOS '); INSERT INTO gifi (accno,description) VALUES ('112010', 'CORPORACIONES DE AHORRO Y VIVIENDA '); INSERT INTO gifi (accno,description) VALUES ('112015', 'ORGANISMOS COOPERATIVOS FINANCIEROS '); INSERT INTO gifi (accno,description) VALUES ('1125', 'FONDOS '); INSERT INTO gifi (accno,description) VALUES ('112505', 'ROTATORIOS MONEDA NACIONAL '); INSERT INTO gifi (accno,description) VALUES ('112510', 'ROTATORIOS MONEDA EXTRANJERA '); INSERT INTO gifi (accno,description) VALUES ('112515', 'ESPECIALES MONEDA NACIONAL '); INSERT INTO gifi (accno,description) VALUES ('112520', 'ESPECIALES MONEDA EXTRANJERA '); INSERT INTO gifi (accno,description) VALUES ('112525', 'DE AMORTIZACION MONEDA NACIONAL '); INSERT INTO gifi (accno,description) VALUES ('112530', 'DE AMORTIZACION MONEDA EXTRANJERA '); INSERT INTO gifi (accno,description) VALUES ('12', 'INVERSIONES '); INSERT INTO gifi (accno,description) VALUES ('1205', 'ACCIONES '); INSERT INTO gifi (accno,description) VALUES ('120505', 'AGRICULTURA, GANADERIA, CAZA Y SILVICULTURA '); INSERT INTO gifi (accno,description) VALUES ('120510', 'PESCA '); INSERT INTO gifi (accno,description) VALUES ('120515', 'EXPLOTACION DE MINAS Y CANTERAS '); INSERT INTO gifi (accno,description) VALUES ('120520', 'INDUSTRIA MANUFACTURERA '); INSERT INTO gifi (accno,description) VALUES ('120525', 'SUMINISTRO DE ELECTRICIDAD, GAS Y AGUA '); INSERT INTO gifi (accno,description) VALUES ('120530', 'CONSTRUCCION '); INSERT INTO gifi (accno,description) VALUES ('120535', 'COMERCIO AL POR MAYOR Y AL POR MENOR '); INSERT INTO gifi (accno,description) VALUES ('120540', 'HOTELES Y RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('120545', 'TRANSPORTE, ALMACENAMIENTO Y COMUNICACIONES '); INSERT INTO gifi (accno,description) VALUES ('120550', 'ACTIVIDAD FINANCIERA '); INSERT INTO gifi (accno,description) VALUES ('120555', 'ACTIVIDADES INMOBILIARIAS, EMPRESARIALES Y DE ALQUILER '); INSERT INTO gifi (accno,description) VALUES ('120560', 'ENSEуANZA '); INSERT INTO gifi (accno,description) VALUES ('120565', 'SERVICIOS SOCIALES Y DE SALUD '); INSERT INTO gifi (accno,description) VALUES ('120570', 'OTRAS ACTIVIDADES DE SERVICIOS COMUNITARIOS, SOCIALES Y PERSONALES '); INSERT INTO gifi (accno,description) VALUES ('120599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1210', 'CUOTAS O PARTES DE INTERES SOCIAL '); INSERT INTO gifi (accno,description) VALUES ('121005', 'AGRICULTURA, GANADERIA, CAZA Y SILVICULTURA '); INSERT INTO gifi (accno,description) VALUES ('121010', 'PESCA '); INSERT INTO gifi (accno,description) VALUES ('121015', 'EXPLOTACION DE MINAS Y CANTERAS '); INSERT INTO gifi (accno,description) VALUES ('121020', 'INDUSTRIA MANUFACTURERA '); INSERT INTO gifi (accno,description) VALUES ('121025', 'SUMINISTRO DE ELECTRICIDAD, GAS Y AGUA '); INSERT INTO gifi (accno,description) VALUES ('121030', 'CONSTRUCCION '); INSERT INTO gifi (accno,description) VALUES ('121035', 'COMERCIO AL POR MAYOR Y AL POR MENOR '); INSERT INTO gifi (accno,description) VALUES ('121040', 'HOTELES Y RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('121045', 'TRANSPORTE, ALMACENAMIENTO Y COMUNICACIONES '); INSERT INTO gifi (accno,description) VALUES ('121050', 'ACTIVIDAD FINANCIERA '); INSERT INTO gifi (accno,description) VALUES ('121055', 'ACTIVIDADES INMOBILIARIAS, EMPRESARIALES Y DE ALQUILER '); INSERT INTO gifi (accno,description) VALUES ('121060', 'ENSEŃANZA '); INSERT INTO gifi (accno,description) VALUES ('121065', 'SERVICIOS SOCIALES Y DE SALUD '); INSERT INTO gifi (accno,description) VALUES ('121070', 'OTRAS ACTIVIDADES DE SERVICIOS COMUNITARIOS, SOCIALES Y PERSONALES '); INSERT INTO gifi (accno,description) VALUES ('121099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1215', 'BONOS '); INSERT INTO gifi (accno,description) VALUES ('121505', 'BONOS PUBLICOS MONEDA NACIONAL '); INSERT INTO gifi (accno,description) VALUES ('121510', 'BONOS PUBLICOS MONEDA EXTRANJERA '); INSERT INTO gifi (accno,description) VALUES ('121515', 'BONOS ORDINARIOS '); INSERT INTO gifi (accno,description) VALUES ('121520', 'BONOS CONVERTIBLES EN ACCIONES '); INSERT INTO gifi (accno,description) VALUES ('121595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('1220', 'CEDULAS '); INSERT INTO gifi (accno,description) VALUES ('122005', 'CEDULAS DE CAPITALIZACION '); INSERT INTO gifi (accno,description) VALUES ('122010', 'CEDULAS HIPOTECARIAS '); INSERT INTO gifi (accno,description) VALUES ('122015', 'CEDULAS DE INVERSION '); INSERT INTO gifi (accno,description) VALUES ('122095', 'OTRAS '); INSERT INTO gifi (accno,description) VALUES ('1225', 'CERTIFICADOS '); INSERT INTO gifi (accno,description) VALUES ('122505', 'CERTIFICADOS DE DEPOSITO A TERMINO (C.D.T.) '); INSERT INTO gifi (accno,description) VALUES ('122510', 'CERTIFICADOS DE DEPOSITO DE AHORRO '); INSERT INTO gifi (accno,description) VALUES ('122515', 'CERTIFICADOS DE AHORRO DE VALOR CONSTANTE (C.A.V.C.) '); INSERT INTO gifi (accno,description) VALUES ('122520', 'CERTIFICADOS DE CAMBIO '); INSERT INTO gifi (accno,description) VALUES ('122525', 'CERTIFICADOS CAFETEROS VALORIZABLES '); INSERT INTO gifi (accno,description) VALUES ('122530', 'CERTIFICADOS ELECTRICOS VALORIZABLES (C.E.V.) '); INSERT INTO gifi (accno,description) VALUES ('122535', 'CERTIFICADOS DE REEMBOLSO TRIBUTARIO (C.E.R.T.) '); INSERT INTO gifi (accno,description) VALUES ('122540', 'CERTIFICADOS DE DESARROLLO TURISTICO '); INSERT INTO gifi (accno,description) VALUES ('122545', 'CERTIFICADOS DE INVERSION FORESTAL (C.I.F.) '); INSERT INTO gifi (accno,description) VALUES ('122595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('1230', 'PAPELES COMERCIALES '); INSERT INTO gifi (accno,description) VALUES ('123005', 'EMPRESAS COMERCIALES '); INSERT INTO gifi (accno,description) VALUES ('123010', 'EMPRESAS INDUSTRIALES '); INSERT INTO gifi (accno,description) VALUES ('123015', 'EMPRESAS DE SERVICIOS '); INSERT INTO gifi (accno,description) VALUES ('1235', 'TITULOS '); INSERT INTO gifi (accno,description) VALUES ('123505', 'TITULOS DE DESARROLLO AGROPECUARIO '); INSERT INTO gifi (accno,description) VALUES ('123510', 'TITULOS CANJEABLES POR CERTIFICADOS DE CAMBIO '); INSERT INTO gifi (accno,description) VALUES ('123515', 'TITULOS DE TESORERIA (T.E.S.) '); INSERT INTO gifi (accno,description) VALUES ('123520', 'TITULOS DE PARTICIPACION '); INSERT INTO gifi (accno,description) VALUES ('123525', 'TITULOS DE CREDITO DE FOMENTO '); INSERT INTO gifi (accno,description) VALUES ('123530', 'TITULOS FINANCIEROS AGROINDUSTRIALES (T.F.A.) '); INSERT INTO gifi (accno,description) VALUES ('123535', 'TITULOS DE AHORRO CAFETERO (T.A.C.) '); INSERT INTO gifi (accno,description) VALUES ('123540', 'TITULOS DE AHORRO NACIONAL (T.A.N.) '); INSERT INTO gifi (accno,description) VALUES ('123545', 'TITULOS ENERGETICOS DE RENTABILIDAD CRECIENTE (T.E.R.) '); INSERT INTO gifi (accno,description) VALUES ('123550', 'TITULOS DE AHORRO EDUCATIVO (T.A.E.) '); INSERT INTO gifi (accno,description) VALUES ('123555', 'TITULOS FINANCIEROS INDUSTRIALES Y COMERCIALES '); INSERT INTO gifi (accno,description) VALUES ('123560', 'TESOROS '); INSERT INTO gifi (accno,description) VALUES ('123565', 'TITULOS DE DEVOLUCION DE IMPUESTOS NACIONALES (TIDIS) '); INSERT INTO gifi (accno,description) VALUES ('123570', 'TITULOS INMOBILIARIOS '); INSERT INTO gifi (accno,description) VALUES ('123595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('1240', 'ACEPTACIONES BANCARIAS O FINANCIERAS '); INSERT INTO gifi (accno,description) VALUES ('124005', 'BANCOS COMERCIALES '); INSERT INTO gifi (accno,description) VALUES ('124010', 'COMPANÍAS DE FIAANNCIAMIENTO COMERCIAL '); INSERT INTO gifi (accno,description) VALUES ('124015', 'CORPORACIONES FINANCIERAS '); INSERT INTO gifi (accno,description) VALUES ('124095', 'OTRAS '); INSERT INTO gifi (accno,description) VALUES ('1245', 'DERECHOS FIDUCIARIOS '); INSERT INTO gifi (accno,description) VALUES ('124505', 'FIDEICOMISOS DE INVERSION MONEDA NACIONAL '); INSERT INTO gifi (accno,description) VALUES ('124510', 'FIDEICOMISOS DE INVERSION MONEDA EXTRANJERA '); INSERT INTO gifi (accno,description) VALUES ('1250', 'DERECHOS DE RECOMPRA DE INVERSIONES NEGOCIADAS (REPOS) '); INSERT INTO gifi (accno,description) VALUES ('125005', 'ACCIONES '); INSERT INTO gifi (accno,description) VALUES ('125010', 'CUOTAS O PARTES DE INTERES SOCIAL '); INSERT INTO gifi (accno,description) VALUES ('125015', 'BONOS '); INSERT INTO gifi (accno,description) VALUES ('125020', 'CEDULAS '); INSERT INTO gifi (accno,description) VALUES ('125025', 'CERTIFICADOS '); INSERT INTO gifi (accno,description) VALUES ('125030', 'PAPELES COMERCIALES '); INSERT INTO gifi (accno,description) VALUES ('125035', 'TITULOS '); INSERT INTO gifi (accno,description) VALUES ('125040', 'ACEPTACIONES BANCARIAS O FINANCIERAS 125095 OTROS '); INSERT INTO gifi (accno,description) VALUES ('125099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1255', 'OBLIGATORIAS '); INSERT INTO gifi (accno,description) VALUES ('125505', 'BONOS DE FINANCIAMIENTO ESPECIAL '); INSERT INTO gifi (accno,description) VALUES ('125510', 'BONOS DE FINANCIAMIENTO PRESUPUESTAL '); INSERT INTO gifi (accno,description) VALUES ('125515', 'BONOS PARA DESARROLLO SOCIAL Y SEGURIDAD INTERNA (B.D.S.I.) '); INSERT INTO gifi (accno,description) VALUES ('125595', 'OTRAS '); INSERT INTO gifi (accno,description) VALUES ('1260', 'CUENTAS EN PARTICIPACION '); INSERT INTO gifi (accno,description) VALUES ('126099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1295', 'OTRAS INVERSIONES '); INSERT INTO gifi (accno,description) VALUES ('129505', 'APORTES EN COOPERATIVAS '); INSERT INTO gifi (accno,description) VALUES ('129510', 'DERECHOS EN CLUBES SOCIALES '); INSERT INTO gifi (accno,description) VALUES ('129515', 'ACCIONES O DERECHOS EN CLUBES DEPORTIVOS '); INSERT INTO gifi (accno,description) VALUES ('129520', 'BONOS EN COLEGIOS '); INSERT INTO gifi (accno,description) VALUES ('129595', 'DIVERSAS '); INSERT INTO gifi (accno,description) VALUES ('129599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1299', 'PROVISIONES '); INSERT INTO gifi (accno,description) VALUES ('129905', 'ACCIONES '); INSERT INTO gifi (accno,description) VALUES ('129910', 'CUOTAS O PARTES DE INTERES SOCIAL '); INSERT INTO gifi (accno,description) VALUES ('129915', 'BONOS '); INSERT INTO gifi (accno,description) VALUES ('129920', 'CEDULAS '); INSERT INTO gifi (accno,description) VALUES ('129925', 'CERTIFICADOS '); INSERT INTO gifi (accno,description) VALUES ('129930', 'PAPELES COMERCIALES '); INSERT INTO gifi (accno,description) VALUES ('129935', 'TITULOS '); INSERT INTO gifi (accno,description) VALUES ('129940', 'ACEPTACIONES BANCARIAS O FINANCIERAS '); INSERT INTO gifi (accno,description) VALUES ('129945', 'DERECHOS FIDUCIARIOS '); INSERT INTO gifi (accno,description) VALUES ('129950', 'DERECHOS DE RECOMPRA DE INVERSIONES NEGOCIADAS '); INSERT INTO gifi (accno,description) VALUES ('129955', 'OBLIGATORIAS '); INSERT INTO gifi (accno,description) VALUES ('129960', 'CUENTAS EN PARTICIPACION '); INSERT INTO gifi (accno,description) VALUES ('129995', 'OTRAS INVERSIONES '); INSERT INTO gifi (accno,description) VALUES ('13', 'DEUDORES '); INSERT INTO gifi (accno,description) VALUES ('1305', 'CLIENTES '); INSERT INTO gifi (accno,description) VALUES ('130505', 'NACIONALES '); INSERT INTO gifi (accno,description) VALUES ('130510', 'DEL EXTERIOR '); INSERT INTO gifi (accno,description) VALUES ('130515', 'DEUDORES DEL SISTEMA '); INSERT INTO gifi (accno,description) VALUES ('1310', 'CUENTAS CORRIENTES COMERCIALES '); INSERT INTO gifi (accno,description) VALUES ('131005', 'CASA MATRIZ '); INSERT INTO gifi (accno,description) VALUES ('131010', 'COMPAŃIAS VINCULADAS '); INSERT INTO gifi (accno,description) VALUES ('131015', 'ACCIONISTAS O SOCIOS '); INSERT INTO gifi (accno,description) VALUES ('131020', 'PARTICULARES '); INSERT INTO gifi (accno,description) VALUES ('131095', 'OTRAS '); INSERT INTO gifi (accno,description) VALUES ('1315', 'CUENTAS POR COBRAR A CASA MATRIZ '); INSERT INTO gifi (accno,description) VALUES ('131505', 'VENTAS '); INSERT INTO gifi (accno,description) VALUES ('131510', 'PAGOS A NOMBRE DE CASA MATRIZ '); INSERT INTO gifi (accno,description) VALUES ('131515', 'VALORES RECIBIDOS POR CASA MATRIZ '); INSERT INTO gifi (accno,description) VALUES ('131520', 'PRESTAMOS '); INSERT INTO gifi (accno,description) VALUES ('1320', 'CUENTAS POR COBRAR A VINCULADOS ECONOMICOS '); INSERT INTO gifi (accno,description) VALUES ('132005', 'FILIALES '); INSERT INTO gifi (accno,description) VALUES ('132010', 'SUBSIDIARIAS '); INSERT INTO gifi (accno,description) VALUES ('132015', 'SUCURSALES '); INSERT INTO gifi (accno,description) VALUES ('1325', 'CUENTA S POR COBRAR A SOCIOS Y ACCIONISTAS '); INSERT INTO gifi (accno,description) VALUES ('132505', 'A SOCIOS '); INSERT INTO gifi (accno,description) VALUES ('132510', 'A ACCIONISTAS '); INSERT INTO gifi (accno,description) VALUES ('1328', 'APORTES POR COBRAR '); INSERT INTO gifi (accno,description) VALUES ('1330', 'ANTICIPOS Y AVANCES '); INSERT INTO gifi (accno,description) VALUES ('133005', 'A PROVEEDORES '); INSERT INTO gifi (accno,description) VALUES ('133010', 'A CONTRATISTAS '); INSERT INTO gifi (accno,description) VALUES ('133015', 'A TRABAJADORES '); INSERT INTO gifi (accno,description) VALUES ('133020', 'A AGENTES '); INSERT INTO gifi (accno,description) VALUES ('133025', 'A CONCESIONARIOS '); INSERT INTO gifi (accno,description) VALUES ('133030', 'DE ADJUDICACIONES '); INSERT INTO gifi (accno,description) VALUES ('133095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('1332', 'CUENTAS DE OPERACION CONJUNTA '); INSERT INTO gifi (accno,description) VALUES ('1335', 'DEPOSITOS '); INSERT INTO gifi (accno,description) VALUES ('133505', 'PARA IMPORTACIONES '); INSERT INTO gifi (accno,description) VALUES ('133510', 'PARA SERVICIOS '); INSERT INTO gifi (accno,description) VALUES ('133515', 'PARA CONTRATOS '); INSERT INTO gifi (accno,description) VALUES ('133520', 'PARA RESPONSABILIDADES '); INSERT INTO gifi (accno,description) VALUES ('133525', 'PARA JUICIOS EJECUTIVOS '); INSERT INTO gifi (accno,description) VALUES ('133530', 'PARA ADQUISICION DE ACCIONES, CUOTAS O DERECHOS SOCIALES '); INSERT INTO gifi (accno,description) VALUES ('133535', 'EN GARANTIA '); INSERT INTO gifi (accno,description) VALUES ('133595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('1340', 'PROMESAS DE COMPRA VENTA '); INSERT INTO gifi (accno,description) VALUES ('134005', 'DE BIENES RAICES '); INSERT INTO gifi (accno,description) VALUES ('134010', 'DE MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('134015', 'DE FLOTA Y EQUIPO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('134020', 'DE FLOTA Y EQUIPO AEREO '); INSERT INTO gifi (accno,description) VALUES ('134025', 'DE FLOTA Y EQUIPO FERREO '); INSERT INTO gifi (accno,description) VALUES ('134030', 'DE FLOTA Y EQUIPO FLUVIAL Y/O MARITIMO '); INSERT INTO gifi (accno,description) VALUES ('134035', 'DE SEMOVIENTES '); INSERT INTO gifi (accno,description) VALUES ('134095', 'DE OTROS BIENES '); INSERT INTO gifi (accno,description) VALUES ('1345', 'INGRESOS POR COBRAR '); INSERT INTO gifi (accno,description) VALUES ('134505', 'DIVIDENDOS Y/O PARTICIPACIONES '); INSERT INTO gifi (accno,description) VALUES ('134510', 'INTERESES '); INSERT INTO gifi (accno,description) VALUES ('134515', 'COMISIONES '); INSERT INTO gifi (accno,description) VALUES ('134520', 'HONORARIOS '); INSERT INTO gifi (accno,description) VALUES ('134525', 'SERVICIOS '); INSERT INTO gifi (accno,description) VALUES ('134530', 'ARRENDAMIENTOS '); INSERT INTO gifi (accno,description) VALUES ('134535', 'CERT POR COBRAR '); INSERT INTO gifi (accno,description) VALUES ('134595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('1350', 'RETENCION SOBRE CONTRATOS '); INSERT INTO gifi (accno,description) VALUES ('135005', 'DE CONSTRUCCION '); INSERT INTO gifi (accno,description) VALUES ('135010', 'DE PRESTACION DE SERVICIOS '); INSERT INTO gifi (accno,description) VALUES ('135095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('1355', 'ANTICIPO DE IMPUESTOS Y CONTRIBUCIONES O SALDOS A FAVOR '); INSERT INTO gifi (accno,description) VALUES ('135505', 'ANTICIPO DE IMPUESTOS DE RENTA Y COMPLEMENTARIOS '); INSERT INTO gifi (accno,description) VALUES ('135510', 'ANTICIPO DE IMPUESTOS DE INDUSTRIA Y COMERCIO '); INSERT INTO gifi (accno,description) VALUES ('135515', 'RETENCION EN LA FUENTE '); INSERT INTO gifi (accno,description) VALUES ('135520', 'SOBRANTES EN LIQUIDACION PRIVADA DE IMPUESTOS '); INSERT INTO gifi (accno,description) VALUES ('135525', 'CONTRIBUCIONES '); INSERT INTO gifi (accno,description) VALUES ('135530', 'IMPUESTOS DESCONTABLES '); INSERT INTO gifi (accno,description) VALUES ('135595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('1360', 'RECLAMACIONES '); INSERT INTO gifi (accno,description) VALUES ('136005', 'A COMPAŃIAS ASEGURADORAS '); INSERT INTO gifi (accno,description) VALUES ('136010', 'A TRANSPORTADORES '); INSERT INTO gifi (accno,description) VALUES ('136015', 'POR TIQUETES AEREOS '); INSERT INTO gifi (accno,description) VALUES ('136095', 'OTRAS '); INSERT INTO gifi (accno,description) VALUES ('1365', 'CUENTAS POR COBRAR A TRABAJADORES '); INSERT INTO gifi (accno,description) VALUES ('136505', 'VIVIENDA '); INSERT INTO gifi (accno,description) VALUES ('136510', 'VEHICULOS '); INSERT INTO gifi (accno,description) VALUES ('136515', 'EDUCACION '); INSERT INTO gifi (accno,description) VALUES ('136520', 'MEDICOS, ODONTOLOGICOS Y SIMILARES '); INSERT INTO gifi (accno,description) VALUES ('136525', 'CALAMIDAD DOMESTICA '); INSERT INTO gifi (accno,description) VALUES ('136530', 'RESPONSABILIDADES '); INSERT INTO gifi (accno,description) VALUES ('136595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('1370', 'PRESTAMOS A PARTICULARES '); INSERT INTO gifi (accno,description) VALUES ('137005', 'CON GARANTIA REAL '); INSERT INTO gifi (accno,description) VALUES ('137010', 'CON GARANTIA PERSONAL '); INSERT INTO gifi (accno,description) VALUES ('1380', 'DEUDORES VARIOS '); INSERT INTO gifi (accno,description) VALUES ('138005', 'DEPOSITARIOS '); INSERT INTO gifi (accno,description) VALUES ('138010', 'COMISIONISTAS DE BOLSAS '); INSERT INTO gifi (accno,description) VALUES ('138015', 'FONDO DE INVERSION '); INSERT INTO gifi (accno,description) VALUES ('138020', 'CUENTAS POR COBRAR DE TERCEROS '); INSERT INTO gifi (accno,description) VALUES ('138025', 'PAGOS POR CUENTA DE TERCEROS '); INSERT INTO gifi (accno,description) VALUES ('138030', 'FONDOS DE INVERSION SOCIAL '); INSERT INTO gifi (accno,description) VALUES ('138095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('1385', 'DERECHOS DE RECOMPRA DE CARTERA NEGOCIADA '); INSERT INTO gifi (accno,description) VALUES ('1390', 'DEUDAS DE DIFICIL COBRO '); INSERT INTO gifi (accno,description) VALUES ('1399', 'PROVISIONES '); INSERT INTO gifi (accno,description) VALUES ('139905', 'CLIENTES '); INSERT INTO gifi (accno,description) VALUES ('139910', 'CUENTAS CORRIENTES COMERCIALES '); INSERT INTO gifi (accno,description) VALUES ('139915', 'CUENTAS POR COBRAR A CASA MATRIZ '); INSERT INTO gifi (accno,description) VALUES ('139920', 'CUENTAS POR COBRAR A VINCULADOS ECONOMICOS '); INSERT INTO gifi (accno,description) VALUES ('139925', 'CUENTAS POR COBRAR A SOCIOS Y ACCIONISTAS '); INSERT INTO gifi (accno,description) VALUES ('139930', 'ANTICIPOS Y AVANCES '); INSERT INTO gifi (accno,description) VALUES ('139932', 'CUENTAS DE OPERACION CONJUNTA '); INSERT INTO gifi (accno,description) VALUES ('139935', 'DEPOSITOS '); INSERT INTO gifi (accno,description) VALUES ('139940', 'PROMESAS DE COMPRAVENTA '); INSERT INTO gifi (accno,description) VALUES ('139945', 'INGRESOS POR COBRAR '); INSERT INTO gifi (accno,description) VALUES ('139950', 'RETENCION SOBRE CONTRATOS '); INSERT INTO gifi (accno,description) VALUES ('139955', 'RECLAMACIONES '); INSERT INTO gifi (accno,description) VALUES ('139960', 'CUENTAS POR COBRAR A TRABAJADORES '); INSERT INTO gifi (accno,description) VALUES ('139965', 'PRESTAMOS A PARTICULARES '); INSERT INTO gifi (accno,description) VALUES ('139975', 'DEUDORES VARIOS '); INSERT INTO gifi (accno,description) VALUES ('139980', 'DERECHOS DE RECOMPRA DE CARTERA NEGOCIADA '); INSERT INTO gifi (accno,description) VALUES ('14', 'INVENTARIOS '); INSERT INTO gifi (accno,description) VALUES ('1405', 'MATERIAS PRIMAS '); INSERT INTO gifi (accno,description) VALUES ('140599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1410', 'PRODUCTOS EN PROCESO '); INSERT INTO gifi (accno,description) VALUES ('141099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1415', 'OBRAS DE CONSTRUCCION EN CURSO '); INSERT INTO gifi (accno,description) VALUES ('141599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1417', 'OBRAS DE URBANISMO '); INSERT INTO gifi (accno,description) VALUES ('141799', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1420', 'CONTRATOS EN EJECUCION '); INSERT INTO gifi (accno,description) VALUES ('142099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1425', 'CULTIVOS EN DESARROLLO '); INSERT INTO gifi (accno,description) VALUES ('142599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1430', 'PRODUCTOS TERMINADOS '); INSERT INTO gifi (accno,description) VALUES ('143005', 'PRODUCTOS MANUFACTURADOS '); INSERT INTO gifi (accno,description) VALUES ('143010', 'PRODUCTOS EXTRAIDOS Y/O PROCESADOS '); INSERT INTO gifi (accno,description) VALUES ('143015', 'PRODUCTOS AGRICOLAS Y FORESTALES '); INSERT INTO gifi (accno,description) VALUES ('143020', 'SUBPRODUCTOS '); INSERT INTO gifi (accno,description) VALUES ('143025', 'PRODUCTOS DE PESCA '); INSERT INTO gifi (accno,description) VALUES ('143099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1435', 'MERCANCIAS NO FABRICADAS POR LA EMPRESA '); INSERT INTO gifi (accno,description) VALUES ('143599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1440', 'BIENES RAICES PARA LA VENTA '); INSERT INTO gifi (accno,description) VALUES ('144099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1445', 'SEMOVIENTES '); INSERT INTO gifi (accno,description) VALUES ('144505', 'ESPECIES MAYORES '); INSERT INTO gifi (accno,description) VALUES ('144510', 'ESPECIES MENORES '); INSERT INTO gifi (accno,description) VALUES ('144599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1450', 'TERRENOS '); INSERT INTO gifi (accno,description) VALUES ('145005', 'POR URBANIZAR '); INSERT INTO gifi (accno,description) VALUES ('145010', 'URBANIZADOS POR CONSTRUIR '); INSERT INTO gifi (accno,description) VALUES ('145099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1455', 'MATERIALES, REPUESTOS Y ACCESORIOS '); INSERT INTO gifi (accno,description) VALUES ('145505', 'COMBUSTIBLES Y LUBRICANTES '); INSERT INTO gifi (accno,description) VALUES ('145510', 'ABONOS Y FERTILIZANTES '); INSERT INTO gifi (accno,description) VALUES ('145515', 'SEMILLAS TERMINADAS '); INSERT INTO gifi (accno,description) VALUES ('145520', 'FUNGICIDAS Y HERBICIDAS '); INSERT INTO gifi (accno,description) VALUES ('145525', 'MATERIALES Y REPUESTOS '); INSERT INTO gifi (accno,description) VALUES ('145530', 'LOZA Y CRISTALERIA '); INSERT INTO gifi (accno,description) VALUES ('145535', 'HERRAMIENTAS '); INSERT INTO gifi (accno,description) VALUES ('145540', 'MEDICINAS '); INSERT INTO gifi (accno,description) VALUES ('145545', 'ELEMENTOS HOSPITALARIOS '); INSERT INTO gifi (accno,description) VALUES ('145550', 'INSTRUMENTAL QUIRURGICO '); INSERT INTO gifi (accno,description) VALUES ('145555', 'DOTACION Y SUMINISTRO A TRABAJADORES '); INSERT INTO gifi (accno,description) VALUES ('145560', 'ELEMENTOS DE ROPERIA Y LENCERIA '); INSERT INTO gifi (accno,description) VALUES ('145595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('145599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1460', 'ENVASES Y EMPAQUES '); INSERT INTO gifi (accno,description) VALUES ('146099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1465', 'INVENTARIOS EN TRANSITO '); INSERT INTO gifi (accno,description) VALUES ('146599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1499', 'PROVISIONES '); INSERT INTO gifi (accno,description) VALUES ('149905', 'PARA OBSOLESCENCIA '); INSERT INTO gifi (accno,description) VALUES ('149910', 'PARA DIFERENCIA DE INVENTARIO FISICO '); INSERT INTO gifi (accno,description) VALUES ('149915', 'PARA PERDIDAS DE INVENTARIOS '); INSERT INTO gifi (accno,description) VALUES ('149920', 'LIFO '); INSERT INTO gifi (accno,description) VALUES ('15', 'PROPIEDADES PLANTA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('1504', 'TERRENOS '); INSERT INTO gifi (accno,description) VALUES ('150405', 'URBANOS '); INSERT INTO gifi (accno,description) VALUES ('150410', 'RURALES '); INSERT INTO gifi (accno,description) VALUES ('150499', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1506', 'MATERIALES PROYECTOS PETROLEROS '); INSERT INTO gifi (accno,description) VALUES ('150605', 'TUBERIAS Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('150610', 'COSTOS DE IMPORTACION MATERIALES '); INSERT INTO gifi (accno,description) VALUES ('150615', 'PROYECTOS DE CONSTRUCCION '); INSERT INTO gifi (accno,description) VALUES ('150699', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1508', 'CONSTRUCCIONES EN CURSO '); INSERT INTO gifi (accno,description) VALUES ('150805', 'CONSTRUCCIONES Y EDIFICACIONES '); INSERT INTO gifi (accno,description) VALUES ('150810', 'ACUEDUCTOS PLANTAS Y REDES '); INSERT INTO gifi (accno,description) VALUES ('150815', 'VIAS DE COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('150820', 'POZOS ARTESIANOS '); INSERT INTO gifi (accno,description) VALUES ('150825', 'PROYECTOS DE EXPLORACION '); INSERT INTO gifi (accno,description) VALUES ('150830', 'PROYECTOS DE DESARROLLO '); INSERT INTO gifi (accno,description) VALUES ('150899', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1512', 'MAQUINARIA Y EQUIPOS EN MONTAJE '); INSERT INTO gifi (accno,description) VALUES ('151205', 'MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('151210', 'EQUIPO DE OFICINA '); INSERT INTO gifi (accno,description) VALUES ('151215', 'EQUIPO DE COMPUTACION Y COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('151220', 'EQUIPO MEDICO-CIENTIFICO '); INSERT INTO gifi (accno,description) VALUES ('151225', 'EQUIPO DE HOTELES Y RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('151230', 'FLOTA Y EQUIPO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('151235', 'FLOTA Y EQUIPO FLUVIAL Y/O MARITIMO '); INSERT INTO gifi (accno,description) VALUES ('151240', 'FLOTA Y EQUIPO AEREO '); INSERT INTO gifi (accno,description) VALUES ('151245', 'FLOTA Y EQUIPO FERREO '); INSERT INTO gifi (accno,description) VALUES ('151250', 'PLANTAS Y REDES '); INSERT INTO gifi (accno,description) VALUES ('151299', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1516', 'CONSTRUCCIONES Y EDIFICACIONES '); INSERT INTO gifi (accno,description) VALUES ('151605', 'EDIFICIOS '); INSERT INTO gifi (accno,description) VALUES ('151610', 'OFICINAS '); INSERT INTO gifi (accno,description) VALUES ('151615', 'ALMACENES '); INSERT INTO gifi (accno,description) VALUES ('151620', 'FABRICAS Y PLANTAS INDUSTRIALES '); INSERT INTO gifi (accno,description) VALUES ('151625', 'SALAS DE EXHIBICION Y VENTAS '); INSERT INTO gifi (accno,description) VALUES ('151630', 'CAFETERIA Y CASINOS '); INSERT INTO gifi (accno,description) VALUES ('151635', 'SILOS '); INSERT INTO gifi (accno,description) VALUES ('151640', 'INVERNADEROS '); INSERT INTO gifi (accno,description) VALUES ('151645', 'CASETAS Y CAMPAMENTOS '); INSERT INTO gifi (accno,description) VALUES ('151650', 'INSTALACIONES AGROPECUARIAS '); INSERT INTO gifi (accno,description) VALUES ('151655', 'VIVIENDAS PARA EMPLEADOS Y OBREROS '); INSERT INTO gifi (accno,description) VALUES ('151660', 'TERMINAL DE BUSES Y TAXIS '); INSERT INTO gifi (accno,description) VALUES ('151663', 'TERMINAL MARITIMO '); INSERT INTO gifi (accno,description) VALUES ('151665', 'TERMINAL FERREO '); INSERT INTO gifi (accno,description) VALUES ('151670', 'PARQUEADEROS, GARAJES Y DEPOSITOS '); INSERT INTO gifi (accno,description) VALUES ('151675', 'HANGARES '); INSERT INTO gifi (accno,description) VALUES ('151680', 'BODEGAS '); INSERT INTO gifi (accno,description) VALUES ('151695', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('151699', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1520', 'MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('152099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1524', 'EQUIPO DE OFICINA '); INSERT INTO gifi (accno,description) VALUES ('152405', 'MUEBLES Y ENSERES '); INSERT INTO gifi (accno,description) VALUES ('152410', 'EQUIPOS '); INSERT INTO gifi (accno,description) VALUES ('152495', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('152499', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1528', 'EQUIPO DE COMPUTACION Y COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('152805', 'EQUIPOS DE PROCESAMIENTO DE DATOS '); INSERT INTO gifi (accno,description) VALUES ('152810', 'EQUIPOS DE TELECOMUNICACIONES '); INSERT INTO gifi (accno,description) VALUES ('152815', 'EQUIPOS DE RADIO '); INSERT INTO gifi (accno,description) VALUES ('152820', 'SATELITES Y ANTENAS '); INSERT INTO gifi (accno,description) VALUES ('152825', 'LINEAS TELEFONICAS '); INSERT INTO gifi (accno,description) VALUES ('152895', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('152899', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1532', 'EQUIPO MEDICO - CIENTIFICO '); INSERT INTO gifi (accno,description) VALUES ('153205', 'MEDICO '); INSERT INTO gifi (accno,description) VALUES ('153210', 'ODONTOLOGICO '); INSERT INTO gifi (accno,description) VALUES ('153215', 'LABORATORIO '); INSERT INTO gifi (accno,description) VALUES ('153220', 'INSTRUMENTAL '); INSERT INTO gifi (accno,description) VALUES ('153295', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('153299', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1536', 'EQUIPO DE HOTELES Y RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('153605', 'DE HABITACIONES '); INSERT INTO gifi (accno,description) VALUES ('153610', 'DE COMESTIBLES Y BEBIDAS '); INSERT INTO gifi (accno,description) VALUES ('153695', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('153699', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1540', 'FLOTA Y EQUIPO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('154005', 'AUTOS, CAMIONETAS Y CAMPEROS '); INSERT INTO gifi (accno,description) VALUES ('154008', 'CAMIONES, VOLQUETAS Y FURGONES '); INSERT INTO gifi (accno,description) VALUES ('154010', 'TRACTOMULAS Y REMOLQUES '); INSERT INTO gifi (accno,description) VALUES ('154015', 'BUSES Y BUSETAS '); INSERT INTO gifi (accno,description) VALUES ('154017', 'RECOLECTORES Y CONTENEDORES '); INSERT INTO gifi (accno,description) VALUES ('154020', 'MONTACARGAS '); INSERT INTO gifi (accno,description) VALUES ('154025', 'PALAS Y GRUAS '); INSERT INTO gifi (accno,description) VALUES ('154030', 'MOTOCICLETAS '); INSERT INTO gifi (accno,description) VALUES ('154035', 'BICICLETAS '); INSERT INTO gifi (accno,description) VALUES ('154040', 'ESTIBAS Y CARRETAS '); INSERT INTO gifi (accno,description) VALUES ('154045', 'BANDAS TRANSPORTADORAS '); INSERT INTO gifi (accno,description) VALUES ('154095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('154099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1544', 'FLOTA Y EQUIPO FLUVIAL Y/O MARITIMO '); INSERT INTO gifi (accno,description) VALUES ('154405', 'BUQUES '); INSERT INTO gifi (accno,description) VALUES ('154410', 'LANCHAS '); INSERT INTO gifi (accno,description) VALUES ('154415', 'REMOLCADORAS '); INSERT INTO gifi (accno,description) VALUES ('154420', 'BOTES '); INSERT INTO gifi (accno,description) VALUES ('154425', 'BOYAS '); INSERT INTO gifi (accno,description) VALUES ('154430', 'AMARRES '); INSERT INTO gifi (accno,description) VALUES ('154435', 'CONTENEDORES Y CHASSISES '); INSERT INTO gifi (accno,description) VALUES ('154440', 'GABARRAS '); INSERT INTO gifi (accno,description) VALUES ('154495', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('154499', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1548', 'FLOTA Y EQUIPO AEREO '); INSERT INTO gifi (accno,description) VALUES ('154805', 'AVIONES '); INSERT INTO gifi (accno,description) VALUES ('154810', 'AVIONETAS '); INSERT INTO gifi (accno,description) VALUES ('154815', 'HELICOPTEROS '); INSERT INTO gifi (accno,description) VALUES ('154820', 'TURBINAS Y MOTORES '); INSERT INTO gifi (accno,description) VALUES ('154825', 'MANUALES DE ENTRENAMIENTO PERSONAL TECNICO '); INSERT INTO gifi (accno,description) VALUES ('154830', 'EQUIPOS DE VUELO '); INSERT INTO gifi (accno,description) VALUES ('154895', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('154899', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1552', 'FLOTA Y EQUIPO FERREO '); INSERT INTO gifi (accno,description) VALUES ('155205', 'LOCOMOTORAS '); INSERT INTO gifi (accno,description) VALUES ('155210', 'VAGONES '); INSERT INTO gifi (accno,description) VALUES ('155215', 'REDES FERREAS '); INSERT INTO gifi (accno,description) VALUES ('155295', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('155299', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1556', 'ACUEDUCTOS PLANTAS Y REDES '); INSERT INTO gifi (accno,description) VALUES ('155605', 'INSTALACIONES PARA AGUA Y ENERGIA '); INSERT INTO gifi (accno,description) VALUES ('155610', 'ACUEDUCTO ACEQUIAS Y CANALIZACIONES '); INSERT INTO gifi (accno,description) VALUES ('155615', 'PLANTAS DE GENERACION HIDRAULICA '); INSERT INTO gifi (accno,description) VALUES ('155620', 'PLANTAS DE GENERACION TERMICA '); INSERT INTO gifi (accno,description) VALUES ('155625', 'PLANTAS DE GENERACION A GAS '); INSERT INTO gifi (accno,description) VALUES ('155628', 'PLANTAS DE GENERACION DIESEL, GASOLINA Y PETROLEO '); INSERT INTO gifi (accno,description) VALUES ('155630', 'PLANTAS DE DISTRIBUCION '); INSERT INTO gifi (accno,description) VALUES ('155635', 'PLANTAS DE TRANSMISION Y SUBESTACIONES '); INSERT INTO gifi (accno,description) VALUES ('155640', 'OLEODUCTOS '); INSERT INTO gifi (accno,description) VALUES ('155645', 'GASODUCTOS '); INSERT INTO gifi (accno,description) VALUES ('155647', 'POLIDUCTOS '); INSERT INTO gifi (accno,description) VALUES ('155650', 'REDES DE DISTRIBUCION '); INSERT INTO gifi (accno,description) VALUES ('155655', 'PLANTAS DE TRATAMIENTO '); INSERT INTO gifi (accno,description) VALUES ('155660', 'REDES DE RECOLECCION DE AGUAS NEGRAS '); INSERT INTO gifi (accno,description) VALUES ('155665', 'INSTALACIONES Y EQUIPO DE BOMBEO '); INSERT INTO gifi (accno,description) VALUES ('155670', 'REDES DE DISTRIBUCION DE VAPOR '); INSERT INTO gifi (accno,description) VALUES ('155675', 'REDES DE AIRE '); INSERT INTO gifi (accno,description) VALUES ('155680', 'REDES ALIMENTACION DE GAS '); INSERT INTO gifi (accno,description) VALUES ('155682', 'REDES EXTERNAS DE TELEFONIA '); INSERT INTO gifi (accno,description) VALUES ('155685', 'PLANTAS DESHIDRATADORAS '); INSERT INTO gifi (accno,description) VALUES ('155695', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('155699', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1560', 'ARMAMENTO DE VIGILANCIA '); INSERT INTO gifi (accno,description) VALUES ('156099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1562', 'ENVASES Y EMPAQUES '); INSERT INTO gifi (accno,description) VALUES ('156299', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1564', 'PLANTACIONES AGRICOLAS Y FORESTALES '); INSERT INTO gifi (accno,description) VALUES ('156405', 'CULTIVOS EN DESARROLLO '); INSERT INTO gifi (accno,description) VALUES ('156410', 'CULTIVOS AMORTIZABLES '); INSERT INTO gifi (accno,description) VALUES ('156499', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1568', 'VIAS DE COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('156805', 'PAVIMENTACION Y PATIOS '); INSERT INTO gifi (accno,description) VALUES ('156810', 'VIAS '); INSERT INTO gifi (accno,description) VALUES ('156815', 'PUENTES '); INSERT INTO gifi (accno,description) VALUES ('156820', 'CALLES '); INSERT INTO gifi (accno,description) VALUES ('156825', 'AERODROMOS '); INSERT INTO gifi (accno,description) VALUES ('156895', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('156899', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1572', 'MINAS Y CANTERAS '); INSERT INTO gifi (accno,description) VALUES ('157205', 'MINAS '); INSERT INTO gifi (accno,description) VALUES ('157210', 'CANTERAS '); INSERT INTO gifi (accno,description) VALUES ('157299', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1576', 'POZOS ARTESIANOS '); INSERT INTO gifi (accno,description) VALUES ('157699', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1580', 'YACIMIENTOS '); INSERT INTO gifi (accno,description) VALUES ('158099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1584', 'SEMOVIENTES '); INSERT INTO gifi (accno,description) VALUES ('158405', 'ESPECIES MENORES '); INSERT INTO gifi (accno,description) VALUES ('158410', 'ESPECIES MAYORES '); INSERT INTO gifi (accno,description) VALUES ('158499', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1588', 'PROPIEDADES PLANTA Y EQUIPO EN TRANSITO '); INSERT INTO gifi (accno,description) VALUES ('158805', 'MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('158810', 'EQUIPO DE OFICINA '); INSERT INTO gifi (accno,description) VALUES ('158815', 'EQUIPO DE COMPUTACION Y COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('158820', 'EQUIPO MEDICO CIENTIFICO '); INSERT INTO gifi (accno,description) VALUES ('158825', 'EQUIPO DE HOTELES Y RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('158830', 'FLOTA Y EQUIPO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('158835', 'FLOTA Y EQUIPO FLUVIAL Y/O MARITIMO '); INSERT INTO gifi (accno,description) VALUES ('158840', 'FLOTA Y EQUIPO AEREO '); INSERT INTO gifi (accno,description) VALUES ('158845', 'FLOTA Y EQUIPO FERREO '); INSERT INTO gifi (accno,description) VALUES ('158850', 'PLANTAS Y REDES '); INSERT INTO gifi (accno,description) VALUES ('158855', 'ARMAMENTO DE VIGILANCIA '); INSERT INTO gifi (accno,description) VALUES ('158860', 'SEMOVIENTES '); INSERT INTO gifi (accno,description) VALUES ('158865', 'ENVASES Y EMPAQUES '); INSERT INTO gifi (accno,description) VALUES ('158899', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1592', 'DEPRECIACION ACUMULADA '); INSERT INTO gifi (accno,description) VALUES ('159205', 'CONSTRUCCIONES Y EDIFICACIONES '); INSERT INTO gifi (accno,description) VALUES ('159210', 'MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('159215', 'EQUIPO DE OFICINA '); INSERT INTO gifi (accno,description) VALUES ('159220', 'EQUIPO DE COMPUTACION Y COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('159225', 'EQUIPO MEDICO CIENTIFICO '); INSERT INTO gifi (accno,description) VALUES ('159230', 'EQUIPO DE HOTELES Y RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('159235', 'FLOTA Y EQUIPO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('159240', 'FLOTA Y EQUIPO FLUVIAL Y/O MARITIMO '); INSERT INTO gifi (accno,description) VALUES ('159245', 'FLOTA Y EQUIPO AEREO '); INSERT INTO gifi (accno,description) VALUES ('159250', 'FLOTA Y EQUIPO FERREO '); INSERT INTO gifi (accno,description) VALUES ('159255', 'ACUEDUCTOS PLANTAS Y REDES '); INSERT INTO gifi (accno,description) VALUES ('159260', 'ARMAMENTO DE VIGILANCIA '); INSERT INTO gifi (accno,description) VALUES ('159265', 'ENVASES Y EMPAQUES '); INSERT INTO gifi (accno,description) VALUES ('159299', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1596', 'DEPRECIACION DIFERIDA '); INSERT INTO gifi (accno,description) VALUES ('159605', 'EXCESO FISCAL SOBRE LA CONTABLE '); INSERT INTO gifi (accno,description) VALUES ('159610', 'DEFECTO FISCAL SOBRE LA CONTABLE (CR) '); INSERT INTO gifi (accno,description) VALUES ('159699', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1597', 'AMORTIZACION ACUMULADA '); INSERT INTO gifi (accno,description) VALUES ('159705', 'PLANTACIONES AGRICOLAS Y FORESTALES '); INSERT INTO gifi (accno,description) VALUES ('159710', 'VIAS DE COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('159715', 'SEMOVIENTES '); INSERT INTO gifi (accno,description) VALUES ('159799', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1598', 'AGOTAMIENTO ACUMULADO '); INSERT INTO gifi (accno,description) VALUES ('159805', 'MINAS Y CANTERAS '); INSERT INTO gifi (accno,description) VALUES ('159815', 'POZOS ARTESIANOS '); INSERT INTO gifi (accno,description) VALUES ('159820', 'YACIMIENTOS '); INSERT INTO gifi (accno,description) VALUES ('159899', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1599', 'PROVISIONES '); INSERT INTO gifi (accno,description) VALUES ('159904', 'TERRENOS '); INSERT INTO gifi (accno,description) VALUES ('159906', 'MATERIALES PROYECTOS PETROLEROS '); INSERT INTO gifi (accno,description) VALUES ('159908', 'CONSTRUCCIONES EN CURSO '); INSERT INTO gifi (accno,description) VALUES ('159912', 'MAQUINARIA EN MONTAJE '); INSERT INTO gifi (accno,description) VALUES ('159916', 'CONSTRUCCIONES Y EDIFICACIONES '); INSERT INTO gifi (accno,description) VALUES ('159920', 'MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('159924', 'EQUIPO DE OFICINA '); INSERT INTO gifi (accno,description) VALUES ('159928', 'EQUIPO DE COMPUTACION Y COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('159932', 'EQUIPO MEDICO CIENTIFICO '); INSERT INTO gifi (accno,description) VALUES ('159936', 'EQUIPO DE HOTELES Y RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('159940', 'FLOTA Y EQUIPO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('159944', 'FLOTA Y EQUIPO FLUVIAL Y/O MARITIMO '); INSERT INTO gifi (accno,description) VALUES ('159948', 'FLOTA Y EQUIPO AEREO '); INSERT INTO gifi (accno,description) VALUES ('159952', 'FLOTA Y EQUIPO FERREO '); INSERT INTO gifi (accno,description) VALUES ('159956', 'ACUEDUCTOS, PLANTAS Y REDES '); INSERT INTO gifi (accno,description) VALUES ('159960', 'ARMAMENTO DE VIGILANCIA '); INSERT INTO gifi (accno,description) VALUES ('159962', 'ENVASES Y EMPAQUES '); INSERT INTO gifi (accno,description) VALUES ('159964', 'PLANTACIONES AGRICOLAS Y FORESTALES '); INSERT INTO gifi (accno,description) VALUES ('159968', 'VIAS DE COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('159972', 'MINAS Y CANTERAS '); INSERT INTO gifi (accno,description) VALUES ('159980', 'POZOS ARTESIANOS '); INSERT INTO gifi (accno,description) VALUES ('159984', 'YACIMIENTOS '); INSERT INTO gifi (accno,description) VALUES ('159988', 'SEMOVIENTES '); INSERT INTO gifi (accno,description) VALUES ('159992', 'PROPIEDADES PLANTA Y EQUIPO EN TRANSITO '); INSERT INTO gifi (accno,description) VALUES ('16', 'INTANGIBLES '); INSERT INTO gifi (accno,description) VALUES ('1605', 'CREDITO MERCANTIL '); INSERT INTO gifi (accno,description) VALUES ('160505', 'FORMADO O ESTIMADO '); INSERT INTO gifi (accno,description) VALUES ('160510', 'ADQUIRIDO O COMPRADO '); INSERT INTO gifi (accno,description) VALUES ('160599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1610', 'MARCAS '); INSERT INTO gifi (accno,description) VALUES ('161005', 'ADQUIRIDAS '); INSERT INTO gifi (accno,description) VALUES ('161010', 'FORMADAS '); INSERT INTO gifi (accno,description) VALUES ('161099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1615', 'PATENTES '); INSERT INTO gifi (accno,description) VALUES ('161505', 'ADQUIRIDAS '); INSERT INTO gifi (accno,description) VALUES ('161510', 'FORMADAS '); INSERT INTO gifi (accno,description) VALUES ('161599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1620', 'CONCESIONES Y FRANQUICIAS '); INSERT INTO gifi (accno,description) VALUES ('162005', 'CONCESIONES '); INSERT INTO gifi (accno,description) VALUES ('162010', 'FRANQUICIAS '); INSERT INTO gifi (accno,description) VALUES ('162099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1625', 'DERECHOS '); INSERT INTO gifi (accno,description) VALUES ('162505', 'DERECHOS DE AUTOR '); INSERT INTO gifi (accno,description) VALUES ('162510', 'PUESTO DE BOLSA '); INSERT INTO gifi (accno,description) VALUES ('162515', 'EN FIDEICOMISOS INMOBILIARIOS '); INSERT INTO gifi (accno,description) VALUES ('162520', 'EN FIDEICOMISOS DE GARANTIA '); INSERT INTO gifi (accno,description) VALUES ('162525', 'EN FIDEICOMISOS DE ADMINISTRACION '); INSERT INTO gifi (accno,description) VALUES ('162595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('162599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1630', 'KNOW HOW '); INSERT INTO gifi (accno,description) VALUES ('163099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1635', 'LICENCIAS '); INSERT INTO gifi (accno,description) VALUES ('163599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1698', 'AMORTIZACION ACUMULADA '); INSERT INTO gifi (accno,description) VALUES ('169805', 'CREDITO MERCANTIL '); INSERT INTO gifi (accno,description) VALUES ('169810', 'MARCAS '); INSERT INTO gifi (accno,description) VALUES ('169815', 'PATENTES '); INSERT INTO gifi (accno,description) VALUES ('169820', 'CONCESIONES Y FRANQUICIAS '); INSERT INTO gifi (accno,description) VALUES ('169830', 'DERECHOS '); INSERT INTO gifi (accno,description) VALUES ('169835', 'KNOW HOW '); INSERT INTO gifi (accno,description) VALUES ('169840', 'LICENCIAS '); INSERT INTO gifi (accno,description) VALUES ('169899', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1699', 'PROVISIONES '); INSERT INTO gifi (accno,description) VALUES ('17', 'DIFERIDOS '); INSERT INTO gifi (accno,description) VALUES ('1705', 'GASTOS PAGADOS POR ANTICIPADO '); INSERT INTO gifi (accno,description) VALUES ('170505', 'INTERESES '); INSERT INTO gifi (accno,description) VALUES ('170510', 'HONORARIOS '); INSERT INTO gifi (accno,description) VALUES ('170515', 'COMISIONES '); INSERT INTO gifi (accno,description) VALUES ('170520', 'SEGUROS Y FIANZAS '); INSERT INTO gifi (accno,description) VALUES ('170525', 'ARRENDAMIENTOS '); INSERT INTO gifi (accno,description) VALUES ('170530', 'BODEGAJES '); INSERT INTO gifi (accno,description) VALUES ('170535', 'MANTENIMIENTO EQUIPOS '); INSERT INTO gifi (accno,description) VALUES ('170540', 'SERVICIOS '); INSERT INTO gifi (accno,description) VALUES ('170545', 'SUSCRIPCIONES '); INSERT INTO gifi (accno,description) VALUES ('170595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('1710', 'CARGOS DIFERIDOS '); INSERT INTO gifi (accno,description) VALUES ('171004', 'ORGANIZACION Y PREOPERATIVOS '); INSERT INTO gifi (accno,description) VALUES ('171008', 'REMODELACIONES '); INSERT INTO gifi (accno,description) VALUES ('171012', 'ESTUDIOS, INVESTIGACIONES Y PROYECTOS '); INSERT INTO gifi (accno,description) VALUES ('171016', 'PROGRAMAS PARA COMPUTADOR (SOFTWARE) '); INSERT INTO gifi (accno,description) VALUES ('171020', 'UTILES Y PAPELERIA '); INSERT INTO gifi (accno,description) VALUES ('171024', 'MEJORAS A PROPIEDADES AJENAS '); INSERT INTO gifi (accno,description) VALUES ('171028', 'CONTRIBUCIONES Y AFILIACIONES '); INSERT INTO gifi (accno,description) VALUES ('171032', 'ENTRENAMIENTO DE PERSONAL '); INSERT INTO gifi (accno,description) VALUES ('171036', 'FERIAS Y EXPOSICIONES '); INSERT INTO gifi (accno,description) VALUES ('171040', 'LICENCIAS '); INSERT INTO gifi (accno,description) VALUES ('171044', 'PUBLICIDAD, PROPAGANDA Y AVISOS '); INSERT INTO gifi (accno,description) VALUES ('171048', 'ELEMENTOS DE ASEO Y CAFETERIA '); INSERT INTO gifi (accno,description) VALUES ('171052', 'MOLDES Y TROQUELES '); INSERT INTO gifi (accno,description) VALUES ('171056', 'INSTRUMENTAL QUIRURGICO '); INSERT INTO gifi (accno,description) VALUES ('171060', 'DOTACION Y SUMINISTRO A TRABAJADORES '); INSERT INTO gifi (accno,description) VALUES ('171064', 'ELEMENTOS DE ROPERIA Y LENCERIA '); INSERT INTO gifi (accno,description) VALUES ('171068', 'LOZA Y CRISTALERIA '); INSERT INTO gifi (accno,description) VALUES ('171072', 'DESCUENTO EN COLOCACION DE BONOS '); INSERT INTO gifi (accno,description) VALUES ('171076', 'IMPUESTO DE RENTA DIFERIDO "DEBITOS" POR DIFERENCIAS TEMPORALES '); INSERT INTO gifi (accno,description) VALUES ('171080', 'CONCURSOS Y LICITACIONES '); INSERT INTO gifi (accno,description) VALUES ('171095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('171099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1715', 'COSTOS DE EXPLORACION POR AMORTIZAR '); INSERT INTO gifi (accno,description) VALUES ('171505', 'POZOS SECOS '); INSERT INTO gifi (accno,description) VALUES ('171510', 'POZOS NO COMERCIALES '); INSERT INTO gifi (accno,description) VALUES ('171515', 'OTROS COSTOS DE EXPLORACION '); INSERT INTO gifi (accno,description) VALUES ('171599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1720', 'COSTOS DE EXPLOTACION Y DESARROLLO '); INSERT INTO gifi (accno,description) VALUES ('172005', 'PERFORACION Y EXPLOTACION '); INSERT INTO gifi (accno,description) VALUES ('172010', 'PERFORACIONES CAMPOS EN DESARROLLO '); INSERT INTO gifi (accno,description) VALUES ('172015', 'FACILIDADES DE PRODUCCION '); INSERT INTO gifi (accno,description) VALUES ('172020', 'SERVICIO A POZOS '); INSERT INTO gifi (accno,description) VALUES ('172099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1730', 'CARGOS POR CORRECCION MONETARIA DIFERIDA '); INSERT INTO gifi (accno,description) VALUES ('1798', 'AMORTIZACION ACUMULADA '); INSERT INTO gifi (accno,description) VALUES ('179805', 'COSTOS DE EXPLORACION POR AMORTIZAR '); INSERT INTO gifi (accno,description) VALUES ('179810', 'COSTOS DE EXPLOTACION Y DESARROLLO '); INSERT INTO gifi (accno,description) VALUES ('179899', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('18', 'OTROS ACTIVOS '); INSERT INTO gifi (accno,description) VALUES ('1805', 'BIENES DE ARTE Y CULTURA '); INSERT INTO gifi (accno,description) VALUES ('180505', 'OBRAS DE ARTE '); INSERT INTO gifi (accno,description) VALUES ('180510', 'BIBLIOTECAS '); INSERT INTO gifi (accno,description) VALUES ('180595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('180599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1895', 'DIVERSOS '); INSERT INTO gifi (accno,description) VALUES ('189505', 'MAQUINAS PORTEADORAS '); INSERT INTO gifi (accno,description) VALUES ('189510', 'BIENES ENTREGADOS EN COMODATO '); INSERT INTO gifi (accno,description) VALUES ('189515', 'AMORTIZACION ACUMULADA DE BIENES ENTREGADOS EN COMODATO (CR) '); INSERT INTO gifi (accno,description) VALUES ('189520', 'BIENES RECIBIDOS EN PAGO '); INSERT INTO gifi (accno,description) VALUES ('189525', 'DERECHOS SUCESORALES '); INSERT INTO gifi (accno,description) VALUES ('189530', 'ESTAMPILLAS '); INSERT INTO gifi (accno,description) VALUES ('189595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('189599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('1899', 'PROVISIONES '); INSERT INTO gifi (accno,description) VALUES ('189905', 'BIENES DE ARTE Y CULTURA '); INSERT INTO gifi (accno,description) VALUES ('189995', 'DIVERSOS '); INSERT INTO gifi (accno,description) VALUES ('19', 'VALORIZACIONES '); INSERT INTO gifi (accno,description) VALUES ('1905', 'DE INVERSIONES '); INSERT INTO gifi (accno,description) VALUES ('190505', 'ACCIONES '); INSERT INTO gifi (accno,description) VALUES ('190510', 'CUOTAS O PARTES DE INTERES SOCIAL '); INSERT INTO gifi (accno,description) VALUES ('190515', 'DERECHOS FIDUCIARIOS '); INSERT INTO gifi (accno,description) VALUES ('1910', 'DE PROPIEDADES PLANTA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('191004', 'TERRENOS '); INSERT INTO gifi (accno,description) VALUES ('191006', 'MATERIALES PROYECTOS PETROLEROS '); INSERT INTO gifi (accno,description) VALUES ('191008', 'CONSTRUCCIONES Y EDIFICACIONES '); INSERT INTO gifi (accno,description) VALUES ('191012', 'MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('191016', 'EQUIPO DE OFICINA '); INSERT INTO gifi (accno,description) VALUES ('191020', 'EQUIPO DE COMPUTACION Y COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('191024', 'EQUIPO MEDICO CIENTIFICO '); INSERT INTO gifi (accno,description) VALUES ('191028', 'EQUIPO DE HOTELES Y RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('191032', 'FLOTA Y EQUIPO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('191036', 'FLOTA Y EQUIPO FLUVIAL Y/O MARITIMO '); INSERT INTO gifi (accno,description) VALUES ('191040', 'FLOTA Y EQUIPO AEREO '); INSERT INTO gifi (accno,description) VALUES ('191044', 'FLOTA Y EQUIPO FERREO '); INSERT INTO gifi (accno,description) VALUES ('191048', 'ACUEDUCTOS PLANTAS Y REDES '); INSERT INTO gifi (accno,description) VALUES ('191052', 'ARMAMENTO DE VIGILANCIA '); INSERT INTO gifi (accno,description) VALUES ('191056', 'ENVASES Y EMPAQUES '); INSERT INTO gifi (accno,description) VALUES ('191060', 'PLANTACIONES AGRICOLAS Y FORESTALES '); INSERT INTO gifi (accno,description) VALUES ('191064', 'VIAS DE COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('191068', 'MINAS Y CANTERAS '); INSERT INTO gifi (accno,description) VALUES ('191072', 'POZOS ARTESIANOS '); INSERT INTO gifi (accno,description) VALUES ('191076', 'YACIMIENTOS '); INSERT INTO gifi (accno,description) VALUES ('191080', 'SEMOVIENTES '); INSERT INTO gifi (accno,description) VALUES ('1995', 'DE OTROS ACTIVOS '); INSERT INTO gifi (accno,description) VALUES ('199505', 'BIENES DE ARTE Y CULTURA '); INSERT INTO gifi (accno,description) VALUES ('199510', 'BIENES ENTREGADOS EN COMODATO '); INSERT INTO gifi (accno,description) VALUES ('199515', 'BIENES RECIBIDOS EN PAGO '); INSERT INTO gifi (accno,description) VALUES ('199520', 'INVENTARIO DE SEMOVIENTES '); INSERT INTO gifi (accno,description) VALUES ('2', 'PASIVO '); INSERT INTO gifi (accno,description) VALUES ('21', 'OBLIGACIONES FINANCIERAS '); INSERT INTO gifi (accno,description) VALUES ('2105', 'BANCOS NACIONALES '); INSERT INTO gifi (accno,description) VALUES ('210505', 'SOBREGIROS '); INSERT INTO gifi (accno,description) VALUES ('210510', 'PAGARES '); INSERT INTO gifi (accno,description) VALUES ('210515', 'CARTAS DE CREDITO '); INSERT INTO gifi (accno,description) VALUES ('210520', 'ACEPTACIONES BANCARIAS '); INSERT INTO gifi (accno,description) VALUES ('2110', 'BANCOS DEL EXTERIOR '); INSERT INTO gifi (accno,description) VALUES ('211005', 'SOBREGIROS '); INSERT INTO gifi (accno,description) VALUES ('211010', 'PAGARES '); INSERT INTO gifi (accno,description) VALUES ('211015', 'CARTAS DE CREDITO '); INSERT INTO gifi (accno,description) VALUES ('211020', 'ACEPTACIONES BANCARIAS '); INSERT INTO gifi (accno,description) VALUES ('2115', 'CORPORACIONES FINANCIERAS '); INSERT INTO gifi (accno,description) VALUES ('211505', 'PAGARES '); INSERT INTO gifi (accno,description) VALUES ('211510', 'ACEPTACIONES FINANCIERAS '); INSERT INTO gifi (accno,description) VALUES ('211515', 'CARTAS DE CREDITO '); INSERT INTO gifi (accno,description) VALUES ('2120', 'COMPAŃIAS DE FINANCIAMIENTO COMERCIAL '); INSERT INTO gifi (accno,description) VALUES ('212005', 'PAGARES '); INSERT INTO gifi (accno,description) VALUES ('212010', 'ACEPTACIONES FINANCIERAS '); INSERT INTO gifi (accno,description) VALUES ('2125', 'CORPORACIONES DE AHORRO Y VIVIENDA '); INSERT INTO gifi (accno,description) VALUES ('212505', 'SOBREGIROS '); INSERT INTO gifi (accno,description) VALUES ('212510', 'PAGARES '); INSERT INTO gifi (accno,description) VALUES ('212515', 'HIPOTECARIAS '); INSERT INTO gifi (accno,description) VALUES ('2130', 'ENTIDADES FINANCIERAS DEL EXTERIOR '); INSERT INTO gifi (accno,description) VALUES ('2135', 'COMPROMISOS DE RECOMPRA DE INVERSIONES NEGOCIADAS '); INSERT INTO gifi (accno,description) VALUES ('213505', 'ACCIONES '); INSERT INTO gifi (accno,description) VALUES ('213510', 'CUOTAS O PARTES DE INTERES SOCIAL '); INSERT INTO gifi (accno,description) VALUES ('213515', 'BONOS '); INSERT INTO gifi (accno,description) VALUES ('213520', 'CEDULAS '); INSERT INTO gifi (accno,description) VALUES ('213525', 'CERTIFICADOS '); INSERT INTO gifi (accno,description) VALUES ('213530', 'PAPELES COMERCIALES '); INSERT INTO gifi (accno,description) VALUES ('213535', 'TITULOS '); INSERT INTO gifi (accno,description) VALUES ('213540', 'ACEPTACIONES BANCARIAS O FINANCIERAS '); INSERT INTO gifi (accno,description) VALUES ('213595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('2140', 'COMPROMISOS DE RECOMPRA DE CARTERA NEGOCIADA '); INSERT INTO gifi (accno,description) VALUES ('2145', 'OBLIGACIONES GUBERNAMENTALES '); INSERT INTO gifi (accno,description) VALUES ('214505', 'GOBIERNO NACIONAL '); INSERT INTO gifi (accno,description) VALUES ('214510', 'ENTIDADES OFICIALES '); INSERT INTO gifi (accno,description) VALUES ('2195', 'OTRAS OBLIGACIONES '); INSERT INTO gifi (accno,description) VALUES ('219505', 'PARTICULARES '); INSERT INTO gifi (accno,description) VALUES ('219510', 'COMPAŃIAS VINCULADAS '); INSERT INTO gifi (accno,description) VALUES ('219515', 'CASA MATRIZ '); INSERT INTO gifi (accno,description) VALUES ('219520', 'SOCIOS O ACCIONISTAS '); INSERT INTO gifi (accno,description) VALUES ('219525', 'FONDOS Y COOPERATIVAS '); INSERT INTO gifi (accno,description) VALUES ('219595', 'OTRAS '); INSERT INTO gifi (accno,description) VALUES ('22', 'PROVEEDORES '); INSERT INTO gifi (accno,description) VALUES ('2205', 'NACIONALES '); INSERT INTO gifi (accno,description) VALUES ('2210', 'DEL EXTERIOR '); INSERT INTO gifi (accno,description) VALUES ('2215', 'CUENTAS CORRIENTES COMERCIALES '); INSERT INTO gifi (accno,description) VALUES ('2220', 'CASA MATRIZ '); INSERT INTO gifi (accno,description) VALUES ('2225', 'COMPAŃIAS VINCULADAS '); INSERT INTO gifi (accno,description) VALUES ('23', 'CUENTAS POR PAGAR '); INSERT INTO gifi (accno,description) VALUES ('2305', 'CUENTAS CORRIENTES COMERCIALES '); INSERT INTO gifi (accno,description) VALUES ('2310', 'A CASA MATRIZ '); INSERT INTO gifi (accno,description) VALUES ('2315', 'A COMPAŃIAS VINCULADAS '); INSERT INTO gifi (accno,description) VALUES ('2320', 'A CONTRATISTAS '); INSERT INTO gifi (accno,description) VALUES ('2330', 'ORDENES DE COMPRA POR UTILIZAR '); INSERT INTO gifi (accno,description) VALUES ('2335', 'COSTOS Y GASTOS POR PAGAR '); INSERT INTO gifi (accno,description) VALUES ('233505', 'GASTOS FINANCIEROS '); INSERT INTO gifi (accno,description) VALUES ('233510', 'GASTOS LEGALES '); INSERT INTO gifi (accno,description) VALUES ('233515', 'LIBROS, SUSCRIPCIONES, PERIODICOS Y REVISTAS '); INSERT INTO gifi (accno,description) VALUES ('233520', 'COMISIONES '); INSERT INTO gifi (accno,description) VALUES ('233525', 'HONORARIOS '); INSERT INTO gifi (accno,description) VALUES ('233530', 'SERVICIOS TECNICOS '); INSERT INTO gifi (accno,description) VALUES ('233535', 'SERVICIOS DE MANTENIMIENTO '); INSERT INTO gifi (accno,description) VALUES ('233540', 'ARRENDAMIENTOS '); INSERT INTO gifi (accno,description) VALUES ('233545', 'TRANSPORTES, FLETES Y ACARREOS '); INSERT INTO gifi (accno,description) VALUES ('233550', 'SERVICIOS PUBLICOS '); INSERT INTO gifi (accno,description) VALUES ('233555', 'SEGUROS '); INSERT INTO gifi (accno,description) VALUES ('233560', 'GASTOS DE VIAJE '); INSERT INTO gifi (accno,description) VALUES ('233565', 'GASTOS DE REPRESENTACION Y RELACIONES PUBLICAS '); INSERT INTO gifi (accno,description) VALUES ('233570', 'SERVICIOS ADUANEROS '); INSERT INTO gifi (accno,description) VALUES ('233595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('2340', 'INSTALAMENTOS POR PAGAR '); INSERT INTO gifi (accno,description) VALUES ('2345', 'ACREEDORES OFICIALES '); INSERT INTO gifi (accno,description) VALUES ('2350', 'REGALIAS POR PAGAR '); INSERT INTO gifi (accno,description) VALUES ('2355', 'DEUDAS CON ACCIONISTAS O SOCIOS '); INSERT INTO gifi (accno,description) VALUES ('235505', 'ACCIONISTAS '); INSERT INTO gifi (accno,description) VALUES ('235510', 'SOCIOS '); INSERT INTO gifi (accno,description) VALUES ('2360', 'DIVIDENDOS O PARTICIPACIONES POR PAGAR '); INSERT INTO gifi (accno,description) VALUES ('236005', 'DIVIDENDOS '); INSERT INTO gifi (accno,description) VALUES ('236010', 'PARTICIPACIONES '); INSERT INTO gifi (accno,description) VALUES ('2365', 'RETENCION EN LA FUENTE '); INSERT INTO gifi (accno,description) VALUES ('236505', 'SALARIOS Y PAGOS LABORALES '); INSERT INTO gifi (accno,description) VALUES ('236510', 'DIVIDENDOS Y/O PARTICIPACIONES '); INSERT INTO gifi (accno,description) VALUES ('236515', 'HONORARIOS '); INSERT INTO gifi (accno,description) VALUES ('236520', 'COMISIONES '); INSERT INTO gifi (accno,description) VALUES ('236525', 'SERVICIOS '); INSERT INTO gifi (accno,description) VALUES ('236530', 'ARRENDAMIENTOS '); INSERT INTO gifi (accno,description) VALUES ('236535', 'RENDIMIENTOS FINANCIEROS '); INSERT INTO gifi (accno,description) VALUES ('236540', 'COMPRAS '); INSERT INTO gifi (accno,description) VALUES ('236545', 'LOTERIAS, RIFAS, APUESTAS Y SIMILARES '); INSERT INTO gifi (accno,description) VALUES ('236550', 'POR PAGOS AL EXTERIOR '); INSERT INTO gifi (accno,description) VALUES ('236555', 'POR INGRESOS OBTENIDOS EN EL EXTERIOR '); INSERT INTO gifi (accno,description) VALUES ('236560', 'ENAJENACION PROPIEDADES PLANTA Y EQUIPO PERSONAS NATURALES '); INSERT INTO gifi (accno,description) VALUES ('236565', 'POR IMPUESTO DE TIMBRE '); INSERT INTO gifi (accno,description) VALUES ('236570', 'OTRAS RETENCIONES Y PATRIMONIO '); INSERT INTO gifi (accno,description) VALUES ('236575', 'AUTORRETENCIONES '); INSERT INTO gifi (accno,description) VALUES ('2370', 'RETENCIONES Y APORTES DE NOMINA '); INSERT INTO gifi (accno,description) VALUES ('237005', 'APORTES AL I.S.S. '); INSERT INTO gifi (accno,description) VALUES ('237010', 'APORTES AL I.C.B.F., SENA Y CAJAS DE COMPENSACION '); INSERT INTO gifi (accno,description) VALUES ('237015', 'APORTES AL F.I.C. '); INSERT INTO gifi (accno,description) VALUES ('237025', 'EMBARGOS JUDICIALES '); INSERT INTO gifi (accno,description) VALUES ('237030', 'LIBRANZAS '); INSERT INTO gifi (accno,description) VALUES ('237035', 'SINDICATOS '); INSERT INTO gifi (accno,description) VALUES ('237040', 'COOPERATIVAS '); INSERT INTO gifi (accno,description) VALUES ('237045', 'FONDOS '); INSERT INTO gifi (accno,description) VALUES ('237095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('2375', 'CUOTAS POR DEVOLVER '); INSERT INTO gifi (accno,description) VALUES ('2380', 'ACREEDORES VARIOS '); INSERT INTO gifi (accno,description) VALUES ('238005', 'DEPOSITARIOS '); INSERT INTO gifi (accno,description) VALUES ('238010', 'COMISIONISTAS DE BOLSAS '); INSERT INTO gifi (accno,description) VALUES ('238015', 'SOCIEDAD ADMINISTRADORA - FONDOS DE INVERSION '); INSERT INTO gifi (accno,description) VALUES ('238020', 'REINTEGROS POR PAGAR '); INSERT INTO gifi (accno,description) VALUES ('238025', 'FONDO DE PERSEVERANCIA '); INSERT INTO gifi (accno,description) VALUES ('238030', 'FONDOS DE CESANTIAS Y/O PENSIONES '); INSERT INTO gifi (accno,description) VALUES ('238035', 'DONACIONES ASIGNADAS POR PAGAR '); INSERT INTO gifi (accno,description) VALUES ('238095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('24', 'IMPUESTOS, GRAVAMENES Y TASAS '); INSERT INTO gifi (accno,description) VALUES ('2404', 'DE RENTA Y COMPLEMENTARIOS '); INSERT INTO gifi (accno,description) VALUES ('240405', 'VIGENCIA FISCAL CORRIENTE '); INSERT INTO gifi (accno,description) VALUES ('240410', 'VIGENCIAS FISCALES ANTERIORES '); INSERT INTO gifi (accno,description) VALUES ('2408', 'IMPUESTO SOBRE LAS VENTAS POR PAGAR '); INSERT INTO gifi (accno,description) VALUES ('2412', 'DE INDUSTRIA Y COMERCIO '); INSERT INTO gifi (accno,description) VALUES ('241205', 'VIGENCIA FISCAL CORRIENTE '); INSERT INTO gifi (accno,description) VALUES ('241210', 'VIGENCIAS FISCALES ANTERIORES '); INSERT INTO gifi (accno,description) VALUES ('2416', 'A LA PROPIEDAD RAIZ '); INSERT INTO gifi (accno,description) VALUES ('2420', 'DERECHOS SOBRE INSTRUMENTOS PUBLICOS '); INSERT INTO gifi (accno,description) VALUES ('2424', 'DE VALORIZACION '); INSERT INTO gifi (accno,description) VALUES ('242405', 'VIGENCIA FISCAL CORRIENTE '); INSERT INTO gifi (accno,description) VALUES ('242410', 'VIGENCIAS FISCALES ANTERIORES '); INSERT INTO gifi (accno,description) VALUES ('2428', 'DE TURISMO '); INSERT INTO gifi (accno,description) VALUES ('2432', 'TASA POR UTILIZACION DE PUERTOS '); INSERT INTO gifi (accno,description) VALUES ('2436', 'DE VEHICULOS '); INSERT INTO gifi (accno,description) VALUES ('243605', 'VIGENCIA FISCAL CORRIENTE '); INSERT INTO gifi (accno,description) VALUES ('243610', 'VIGENCIAS FISCALES ANTERIORES '); INSERT INTO gifi (accno,description) VALUES ('2440', 'DE ESPECTACULOS PUBLICOS '); INSERT INTO gifi (accno,description) VALUES ('2444', 'DE HIDROCARBUROS Y MINAS '); INSERT INTO gifi (accno,description) VALUES ('244405', 'DE HIDROCARBUROS '); INSERT INTO gifi (accno,description) VALUES ('244410', 'DE MINAS '); INSERT INTO gifi (accno,description) VALUES ('2448', 'REGALIAS E IMPUESTOS A LA PEQUEŃA Y MEDIANA MINERIA '); INSERT INTO gifi (accno,description) VALUES ('2452', 'A LAS EXPORTACIONES CAFETERAS '); INSERT INTO gifi (accno,description) VALUES ('2456', 'A LAS IMPORTACIONES '); INSERT INTO gifi (accno,description) VALUES ('2460', 'CUOTAS DE FOMENTO '); INSERT INTO gifi (accno,description) VALUES ('2464', 'DE LICORES, CERVEZAS Y CIGARRILLOS '); INSERT INTO gifi (accno,description) VALUES ('246405', 'DE LICORES '); INSERT INTO gifi (accno,description) VALUES ('246410', 'DE CERVEZAS '); INSERT INTO gifi (accno,description) VALUES ('246415', 'DE CIGARRILLOS '); INSERT INTO gifi (accno,description) VALUES ('2468', 'AL SACRIFICIO DE GANADO '); INSERT INTO gifi (accno,description) VALUES ('2472', 'AL AZAR Y JUEGOS '); INSERT INTO gifi (accno,description) VALUES ('2476', 'GRAVAMENES Y REGALIAS POR UTILIZACION DEL SUELO '); INSERT INTO gifi (accno,description) VALUES ('2495', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('25', 'OBLIGACIONES LABORALES '); INSERT INTO gifi (accno,description) VALUES ('2505', 'SALARIOS POR PAGAR '); INSERT INTO gifi (accno,description) VALUES ('2510', 'CESANTIAS CONSOLIDADAS '); INSERT INTO gifi (accno,description) VALUES ('251005', 'LEY LABORAL ANTERIOR '); INSERT INTO gifi (accno,description) VALUES ('251010', 'LEY 50 DE 1990 Y NORMAS POSTERIORES '); INSERT INTO gifi (accno,description) VALUES ('2515', 'INTERESES SOBRE CESANTIAS '); INSERT INTO gifi (accno,description) VALUES ('2520', 'PRIMA DE SERVICIOS '); INSERT INTO gifi (accno,description) VALUES ('2525', 'VACACIONES CONSOLIDADAS '); INSERT INTO gifi (accno,description) VALUES ('2530', 'PRESTACIONES EXTRALEGALES '); INSERT INTO gifi (accno,description) VALUES ('253005', 'PRIMAS '); INSERT INTO gifi (accno,description) VALUES ('253010', 'AUXILIOS '); INSERT INTO gifi (accno,description) VALUES ('253015', 'DOTACION Y SUMINISTRO A TRABAJADORES '); INSERT INTO gifi (accno,description) VALUES ('253020', 'BONIFICACIONES '); INSERT INTO gifi (accno,description) VALUES ('253025', 'SEGUROS '); INSERT INTO gifi (accno,description) VALUES ('253095', 'OTRAS '); INSERT INTO gifi (accno,description) VALUES ('2532', 'PENSIONES POR PAGAR '); INSERT INTO gifi (accno,description) VALUES ('2535', 'CUOTAS PARTES PENSIONES DE JUBILACION '); INSERT INTO gifi (accno,description) VALUES ('2540', 'INDEMNIZACIONES LABORALES '); INSERT INTO gifi (accno,description) VALUES ('26', 'PASIVOS ESTIMADOS Y PROVISIONES '); INSERT INTO gifi (accno,description) VALUES ('2605', 'PARA COSTOS Y GASTOS '); INSERT INTO gifi (accno,description) VALUES ('260505', 'INTERESES '); INSERT INTO gifi (accno,description) VALUES ('260510', 'COMISIONES '); INSERT INTO gifi (accno,description) VALUES ('260515', 'HONORARIOS '); INSERT INTO gifi (accno,description) VALUES ('260520', 'SERVICIOS TECNICOS '); INSERT INTO gifi (accno,description) VALUES ('260525', 'TRANSPORTES, FLETES Y ACARREOS '); INSERT INTO gifi (accno,description) VALUES ('260530', 'GASTOS DE VIAJE '); INSERT INTO gifi (accno,description) VALUES ('260535', 'SERVICIOS PUBLICOS '); INSERT INTO gifi (accno,description) VALUES ('260540', 'REGALIAS '); INSERT INTO gifi (accno,description) VALUES ('260545', 'GARANTIAS '); INSERT INTO gifi (accno,description) VALUES ('260550', 'MATERIALES Y REPUESTOS '); INSERT INTO gifi (accno,description) VALUES ('260595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('2610', 'PARA OBLIGACIONES LABORALES '); INSERT INTO gifi (accno,description) VALUES ('261005', 'CESANTIAS '); INSERT INTO gifi (accno,description) VALUES ('261010', 'INTERESES SOBRE CESANTIAS '); INSERT INTO gifi (accno,description) VALUES ('261015', 'VACACIONES '); INSERT INTO gifi (accno,description) VALUES ('261020', 'PRIMA DE SERVICIOS '); INSERT INTO gifi (accno,description) VALUES ('261025', 'PRESTACIONES EXTRALEGALES '); INSERT INTO gifi (accno,description) VALUES ('261030', 'VIATICOS '); INSERT INTO gifi (accno,description) VALUES ('261095', 'OTRAS '); INSERT INTO gifi (accno,description) VALUES ('2615', 'PARA OBLIGACIONES FISCALES '); INSERT INTO gifi (accno,description) VALUES ('261505', 'DE RENTA Y COMPLEMENTARIOS '); INSERT INTO gifi (accno,description) VALUES ('261510', 'DE INDUSTRIA Y COMERCIO '); INSERT INTO gifi (accno,description) VALUES ('261515', 'TASA POR UTILIZACION DE PUERTOS '); INSERT INTO gifi (accno,description) VALUES ('261520', 'DE VEHICULOS '); INSERT INTO gifi (accno,description) VALUES ('261525', 'DE HIDROCARBUROS Y MINAS '); INSERT INTO gifi (accno,description) VALUES ('261595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('2620', 'PENSIONES DE JUBILACION '); INSERT INTO gifi (accno,description) VALUES ('262005', 'CALCULO ACTUARIAL PENSIONES DE JUBILACION '); INSERT INTO gifi (accno,description) VALUES ('262010', 'PENSIONES DE JUBILACION POR AMORTIZAR (DB) '); INSERT INTO gifi (accno,description) VALUES ('2625', 'PARA OBRAS DE URBANISMO '); INSERT INTO gifi (accno,description) VALUES ('262505', 'ACUEDUCTO Y ALCANTARILLADO '); INSERT INTO gifi (accno,description) VALUES ('262510', 'ENERGIA ELECTRICA '); INSERT INTO gifi (accno,description) VALUES ('262515', 'TELEFONOS '); INSERT INTO gifi (accno,description) VALUES ('262595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('2630', 'PARA MANTENIMIENTO Y REPARACIONES '); INSERT INTO gifi (accno,description) VALUES ('263005', 'TERRENOS '); INSERT INTO gifi (accno,description) VALUES ('263010', 'CONSTRUCCIONES Y EDIFICACIONES '); INSERT INTO gifi (accno,description) VALUES ('263015', 'MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('263020', 'EQUIPO DE OFICINA '); INSERT INTO gifi (accno,description) VALUES ('263025', 'EQUIPO DE COMPUTACION Y COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('263030', 'EQUIPO MEDICO - CIENTIFICO '); INSERT INTO gifi (accno,description) VALUES ('263035', 'EQUIPO DE HOTELES Y RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('263040', 'FLOTA Y EQUIPO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('263045', 'FLOTA Y EQUIPO FLUVIAL Y/O MARITIMO '); INSERT INTO gifi (accno,description) VALUES ('263050', 'FLOTA Y EQUIPO AEREO '); INSERT INTO gifi (accno,description) VALUES ('263055', 'FLOTA Y EQUIPO FERREO '); INSERT INTO gifi (accno,description) VALUES ('263060', 'ACUEDUCTOS PLANTAS Y REDES '); INSERT INTO gifi (accno,description) VALUES ('263065', 'ARMAMENTO DE VIGILANCIA '); INSERT INTO gifi (accno,description) VALUES ('263070', 'ENVASES Y EMPAQUES '); INSERT INTO gifi (accno,description) VALUES ('263075', 'PLANTACIONES AGRICOLAS Y FORESTALES '); INSERT INTO gifi (accno,description) VALUES ('263080', 'VIAS DE CUMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('263085', 'POZOS ARTESIANOS '); INSERT INTO gifi (accno,description) VALUES ('263095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('2635', 'PARA CONTINGENCIAS '); INSERT INTO gifi (accno,description) VALUES ('263505', 'MULTAS Y SANCIONES AUTORIDADES ADMINISTRATIVAS '); INSERT INTO gifi (accno,description) VALUES ('263510', 'INTERESES POR MULTAS Y SANCIONES '); INSERT INTO gifi (accno,description) VALUES ('263515', 'RECLAMOS '); INSERT INTO gifi (accno,description) VALUES ('263520', 'LABORALES '); INSERT INTO gifi (accno,description) VALUES ('263525', 'CIVILES '); INSERT INTO gifi (accno,description) VALUES ('263530', 'PENALES '); INSERT INTO gifi (accno,description) VALUES ('263535', 'ADMINISTRATIVOS '); INSERT INTO gifi (accno,description) VALUES ('263540', 'COMERCIALES '); INSERT INTO gifi (accno,description) VALUES ('263595', 'OTRAS '); INSERT INTO gifi (accno,description) VALUES ('2640', 'PARA OBLIGACIONES DE GARANTIAS '); INSERT INTO gifi (accno,description) VALUES ('2695', 'PROVISIONES DIVERSAS '); INSERT INTO gifi (accno,description) VALUES ('269505', 'PARA BENEFICENCIA '); INSERT INTO gifi (accno,description) VALUES ('269510', 'PARA COMUNICACIONES '); INSERT INTO gifi (accno,description) VALUES ('269515', 'PARA PERDIDA EN TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('269520', 'PARA OPERACION '); INSERT INTO gifi (accno,description) VALUES ('269525', 'PARA PROTECCION DE BIENES AGOTABLES '); INSERT INTO gifi (accno,description) VALUES ('269530', 'PARA AJUSTES EN REDENCION DE UNIDADES '); INSERT INTO gifi (accno,description) VALUES ('269535', 'AUTOSEGURO '); INSERT INTO gifi (accno,description) VALUES ('269540', 'PLANES Y PROGRAMAS DE REFORESTACION Y ELECTRIFICACION '); INSERT INTO gifi (accno,description) VALUES ('269595', 'OTRAS '); INSERT INTO gifi (accno,description) VALUES ('27', 'DIFERIDOS '); INSERT INTO gifi (accno,description) VALUES ('2705', 'INGRESOS RECIBIDOS POR ANTICIPADO '); INSERT INTO gifi (accno,description) VALUES ('270505', 'INTERESES '); INSERT INTO gifi (accno,description) VALUES ('270510', 'COMISIONES '); INSERT INTO gifi (accno,description) VALUES ('270515', 'ARRENDAMIENTOS '); INSERT INTO gifi (accno,description) VALUES ('270520', 'HONORARIOS '); INSERT INTO gifi (accno,description) VALUES ('270525', 'SERVICIOS TECNICOS '); INSERT INTO gifi (accno,description) VALUES ('270530', 'DE SUSCRIPTORES '); INSERT INTO gifi (accno,description) VALUES ('270535', 'TRANSPORTES, FLETES Y ACARREOS '); INSERT INTO gifi (accno,description) VALUES ('270540', 'MERCANCIA EN TRANSITO YA VENDIDA '); INSERT INTO gifi (accno,description) VALUES ('270545', 'MATRICULAS Y PENSIONES '); INSERT INTO gifi (accno,description) VALUES ('270550', 'CUOTAS DE ADMINISTRACION '); INSERT INTO gifi (accno,description) VALUES ('270595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('2710', 'ABONOS DIFERIDOS '); INSERT INTO gifi (accno,description) VALUES ('271005', 'REAJUSTE DEL SISTEMA '); INSERT INTO gifi (accno,description) VALUES ('2715', 'UTILIDAD DIFERIDA EN VENTAS A PLAZOS '); INSERT INTO gifi (accno,description) VALUES ('2720', 'CREDITO POR CORRECCION MONETARIA DIFERIDA '); INSERT INTO gifi (accno,description) VALUES ('2725', 'IMPUESTOS DIFERIDOS '); INSERT INTO gifi (accno,description) VALUES ('272505', 'POR DEPRECIACION FLEXIBLE '); INSERT INTO gifi (accno,description) VALUES ('272595', 'DIVERSOS '); INSERT INTO gifi (accno,description) VALUES ('272599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('28', 'OTROS PASIVOS '); INSERT INTO gifi (accno,description) VALUES ('2805', 'ANTICIPOS Y AVANCES RECIBIDOS '); INSERT INTO gifi (accno,description) VALUES ('280505', 'DE CLIENTES '); INSERT INTO gifi (accno,description) VALUES ('280510', 'SOBRE CONTRATOS '); INSERT INTO gifi (accno,description) VALUES ('280515', 'PARA OBRAS EN PROCESO '); INSERT INTO gifi (accno,description) VALUES ('280595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('2810', 'DEPOSITOS RECIBIDOS '); INSERT INTO gifi (accno,description) VALUES ('281005', 'PARA FUTURA SUSCRIPCION DE ACCIONES '); INSERT INTO gifi (accno,description) VALUES ('281010', 'PARA FUTURO PAGO DE CUOTAS O DERECHOS SOCIALES '); INSERT INTO gifi (accno,description) VALUES ('281015', 'PARA GARANTIA EN LA PRESTACION DE SERVICIOS '); INSERT INTO gifi (accno,description) VALUES ('281020', 'PARA GARANTIA DE CONTRATOS '); INSERT INTO gifi (accno,description) VALUES ('281025', 'DE LICITACIONES '); INSERT INTO gifi (accno,description) VALUES ('281030', 'DE MANEJO DE BIENES '); INSERT INTO gifi (accno,description) VALUES ('281035', 'FONDO DE RESERVA '); INSERT INTO gifi (accno,description) VALUES ('281095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('2815', 'INGRESOS RECIBIDOS PARA TERCEROS '); INSERT INTO gifi (accno,description) VALUES ('281505', 'VALORES RECIBIDOS PARA TERCEROS '); INSERT INTO gifi (accno,description) VALUES ('281510', 'VENTA POR CUENTA DE TERCEROS '); INSERT INTO gifi (accno,description) VALUES ('2820', 'CUENTAS DE OPERACION CONJUNTA '); INSERT INTO gifi (accno,description) VALUES ('2825', 'RETENCIONES A TERCEROS SOBRE CONTRATOS '); INSERT INTO gifi (accno,description) VALUES ('282505', 'CUMPLIMIENTO OBLIGACIONES LABORALES '); INSERT INTO gifi (accno,description) VALUES ('282510', 'PARA ESTABILIDAD DE OBRA '); INSERT INTO gifi (accno,description) VALUES ('282515', 'GARANTIA CUMPLIMIENTO DE CONTRATOS '); INSERT INTO gifi (accno,description) VALUES ('2830', 'EMBARGOS JUDICIALES '); INSERT INTO gifi (accno,description) VALUES ('283005', 'INDEMNIZACIONES '); INSERT INTO gifi (accno,description) VALUES ('283010', 'DEPOSITOS JUDICIALES '); INSERT INTO gifi (accno,description) VALUES ('2835', 'ACREEDORES DEL SISTEMA '); INSERT INTO gifi (accno,description) VALUES ('283505', 'CUOTAS NETAS '); INSERT INTO gifi (accno,description) VALUES ('283510', 'GRUPOS EN FORMACION '); INSERT INTO gifi (accno,description) VALUES ('2840', 'CUENTAS EN PARTICIPACION '); INSERT INTO gifi (accno,description) VALUES ('2895', 'DIVERSOS '); INSERT INTO gifi (accno,description) VALUES ('289505', 'PRESTAMOS DE PRODUCTOS '); INSERT INTO gifi (accno,description) VALUES ('289510', 'REEMBOLSO DE COSTOS EXPLORATORIOS '); INSERT INTO gifi (accno,description) VALUES ('289515', 'PROGRAMA DE EXTENSION AGROPECUARIA '); INSERT INTO gifi (accno,description) VALUES ('29', 'BONOS Y PAPELES COMERCIALES '); INSERT INTO gifi (accno,description) VALUES ('2905', 'BONOS EN CIRCULACION '); INSERT INTO gifi (accno,description) VALUES ('290505', 'GARANTIA GENERAL '); INSERT INTO gifi (accno,description) VALUES ('290510', 'GARANTIA ESPECIFICA '); INSERT INTO gifi (accno,description) VALUES ('2910', 'BONOS OBLIGATORIAMENTE CONVERTIBLES EN ACCIONES '); INSERT INTO gifi (accno,description) VALUES ('2915', 'PAPELES COMERCIALES '); INSERT INTO gifi (accno,description) VALUES ('3', 'PATRIMONIO '); INSERT INTO gifi (accno,description) VALUES ('31', 'CAPITAL SOCIAL '); INSERT INTO gifi (accno,description) VALUES ('3105', 'CAPITAL SUSCRITO Y PAGADO '); INSERT INTO gifi (accno,description) VALUES ('310505', 'CAPITAL AUTORIZADO '); INSERT INTO gifi (accno,description) VALUES ('310510', 'CAPITAL POR SUSCRIBIR (DB) '); INSERT INTO gifi (accno,description) VALUES ('310515', 'CAPITAL SUSCRITO POR COBRAR (DB) '); INSERT INTO gifi (accno,description) VALUES ('3110', 'ACCIONES, CUOTAS O PARTES DE INTERES SOCIAL PROPIAS READQUIRIDAS (DB) '); INSERT INTO gifi (accno,description) VALUES ('311005', 'ACCIONES PROPIAS READQUIRIDAS (DB) '); INSERT INTO gifi (accno,description) VALUES ('311010', 'CUOTAS O PARTES DE INTERES SOCIAL PROPIAS READQUIRIDAS (DB) '); INSERT INTO gifi (accno,description) VALUES ('3115', 'APORTES SOCIALES '); INSERT INTO gifi (accno,description) VALUES ('311505', 'CUOTAS O PARTES DE INTERES SOCIAL '); INSERT INTO gifi (accno,description) VALUES ('311510', 'APORTES DE SOCIOS - FONDO MUTUO DE INVERSION '); INSERT INTO gifi (accno,description) VALUES ('311515', 'CONTRIBUCION DE LA EMPRESA - FONDO MUTUO DE INVERSION '); INSERT INTO gifi (accno,description) VALUES ('311520', 'SUSCRIPCIONES DEL PUBLICO '); INSERT INTO gifi (accno,description) VALUES ('3120', 'CAPITAL ASIGNADO '); INSERT INTO gifi (accno,description) VALUES ('3125', 'INVERSION SUPLEMENTARIA AL CAPITAL ASIGNADO '); INSERT INTO gifi (accno,description) VALUES ('3130', 'CAPITAL DE PERSONAS NATURALES '); INSERT INTO gifi (accno,description) VALUES ('3135', 'APORTES DEL ESTADO '); INSERT INTO gifi (accno,description) VALUES ('3140', 'FONDO SOCIAL '); INSERT INTO gifi (accno,description) VALUES ('32', 'SUPERAVIT DE CAPITAL '); INSERT INTO gifi (accno,description) VALUES ('3205', 'PRIMA EN COLOCACION DE ACCIONES, CUOTAS O PARTES DE INTERES SOCIAL '); INSERT INTO gifi (accno,description) VALUES ('320505', 'PRIMA EN COLOCACION DE ACCIONES '); INSERT INTO gifi (accno,description) VALUES ('320510', 'PRIMA EN COLOCACION DE ACCIONES POR COBRAR (DB) '); INSERT INTO gifi (accno,description) VALUES ('320515', 'PRIMA EN COLOCACION DE CUOTAS O PARTES DE INTERES SOCIAL '); INSERT INTO gifi (accno,description) VALUES ('3210', 'DONACIONES '); INSERT INTO gifi (accno,description) VALUES ('321005', 'EN DINERO '); INSERT INTO gifi (accno,description) VALUES ('321010', 'EN VALORES MOBILIARIOS '); INSERT INTO gifi (accno,description) VALUES ('321015', 'EN BIENES MUEBLES '); INSERT INTO gifi (accno,description) VALUES ('321020', 'EN BIENES INMUEBLES '); INSERT INTO gifi (accno,description) VALUES ('321025', 'EN INTANGIBLES '); INSERT INTO gifi (accno,description) VALUES ('3215', 'CREDITO MERCANTIL '); INSERT INTO gifi (accno,description) VALUES ('33', 'RESERVAS '); INSERT INTO gifi (accno,description) VALUES ('3305', 'RESERVAS OBLIGATORIAS '); INSERT INTO gifi (accno,description) VALUES ('330505', 'RESERVA LEGAL '); INSERT INTO gifi (accno,description) VALUES ('330510', 'RESERVAS POR DISPOSICIONES FISCALES '); INSERT INTO gifi (accno,description) VALUES ('330515', 'RESERVA PARA READQUISICION DE ACCIONES '); INSERT INTO gifi (accno,description) VALUES ('330517', 'RESERVA PARA READQUISICION DE CUOTAS O PARTES DE INTERES SOCIAL '); INSERT INTO gifi (accno,description) VALUES ('330520', 'RESERVA PARA EXTENSION AGROPECUARIA '); INSERT INTO gifi (accno,description) VALUES ('330525', 'RESERVA LEY 7a. DE 1990 '); INSERT INTO gifi (accno,description) VALUES ('330530', 'RESERVA PARA REPOSICION DE SEMOVIENTES '); INSERT INTO gifi (accno,description) VALUES ('330535', 'RESERVA LEY 4a DE 1980 '); INSERT INTO gifi (accno,description) VALUES ('330595', 'OTRAS '); INSERT INTO gifi (accno,description) VALUES ('3310', 'RESERVAS ESTATUTARIAS '); INSERT INTO gifi (accno,description) VALUES ('331005', 'PARA FUTURAS CAPITALIZACIONES '); INSERT INTO gifi (accno,description) VALUES ('331010', 'PARA REPOSICION DE ACTIVOS '); INSERT INTO gifi (accno,description) VALUES ('331015', 'PARA FUTUROS ENSANCHES '); INSERT INTO gifi (accno,description) VALUES ('331095', 'OTRAS '); INSERT INTO gifi (accno,description) VALUES ('3315', 'RESERVAS OCASIONALES '); INSERT INTO gifi (accno,description) VALUES ('331505', 'PARA BENEFICENCIA Y CIVISMO '); INSERT INTO gifi (accno,description) VALUES ('331510', 'PARA FUTURAS CAPITALIZACIONES '); INSERT INTO gifi (accno,description) VALUES ('331515', 'PARA FUTUROS ENSANCHES '); INSERT INTO gifi (accno,description) VALUES ('331520', 'PARA ADQUISICION O REPOSICION DE PROPIEDADES PLANTA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('331525', 'PARA INVESTIGACIONES Y DESARROLLO '); INSERT INTO gifi (accno,description) VALUES ('331530', 'PARA FOMENTO ECONOMICO '); INSERT INTO gifi (accno,description) VALUES ('331535', 'PARA CAPITAL DE TRABAJO '); INSERT INTO gifi (accno,description) VALUES ('331540', 'PARA ESTABILIZACION DE RENDIMIENTOS '); INSERT INTO gifi (accno,description) VALUES ('331545', 'A DISPOSICION DEL MAXIMO ORGANO SOCIAL '); INSERT INTO gifi (accno,description) VALUES ('331595', 'OTRAS '); INSERT INTO gifi (accno,description) VALUES ('34', 'REVALORIZACION DEL PATRIMONIO '); INSERT INTO gifi (accno,description) VALUES ('3405', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('340505', 'DE CAPITAL SOCIAL '); INSERT INTO gifi (accno,description) VALUES ('340510', 'DE SUPERAVIT DE CAPITAL '); INSERT INTO gifi (accno,description) VALUES ('340515', 'DE RESERVAS '); INSERT INTO gifi (accno,description) VALUES ('340520', 'DE RESULTADOS DE EJERCICIOS ANTERIORES '); INSERT INTO gifi (accno,description) VALUES ('340525', 'DE ACTIVOS EN PERIODO IMPRODUCTIVO '); INSERT INTO gifi (accno,description) VALUES ('3410', 'SANEAMIENTO FISCAL '); INSERT INTO gifi (accno,description) VALUES ('3415', 'AJUSTES POR INFLACION DECRETO 3019 DE 1989 '); INSERT INTO gifi (accno,description) VALUES ('35', 'DIVIDENDOS O PARTICIPACIONES DECRETADOS EN ACCIONES, CUOTAS O PARTES DE INTERES SOCIAL '); INSERT INTO gifi (accno,description) VALUES ('3505', 'DIVIDENDOS DECRETADOS EN ACCIONES '); INSERT INTO gifi (accno,description) VALUES ('3510', 'PARTICIPACIONES DECRETADAS EN CUOTAS O PARTES DE INTERES SOCIAL '); INSERT INTO gifi (accno,description) VALUES ('36', 'RESULTADOS DEL EJERCICIO '); INSERT INTO gifi (accno,description) VALUES ('3605', 'UTILIDAD DEL EJERCICIO '); INSERT INTO gifi (accno,description) VALUES ('360505', 'UTILIDAD DEL EJERCICIO '); INSERT INTO gifi (accno,description) VALUES ('360510', 'UTILIDAD POR EXPOSICION A LA INFLACION '); INSERT INTO gifi (accno,description) VALUES ('3610', 'PERDIDA DEL EJERCICIO '); INSERT INTO gifi (accno,description) VALUES ('361005', 'PERDIDA DEL EJERCICIO '); INSERT INTO gifi (accno,description) VALUES ('361010', 'PERDIDA POR EXPOSICION A LA INFLACION '); INSERT INTO gifi (accno,description) VALUES ('37', 'RESULTADOS DE EJERCICIOS ANTERIORES '); INSERT INTO gifi (accno,description) VALUES ('3705', 'UTILIDADES O EXCEDENTES ACUMULADOS '); INSERT INTO gifi (accno,description) VALUES ('3710', 'PERDIDAS ACUMULADAS '); INSERT INTO gifi (accno,description) VALUES ('38', 'SUPERAVIT POR VALORIZACIONES '); INSERT INTO gifi (accno,description) VALUES ('3805', 'DE INVERSIONES '); INSERT INTO gifi (accno,description) VALUES ('380505', 'ACCIONES '); INSERT INTO gifi (accno,description) VALUES ('380510', 'CUOTAS O PARTES DE INTERES SOCIAL '); INSERT INTO gifi (accno,description) VALUES ('380515', 'DERECHOS FIDUCIARIOS '); INSERT INTO gifi (accno,description) VALUES ('3810', 'DE PROPIEDADES PLANTA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('381004', 'TERRENOS '); INSERT INTO gifi (accno,description) VALUES ('381006', 'MATERIALES PROYECTOS PETROLEROS '); INSERT INTO gifi (accno,description) VALUES ('381008', 'CONSTRUCCIONES Y EDIFICACIONES '); INSERT INTO gifi (accno,description) VALUES ('381012', 'MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('381016', 'EQUIPO DE OFICINA '); INSERT INTO gifi (accno,description) VALUES ('381020', 'EQUIPO DE COMPUTACION Y COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('381024', 'EQUIPO MEDICO CIENTIFICO '); INSERT INTO gifi (accno,description) VALUES ('381028', 'EQUIPO DE HOTELES Y RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('381032', 'FLOTA Y EQUIPO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('381036', 'FLOTA Y EQUIPO FLUVIAL Y/O MARITIMO '); INSERT INTO gifi (accno,description) VALUES ('381040', 'FLOTA Y EQUIPO AEREO '); INSERT INTO gifi (accno,description) VALUES ('381044', 'FLOTA Y EQUIPO FERREO '); INSERT INTO gifi (accno,description) VALUES ('381048', 'ACUEDUCTOS PLANTAS Y REDES '); INSERT INTO gifi (accno,description) VALUES ('381052', 'ARMAMENTO DE VIGILANCIA '); INSERT INTO gifi (accno,description) VALUES ('381056', 'ENVASES Y EMPAQUES '); INSERT INTO gifi (accno,description) VALUES ('381060', 'PLANTACIONES AGRICOLAS Y FORESTALES '); INSERT INTO gifi (accno,description) VALUES ('381064', 'VIAS DE COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('381068', 'MINAS Y CANTERAS '); INSERT INTO gifi (accno,description) VALUES ('381072', 'POZOS ARTESIANOS '); INSERT INTO gifi (accno,description) VALUES ('381076', 'YACIMIENTOS '); INSERT INTO gifi (accno,description) VALUES ('381080', 'SEMOVIENTES '); INSERT INTO gifi (accno,description) VALUES ('3895', 'DE OTROS ACTIVOS '); INSERT INTO gifi (accno,description) VALUES ('389505', 'BIENES DE ARTE Y CULTURA '); INSERT INTO gifi (accno,description) VALUES ('389510', 'BIENES ENTREGADOS EN COMODATO '); INSERT INTO gifi (accno,description) VALUES ('389515', 'BIENES RECIBIDOS EN PAGO '); INSERT INTO gifi (accno,description) VALUES ('389520', 'INVENTARIO DE SEMOVIENTES '); INSERT INTO gifi (accno,description) VALUES ('4', 'INGRESOS '); INSERT INTO gifi (accno,description) VALUES ('41', 'OPERACIONALES '); INSERT INTO gifi (accno,description) VALUES ('4105', 'AGRICULTURA, GANADERIA, CAZA Y SILVICULTURA '); INSERT INTO gifi (accno,description) VALUES ('410505', 'CULTIVO DE CEREALES '); INSERT INTO gifi (accno,description) VALUES ('410510', 'CULTIVOS DE HORTALIZAS, LEGUMBRES Y PLANTAS ORNAMENTALES '); INSERT INTO gifi (accno,description) VALUES ('410515', 'CULTIVOS DE FRUTAS, NUECES Y PLANTAS AROMATICAS '); INSERT INTO gifi (accno,description) VALUES ('410520', 'CULTIVO DE CAFE '); INSERT INTO gifi (accno,description) VALUES ('410525', 'CULTIVO DE FLORES '); INSERT INTO gifi (accno,description) VALUES ('410530', 'CULTIVO DE CAŃA DE AZUCAR '); INSERT INTO gifi (accno,description) VALUES ('410535', 'CULTIVO DE ALGODON Y PLANTAS PARA MATERIAL TEXTIL '); INSERT INTO gifi (accno,description) VALUES ('410540', 'CULTIVO DE BANANO '); INSERT INTO gifi (accno,description) VALUES ('410545', 'OTROS CULTIVOS AGRICOLAS '); INSERT INTO gifi (accno,description) VALUES ('410550', 'CRIA DE OVEJAS, CABRAS, ASNOS, MULAS Y BURDEGANOS '); INSERT INTO gifi (accno,description) VALUES ('410555', 'CRIA DE GANADO CABALLAR Y VACUNO. '); INSERT INTO gifi (accno,description) VALUES ('410560', 'PRODUCCION AVICOLA '); INSERT INTO gifi (accno,description) VALUES ('410565', 'CRIA DE OTROS ANIMALES '); INSERT INTO gifi (accno,description) VALUES ('410570', 'SERVICIOS AGRICOLAS Y GANADEROS '); INSERT INTO gifi (accno,description) VALUES ('410575', 'ACTIVIDAD DE CAZA '); INSERT INTO gifi (accno,description) VALUES ('410580', 'ACTIVIDAD DE SILVICULTURA '); INSERT INTO gifi (accno,description) VALUES ('410599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4110', 'PESCA '); INSERT INTO gifi (accno,description) VALUES ('411005', 'ACTIVIDAD DE PESCA '); INSERT INTO gifi (accno,description) VALUES ('411010', 'EXPLOTACION DE CRIADEROS DE PECES '); INSERT INTO gifi (accno,description) VALUES ('411095', 'ACTIVIDADES CONEXAS '); INSERT INTO gifi (accno,description) VALUES ('411099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4115', 'EXPLOTACION DE MINAS Y CANTERAS '); INSERT INTO gifi (accno,description) VALUES ('411505', 'CARBON '); INSERT INTO gifi (accno,description) VALUES ('411510', 'PETROLEO CRUDO '); INSERT INTO gifi (accno,description) VALUES ('411512', 'GAS NATURAL '); INSERT INTO gifi (accno,description) VALUES ('411514', 'SERVICIOS RELACIONADOS CON EXTRACCION DE PETROLEO Y GAS '); INSERT INTO gifi (accno,description) VALUES ('411515', 'MINERALES DE HIERRO '); INSERT INTO gifi (accno,description) VALUES ('411520', 'MINERALES METALIFEROS NO FERROSOS '); INSERT INTO gifi (accno,description) VALUES ('411525', 'PIEDRA, ARENA Y ARCILLA '); INSERT INTO gifi (accno,description) VALUES ('411527', 'PIEDRAS PRECIOSAS '); INSERT INTO gifi (accno,description) VALUES ('411528', 'ORO '); INSERT INTO gifi (accno,description) VALUES ('411530', 'OTRAS MINAS Y CANTERAS '); INSERT INTO gifi (accno,description) VALUES ('411532', 'PRESTACION DE SERVICIOS SECTOR MINERO '); INSERT INTO gifi (accno,description) VALUES ('411595', 'ACTIVIDADES CONEXAS '); INSERT INTO gifi (accno,description) VALUES ('411599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4120', 'INDUSTRIAS MANUFACTURERAS '); INSERT INTO gifi (accno,description) VALUES ('412001', 'PRODUCCION Y PROCESAMIENTO DE CARNES Y PRODUCTOS CARNICOS '); INSERT INTO gifi (accno,description) VALUES ('412002', 'PRODUCTOS DE PESCADO '); INSERT INTO gifi (accno,description) VALUES ('412003', 'PRODUCTOS DE FRUTAS, LEGUMBRES Y HORTALIZAS '); INSERT INTO gifi (accno,description) VALUES ('412004', 'ELABORACION DE ACEITES Y GRASAS '); INSERT INTO gifi (accno,description) VALUES ('412005', 'ELABORACION DE PRODUCTOS LACTEOS '); INSERT INTO gifi (accno,description) VALUES ('412006', 'ELABORACION DE PRODUCTOS DE MOLINERIA '); INSERT INTO gifi (accno,description) VALUES ('412007', 'ELABORACION DE ALMIDONES Y DERIVADOS '); INSERT INTO gifi (accno,description) VALUES ('412008', 'ELABORACION DE ALIMENTOS PARA ANIMALES '); INSERT INTO gifi (accno,description) VALUES ('412009', 'ELABORACION DE PRODUCTOS PARA PANADERIA '); INSERT INTO gifi (accno,description) VALUES ('412010', 'ELABORACION DE AZUCAR Y MELAZAS '); INSERT INTO gifi (accno,description) VALUES ('412011', 'ELABORACION DE CACAO, CHOCOLATE Y CONFITERIA '); INSERT INTO gifi (accno,description) VALUES ('412012', 'ELABORACION DE PASTAS Y PRODUCTOS FARINACEOS '); INSERT INTO gifi (accno,description) VALUES ('412013', 'ELABORACION DE PRODUCTOS DE CAFE '); INSERT INTO gifi (accno,description) VALUES ('412014', 'ELABORACION DE OTROS PRODUCTOS ALIMENTICIOS '); INSERT INTO gifi (accno,description) VALUES ('412015', 'ELABORACION DE BEBIDAS ALCOHOLICAS Y ALCOHOL ETILICO '); INSERT INTO gifi (accno,description) VALUES ('412016', 'ELABORACION DE VINOS '); INSERT INTO gifi (accno,description) VALUES ('412017', 'ELABORACION DE BEBIDAS MALTEADAS Y DE MALTA '); INSERT INTO gifi (accno,description) VALUES ('412018', 'ELABORACION DE BEBIDAS NO ALCOHOLICAS '); INSERT INTO gifi (accno,description) VALUES ('412019', 'ELABORACION DE PRODUCTOS DE TABACO '); INSERT INTO gifi (accno,description) VALUES ('412020', 'PREPARACION E HILATURA DE FIBRAS TEXTILES Y TEJEDURIA '); INSERT INTO gifi (accno,description) VALUES ('412021', 'ACABADO DE PRODUCTOS TEXTILES '); INSERT INTO gifi (accno,description) VALUES ('412022', 'ELABORACION DE ARTICULOS DE MATERIALES TEXTILES '); INSERT INTO gifi (accno,description) VALUES ('412023', 'ELABORACION DE TAPICES Y ALFOMBRAS '); INSERT INTO gifi (accno,description) VALUES ('412024', 'ELABORACION DE CUERDAS, CORDELES, BRAMANTES Y REDES '); INSERT INTO gifi (accno,description) VALUES ('412025', 'ELABORACION DE OTROS PRODUCTOS TEXTILES '); INSERT INTO gifi (accno,description) VALUES ('412026', 'ELABORACION DE TEJIDOS '); INSERT INTO gifi (accno,description) VALUES ('412027', 'ELABORACION DE PRENDAS DE VESTIR '); INSERT INTO gifi (accno,description) VALUES ('412028', 'PREPARACION, ADOBO Y TEŃIDO DE PIELES '); INSERT INTO gifi (accno,description) VALUES ('412029', 'CURTIDO, ADOBO O PREPARACION DE CUERO '); INSERT INTO gifi (accno,description) VALUES ('412030', 'ELABORACION DE MALETAS, BOLSOS Y SIMILARES '); INSERT INTO gifi (accno,description) VALUES ('412031', 'ELABORACION DE CALZADO '); INSERT INTO gifi (accno,description) VALUES ('412032', 'PRODUCCION DE MADERA, ARTICULOS DE MADERA Y CORCHO '); INSERT INTO gifi (accno,description) VALUES ('412033', 'ELABORACION DE PASTA Y PRODUCTOS DE MADERA, PAPEL Y CARTON '); INSERT INTO gifi (accno,description) VALUES ('412034', 'EDICIONES Y PUBLICACIONES '); INSERT INTO gifi (accno,description) VALUES ('412035', 'IMPRESION '); INSERT INTO gifi (accno,description) VALUES ('412036', 'SERVICIOS RELACIONADOS CON LA EDICION Y LA IMPRESION '); INSERT INTO gifi (accno,description) VALUES ('412037', 'REPRODUCCION DE GRABACIONES '); INSERT INTO gifi (accno,description) VALUES ('412038', 'ELABORACION DE PRODUCTOS DE HORNO DE COQUE '); INSERT INTO gifi (accno,description) VALUES ('412039', 'ELABORACION DE PRODUCTOS DE LA REFINACION DE PETROLEO '); INSERT INTO gifi (accno,description) VALUES ('412040', 'ELABORACION DE SUSTANCIAS QUIMICAS BASICAS '); INSERT INTO gifi (accno,description) VALUES ('412041', 'ELABORACION DE ABONOS Y COMPUESTOS DE NITROGENO '); INSERT INTO gifi (accno,description) VALUES ('412042', 'ELABORACION DE PLASTICO Y CAUCHO SINTETICO '); INSERT INTO gifi (accno,description) VALUES ('412043', 'ELABORACION DE PRODUCTOS QUIMICOS DE USO AGROPECUARIO '); INSERT INTO gifi (accno,description) VALUES ('412044', 'ELABORACION DE PINTURAS, TINTAS Y MASILLAS '); INSERT INTO gifi (accno,description) VALUES ('412045', 'ELABORACION DE PRODUCTOS FARMACEUTICOS Y BOTANICOS '); INSERT INTO gifi (accno,description) VALUES ('412046', 'ELABORACION DE JABONES, DETERGENTES Y PREPARADOS DE TOCADOR '); INSERT INTO gifi (accno,description) VALUES ('412047', 'ELABORACION DE OTROS PRODUCTOS QUIMICOS '); INSERT INTO gifi (accno,description) VALUES ('412048', 'ELABORACION DE FIBRAS '); INSERT INTO gifi (accno,description) VALUES ('412049', 'ELABORACION DE OTROS PRODUCTOS DE CAUCHO '); INSERT INTO gifi (accno,description) VALUES ('412050', 'ELABORACION DE PRODUCTOS DE PLASTICO '); INSERT INTO gifi (accno,description) VALUES ('412051', 'ELABORACION DE VIDRIO Y PRODUCTOS DE VIDRIO '); INSERT INTO gifi (accno,description) VALUES ('412052', 'ELABORACION DE PRODUCTOS DE CERAMICA, LOZA, PIEDRA, ARCILLA Y PORCELANA '); INSERT INTO gifi (accno,description) VALUES ('412053', 'ELABORACION DE CEMENTO, CAL Y YESO '); INSERT INTO gifi (accno,description) VALUES ('412054', 'ELABORACION DE ARTICULOS DE HORMIGON, CEMENTO Y YESO '); INSERT INTO gifi (accno,description) VALUES ('412055', 'CORTE, TALLADO Y ACABADO DE LA PIEDRA '); INSERT INTO gifi (accno,description) VALUES ('412056', 'ELABORACION DE OTROS PRODUCTOS MINERALES NO METALICOS '); INSERT INTO gifi (accno,description) VALUES ('412057', 'INDUSTRIAS BASICAS Y FUNDICION DE HIERRO Y ACERO '); INSERT INTO gifi (accno,description) VALUES ('412058', 'PRODUCTOS PRIMARIOS DE METALES PRECIOSOS Y DE METALES NO FERROSOS '); INSERT INTO gifi (accno,description) VALUES ('412059', 'FUNDICION DE METALES NO FERROSOS '); INSERT INTO gifi (accno,description) VALUES ('412060', 'FABRICACION DE PRODUCTOS METALICOS PARA USO ESTRUCTURAL '); INSERT INTO gifi (accno,description) VALUES ('412061', 'FORJA, PRENSADO, ESTAMPADO, LAMINADO DE METAL Y PULVIMETALURGIA '); INSERT INTO gifi (accno,description) VALUES ('412062', 'REVESTIMIENTO DE METALES Y OBRAS DE INGENIERIA MECANICA '); INSERT INTO gifi (accno,description) VALUES ('412063', 'FABRICACION DE ARTICULOS DE FERRETERIA '); INSERT INTO gifi (accno,description) VALUES ('412064', 'ELABORACION DE OTROS PRODUCTOS DE METAL '); INSERT INTO gifi (accno,description) VALUES ('412065', 'FABRICACION DE MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('412066', 'FABRICACION DE EQUIPOS DE ELEVACION Y MANIPULACION '); INSERT INTO gifi (accno,description) VALUES ('412067', 'ELABORACION DE APARATOS DE USO DOMESTICO '); INSERT INTO gifi (accno,description) VALUES ('412068', 'ELABORACION DE EQUIPO DE OFICINA '); INSERT INTO gifi (accno,description) VALUES ('412069', 'ELABORACION DE PILAS Y BATERIAS PRIMARIAS '); INSERT INTO gifi (accno,description) VALUES ('412070', 'ELABORACION DE EQUIPO DE ILUMINACION '); INSERT INTO gifi (accno,description) VALUES ('412071', 'ELABORACION DE OTROS TIPOS DE EQUIPO ELECTRICO '); INSERT INTO gifi (accno,description) VALUES ('412072', 'FABRICACION DE EQUIPOS DE RADIO, TELEVISION Y COMUNICACIONES '); INSERT INTO gifi (accno,description) VALUES ('412073', 'FABRICACION DE APARATOS E INSTRUMENTOS MEDICOS '); INSERT INTO gifi (accno,description) VALUES ('412074', 'FABRICACION DE INSTRUMENTOS DE MEDICION Y CONTROL '); INSERT INTO gifi (accno,description) VALUES ('412075', 'FABRICACION DE INSTRUMENTOS DE OPTICA Y EQUIPO FOTOGRAFICO '); INSERT INTO gifi (accno,description) VALUES ('412076', 'FABRICACION DE RELOJES '); INSERT INTO gifi (accno,description) VALUES ('412077', 'FABRICACION DE VEHICULOS AUTOMOTORES '); INSERT INTO gifi (accno,description) VALUES ('412078', 'FABRICACION DE CARROCERIAS PARA AUTOMOTORES '); INSERT INTO gifi (accno,description) VALUES ('412079', 'FABRICACION DE PARTES PIEZAS Y ACCESORIOS PARA AUTOMOTORES '); INSERT INTO gifi (accno,description) VALUES ('412080', 'FABRICACION Y REPARACION DE BUQUES Y OTRAS EMBARCACIONES '); INSERT INTO gifi (accno,description) VALUES ('412081', 'FABRICACION DE LOCOMOTORAS Y MATERIAL RODANTE PARA FERROCARRILES '); INSERT INTO gifi (accno,description) VALUES ('412082', 'FABRICACION DE AERONAVES '); INSERT INTO gifi (accno,description) VALUES ('412083', 'FABRICACION DE MOTOCICLETAS '); INSERT INTO gifi (accno,description) VALUES ('412084', 'FABRICACION DE BICICLETAS Y SILLAS DE RUEDAS '); INSERT INTO gifi (accno,description) VALUES ('412085', 'FABRICACION DE OTROS TIPOS DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('412086', 'FABRICACION DE MUEBLES '); INSERT INTO gifi (accno,description) VALUES ('412087', 'FABRICACION DE JOYAS Y ARTICULOS CONEXOS '); INSERT INTO gifi (accno,description) VALUES ('412088', 'FABRICACION DE INSTRUMENTOS DE MUSICA '); INSERT INTO gifi (accno,description) VALUES ('412089', 'FABRICACION DE ARTICULOS Y EQUIPO PARA DEPORTE '); INSERT INTO gifi (accno,description) VALUES ('412090', 'FABRICACION DE JUEGOS Y JUGUETES '); INSERT INTO gifi (accno,description) VALUES ('412091', 'RECICLAMIENTO DE DESPERDICIOS '); INSERT INTO gifi (accno,description) VALUES ('412095', 'PRODUCTOS DE OTRAS INDUSTRIAS MANUFACTURERAS '); INSERT INTO gifi (accno,description) VALUES ('412099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4125', 'SUMINISTRO DE ELECTRICIDAD, GAS Y AGUA '); INSERT INTO gifi (accno,description) VALUES ('412505', 'GENERACION, CAPTACION Y DISTRIBUCION DE ENERGIA ELECTRICA '); INSERT INTO gifi (accno,description) VALUES ('412510', 'FABRICACION DE GAS Y DISTRIBUCION DE COMBUSTIBLES GASEOSOS '); INSERT INTO gifi (accno,description) VALUES ('412515', 'CAPTACION, DEPURACION Y DISTRIBUCION DE AGUA '); INSERT INTO gifi (accno,description) VALUES ('412595', 'ACTIVIDADES CONEXAS '); INSERT INTO gifi (accno,description) VALUES ('412599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4130', 'CONSTRUCCION '); INSERT INTO gifi (accno,description) VALUES ('413005', 'PREPARACION DE TERRENOS '); INSERT INTO gifi (accno,description) VALUES ('413010', 'CONSTRUCCION DE EDIFICIOS Y OBRAS DE INGENIERIA CIVIL '); INSERT INTO gifi (accno,description) VALUES ('413015', 'ACONDICIONAMIENTO DE EDIFICIOS '); INSERT INTO gifi (accno,description) VALUES ('413020', 'TERMINACION DE EDIFICACIONES '); INSERT INTO gifi (accno,description) VALUES ('413025', 'ALQUILER DE EQUIPO CON OPERARIOS '); INSERT INTO gifi (accno,description) VALUES ('413095', 'ACTIVIDADES CONEXAS '); INSERT INTO gifi (accno,description) VALUES ('413099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4135', 'COMERCIO AL POR MAYOR Y AL POR MENOR '); INSERT INTO gifi (accno,description) VALUES ('413502', 'VENTA DE VEHICULOS AUTOMOTORES '); INSERT INTO gifi (accno,description) VALUES ('413504', 'MANTENIMIENTO, REPARACION Y LAVADO DE VEHICULOS AUTOMOTORES '); INSERT INTO gifi (accno,description) VALUES ('413506', 'VENTA DE PARTES, PIEZAS Y ACCESORIOS DE VEHICULOS AUTOMOTORES '); INSERT INTO gifi (accno,description) VALUES ('413508', 'VENTA DE COMBUSTIBLES SOLIDOS, LIQUIDOS, GASEOSOS '); INSERT INTO gifi (accno,description) VALUES ('413510', 'VENTA DE LUBRICANTES, ADITIVOS, LLANTAS Y LUJOS PARA AUTOMOTORES '); INSERT INTO gifi (accno,description) VALUES ('413512', 'VENTA A CAMBIO DE RETRIBUCION O POR CONTRATA '); INSERT INTO gifi (accno,description) VALUES ('413514', 'VENTA DE INSUMOS, MATERIAS PRIMAS AGROPECUARIAS Y FLORES '); INSERT INTO gifi (accno,description) VALUES ('413516', 'VENTA DE OTROS INSUMOS Y MATERIAS PRIMAS NO AGROPECUARIAS '); INSERT INTO gifi (accno,description) VALUES ('413518', 'VENTA DE ANIMALES VIVOS Y CUEROS '); INSERT INTO gifi (accno,description) VALUES ('413520', 'VENTA DE PRODUCTOS EN ALMACENES NO ESPECIALIZADOS '); INSERT INTO gifi (accno,description) VALUES ('413522', 'VENTA DE PRODUCTOS AGROPECUARIOS '); INSERT INTO gifi (accno,description) VALUES ('413524', 'VENTA DE PRODUCTOS TEXTILES, DE VESTIR, DE CUERO Y CALZADO '); INSERT INTO gifi (accno,description) VALUES ('413526', 'VENTA DE PAPEL Y CARTON '); INSERT INTO gifi (accno,description) VALUES ('413528', 'VENTA DE LIBROS, REVISTAS, ELEMENTOS DE PAPELERIA, UTILES Y TEXTOS ESCOLARES '); INSERT INTO gifi (accno,description) VALUES ('413530', 'VENTA DE JUEGOS, JUGUETES Y ARTICULOS DEPORTIVOS '); INSERT INTO gifi (accno,description) VALUES ('413532', 'VENTA DE INSTRUMENTOS QUIRURGICOS Y ORTOPEDICOS '); INSERT INTO gifi (accno,description) VALUES ('413534', 'VENTA DE ARTICULOS EN RELOJERIAS Y JOYERIAS '); INSERT INTO gifi (accno,description) VALUES ('413536', 'VENTA DE ELECTRODOMESTICOS Y MUEBLES '); INSERT INTO gifi (accno,description) VALUES ('413538', 'VENTA DE PRODUCTOS DE ASEO, FARMACEUTICOS, MEDICINALES, Y ARTICULOS DE TOCADOR '); INSERT INTO gifi (accno,description) VALUES ('413540', 'VENTA DE CUBIERTOS, VAJILLAS, CRISTALERIA, PORCELANAS, CERAMICAS Y OTROS ARTICULOS DE USO DOMESTICO '); INSERT INTO gifi (accno,description) VALUES ('413542', 'VENTA DE MATERIALES DE CONSTRUCCION, FONTANERIA Y CALEFACCION '); INSERT INTO gifi (accno,description) VALUES ('413544', 'VENTA DE PINTURAS Y LACAS '); INSERT INTO gifi (accno,description) VALUES ('413546', 'VENTA DE PRODUCTOS DE VIDRIOS Y MARQUETERIA '); INSERT INTO gifi (accno,description) VALUES ('413548', 'VENTA DE HERRAMIENTAS Y ARTICULOS DE FERRETERIA '); INSERT INTO gifi (accno,description) VALUES ('413550', 'VENTA DE QUIMICOS '); INSERT INTO gifi (accno,description) VALUES ('413552', 'VENTA DE PRODUCTOS INTERMEDIOS, DESPERDICIOS Y DESECHOS '); INSERT INTO gifi (accno,description) VALUES ('413554', 'VENTA DE MAQUINARIA, EQUIPO DE OFICINA Y PROGRAMAS DE COMPUTADOR '); INSERT INTO gifi (accno,description) VALUES ('413556', 'VENTA DE ARTICULOS EN CACHARRERIAS Y MISCELANEAS '); INSERT INTO gifi (accno,description) VALUES ('413558', 'VENTA DE INSTRUMENTOS MUSICALES '); INSERT INTO gifi (accno,description) VALUES ('413560', 'VENTA DE ARTICULOS EN CASAS DE EMPEŃO Y PRENDERIAS '); INSERT INTO gifi (accno,description) VALUES ('413562', 'VENTA DE EQUIPO FOTOGRAFICO '); INSERT INTO gifi (accno,description) VALUES ('413564', 'VENTA DE EQUIPO OPTICO Y DE PRECISION '); INSERT INTO gifi (accno,description) VALUES ('413566', 'VENTA DE EMPAQUES '); INSERT INTO gifi (accno,description) VALUES ('413568', 'VENTA DE EQUIPO PROFESIONAL Y CIENTIFICO '); INSERT INTO gifi (accno,description) VALUES ('413570', 'VENTA DE LOTERIAS, RIFAS, CHANCE, APUESTAS Y SIMILARES '); INSERT INTO gifi (accno,description) VALUES ('413572', 'REPARACION DE EFECTOS PERSONALES Y ELECTRODOMESTICOS '); INSERT INTO gifi (accno,description) VALUES ('413595', 'VENTA DE OTROS PRODUCTOS '); INSERT INTO gifi (accno,description) VALUES ('413599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4140', 'HOTELES Y RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('414005', 'HOTELERIA '); INSERT INTO gifi (accno,description) VALUES ('414010', 'CAMPAMENTO Y OTROS TIPOS DE HOSPEDAJE '); INSERT INTO gifi (accno,description) VALUES ('414015', 'RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('414020', 'BARES Y CANTINAS '); INSERT INTO gifi (accno,description) VALUES ('414095', 'ACTIVIDADES CONEXAS '); INSERT INTO gifi (accno,description) VALUES ('414099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4145', 'TRANSPORTE, ALMACENAMIENTO Y COMUNICACIONES '); INSERT INTO gifi (accno,description) VALUES ('414505', 'SERVICIO DE TRANSPORTE POR CARRETERA '); INSERT INTO gifi (accno,description) VALUES ('414510', 'SERVICIO DE TRANSPORTE POR VIA FERREA '); INSERT INTO gifi (accno,description) VALUES ('414515', 'SERVICIO DE TRANSPORTE POR VIA ACUATICA '); INSERT INTO gifi (accno,description) VALUES ('414520', 'SERVICIO DE TRANSPORTE POR VIA AEREA '); INSERT INTO gifi (accno,description) VALUES ('414525', 'SERVICIO DE TRANSPORTE POR TUBERIAS '); INSERT INTO gifi (accno,description) VALUES ('414530', 'MANIPULACION DE CARGA '); INSERT INTO gifi (accno,description) VALUES ('414535', 'ALMACENAMIENTO Y DEPOSITO '); INSERT INTO gifi (accno,description) VALUES ('414540', 'SERVICIOS COMPLEMENTARIOS PARA EL TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('414545', 'AGENCIAS DE VIAJE '); INSERT INTO gifi (accno,description) VALUES ('414550', 'OTRAS AGENCIAS DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('414555', 'SERVICIO POSTAL Y DE CORREO '); INSERT INTO gifi (accno,description) VALUES ('414560', 'SERVICIO TELEFONICO '); INSERT INTO gifi (accno,description) VALUES ('414565', 'SERVICIO DE TELEGRAFO '); INSERT INTO gifi (accno,description) VALUES ('414570', 'SERVICIO DE TRANSMISION DE DATOS '); INSERT INTO gifi (accno,description) VALUES ('414575', 'SERVICIO DE RADIO Y TELEVISION POR CABLE '); INSERT INTO gifi (accno,description) VALUES ('414580', 'TRANSMISION DE SONIDO E IMAGENES POR CONTRATO '); INSERT INTO gifi (accno,description) VALUES ('414595', 'ACTIVIDADES CONEXAS '); INSERT INTO gifi (accno,description) VALUES ('414599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4150', 'ACTIVIDAD FINANCIERA '); INSERT INTO gifi (accno,description) VALUES ('415005', 'VENTA DE INVERSIONES '); INSERT INTO gifi (accno,description) VALUES ('415010', 'DIVIDENDOS DE SOCIEDADES ANONIMAS Y/O ASIMILADAS '); INSERT INTO gifi (accno,description) VALUES ('415015', 'PARTICIPACIONES DE SOCIEDADES LIMITADAS Y/O ASIMILADAS '); INSERT INTO gifi (accno,description) VALUES ('415020', 'INTERESES '); INSERT INTO gifi (accno,description) VALUES ('415025', 'REAJUSTE MONETARIO - UPAC '); INSERT INTO gifi (accno,description) VALUES ('415030', 'COMISIONES '); INSERT INTO gifi (accno,description) VALUES ('415035', 'OPERACIONES DE DESCUENTO '); INSERT INTO gifi (accno,description) VALUES ('415040', 'CUOTAS DE INSCRIPCION - CONSORCIOS '); INSERT INTO gifi (accno,description) VALUES ('415045', 'CUOTAS DE ADMINISTRACION - CONSORCIOS '); INSERT INTO gifi (accno,description) VALUES ('415050', 'REAJUSTE DEL SISTEMA - CONSORCIOS '); INSERT INTO gifi (accno,description) VALUES ('415055', 'ELIMINACION DE SUSCRIPTORES - CONSORCIOS '); INSERT INTO gifi (accno,description) VALUES ('415060', 'CUOTAS DE INGRESO O RETIRO - SOCIEDAD ADMINISTRADORA '); INSERT INTO gifi (accno,description) VALUES ('415065', 'SERVICIOS A COMISIONISTAS '); INSERT INTO gifi (accno,description) VALUES ('415070', 'INSCRIPCIONES Y CUOTAS '); INSERT INTO gifi (accno,description) VALUES ('415075', 'RECUPERACION DE GARANTIAS '); INSERT INTO gifi (accno,description) VALUES ('415095', 'ACTIVIDADES CONEXAS '); INSERT INTO gifi (accno,description) VALUES ('415099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4155', 'ACTIVIDADES INMOBILIARIAS, EMPRESARIALES Y DE ALQUILER '); INSERT INTO gifi (accno,description) VALUES ('415505', 'ARRENDAMIENTOS DE BIENES INMUEBLES '); INSERT INTO gifi (accno,description) VALUES ('415510', 'INMOBILIARIAS POR RETRIBUCION O CONTRATA '); INSERT INTO gifi (accno,description) VALUES ('415515', 'ALQUILER EQUIPO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('415520', 'ALQUILER MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('415525', 'ALQUILER DE EFECTOS PERSONALES Y ENSERES DOMESTICOS '); INSERT INTO gifi (accno,description) VALUES ('415530', 'CONSULTORIA EN EQUIPO Y PROGRAMAS DE INFORMATICA '); INSERT INTO gifi (accno,description) VALUES ('415535', 'PROCESAMIENTO DE DATOS '); INSERT INTO gifi (accno,description) VALUES ('415540', 'MANTENIMIENTO Y REPARACION DE MAQUINARIA DE OFICINA '); INSERT INTO gifi (accno,description) VALUES ('415545', 'INVESTIGACIONES CIENTIFICAS Y DE DESARROLLO '); INSERT INTO gifi (accno,description) VALUES ('415550', 'ACTIVIDADES EMPRESARIALES DE CONSULTORIA '); INSERT INTO gifi (accno,description) VALUES ('415555', 'PUBLICIDAD '); INSERT INTO gifi (accno,description) VALUES ('415560', 'DOTACION DE PERSONAL '); INSERT INTO gifi (accno,description) VALUES ('415565', 'INVESTIGACION Y SEGURIDAD '); INSERT INTO gifi (accno,description) VALUES ('415570', 'LIMPIEZA DE INMUEBLES '); INSERT INTO gifi (accno,description) VALUES ('415575', 'FOTOGRAFIA '); INSERT INTO gifi (accno,description) VALUES ('415580', 'ENVASE Y EMPAQUE '); INSERT INTO gifi (accno,description) VALUES ('415585', 'FOTOCOPIADO '); INSERT INTO gifi (accno,description) VALUES ('415590', 'MANTENIMIENTO Y REPARACION DE MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('415595', 'ACTIVIDADES CONEXAS '); INSERT INTO gifi (accno,description) VALUES ('415599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4160', 'ENSEŃANZA '); INSERT INTO gifi (accno,description) VALUES ('416005', 'ACTIVIDADES RELACIONADAS CON LA EDUCACION '); INSERT INTO gifi (accno,description) VALUES ('416095', 'ACTIVIDADES CONEXAS '); INSERT INTO gifi (accno,description) VALUES ('416099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4165', 'SERVICIOS SOCIALES Y DE SALUD '); INSERT INTO gifi (accno,description) VALUES ('416505', 'SERVICIO HOSPITALARIO '); INSERT INTO gifi (accno,description) VALUES ('416510', 'SERVICIO MEDICO '); INSERT INTO gifi (accno,description) VALUES ('416515', 'SERVICIO ODONTOLOGICO '); INSERT INTO gifi (accno,description) VALUES ('416520', 'SERVICIO DE LABORATORIO '); INSERT INTO gifi (accno,description) VALUES ('416525', 'ACTIVIDADES VETERINARIAS '); INSERT INTO gifi (accno,description) VALUES ('416530', 'ACTIVIDADES DE SERVICIOS SOCIALES '); INSERT INTO gifi (accno,description) VALUES ('416595', 'ACTIVIDADES CONEXAS '); INSERT INTO gifi (accno,description) VALUES ('416599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4170', 'OTRAS ACTIVIDADES DE SERVICIOS COMUNITARIOS, SOCIALES Y PERSONALES '); INSERT INTO gifi (accno,description) VALUES ('417005', 'ELIMINACION DE DESPERDICIOS Y AGUAS RESIDUALES '); INSERT INTO gifi (accno,description) VALUES ('417010', 'ACTIVIDADES DE ASOCIACION '); INSERT INTO gifi (accno,description) VALUES ('417015', 'PRODUCCION Y DISTRIBUCION DE FILMES Y VIDEOCINTAS '); INSERT INTO gifi (accno,description) VALUES ('417020', 'EXHIBICION DE FILMES Y VIDEOCINTAS '); INSERT INTO gifi (accno,description) VALUES ('417025', 'ACTIVIDAD DE RADIO Y TELEVISION '); INSERT INTO gifi (accno,description) VALUES ('417030', 'ACTIVIDAD TEATRAL, MUSICAL Y ARTISTICA '); INSERT INTO gifi (accno,description) VALUES ('417035', 'GRABACION Y PRODUCCION DE DISCOS '); INSERT INTO gifi (accno,description) VALUES ('417040', 'ENTRETENIMIENTO Y ESPARCIMIENTO '); INSERT INTO gifi (accno,description) VALUES ('417045', 'AGENCIAS DE NOTICIAS '); INSERT INTO gifi (accno,description) VALUES ('417050', 'LAVANDERIAS Y SIMILARES '); INSERT INTO gifi (accno,description) VALUES ('417055', 'PELUQUERIAS Y SIMILARES '); INSERT INTO gifi (accno,description) VALUES ('417060', 'SERVICIOS FUNERARIOS '); INSERT INTO gifi (accno,description) VALUES ('417065', 'ZONAS FRANCAS '); INSERT INTO gifi (accno,description) VALUES ('417095', 'ACTIVIDADES CONEXAS '); INSERT INTO gifi (accno,description) VALUES ('417099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4175', 'DEVOLUCIONES, REBAJAS Y DESCUENTOS EN VENTAS (DB) '); INSERT INTO gifi (accno,description) VALUES ('417599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('42', 'NO OPERACIONALES '); INSERT INTO gifi (accno,description) VALUES ('4205', 'OTRAS VENTAS '); INSERT INTO gifi (accno,description) VALUES ('420505', 'MATERIA PRIMA '); INSERT INTO gifi (accno,description) VALUES ('420510', 'MATERIAL DE DESECHO '); INSERT INTO gifi (accno,description) VALUES ('420515', 'MATERIALES VARIOS '); INSERT INTO gifi (accno,description) VALUES ('420520', 'PRODUCTOS DE DIVERSIFICACION '); INSERT INTO gifi (accno,description) VALUES ('420525', 'EXCEDENTES DE EXPORTACION '); INSERT INTO gifi (accno,description) VALUES ('420530', 'ENVASES Y EMPAQUES '); INSERT INTO gifi (accno,description) VALUES ('420535', 'PRODUCTOS AGRICOLAS '); INSERT INTO gifi (accno,description) VALUES ('420540', 'DE PROPAGANDA '); INSERT INTO gifi (accno,description) VALUES ('420545', 'PRODUCTOS EN REMATE '); INSERT INTO gifi (accno,description) VALUES ('420550', 'COMBUSTIBLES Y LUBRICANTES '); INSERT INTO gifi (accno,description) VALUES ('420599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4210', 'FINANCIEROS '); INSERT INTO gifi (accno,description) VALUES ('421005', 'INTERESES '); INSERT INTO gifi (accno,description) VALUES ('421010', 'REAJUSTE MONETARIO - UPAC '); INSERT INTO gifi (accno,description) VALUES ('421015', 'DESCUENTOS AMORTIZADOS '); INSERT INTO gifi (accno,description) VALUES ('421020', 'DIFERENCIA EN CAMBIO '); INSERT INTO gifi (accno,description) VALUES ('421025', 'FINANCIACION VEHICULOS '); INSERT INTO gifi (accno,description) VALUES ('421030', 'FINANCIACION SISTEMAS DE VIAJES '); INSERT INTO gifi (accno,description) VALUES ('421035', 'ACEPTACIONES BANCARIAS '); INSERT INTO gifi (accno,description) VALUES ('421040', 'DESCUENTOS COMERCIALES CONDICIONADOS '); INSERT INTO gifi (accno,description) VALUES ('421045', 'DESCUENTOS BANCARIOS '); INSERT INTO gifi (accno,description) VALUES ('421050', 'COMISIONES CHEQUES DE OTRAS PLAZAS '); INSERT INTO gifi (accno,description) VALUES ('421055', 'MULTAS Y RECARGOS '); INSERT INTO gifi (accno,description) VALUES ('421060', 'SANCIONES CHEQUES DEVUELTOS '); INSERT INTO gifi (accno,description) VALUES ('421095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('421099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4215', 'DIVIDENDOS Y PARTICIPACIONES '); INSERT INTO gifi (accno,description) VALUES ('421505', 'DE SOCIEDADES ANONIMAS Y/O ASIMILADAS '); INSERT INTO gifi (accno,description) VALUES ('421510', 'DE SOCIEDADES LIMITADAS Y/O ASIMILADAS '); INSERT INTO gifi (accno,description) VALUES ('421599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4220', 'ARRENDAMIENTOS '); INSERT INTO gifi (accno,description) VALUES ('422005', 'TERRENOS '); INSERT INTO gifi (accno,description) VALUES ('422010', 'CONSTRUCCIONES Y EDIFICIOS '); INSERT INTO gifi (accno,description) VALUES ('422015', 'MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('422020', 'EQUIPO DE OFICINA '); INSERT INTO gifi (accno,description) VALUES ('422025', 'EQUIPO DE COMPUTACION Y COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('422030', 'EQUIPO MEDICO - CIENTIFICO '); INSERT INTO gifi (accno,description) VALUES ('422035', 'EQUIPO DE HOTELES Y RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('422040', 'FLOTA Y EQUIPO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('422045', 'FLOTA Y EQUIPO FLUVIAL Y/O MARITIMO '); INSERT INTO gifi (accno,description) VALUES ('422050', 'FLOTA Y EQUIPO AEREO '); INSERT INTO gifi (accno,description) VALUES ('422055', 'FLOTA Y EQUIPO FERREO '); INSERT INTO gifi (accno,description) VALUES ('422060', 'ACUEDUCTOS PLANTAS Y REDES '); INSERT INTO gifi (accno,description) VALUES ('422062', 'ENVASES Y EMPAQUES '); INSERT INTO gifi (accno,description) VALUES ('422065', 'PLANTACIONES AGRICOLAS Y FORESTALES '); INSERT INTO gifi (accno,description) VALUES ('422070', 'AERODROMOS '); INSERT INTO gifi (accno,description) VALUES ('422075', 'SEMOVIENTES '); INSERT INTO gifi (accno,description) VALUES ('422099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4225', 'COMISIONES '); INSERT INTO gifi (accno,description) VALUES ('422505', 'SOBRE INVERSIONES '); INSERT INTO gifi (accno,description) VALUES ('422510', 'DE CONCESIONARIOS '); INSERT INTO gifi (accno,description) VALUES ('422515', 'DE ACTIVIDADES FINANCIERAS '); INSERT INTO gifi (accno,description) VALUES ('422520', 'POR VENTA DE SERVICIOS DE TALLER '); INSERT INTO gifi (accno,description) VALUES ('422525', 'POR VENTA DE SEGUROS '); INSERT INTO gifi (accno,description) VALUES ('422530', 'POR INGRESOS PARA TERCEROS '); INSERT INTO gifi (accno,description) VALUES ('422535', 'POR DISTRIBUCION DE PELICULAS '); INSERT INTO gifi (accno,description) VALUES ('422540', 'DERECHOS DE AUTOR '); INSERT INTO gifi (accno,description) VALUES ('422545', 'DERECHOS DE PROGRAMACION '); INSERT INTO gifi (accno,description) VALUES ('422599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4230', 'HONORARIOS '); INSERT INTO gifi (accno,description) VALUES ('423005', 'ASESORIAS '); INSERT INTO gifi (accno,description) VALUES ('423010', 'ASISTENCIA TECNICA '); INSERT INTO gifi (accno,description) VALUES ('423015', 'ADMINISTRACION DE VINCULADAS '); INSERT INTO gifi (accno,description) VALUES ('423099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4235', 'SERVICIOS '); INSERT INTO gifi (accno,description) VALUES ('423505', 'DE BASCULA '); INSERT INTO gifi (accno,description) VALUES ('423510', 'DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('423515', 'DE PRENSA '); INSERT INTO gifi (accno,description) VALUES ('423520', 'ADMINISTRATIVOS '); INSERT INTO gifi (accno,description) VALUES ('423525', 'TECNICOS '); INSERT INTO gifi (accno,description) VALUES ('423530', 'DE COMPUTACION '); INSERT INTO gifi (accno,description) VALUES ('423535', 'DE TELEFAX '); INSERT INTO gifi (accno,description) VALUES ('423540', 'TALLER DE VEHICULOS '); INSERT INTO gifi (accno,description) VALUES ('423545', 'DE RECEPCION DE AERONAVES '); INSERT INTO gifi (accno,description) VALUES ('423550', 'DE TRANSPORTE PROGRAMA GAS NATURAL '); INSERT INTO gifi (accno,description) VALUES ('423555', 'POR CONTRATOS '); INSERT INTO gifi (accno,description) VALUES ('423560', 'DE TRILLLA '); INSERT INTO gifi (accno,description) VALUES ('423565', 'DE MANTENIMIENTO '); INSERT INTO gifi (accno,description) VALUES ('423570', 'AL PERSONAL '); INSERT INTO gifi (accno,description) VALUES ('423575', 'DE CASINO '); INSERT INTO gifi (accno,description) VALUES ('423580', 'FLETES '); INSERT INTO gifi (accno,description) VALUES ('423585', 'ENTRE COMPAŃIAS '); INSERT INTO gifi (accno,description) VALUES ('423595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('423599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4240', 'UTILIDAD EN VENTA DE INVERSIONES '); INSERT INTO gifi (accno,description) VALUES ('424005', 'ACCIONES '); INSERT INTO gifi (accno,description) VALUES ('424010', 'CUOTAS O PARTES DE INTERES SOCIAL '); INSERT INTO gifi (accno,description) VALUES ('424015', 'BONOS '); INSERT INTO gifi (accno,description) VALUES ('424020', 'CEDULAS '); INSERT INTO gifi (accno,description) VALUES ('424025', 'CERTIFICADOS '); INSERT INTO gifi (accno,description) VALUES ('424030', 'PAPELES COMERCIALES '); INSERT INTO gifi (accno,description) VALUES ('424035', 'TITULOS '); INSERT INTO gifi (accno,description) VALUES ('424045', 'DERECHOS FIDUCIARIOS '); INSERT INTO gifi (accno,description) VALUES ('424050', 'OBLIGATORIAS '); INSERT INTO gifi (accno,description) VALUES ('424095', 'OTRAS '); INSERT INTO gifi (accno,description) VALUES ('424099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4245', 'UTILIDAD EN VENTA DE PROPIEDADES PLANTA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('424504', 'TERRENOS '); INSERT INTO gifi (accno,description) VALUES ('424506', 'MATERIALES INDUSTRIA PETROLERA '); INSERT INTO gifi (accno,description) VALUES ('424508', 'CONSTRUCCIONES EN CURSO '); INSERT INTO gifi (accno,description) VALUES ('424512', 'MAQUINARIA EN MONTAJE '); INSERT INTO gifi (accno,description) VALUES ('424516', 'CONSTRUCCIONES Y EDIFICACIONES '); INSERT INTO gifi (accno,description) VALUES ('424520', 'MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('424524', 'EQUIPO DE OFICINA '); INSERT INTO gifi (accno,description) VALUES ('424528', 'EQUIPO DE COMPUTACION Y COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('424532', 'EQUIPO MEDICO - CIENTIFICO '); INSERT INTO gifi (accno,description) VALUES ('424536', 'EQUIPO DE HOTELES Y RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('424540', 'FLOTA Y EQUIPO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('424544', 'FLOTA Y EQUIPO FLUVIAL Y/O MARITIMO '); INSERT INTO gifi (accno,description) VALUES ('424548', 'FLOTA Y EQUIPO AEREO '); INSERT INTO gifi (accno,description) VALUES ('424552', 'FLOTA Y EQUIPO FERREO '); INSERT INTO gifi (accno,description) VALUES ('424556', 'ACUEDUCTOS PLANTAS Y REDES '); INSERT INTO gifi (accno,description) VALUES ('424560', 'ARMAMENTO DE VIGILANCIA '); INSERT INTO gifi (accno,description) VALUES ('424562', 'ENVASES Y EMPAQUES '); INSERT INTO gifi (accno,description) VALUES ('424564', 'PLANTACIONES AGRICOLAS Y FORESTALES '); INSERT INTO gifi (accno,description) VALUES ('424568', 'VIAS DE COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('424572', 'MINAS Y CANTERAS '); INSERT INTO gifi (accno,description) VALUES ('424580', 'POZOS ARTESIANOS '); INSERT INTO gifi (accno,description) VALUES ('424584', 'YACIMIENTOS '); INSERT INTO gifi (accno,description) VALUES ('424588', 'SEMOVIENTES '); INSERT INTO gifi (accno,description) VALUES ('424599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4248', 'UTILIDAD EN VENTA DE OTROS BIENES '); INSERT INTO gifi (accno,description) VALUES ('424805', 'INTANGIBLES '); INSERT INTO gifi (accno,description) VALUES ('424810', 'OTROS ACTIVOS '); INSERT INTO gifi (accno,description) VALUES ('424899', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4250', 'RECUPERACIONES '); INSERT INTO gifi (accno,description) VALUES ('425005', 'DEUDAS MALAS '); INSERT INTO gifi (accno,description) VALUES ('425010', 'SEGUROS '); INSERT INTO gifi (accno,description) VALUES ('425015', 'RECLAMOS '); INSERT INTO gifi (accno,description) VALUES ('425020', 'REINTEGRO POR PERSONAL EN COMISION '); INSERT INTO gifi (accno,description) VALUES ('425025', 'REINTEGRO GARANTIAS '); INSERT INTO gifi (accno,description) VALUES ('425030', 'DESCUENTOS CONCEDIDOS '); INSERT INTO gifi (accno,description) VALUES ('425035', 'REINTEGRO PROVISIONES '); INSERT INTO gifi (accno,description) VALUES ('425040', 'GASTOS BANCARIOS '); INSERT INTO gifi (accno,description) VALUES ('425045', 'DE DEPRECIACION '); INSERT INTO gifi (accno,description) VALUES ('425050', 'REINTEGRO DE OTROS COSTOS Y GASTOS '); INSERT INTO gifi (accno,description) VALUES ('425099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4255', 'INDEMNIZACIONES '); INSERT INTO gifi (accno,description) VALUES ('425505', 'POR SINIESTRO '); INSERT INTO gifi (accno,description) VALUES ('425510', 'POR SUMINISTROS '); INSERT INTO gifi (accno,description) VALUES ('425515', 'LUCRO CESANTE COMPAŃIAS DE SEGUROS '); INSERT INTO gifi (accno,description) VALUES ('425520', 'DAŃO EMERGENTE COMPAŃIAS DE SEGUROS '); INSERT INTO gifi (accno,description) VALUES ('425525', 'POR PERDIDA DE MERCANCIA '); INSERT INTO gifi (accno,description) VALUES ('425530', 'POR INCUMPLIMIENTO DE CONTRATOS '); INSERT INTO gifi (accno,description) VALUES ('425535', 'DE TERCEROS '); INSERT INTO gifi (accno,description) VALUES ('425540', 'POR INCAPACIDADES I.S.S. '); INSERT INTO gifi (accno,description) VALUES ('425595', 'OTRAS '); INSERT INTO gifi (accno,description) VALUES ('425599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4260', 'PARTICIPACIONES EN CONCESIONES '); INSERT INTO gifi (accno,description) VALUES ('426099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4265', 'INGRESOS DE EJERCICIOS ANTERIORES '); INSERT INTO gifi (accno,description) VALUES ('426599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4275', 'DEVOLUCIONES, REBAJAS Y DESCUENTOS EN OTRAS VENTAS (DB) '); INSERT INTO gifi (accno,description) VALUES ('427599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4295', 'DIVERSOS '); INSERT INTO gifi (accno,description) VALUES ('429503', 'CERT '); INSERT INTO gifi (accno,description) VALUES ('429505', 'APROVECHAMIENTOS '); INSERT INTO gifi (accno,description) VALUES ('429507', 'AUXILIOS '); INSERT INTO gifi (accno,description) VALUES ('429509', 'DONACIONES '); INSERT INTO gifi (accno,description) VALUES ('429511', 'INGRESOS POR INVESTIGACION Y DESARROLLO '); INSERT INTO gifi (accno,description) VALUES ('429513', 'POR TRABAJOS EJECUTADOS '); INSERT INTO gifi (accno,description) VALUES ('429515', 'REGALIAS '); INSERT INTO gifi (accno,description) VALUES ('429517', 'DERIVADOS DE LAS EXPORTACIONES '); INSERT INTO gifi (accno,description) VALUES ('429519', 'OTROS INGRESOS DE EXPLOTACION '); INSERT INTO gifi (accno,description) VALUES ('429521', 'DE LA ACTIVIDAD GANADERA '); INSERT INTO gifi (accno,description) VALUES ('429525', 'DERECHOS Y LICITACIONES '); INSERT INTO gifi (accno,description) VALUES ('429530', 'INGRESOS POR ELEMENTOS PERDIDOS '); INSERT INTO gifi (accno,description) VALUES ('429533', 'MULTAS Y RECARGOS '); INSERT INTO gifi (accno,description) VALUES ('429535', 'PREAVISOS DESCONTADOS '); INSERT INTO gifi (accno,description) VALUES ('429537', 'RECLAMOS '); INSERT INTO gifi (accno,description) VALUES ('429540', 'RECOBRO DE DAŃOS '); INSERT INTO gifi (accno,description) VALUES ('429543', 'PREMIOS '); INSERT INTO gifi (accno,description) VALUES ('429545', 'BONIFICACIONES '); INSERT INTO gifi (accno,description) VALUES ('429547', 'PRODUCTOS DESCONTADOS '); INSERT INTO gifi (accno,description) VALUES ('429549', 'RECONOCIMIENTOS I.S.S. '); INSERT INTO gifi (accno,description) VALUES ('429551', 'EXCEDENTES '); INSERT INTO gifi (accno,description) VALUES ('429553', 'SOBRANTES DE CAJA MENOR '); INSERT INTO gifi (accno,description) VALUES ('429555', 'SOBRANTES EN LIQUIDACION FLETES '); INSERT INTO gifi (accno,description) VALUES ('429557', 'SUBSIDIOS ESTATALES '); INSERT INTO gifi (accno,description) VALUES ('429559', 'CAPACITACION DISTRIBUIDORES '); INSERT INTO gifi (accno,description) VALUES ('429561', 'DE ESCRITURACION '); INSERT INTO gifi (accno,description) VALUES ('429563', 'REGISTRO PROMESAS DE VENTA '); INSERT INTO gifi (accno,description) VALUES ('429567', 'UTILES, PAPELERIA Y FOTOCOPIAS '); INSERT INTO gifi (accno,description) VALUES ('429571', 'RESULTADOS MATRICULAS Y TRASPASOS '); INSERT INTO gifi (accno,description) VALUES ('429573', 'DECORACIONES '); INSERT INTO gifi (accno,description) VALUES ('429575', 'MANEJO DE CARGA '); INSERT INTO gifi (accno,description) VALUES ('429579', 'HISTORIA CLINICA '); INSERT INTO gifi (accno,description) VALUES ('429581', 'AJUSTE AL PESO '); INSERT INTO gifi (accno,description) VALUES ('429583', 'LLAMADAS TELEFONICAS '); INSERT INTO gifi (accno,description) VALUES ('429599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('47', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('4705', 'CORRECCION MONETARIA '); INSERT INTO gifi (accno,description) VALUES ('470505', 'INVERSIONES (CR) '); INSERT INTO gifi (accno,description) VALUES ('470510', 'INVENTARIOS (CR) '); INSERT INTO gifi (accno,description) VALUES ('470515', 'PROPIEDADES, PLANTA Y EQUIPO (CR) '); INSERT INTO gifi (accno,description) VALUES ('470520', 'INTANGIBLES (CR) '); INSERT INTO gifi (accno,description) VALUES ('470525', 'ACTIVOS DIFERIDOS '); INSERT INTO gifi (accno,description) VALUES ('470530', 'OTROS ACTIVOS (CR) '); INSERT INTO gifi (accno,description) VALUES ('470535', 'PASIVOS SUJETOS DE AJUSTE '); INSERT INTO gifi (accno,description) VALUES ('470540', 'PATRIMONIO '); INSERT INTO gifi (accno,description) VALUES ('470545', 'DEPRECIACION ACUMULADA (DB) '); INSERT INTO gifi (accno,description) VALUES ('470550', 'DEPRECIACION DIFERIDA (CR) '); INSERT INTO gifi (accno,description) VALUES ('470555', 'AGOTAMIENTO ACUMULADO (DB) '); INSERT INTO gifi (accno,description) VALUES ('470560', 'AMORTIZACION ACUMULADA (DB) '); INSERT INTO gifi (accno,description) VALUES ('470565', 'INGRESOS OPERACIONALES (DB) '); INSERT INTO gifi (accno,description) VALUES ('470570', 'INGRESOS NO OPERACIONALES (DB) '); INSERT INTO gifi (accno,description) VALUES ('470575', 'GASTOS OPERACIONALES DE ADMINISTRACION (CR) '); INSERT INTO gifi (accno,description) VALUES ('470580', 'GASTOS OPERACIONALES DE VENTAS (CR) '); INSERT INTO gifi (accno,description) VALUES ('470585', 'GASTOS NO OPERACIONALES (CR) '); INSERT INTO gifi (accno,description) VALUES ('470590', 'COMPRAS (CR) '); INSERT INTO gifi (accno,description) VALUES ('470592', 'COSTO DE VENTAS (CR) '); INSERT INTO gifi (accno,description) VALUES ('470594', 'COSTOS DE PRODUCCION O DE OPERACION (DB) '); INSERT INTO gifi (accno,description) VALUES ('51', 'OPERACIONALES DE ADMINISTRACION '); INSERT INTO gifi (accno,description) VALUES ('5105', 'GASTOS DE PERSONAL '); INSERT INTO gifi (accno,description) VALUES ('510503', 'SALARIO INTEGRAL '); INSERT INTO gifi (accno,description) VALUES ('510506', 'SUELDOS '); INSERT INTO gifi (accno,description) VALUES ('510512', 'JORNALES '); INSERT INTO gifi (accno,description) VALUES ('510515', 'HORAS EXTRAS Y RECARGOS '); INSERT INTO gifi (accno,description) VALUES ('510518', 'COMISIONES '); INSERT INTO gifi (accno,description) VALUES ('510521', 'VIATICOS '); INSERT INTO gifi (accno,description) VALUES ('510524', 'INCAPACIDADES '); INSERT INTO gifi (accno,description) VALUES ('510527', 'AUXILIO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('510530', 'CESANTIAS '); INSERT INTO gifi (accno,description) VALUES ('510533', 'INTERESES SOBRE CESANTIAS '); INSERT INTO gifi (accno,description) VALUES ('510536', 'PRIMA DE SERVICIOS '); INSERT INTO gifi (accno,description) VALUES ('510539', 'VACACIONES '); INSERT INTO gifi (accno,description) VALUES ('510542', 'PRIMAS EXTRALEGALES '); INSERT INTO gifi (accno,description) VALUES ('510545', 'AUXILIOS '); INSERT INTO gifi (accno,description) VALUES ('510548', 'BONIFICACIONES '); INSERT INTO gifi (accno,description) VALUES ('510551', 'DOTACION Y SUMINISTRO A TRABAJADORES '); INSERT INTO gifi (accno,description) VALUES ('510554', 'SEGUROS '); INSERT INTO gifi (accno,description) VALUES ('510557', 'CUOTAS PARTES PENSIONES DE JUBILACION '); INSERT INTO gifi (accno,description) VALUES ('510558', 'AMORTIZACION CALCULO ACTUARIAL PENSIONES DE JUBILACION '); INSERT INTO gifi (accno,description) VALUES ('510559', 'PENSIONES DE JUBILACION '); INSERT INTO gifi (accno,description) VALUES ('510560', 'INDEMNIZACIONES LABORALES '); INSERT INTO gifi (accno,description) VALUES ('510563', 'CAPACITACION AL PERSONAL '); INSERT INTO gifi (accno,description) VALUES ('510566', 'GASTOS DEPORTIVOS Y DE RECREACION '); INSERT INTO gifi (accno,description) VALUES ('510569', 'APORTES AL I.S.S '); INSERT INTO gifi (accno,description) VALUES ('510572', 'APORTES CAJAS DE COMPENSACION FAMILIAR '); INSERT INTO gifi (accno,description) VALUES ('510575', 'APORTES I.C.B.F. '); INSERT INTO gifi (accno,description) VALUES ('510578', 'SENA '); INSERT INTO gifi (accno,description) VALUES ('510581', 'APORTES SINDICALES '); INSERT INTO gifi (accno,description) VALUES ('510584', 'GASTOS MEDICOS Y DROGAS '); INSERT INTO gifi (accno,description) VALUES ('510595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('510599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5110', 'HONORARIOS '); INSERT INTO gifi (accno,description) VALUES ('511005', 'JUNTA DIRECTIVA '); INSERT INTO gifi (accno,description) VALUES ('511010', 'REVISORÍA FISCAL '); INSERT INTO gifi (accno,description) VALUES ('511015', 'AUDITORIA EXTERNA '); INSERT INTO gifi (accno,description) VALUES ('511020', 'AVALUOS '); INSERT INTO gifi (accno,description) VALUES ('511025', 'ASESORIA JURIDICA '); INSERT INTO gifi (accno,description) VALUES ('511030', 'ASESORIA FINANCIERA '); INSERT INTO gifi (accno,description) VALUES ('511035', 'ASESORIA TECNICA '); INSERT INTO gifi (accno,description) VALUES ('511095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('511099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5115', 'IMPUESTOS '); INSERT INTO gifi (accno,description) VALUES ('511505', 'INDUSTRIA Y COMERCIO '); INSERT INTO gifi (accno,description) VALUES ('511510', 'DE TIMBRES '); INSERT INTO gifi (accno,description) VALUES ('511515', 'A LA PROPIEDAD RAIZ '); INSERT INTO gifi (accno,description) VALUES ('511520', 'DERECHOS SOBRE INSTRUMENTOS PUBLICOS '); INSERT INTO gifi (accno,description) VALUES ('511525', 'DE VALORIZACION '); INSERT INTO gifi (accno,description) VALUES ('511530', 'DE TURISMO '); INSERT INTO gifi (accno,description) VALUES ('511535', 'TASA POR UTILIZACION DE PUERTOS '); INSERT INTO gifi (accno,description) VALUES ('511540', 'DE VEHICULOS '); INSERT INTO gifi (accno,description) VALUES ('511545', 'DE ESPECTACULOS PUBLICOS '); INSERT INTO gifi (accno,description) VALUES ('511550', 'CUOTAS DE FOMENTO '); INSERT INTO gifi (accno,description) VALUES ('511570', 'IVA DESCONTABLE '); INSERT INTO gifi (accno,description) VALUES ('511595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('511599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5120', 'ARRENDAMIENTOS '); INSERT INTO gifi (accno,description) VALUES ('512005', 'TERRENOS '); INSERT INTO gifi (accno,description) VALUES ('512010', 'CONSTRUCCIONES Y EDIFICACIONES '); INSERT INTO gifi (accno,description) VALUES ('512015', 'MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('512020', 'EQUIPO DE OFICINA '); INSERT INTO gifi (accno,description) VALUES ('512025', 'EQUIPO DE COMPUTACION Y COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('512030', 'EQUIPO MEDICO - CIENTIFICO '); INSERT INTO gifi (accno,description) VALUES ('512035', 'EQUIPO DE HOTELES Y RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('512040', 'FLOTA Y EQUIPO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('512045', 'FLOTA Y EQUIPO FLUVIAL Y/O MARITIMO '); INSERT INTO gifi (accno,description) VALUES ('512050', 'FLOTA Y EQUIPO AEREO '); INSERT INTO gifi (accno,description) VALUES ('512055', 'FLOTA Y EQUIPO FERREO '); INSERT INTO gifi (accno,description) VALUES ('512060', 'ACUEDUCTOS PLANTAS Y REDES '); INSERT INTO gifi (accno,description) VALUES ('512065', 'AERODROMOS '); INSERT INTO gifi (accno,description) VALUES ('512070', 'SEMOVIENTES '); INSERT INTO gifi (accno,description) VALUES ('512095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('512099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5125', 'CONTRIBUCIONES Y AFILIACIONES '); INSERT INTO gifi (accno,description) VALUES ('512505', 'CONTRIBUCIONES '); INSERT INTO gifi (accno,description) VALUES ('512510', 'AFILIACIONES Y SOSTENIMIENTO '); INSERT INTO gifi (accno,description) VALUES ('512599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5130', 'SEGUROS '); INSERT INTO gifi (accno,description) VALUES ('513005', 'MANEJO '); INSERT INTO gifi (accno,description) VALUES ('513010', 'CUMPLIMIENTO '); INSERT INTO gifi (accno,description) VALUES ('513015', 'CORRIENTE DEBIL '); INSERT INTO gifi (accno,description) VALUES ('513020', 'VIDA COLECTIVA '); INSERT INTO gifi (accno,description) VALUES ('513025', 'INCENDIO '); INSERT INTO gifi (accno,description) VALUES ('513030', 'TERREMOTO '); INSERT INTO gifi (accno,description) VALUES ('513035', 'SUSTRACCION Y HURTO '); INSERT INTO gifi (accno,description) VALUES ('513040', 'FLOTA Y EQUIPO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('513045', 'FLOTA Y EQUIPO FLUVIAL Y/O MARITIMO '); INSERT INTO gifi (accno,description) VALUES ('513050', 'FLOTA Y EQUIPO AEREO '); INSERT INTO gifi (accno,description) VALUES ('513055', 'FLOTA Y EQUIPO FERREO '); INSERT INTO gifi (accno,description) VALUES ('513060', 'RESPONSABILIDAD CIVIL Y EXTRACONTRACTUAL '); INSERT INTO gifi (accno,description) VALUES ('513065', 'VUELO '); INSERT INTO gifi (accno,description) VALUES ('513070', 'ROTURA DE MAQUINARIA '); INSERT INTO gifi (accno,description) VALUES ('513075', 'OBLIGATORIO ACCIDENTE DE TRANSITO '); INSERT INTO gifi (accno,description) VALUES ('513080', 'LUCRO CESANTE '); INSERT INTO gifi (accno,description) VALUES ('513095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('513099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5135', 'SERVICIOS '); INSERT INTO gifi (accno,description) VALUES ('513505', 'ASEO Y VIGILANCIA '); INSERT INTO gifi (accno,description) VALUES ('513510', 'TEMPORALES '); INSERT INTO gifi (accno,description) VALUES ('513515', 'ASISTENCIA TECNICA '); INSERT INTO gifi (accno,description) VALUES ('513520', 'PROCESAMIENTO ELECTRONICO DE DATOS '); INSERT INTO gifi (accno,description) VALUES ('513525', 'ACUEDUCTO Y ALCANTARILLADO '); INSERT INTO gifi (accno,description) VALUES ('513530', 'ENERGIA ELECTRICA '); INSERT INTO gifi (accno,description) VALUES ('513535', 'TELEFONO '); INSERT INTO gifi (accno,description) VALUES ('513540', 'CORREO, PORTES Y TELEGRAMAS '); INSERT INTO gifi (accno,description) VALUES ('513545', 'FAX Y TELEX '); INSERT INTO gifi (accno,description) VALUES ('513550', 'TRANSPORTE, FLETES Y ACARREOS '); INSERT INTO gifi (accno,description) VALUES ('513555', 'GAS '); INSERT INTO gifi (accno,description) VALUES ('513595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('513599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5140', 'GASTOS LEGALES '); INSERT INTO gifi (accno,description) VALUES ('514005', 'NOTARIALES '); INSERT INTO gifi (accno,description) VALUES ('514010', 'REGISTRO MERCANTIL '); INSERT INTO gifi (accno,description) VALUES ('514015', 'TRAMITES Y LICENCIAS '); INSERT INTO gifi (accno,description) VALUES ('514020', 'ADUANEROS '); INSERT INTO gifi (accno,description) VALUES ('514025', 'CONSULARES '); INSERT INTO gifi (accno,description) VALUES ('514095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('514099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5145', 'MANTENIMIENTO Y REPARACIONES '); INSERT INTO gifi (accno,description) VALUES ('514505', 'TERRENOS '); INSERT INTO gifi (accno,description) VALUES ('514510', 'CONSTRUCCIONES Y EDIFICACIONES '); INSERT INTO gifi (accno,description) VALUES ('514515', 'MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('514520', 'EQUIPO DE OFICINA '); INSERT INTO gifi (accno,description) VALUES ('514525', 'EQUIPO DE COMPUTACION Y COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('514530', 'EQUIPO MEDICO-CIENTIFICO '); INSERT INTO gifi (accno,description) VALUES ('514535', 'EQUIPO DE HOTELES Y RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('514540', 'FLOTA Y EQUIPO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('514545', 'FLOTA Y EQUIPO FLUVIAL Y/O MARITIMO '); INSERT INTO gifi (accno,description) VALUES ('514550', 'FLOTA Y EQUIPO AEREO '); INSERT INTO gifi (accno,description) VALUES ('514555', 'FLOTA Y EQUIPO FERREO '); INSERT INTO gifi (accno,description) VALUES ('514560', 'ACUEDUCTOS PLANTAS Y REDES '); INSERT INTO gifi (accno,description) VALUES ('514565', 'ARMAMENTO DE VIGILANCIA '); INSERT INTO gifi (accno,description) VALUES ('514570', 'VIAS DE COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('514599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5150', 'ADECUACION E INSTALACION '); INSERT INTO gifi (accno,description) VALUES ('515005', 'INSTALACIONES ELECTRICAS '); INSERT INTO gifi (accno,description) VALUES ('515010', 'ARREGLOS ORNAMENTALES '); INSERT INTO gifi (accno,description) VALUES ('515015', 'REPARACIONES LOCATIVAS '); INSERT INTO gifi (accno,description) VALUES ('515095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('515099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5155', 'GASTOS DE VIAJE '); INSERT INTO gifi (accno,description) VALUES ('515505', 'ALOJAMIENTO Y MANUTENCION '); INSERT INTO gifi (accno,description) VALUES ('515510', 'PASAJES FLUVIALES Y/O MARITIMOS '); INSERT INTO gifi (accno,description) VALUES ('515515', 'PASAJES AEREOS '); INSERT INTO gifi (accno,description) VALUES ('515520', 'PASAJES TERRESTRES '); INSERT INTO gifi (accno,description) VALUES ('515525', 'PASAJES FERREOS '); INSERT INTO gifi (accno,description) VALUES ('515595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('515599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5160', 'DEPRECIACIONES '); INSERT INTO gifi (accno,description) VALUES ('516005', 'CONSTRUCCIONES Y EDIFICACIONES '); INSERT INTO gifi (accno,description) VALUES ('516010', 'MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('516015', 'EQUIPO DE OFICINA '); INSERT INTO gifi (accno,description) VALUES ('516020', 'EQUIPO DE COMPUTACION Y COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('516025', 'EQUIPO MEDICO - CIENTIFICO '); INSERT INTO gifi (accno,description) VALUES ('516030', 'EQUIPO DE HOTELES Y RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('516035', 'FLOTA Y EQUIPO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('516040', 'FLOTA Y EQUIPO FLUVIAL Y/O MARITIMO '); INSERT INTO gifi (accno,description) VALUES ('516045', 'FLOTA Y EQUIPO AEREO '); INSERT INTO gifi (accno,description) VALUES ('516050', 'FLOTA Y EQUIPO FERREO '); INSERT INTO gifi (accno,description) VALUES ('516055', 'ACUEDUCTOS, PLANTAS Y REDES '); INSERT INTO gifi (accno,description) VALUES ('516060', 'ARMAMENTO DE VIGILANCIA '); INSERT INTO gifi (accno,description) VALUES ('516099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5165', 'AMORTIZACIONES '); INSERT INTO gifi (accno,description) VALUES ('516505', 'VIAS DE COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('516510', 'INTANGIBLES '); INSERT INTO gifi (accno,description) VALUES ('516515', 'CARGOS DIFERIDOS '); INSERT INTO gifi (accno,description) VALUES ('516595', 'OTRAS '); INSERT INTO gifi (accno,description) VALUES ('516599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5195', 'DIVERSOS '); INSERT INTO gifi (accno,description) VALUES ('519505', 'COMISIONES '); INSERT INTO gifi (accno,description) VALUES ('519510', 'LIBROS, SUSCRIPCIONES, PERIODICOS Y REVISTAS '); INSERT INTO gifi (accno,description) VALUES ('519515', 'MUSICA AMBIENTAL '); INSERT INTO gifi (accno,description) VALUES ('519520', 'GASTOS DE REPRESENTACION Y RELACIONES PUBLICAS '); INSERT INTO gifi (accno,description) VALUES ('519525', 'ELEMENTOS DE ASEO Y CAFETERIA '); INSERT INTO gifi (accno,description) VALUES ('519530', 'UTILES, PAPELERIA Y FOTOCOPIAS '); INSERT INTO gifi (accno,description) VALUES ('519535', 'COMBUSTIBLES Y LUBRICANTES '); INSERT INTO gifi (accno,description) VALUES ('519540', 'ENVASES Y EMPAQUES '); INSERT INTO gifi (accno,description) VALUES ('519545', 'TAXIS Y BUSES '); INSERT INTO gifi (accno,description) VALUES ('519550', 'ESTAMPILLAS '); INSERT INTO gifi (accno,description) VALUES ('519555', 'MICROFILMACION '); INSERT INTO gifi (accno,description) VALUES ('519560', 'CASINO Y RESTAURANTE '); INSERT INTO gifi (accno,description) VALUES ('519565', 'PARQUEADEROS '); INSERT INTO gifi (accno,description) VALUES ('519570', 'INDEMNIZACION POR DAŃOS A TERCEROS '); INSERT INTO gifi (accno,description) VALUES ('519575', 'POLVORA Y SIMILARES '); INSERT INTO gifi (accno,description) VALUES ('519595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('519599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5199', 'PROVISIONES '); INSERT INTO gifi (accno,description) VALUES ('519905', 'INVERSIONES '); INSERT INTO gifi (accno,description) VALUES ('519910', 'DEUDORES '); INSERT INTO gifi (accno,description) VALUES ('519915', 'PROPIEDADES, PLANTA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('519995', 'OTROS ACTIVOS '); INSERT INTO gifi (accno,description) VALUES ('519999', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('52', 'OPERACIONALES DE VENTAS '); INSERT INTO gifi (accno,description) VALUES ('5205', 'GASTOS DE PERSONAL '); INSERT INTO gifi (accno,description) VALUES ('520503', 'SALARIO INTEGRAL '); INSERT INTO gifi (accno,description) VALUES ('520506', 'SUELDOS '); INSERT INTO gifi (accno,description) VALUES ('520512', 'JORNALES '); INSERT INTO gifi (accno,description) VALUES ('520515', 'HORAS EXTRAS Y RECARGOS '); INSERT INTO gifi (accno,description) VALUES ('520518', 'COMISIONES '); INSERT INTO gifi (accno,description) VALUES ('520521', 'VIATICOS '); INSERT INTO gifi (accno,description) VALUES ('520524', 'INCAPACIDADES '); INSERT INTO gifi (accno,description) VALUES ('520527', 'AUXILIO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('520530', 'CESANTIAS '); INSERT INTO gifi (accno,description) VALUES ('520533', 'INTERESES SOBRE CESANTIAS '); INSERT INTO gifi (accno,description) VALUES ('520536', 'PRIMA DE SERVICIOS '); INSERT INTO gifi (accno,description) VALUES ('520539', 'VACACIONES '); INSERT INTO gifi (accno,description) VALUES ('520542', 'PRIMAS EXTRALEGALES '); INSERT INTO gifi (accno,description) VALUES ('520545', 'AUXILIOS '); INSERT INTO gifi (accno,description) VALUES ('520548', 'BONIFICACIONES '); INSERT INTO gifi (accno,description) VALUES ('520551', 'DOTACION Y SUMINISTRO A TRABAJADORES '); INSERT INTO gifi (accno,description) VALUES ('520554', 'SEGUROS '); INSERT INTO gifi (accno,description) VALUES ('520557', 'CUOTAS PARTES PENSIONES DE JUBILACION '); INSERT INTO gifi (accno,description) VALUES ('520558', 'AMORTIZACION CALCULO ACTUARIAL PENSIONES DE JUBILACION '); INSERT INTO gifi (accno,description) VALUES ('520559', 'PENSIONES DE JUBILACION '); INSERT INTO gifi (accno,description) VALUES ('520560', 'INDEMNIZACIONES LABORALES '); INSERT INTO gifi (accno,description) VALUES ('520563', 'CAPACITACION AL PERSONAL '); INSERT INTO gifi (accno,description) VALUES ('520566', 'GASTOS DEPORTIVOS Y DE RECREACION '); INSERT INTO gifi (accno,description) VALUES ('520569', 'APORTES AL I.S.S '); INSERT INTO gifi (accno,description) VALUES ('520572', 'APORTES CAJAS DE COMPENSACION FAMILIAR '); INSERT INTO gifi (accno,description) VALUES ('520575', 'APORTES I.C.B.F. '); INSERT INTO gifi (accno,description) VALUES ('520578', 'SENA '); INSERT INTO gifi (accno,description) VALUES ('520581', 'APORTES SINDICALES '); INSERT INTO gifi (accno,description) VALUES ('520584', 'GASTOS MEDICOS Y DROGAS '); INSERT INTO gifi (accno,description) VALUES ('520595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('520599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5210', 'HONORARIOS '); INSERT INTO gifi (accno,description) VALUES ('521005', 'JUNTA DIRECTIVA '); INSERT INTO gifi (accno,description) VALUES ('521010', 'REVISORIA FISCAL '); INSERT INTO gifi (accno,description) VALUES ('521015', 'AUDITORIA EXTERNA '); INSERT INTO gifi (accno,description) VALUES ('521020', 'AVALUOS '); INSERT INTO gifi (accno,description) VALUES ('521025', 'ASESORIA JURIDICA '); INSERT INTO gifi (accno,description) VALUES ('521030', 'ASESORIA FINANCIERA '); INSERT INTO gifi (accno,description) VALUES ('521035', 'ASESORIA TECNICA '); INSERT INTO gifi (accno,description) VALUES ('521095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('521099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5215', 'IMPUESTOS '); INSERT INTO gifi (accno,description) VALUES ('521505', 'INDUSTRIA Y COMERCIO '); INSERT INTO gifi (accno,description) VALUES ('521510', 'DE TIMBRES '); INSERT INTO gifi (accno,description) VALUES ('521515', 'A LA PROPIEDAD RAIZ '); INSERT INTO gifi (accno,description) VALUES ('521520', 'DERECHOS SOBRE INSTRUMENTOS PUBLICOS '); INSERT INTO gifi (accno,description) VALUES ('521525', 'DE VALORIZACION '); INSERT INTO gifi (accno,description) VALUES ('521530', 'DE TURISMO '); INSERT INTO gifi (accno,description) VALUES ('521535', 'TASA POR UTILIZACION DE PUERTOS '); INSERT INTO gifi (accno,description) VALUES ('521540', 'DE VEHICULOS '); INSERT INTO gifi (accno,description) VALUES ('521545', 'DE ESPECTACULOS PUBLICOS '); INSERT INTO gifi (accno,description) VALUES ('521550', 'CUOTAS DE FOMENTO '); INSERT INTO gifi (accno,description) VALUES ('521555', 'LICORES '); INSERT INTO gifi (accno,description) VALUES ('521560', 'CERVEZAS '); INSERT INTO gifi (accno,description) VALUES ('521565', 'CIGARRILLOS '); INSERT INTO gifi (accno,description) VALUES ('521570', 'IVA DESCONTABLE '); INSERT INTO gifi (accno,description) VALUES ('521595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('521599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5220', 'ARRENDAMIENTOS '); INSERT INTO gifi (accno,description) VALUES ('522005', 'TERRENOS '); INSERT INTO gifi (accno,description) VALUES ('522010', 'CONSTRUCCIONES Y EDIFICACIONES '); INSERT INTO gifi (accno,description) VALUES ('522015', 'MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('522020', 'EQUIPO DE OFICINA '); INSERT INTO gifi (accno,description) VALUES ('522025', 'EQUIPO DE COMPUTACION Y COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('522030', 'EQUIPO MEDICO - CIENTIFICO '); INSERT INTO gifi (accno,description) VALUES ('522035', 'EQUIPO DE HOTELES Y RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('522040', 'FLOTA Y EQUIPO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('522045', 'FLOTA Y EQUIPO FLUVIAL Y/O MARITIMO '); INSERT INTO gifi (accno,description) VALUES ('522050', 'FLOTA Y EQUIPO AEREO '); INSERT INTO gifi (accno,description) VALUES ('522055', 'FLOTA Y EQUIPO FERREO '); INSERT INTO gifi (accno,description) VALUES ('522060', 'ACUEDUCTOS PLANTAS Y REDES '); INSERT INTO gifi (accno,description) VALUES ('522065', 'AERODROMOS '); INSERT INTO gifi (accno,description) VALUES ('522070', 'SEMOVIENTES '); INSERT INTO gifi (accno,description) VALUES ('522095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('522099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5225', 'CONTRIBUCIONES Y AFILIACIONES '); INSERT INTO gifi (accno,description) VALUES ('522505', 'CONTRIBUCIONES '); INSERT INTO gifi (accno,description) VALUES ('522510', 'AFILIACIONES Y SOSTENIMIENTO '); INSERT INTO gifi (accno,description) VALUES ('522599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5230', 'SEGUROS '); INSERT INTO gifi (accno,description) VALUES ('523005', 'MANEJO '); INSERT INTO gifi (accno,description) VALUES ('523010', 'CUMPLIMIENTO '); INSERT INTO gifi (accno,description) VALUES ('523015', 'CORRIENTE DEBIL '); INSERT INTO gifi (accno,description) VALUES ('523020', 'VIDA COLECTIVA '); INSERT INTO gifi (accno,description) VALUES ('523025', 'INCENDIO '); INSERT INTO gifi (accno,description) VALUES ('523030', 'TERREMOTO '); INSERT INTO gifi (accno,description) VALUES ('523035', 'SUSTRACCION Y HURTO '); INSERT INTO gifi (accno,description) VALUES ('523040', 'FLOTA Y EQUIPO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('523045', 'FLOTA Y EQUIPO FLUVIAL Y/O MARITIMO '); INSERT INTO gifi (accno,description) VALUES ('523050', 'FLOTA Y EQUIPO AEREO '); INSERT INTO gifi (accno,description) VALUES ('523055', 'FLOTA Y EQUIPO FERREO '); INSERT INTO gifi (accno,description) VALUES ('523060', 'RESPONSABILIDAD CIVIL Y EXTRACONTRACTUAL '); INSERT INTO gifi (accno,description) VALUES ('523065', 'VUELO '); INSERT INTO gifi (accno,description) VALUES ('523070', 'ROTURA DE MAQUINARIA '); INSERT INTO gifi (accno,description) VALUES ('523075', 'OBLIGATORIO ACCIDENTE DE TRANSITO '); INSERT INTO gifi (accno,description) VALUES ('523080', 'LUCRO CESANTE '); INSERT INTO gifi (accno,description) VALUES ('523095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('523099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5235', 'SERVICIOS '); INSERT INTO gifi (accno,description) VALUES ('523505', 'ASEO Y VIGILANCIA '); INSERT INTO gifi (accno,description) VALUES ('523510', 'TEMPORALES '); INSERT INTO gifi (accno,description) VALUES ('523515', 'ASISTENCIA TECNICA '); INSERT INTO gifi (accno,description) VALUES ('523520', 'PROCESAMIENTO ELECTRONICO DE DATOS '); INSERT INTO gifi (accno,description) VALUES ('523525', 'ACUEDUCTO Y ALCANTARILLADO '); INSERT INTO gifi (accno,description) VALUES ('523530', 'ENERGIA ELECTRICA '); INSERT INTO gifi (accno,description) VALUES ('523535', 'TELEFONO '); INSERT INTO gifi (accno,description) VALUES ('523540', 'CORREO, PORTES Y TELEGRAMAS '); INSERT INTO gifi (accno,description) VALUES ('523545', 'FAX Y TELEX '); INSERT INTO gifi (accno,description) VALUES ('523550', 'TRANSPORTE, FLETES Y ACARREOS '); INSERT INTO gifi (accno,description) VALUES ('523555', 'GAS '); INSERT INTO gifi (accno,description) VALUES ('523560', 'PROPAGANDA Y PUBLICIDAD '); INSERT INTO gifi (accno,description) VALUES ('523595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('523599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5240', 'GASTOS LEGALES '); INSERT INTO gifi (accno,description) VALUES ('524005', 'NOTARIALES '); INSERT INTO gifi (accno,description) VALUES ('524010', 'REGISTRO MERCANTIL '); INSERT INTO gifi (accno,description) VALUES ('524015', 'TRAMITES Y LICENCIAS '); INSERT INTO gifi (accno,description) VALUES ('524020', 'ADUANEROS '); INSERT INTO gifi (accno,description) VALUES ('524025', 'CONSULARES '); INSERT INTO gifi (accno,description) VALUES ('524095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('524099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5245', 'MANTENIMIENTO Y REPARACIONES '); INSERT INTO gifi (accno,description) VALUES ('524505', 'TERRENOS '); INSERT INTO gifi (accno,description) VALUES ('524510', 'CONSTRUCCIONES Y EDIFICACIONES '); INSERT INTO gifi (accno,description) VALUES ('524515', 'MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('524520', 'EQUIPO DE OFICINA '); INSERT INTO gifi (accno,description) VALUES ('524525', 'EQUIPO DE COMPUTACION Y COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('524530', 'EQUIPO MEDICO - CIENTIFICO '); INSERT INTO gifi (accno,description) VALUES ('524535', 'EQUIPO DE HOTELES Y RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('524540', 'FLOTA Y EQUIPO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('524545', 'FLOTA Y EQUIPO FLUVIAL Y/O MARITIMO '); INSERT INTO gifi (accno,description) VALUES ('524550', 'FLOTA Y EQUIPO AEREO '); INSERT INTO gifi (accno,description) VALUES ('524555', 'FLOTA Y EQUIPO FERREO '); INSERT INTO gifi (accno,description) VALUES ('524560', 'ACUEDUCTOS PLANTAS Y REDES '); INSERT INTO gifi (accno,description) VALUES ('524565', 'ARMAMENTO DE VIGILANCIA '); INSERT INTO gifi (accno,description) VALUES ('524570', 'VIAS DE COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('524599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5250', 'ADECUACION E INSTALACION '); INSERT INTO gifi (accno,description) VALUES ('525005', 'INSTALACIONES ELECTRICAS '); INSERT INTO gifi (accno,description) VALUES ('525010', 'ARREGLOS ORNAMENTALES '); INSERT INTO gifi (accno,description) VALUES ('525015', 'REPARACIONES LOCATIVAS '); INSERT INTO gifi (accno,description) VALUES ('525095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('525099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5255', 'GASTOS DE VIAJE '); INSERT INTO gifi (accno,description) VALUES ('525505', 'ALOJAMIENTO Y MANUTENCION '); INSERT INTO gifi (accno,description) VALUES ('525510', 'PASAJES FLUVIALES Y/O MARITIMOS '); INSERT INTO gifi (accno,description) VALUES ('525515', 'PASAJES AEREOS '); INSERT INTO gifi (accno,description) VALUES ('525520', 'PASAJES TERRESTRES '); INSERT INTO gifi (accno,description) VALUES ('525525', 'PASAJES FERREOS '); INSERT INTO gifi (accno,description) VALUES ('525595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('525599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5260', 'DEPRECIACIONES '); INSERT INTO gifi (accno,description) VALUES ('526005', 'CONSTRUCCIONES Y EDIFICACIONES '); INSERT INTO gifi (accno,description) VALUES ('526010', 'MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('526015', 'EQUIPO DE OFICINA '); INSERT INTO gifi (accno,description) VALUES ('526020', 'EQUIPO DE COMPUTACION Y COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('526025', 'EQUIPO MEDICO - CIENTIFICO '); INSERT INTO gifi (accno,description) VALUES ('526030', 'EQUIPO DE HOTELES Y RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('526035', 'FLOTA Y EQUIPO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('526040', 'FLOTA Y EQUIPO FLUVIAL Y/O MARITIMO '); INSERT INTO gifi (accno,description) VALUES ('526045', 'FLOTA Y EQUIPO AEREO '); INSERT INTO gifi (accno,description) VALUES ('526050', 'FLOTA Y EQUIPO FERREO '); INSERT INTO gifi (accno,description) VALUES ('526055', 'ACUEDUCTOS, PLANTAS Y REDES '); INSERT INTO gifi (accno,description) VALUES ('526060', 'ARMAMENTO DE VIGILANCIA '); INSERT INTO gifi (accno,description) VALUES ('526065', 'ENVASES Y EMPAQUES '); INSERT INTO gifi (accno,description) VALUES ('526099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5265', 'AMORTIZACIONES '); INSERT INTO gifi (accno,description) VALUES ('526505', 'VIAS DE COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('526510', 'INTANGIBLES '); INSERT INTO gifi (accno,description) VALUES ('526515', 'CARGOS DIFERIDOS '); INSERT INTO gifi (accno,description) VALUES ('526595', 'OTRAS '); INSERT INTO gifi (accno,description) VALUES ('526599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5270', 'FINANCIEROS - REAJUSTE DEL SISTEMA '); INSERT INTO gifi (accno,description) VALUES ('527099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5295', 'DIVERSOS '); INSERT INTO gifi (accno,description) VALUES ('529505', 'COMISIONES '); INSERT INTO gifi (accno,description) VALUES ('529510', 'LIBROS, SUSCRIPCIONES, PERIODICOS Y REVISTAS '); INSERT INTO gifi (accno,description) VALUES ('529515', 'MUSICA AMBIENTAL '); INSERT INTO gifi (accno,description) VALUES ('529520', 'GASTOS DE REPRESENTACION Y RELACIONES PUBLICAS '); INSERT INTO gifi (accno,description) VALUES ('529525', 'ELEMENTOS DE ASEO Y CAFETERIA '); INSERT INTO gifi (accno,description) VALUES ('529530', 'UTILES, PAPELERIA Y FOTOCOPIAS '); INSERT INTO gifi (accno,description) VALUES ('529535', 'COMBUSTIBLES Y LUBRICANTES '); INSERT INTO gifi (accno,description) VALUES ('529540', 'ENVASES Y EMPAQUES '); INSERT INTO gifi (accno,description) VALUES ('529545', 'TAXIS Y BUSES '); INSERT INTO gifi (accno,description) VALUES ('529550', 'ESTAMPILLAS '); INSERT INTO gifi (accno,description) VALUES ('529555', 'MICROFILMACION '); INSERT INTO gifi (accno,description) VALUES ('529560', 'CASINO Y RESTAURANTE '); INSERT INTO gifi (accno,description) VALUES ('529565', 'PARQUEADEROS '); INSERT INTO gifi (accno,description) VALUES ('529570', 'INDEMNIZACION POR DAŃOS A TERCEROS '); INSERT INTO gifi (accno,description) VALUES ('529575', 'POLVORA Y SIMILARES '); INSERT INTO gifi (accno,description) VALUES ('529595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('529599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5299', 'PROVISIONES '); INSERT INTO gifi (accno,description) VALUES ('529905', 'INVERSIONES '); INSERT INTO gifi (accno,description) VALUES ('529910', 'DEUDORES '); INSERT INTO gifi (accno,description) VALUES ('529915', 'INVENTARIOS '); INSERT INTO gifi (accno,description) VALUES ('529920', 'PROPIEDADES, PLANTA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('529995', 'OTROS ACTIVOS '); INSERT INTO gifi (accno,description) VALUES ('529999', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('53', 'NO OPERACIONALES '); INSERT INTO gifi (accno,description) VALUES ('5305', 'FINANCIEROS '); INSERT INTO gifi (accno,description) VALUES ('530505', 'GASTOS BANCARIOS '); INSERT INTO gifi (accno,description) VALUES ('530510', 'REAJUSTE MONETARIO - UPAC '); INSERT INTO gifi (accno,description) VALUES ('530515', 'COMISIONES '); INSERT INTO gifi (accno,description) VALUES ('530520', 'INTERESES '); INSERT INTO gifi (accno,description) VALUES ('530525', 'DIFERENCIA EN CAMBIO '); INSERT INTO gifi (accno,description) VALUES ('530530', 'GASTOS EN NEGOCIACION CERTIFICADOS DE CAMBIO '); INSERT INTO gifi (accno,description) VALUES ('530535', 'DESCUENTOS COMERCIALES CONDICIONADOS '); INSERT INTO gifi (accno,description) VALUES ('530540', 'GASTOS MANEJO Y EMISION DE BONOS '); INSERT INTO gifi (accno,description) VALUES ('530545', 'PRIMA AMORTIZADA '); INSERT INTO gifi (accno,description) VALUES ('530595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('530599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5310', 'PERDIDA EN VENTA Y RETIRO DE BIENES '); INSERT INTO gifi (accno,description) VALUES ('531005', 'VENTA DE INVERSIONES '); INSERT INTO gifi (accno,description) VALUES ('531010', 'VENTA DE CARTERA '); INSERT INTO gifi (accno,description) VALUES ('531015', 'VENTA DE PROPIEDADES PLANTA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('531020', 'VENTA DE INTANGIBLES '); INSERT INTO gifi (accno,description) VALUES ('531025', 'VENTA DE OTROS ACTIVOS '); INSERT INTO gifi (accno,description) VALUES ('531030', 'RETIRO DE PROPIEDADES PLANTA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('531035', 'RETIRO DE OTROS ACTIVOS '); INSERT INTO gifi (accno,description) VALUES ('531040', 'PERDIDAS POR SINIESTROS '); INSERT INTO gifi (accno,description) VALUES ('531095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('531099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5315', 'GASTOS EXTRAORDINARIOS '); INSERT INTO gifi (accno,description) VALUES ('531505', 'COSTAS Y PROCESOS JUDICIALES '); INSERT INTO gifi (accno,description) VALUES ('531510', 'ACTIVIDADES CULTURALES Y CIVICAS '); INSERT INTO gifi (accno,description) VALUES ('531515', 'COSTOS Y GASTOS DE EJERCICIOS ANTERIORES '); INSERT INTO gifi (accno,description) VALUES ('531520', 'IMPUESTOS ASUMIDOS '); INSERT INTO gifi (accno,description) VALUES ('531595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('531599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('5395', 'GASTOS DIVERSOS '); INSERT INTO gifi (accno,description) VALUES ('539505', 'DEMANDAS LABORALES '); INSERT INTO gifi (accno,description) VALUES ('539510', 'DEMANDAS POR INCUMPLIMIENTO DE CONTRATOS '); INSERT INTO gifi (accno,description) VALUES ('539515', 'INDEMNIZACIONES '); INSERT INTO gifi (accno,description) VALUES ('539520', 'MULTAS, SANCIONES Y LITIGIOS '); INSERT INTO gifi (accno,description) VALUES ('539525', 'DONACIONES '); INSERT INTO gifi (accno,description) VALUES ('539530', 'CONSTITUCION DE GARANTIAS '); INSERT INTO gifi (accno,description) VALUES ('539535', 'AMORTIZACION DE BIENES ENTREGADOS EN COMODATO '); INSERT INTO gifi (accno,description) VALUES ('539595', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('539599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('54', 'IMPUESTO DE RENTA Y COMPLEMENTARIOS '); INSERT INTO gifi (accno,description) VALUES ('5405', 'IMPUESTO DE RENTA Y COMPLEMENTARIOS '); INSERT INTO gifi (accno,description) VALUES ('540505', 'IMPUESTO DE RENTA Y COMPLEMENTARIOS '); INSERT INTO gifi (accno,description) VALUES ('59', 'GANANCIAS Y PERDIDAS '); INSERT INTO gifi (accno,description) VALUES ('5905', 'GANANCIAS Y PERDIDAS '); INSERT INTO gifi (accno,description) VALUES ('590505', 'GANANCIAS Y PERDIDAS '); INSERT INTO gifi (accno,description) VALUES ('6', 'COSTOS DE VENTAS '); INSERT INTO gifi (accno,description) VALUES ('61', 'COSTO DE VENTAS Y DE PRESTACION DE SERVICIOS '); INSERT INTO gifi (accno,description) VALUES ('6105', 'AGRICULTURA, GANADERIA, CAZA Y SILVICULTURA '); INSERT INTO gifi (accno,description) VALUES ('610505', 'CULTIVO DE CEREALES '); INSERT INTO gifi (accno,description) VALUES ('610510', 'CULTIVOS DE HORTALIZAS, LEGUMBRES Y PLANTAS ORNAMENTALES '); INSERT INTO gifi (accno,description) VALUES ('610515', 'CULTIVOS DE FRUTAS, NUECES Y PLANTAS AROMATICAS '); INSERT INTO gifi (accno,description) VALUES ('610520', 'CULTIVO DE CAFE '); INSERT INTO gifi (accno,description) VALUES ('610525', 'CULTIVO DE FLORES '); INSERT INTO gifi (accno,description) VALUES ('610530', 'CULTIVO DE CAŃA DE AZUCAR '); INSERT INTO gifi (accno,description) VALUES ('610535', 'CULTIVO DE ALGODON Y PLANTAS PARA MATERIAL TEXTIL '); INSERT INTO gifi (accno,description) VALUES ('610540', 'CULTIVO DE BANANO '); INSERT INTO gifi (accno,description) VALUES ('610545', 'OTROS CULTIVOS AGRICOLAS '); INSERT INTO gifi (accno,description) VALUES ('610550', 'CRIA DE OVEJAS, CABRAS, ASNOS, MULAS Y BURDEGANOS '); INSERT INTO gifi (accno,description) VALUES ('610555', 'CRIA DE GANADO CABALLAR Y VACUNO. '); INSERT INTO gifi (accno,description) VALUES ('610560', 'PRODUCCION AVICOLA '); INSERT INTO gifi (accno,description) VALUES ('610565', 'CRIA DE OTROS ANIMALES '); INSERT INTO gifi (accno,description) VALUES ('610570', 'SERVICIOS AGRICOLAS Y GANADEROS '); INSERT INTO gifi (accno,description) VALUES ('610575', 'ACTIVIDAD DE CAZA '); INSERT INTO gifi (accno,description) VALUES ('610580', 'ACTIVIDAD DE SILVICULTURA '); INSERT INTO gifi (accno,description) VALUES ('610599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('6110', 'PESCA '); INSERT INTO gifi (accno,description) VALUES ('611005', 'ACTIVIDAD DE PESCA '); INSERT INTO gifi (accno,description) VALUES ('611010', 'EXPLOTACION DE CRIADEROS DE PECES '); INSERT INTO gifi (accno,description) VALUES ('611095', 'ACTIVIDADES CONEXAS '); INSERT INTO gifi (accno,description) VALUES ('611099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('6115', 'EXPLOTACION DE MINAS Y CANTERAS '); INSERT INTO gifi (accno,description) VALUES ('611505', 'CARBON '); INSERT INTO gifi (accno,description) VALUES ('611510', 'PETROLEO CRUDO '); INSERT INTO gifi (accno,description) VALUES ('611512', 'GAS NATURAL '); INSERT INTO gifi (accno,description) VALUES ('611514', 'SERVICIOS RELACIONADOS CON EXTRACCION DE PETROLEO Y GAS '); INSERT INTO gifi (accno,description) VALUES ('611515', 'MINERALES DE HIERRO '); INSERT INTO gifi (accno,description) VALUES ('611520', 'MINERALES METALIFEROS NO FERROSOS '); INSERT INTO gifi (accno,description) VALUES ('611525', 'PIEDRA, ARENA Y ARCILLA '); INSERT INTO gifi (accno,description) VALUES ('611527', 'PIEDRAS PRECIOSAS '); INSERT INTO gifi (accno,description) VALUES ('611528', 'ORO '); INSERT INTO gifi (accno,description) VALUES ('611530', 'OTRAS MINAS Y CANTERAS '); INSERT INTO gifi (accno,description) VALUES ('611532', 'PRESTACION DE SERVICIOS SECTOR MINERO '); INSERT INTO gifi (accno,description) VALUES ('611595', 'ACTIVIDADES CONEXAS '); INSERT INTO gifi (accno,description) VALUES ('611599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('6120', 'INDUSTRIAS MANUFACTURERAS '); INSERT INTO gifi (accno,description) VALUES ('612001', 'PRODUCCION Y PROCESAMIENTO DE CARNES Y PRODUCTOS CARNICOS '); INSERT INTO gifi (accno,description) VALUES ('612002', 'PRODUCTOS DE PESCADO '); INSERT INTO gifi (accno,description) VALUES ('612003', 'PRODUCTOS DE FRUTAS, LEGUMBRES Y HORTALIZAS '); INSERT INTO gifi (accno,description) VALUES ('612004', 'ELABORACION DE ACEITES Y GRASAS '); INSERT INTO gifi (accno,description) VALUES ('612005', 'ELABORACION DE PRODUCTOS LACTEOS '); INSERT INTO gifi (accno,description) VALUES ('612006', 'ELABORACION DE PRODUCTOS DE MOLINERIA '); INSERT INTO gifi (accno,description) VALUES ('612007', 'ELABORACION DE ALMIDONES Y DERIVADOS '); INSERT INTO gifi (accno,description) VALUES ('612008', 'ELABORACION DE ALIMENTOS PARA ANIMALES '); INSERT INTO gifi (accno,description) VALUES ('612009', 'ELABORACION DE PRODUCTOS PARA PANADERIA '); INSERT INTO gifi (accno,description) VALUES ('612010', 'ELABORACION DE AZUCAR Y MELAZAS '); INSERT INTO gifi (accno,description) VALUES ('612011', 'ELABORACION DE CACAO, CHOCOLATE Y CONFITERIA '); INSERT INTO gifi (accno,description) VALUES ('612012', 'ELABORACION DE PASTAS Y PRODUCTOS FARINACEOS '); INSERT INTO gifi (accno,description) VALUES ('612013', 'ELABORACION DE PRODUCTOS DE CAFE '); INSERT INTO gifi (accno,description) VALUES ('612014', 'ELABORACION DE OTROS PRODUCTOS ALIMENTICIOS '); INSERT INTO gifi (accno,description) VALUES ('612015', 'ELABORACION DE BEBIDAS ALCOHOLICAS Y ALCOHOL ETILICO '); INSERT INTO gifi (accno,description) VALUES ('612016', 'ELABORACION DE VINOS '); INSERT INTO gifi (accno,description) VALUES ('612017', 'ELABORACION DE BEBIDAS MALTEADAS Y DE MALTA '); INSERT INTO gifi (accno,description) VALUES ('612018', 'ELABORACION DE BEBIDAS NO ALCOHOLICAS '); INSERT INTO gifi (accno,description) VALUES ('612019', 'ELABORACION DE PRODUCTOS DE TABACO '); INSERT INTO gifi (accno,description) VALUES ('612020', 'PREPARACION E HILATURA DE FIBRAS TEXTILES Y TEJEDURIA '); INSERT INTO gifi (accno,description) VALUES ('612021', 'ACABADO DE PRODUCTOS TEXTILES '); INSERT INTO gifi (accno,description) VALUES ('612022', 'ELABORACION DE ARTICULOS DE MATERIALES TEXTILES '); INSERT INTO gifi (accno,description) VALUES ('612023', 'ELABORACION DE TAPICES Y ALFOMBRAS '); INSERT INTO gifi (accno,description) VALUES ('612024', 'ELABORACION DE CUERDAS, CORDELES, BRAMANTES Y REDES '); INSERT INTO gifi (accno,description) VALUES ('612025', 'ELABORACION DE OTROS PRODUCTOS TEXTILES '); INSERT INTO gifi (accno,description) VALUES ('612026', 'ELABORACION DE TEJIDOS '); INSERT INTO gifi (accno,description) VALUES ('612027', 'ELABORACION DE PRENDAS DE VESTIR '); INSERT INTO gifi (accno,description) VALUES ('612028', 'PREPARACION, ADOBO Y TEŃIDO DE PIELES '); INSERT INTO gifi (accno,description) VALUES ('612029', 'CURTIDO, ADOBO O PREPARACION DE CUERO '); INSERT INTO gifi (accno,description) VALUES ('612030', 'ELABORACION DE MALETAS, BOLSOS Y SIMILARES '); INSERT INTO gifi (accno,description) VALUES ('612031', 'ELABORACION DE CALZADO '); INSERT INTO gifi (accno,description) VALUES ('612032', 'PRODUCCION DE MADERA, ARTICULOS DE MADERA Y CORCHO '); INSERT INTO gifi (accno,description) VALUES ('612033', 'ELABORACION DE PASTA Y PRODUCTOS DE MADERA, PAPEL Y CARTON '); INSERT INTO gifi (accno,description) VALUES ('612034', 'EDICIONES Y PUBLICACIONES '); INSERT INTO gifi (accno,description) VALUES ('612035', 'IMPRESION '); INSERT INTO gifi (accno,description) VALUES ('612036', 'SERVICIOS RELACIONADOS CON LA EDICION Y LA IMPRESION '); INSERT INTO gifi (accno,description) VALUES ('612037', 'REPRODUCCION DE GRABACIONES '); INSERT INTO gifi (accno,description) VALUES ('612038', 'ELABORACION DE PRODUCTOS DE HORNO DE COQUE '); INSERT INTO gifi (accno,description) VALUES ('612039', 'ELABORACION DE PRODUCTOS DE LA REFINACION DE PETROLEO '); INSERT INTO gifi (accno,description) VALUES ('612040', 'ELABORACION DE SUSTANCIAS QUIMICAS BASICAS '); INSERT INTO gifi (accno,description) VALUES ('612041', 'ELABORACION DE ABONOS Y COMPUESTOS DE NITROGENO '); INSERT INTO gifi (accno,description) VALUES ('612042', 'ELABORACION DE PLASTICO Y CAUCHO SINTETICO '); INSERT INTO gifi (accno,description) VALUES ('612043', 'ELABORACION DE PRODUCTOS QUIMICOS DE USO AGROPECUARIO '); INSERT INTO gifi (accno,description) VALUES ('612044', 'ELABORACION DE PINTURAS, TINTAS Y MASILLAS '); INSERT INTO gifi (accno,description) VALUES ('612045', 'ELABORACION DE PRODUCTOS FARMACEUTICOS Y BOTANICOS '); INSERT INTO gifi (accno,description) VALUES ('612046', 'ELABORACION DE JABONES, DETERGENTES Y PREPARADOS DE TOCADOR '); INSERT INTO gifi (accno,description) VALUES ('612047', 'ELABORACION DE OTROS PRODUCTOS QUIMICOS '); INSERT INTO gifi (accno,description) VALUES ('612048', 'ELABORACION DE FIBRAS '); INSERT INTO gifi (accno,description) VALUES ('612049', 'ELABORACION DE OTROS PRODUCTOS DE CAUCHO '); INSERT INTO gifi (accno,description) VALUES ('612050', 'ELABORACION DE PRODUCTOS DE PLASTICO '); INSERT INTO gifi (accno,description) VALUES ('612051', 'ELABORACION DE VIDRIO Y PRODUCTOS DE VIDRIO '); INSERT INTO gifi (accno,description) VALUES ('612052', 'ELABORACION DE PRODUCTOS DE CERAMICA, LOZA, PIEDRA, ARCILLA Y PORCELANA '); INSERT INTO gifi (accno,description) VALUES ('612053', 'ELABORACION DE CEMENTO, CAL Y YESO '); INSERT INTO gifi (accno,description) VALUES ('612054', 'ELABORACION DE ARTICULOS DE HORMIGON, CEMENTO Y YESO '); INSERT INTO gifi (accno,description) VALUES ('612055', 'CORTE, TALLADO Y ACABADO DE LA PIEDRA '); INSERT INTO gifi (accno,description) VALUES ('612056', 'ELABORACION DE OTROS PRODUCTOS MINERALES NO METALICOS '); INSERT INTO gifi (accno,description) VALUES ('612057', 'INDUSTRIAS BASICAS Y FUNDICION DE HIERRO Y ACERO '); INSERT INTO gifi (accno,description) VALUES ('612058', 'PRODUCTOS PRIMARIOS DE METALES PRECIOSOS Y DE METALES NO FERROSOS '); INSERT INTO gifi (accno,description) VALUES ('612059', 'FUNDICION DE METALES NO FERROSOS '); INSERT INTO gifi (accno,description) VALUES ('612060', 'FABRICACION DE PRODUCTOS METALICOS PARA USO ESTRUCTURAL '); INSERT INTO gifi (accno,description) VALUES ('612061', 'FORJA, PRENSADO, ESTAMPADO, LAMINADO DE METAL Y '); INSERT INTO gifi (accno,description) VALUES ('612062', 'REVESTIMIENTO DE METALES Y OBRAS DE INGENIERIA MECANICA '); INSERT INTO gifi (accno,description) VALUES ('612063', 'FABRICACION DE ARTICULOS DE FERRETERIA '); INSERT INTO gifi (accno,description) VALUES ('612064', 'ELABORACION DE OTROS PRODUCTOS DE METAL '); INSERT INTO gifi (accno,description) VALUES ('612065', 'FABRICACION DE MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('612066', 'FABRICACION DE EQUIPOS DE ELEVACION Y MANIPULACION '); INSERT INTO gifi (accno,description) VALUES ('612067', 'ELABORACION DE APARATOS DE USO DOMESTICO '); INSERT INTO gifi (accno,description) VALUES ('612068', 'ELABORACION DE EQUIPO DE OFICINA '); INSERT INTO gifi (accno,description) VALUES ('612069', 'ELABORACION DE PILAS Y BATERIAS PRIMARIAS '); INSERT INTO gifi (accno,description) VALUES ('612070', 'ELABORACION DE EQUIPO DE ILUMINACION '); INSERT INTO gifi (accno,description) VALUES ('612071', 'ELABORACION DE OTROS TIPOS DE EQUIPO ELECTRICO '); INSERT INTO gifi (accno,description) VALUES ('612072', 'FABRICACION DE EQUIPOS DE RADIO, TELEVISION Y COMUNICACIONES '); INSERT INTO gifi (accno,description) VALUES ('612073', 'FABRICACION DE APARATOS E INSTRUMENTOS MEDICOS '); INSERT INTO gifi (accno,description) VALUES ('612074', 'FABRICACION DE INSTRUMENTOS DE MEDICION Y CONTROL '); INSERT INTO gifi (accno,description) VALUES ('612075', 'FABRICACION DE INSTRUMENTOS DE OPTICA Y EQUIPO FOTOGRAFICO '); INSERT INTO gifi (accno,description) VALUES ('612076', 'FABRICACION DE RELOJES '); INSERT INTO gifi (accno,description) VALUES ('612077', 'FABRICACION DE VEHICULOS AUTOMOTORES '); INSERT INTO gifi (accno,description) VALUES ('612078', 'FABRICACION DE CARROCERIAS PARA AUTOMOTORES '); INSERT INTO gifi (accno,description) VALUES ('612079', 'FABRICACION DE PARTES PIEZAS Y ACCESORIOS PARA AUTOMOTORES '); INSERT INTO gifi (accno,description) VALUES ('612080', 'FABRICACION Y REPARACION DE BUQUES Y OTRAS EMBARCACIONES '); INSERT INTO gifi (accno,description) VALUES ('612081', 'FABRICACION DE LOCOMOTORAS Y MATERIAL RODANTE PARA FERROCARRILES '); INSERT INTO gifi (accno,description) VALUES ('612082', 'FABRICACION DE AERONAVES '); INSERT INTO gifi (accno,description) VALUES ('612083', 'FABRICACION DE MOTOCICLETAS '); INSERT INTO gifi (accno,description) VALUES ('612084', 'FABRICACION DE BICICLETAS Y SILLAS DE RUEDAS '); INSERT INTO gifi (accno,description) VALUES ('612085', 'FABRICACION DE OTROS TIPOS DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('612086', 'FABRICACION DE MUEBLES '); INSERT INTO gifi (accno,description) VALUES ('612087', 'FABRICACION DE JOYAS Y ARTICULOS CONEXOS '); INSERT INTO gifi (accno,description) VALUES ('612088', 'FABRICACION DE INSTRUMENTOS DE MUSICA '); INSERT INTO gifi (accno,description) VALUES ('612089', 'FABRICACION DE ARTICULOS Y EQUIPO PARA DEPORTE '); INSERT INTO gifi (accno,description) VALUES ('612090', 'FABRICACION DE JUEGOS Y JUGUETES '); INSERT INTO gifi (accno,description) VALUES ('612091', 'RECICLAMIENTO DE DESPERDICIOS '); INSERT INTO gifi (accno,description) VALUES ('612095', 'PRODUCTOS DE OTRAS INDUSTRIAS MANUFACTURERAS '); INSERT INTO gifi (accno,description) VALUES ('612099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('6125', 'SUMINISTRO DE ELECTRICIDAD, GAS Y AGUA '); INSERT INTO gifi (accno,description) VALUES ('612505', 'GENERACION, CAPTACION Y DISTRIBUCION DE ENERGIA ELECTRICA '); INSERT INTO gifi (accno,description) VALUES ('612510', 'FABRICACION DE GAS Y DISTRIBUCION DE COMBUSTIBLES GASEOSOS '); INSERT INTO gifi (accno,description) VALUES ('612515', 'CAPTACION, DEPURACION Y DISTRIBUCION DE AGUA '); INSERT INTO gifi (accno,description) VALUES ('612595', 'ACTIVIDADES CONEXAS '); INSERT INTO gifi (accno,description) VALUES ('612599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('6130', 'CONSTRUCCION '); INSERT INTO gifi (accno,description) VALUES ('613005', 'PREPARACION DE TERRENOS '); INSERT INTO gifi (accno,description) VALUES ('613010', 'CONSTRUCCION DE EDIFICIOS Y OBRAS DE INGENIERIA CIVIL '); INSERT INTO gifi (accno,description) VALUES ('613015', 'ACONDICIONAMIENTO DE EDIFICIOS '); INSERT INTO gifi (accno,description) VALUES ('613020', 'TERMINACION DE EDIFICACIONES '); INSERT INTO gifi (accno,description) VALUES ('613025', 'ALQUILER DE EQUIPO CON OPERARIO '); INSERT INTO gifi (accno,description) VALUES ('613095', 'ACTIVIDADES CONEXAS '); INSERT INTO gifi (accno,description) VALUES ('613099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('6135', 'COMERCIO AL POR MAYOR Y AL POR MENOR '); INSERT INTO gifi (accno,description) VALUES ('613502', 'VENTA DE VEHICULOS AUTOMOTORES '); INSERT INTO gifi (accno,description) VALUES ('613504', 'MANTENIMIENTO, REPARACION Y LAVADO DE VEHICULOS AUTOMOTORES '); INSERT INTO gifi (accno,description) VALUES ('613506', 'VENTA DE PARTES, PIEZAS Y ACCESORIOS DE VEHICULOS AUTOMOTORES '); INSERT INTO gifi (accno,description) VALUES ('613508', 'VENTA DE COMBUSTIBLES SOLIDOS, LIQUIDOS, GASEOSOS '); INSERT INTO gifi (accno,description) VALUES ('613510', 'VENTA DE LUBRICANTES, ADITIVOS, LLANTAS Y LUJOS PARA AUTOMOTORES '); INSERT INTO gifi (accno,description) VALUES ('613512', 'VENTA A CAMBIO DE RETRIBUCION O POR CONTRATA '); INSERT INTO gifi (accno,description) VALUES ('613514', 'VENTA DE INSUMOS, MATERIAS PRIMAS AGROPECUARIAS Y FLORES '); INSERT INTO gifi (accno,description) VALUES ('613516', 'VENTA DE OTROS INSUMOS Y MATERIAS PRIMAS NO AGROPECUARIAS '); INSERT INTO gifi (accno,description) VALUES ('613518', 'VENTA DE ANIMALES VIVOS Y CUEROS '); INSERT INTO gifi (accno,description) VALUES ('613520', 'VENTA DE PRODUCTOS EN ALMACENES NO ESPECIALIZADOS '); INSERT INTO gifi (accno,description) VALUES ('613522', 'VENTA DE PRODUCTOS AGROPECUARIOS '); INSERT INTO gifi (accno,description) VALUES ('613524', 'VENTA DE PRODUCTOS TEXTILES, DE VESTIR, DE CUERO Y CALZADO '); INSERT INTO gifi (accno,description) VALUES ('613526', 'VENTA DE PAPEL Y CARTON '); INSERT INTO gifi (accno,description) VALUES ('613528', 'VENTA DE LIBROS, REVISTAS, ELEMENTOS DE PAPELERIA, UTILES Y TEXTOS ESCOLARES '); INSERT INTO gifi (accno,description) VALUES ('613530', 'VENTA DE JUEGOS, JUGUETES Y ARTICULOS DEPORTIVOS '); INSERT INTO gifi (accno,description) VALUES ('613532', 'VENTA DE INSTRUMENTOS QUIRURGICOS Y ORTOPEDICOS '); INSERT INTO gifi (accno,description) VALUES ('613534', 'VENTA DE ARTICULOS EN RELOJERIAS Y JOYERIAS '); INSERT INTO gifi (accno,description) VALUES ('613536', 'VENTA DE ELECTRODOMESTICOS Y MUEBLES '); INSERT INTO gifi (accno,description) VALUES ('613538', 'VENTA DE PRODUCTOS DE ASEO, FARMACEUTICOS, MEDICINALES, Y ARTICULOS DE TOCADOR '); INSERT INTO gifi (accno,description) VALUES ('613540', 'VENTA DE CUBIERTOS, VAJILLAS, CRISTALERIA, PORCELANAS, CERAMICAS Y OTROS ARTICULOS DE USO DOMESTICO '); INSERT INTO gifi (accno,description) VALUES ('613542', 'VENTA DE MATERIALES DE CONSTRUCCION, FONTANERIA Y CALEFACCION '); INSERT INTO gifi (accno,description) VALUES ('613544', 'VENTA DE PINTURAS Y LACAS '); INSERT INTO gifi (accno,description) VALUES ('613546', 'VENTA DE PRODUCTOS DE VIDRIOS Y MARQUETERIA '); INSERT INTO gifi (accno,description) VALUES ('613548', 'VENTA DE HERRAMIENTAS Y ARTICULOS DE FERRETERIA '); INSERT INTO gifi (accno,description) VALUES ('613550', 'VENTA DE QUIMICOS '); INSERT INTO gifi (accno,description) VALUES ('613552', 'VENTA DE PRODUCTOS INTERMEDIOS, DESPERDICIOS Y DESECHOS '); INSERT INTO gifi (accno,description) VALUES ('613554', 'VENTA DE MAQUINARIA, EQUIPO DE OFICINA Y PROGRAMAS DE COMPUTADOR '); INSERT INTO gifi (accno,description) VALUES ('613556', 'VENTA DE ARTICULOS EN CACHARRERIAS Y MISCELANEAS '); INSERT INTO gifi (accno,description) VALUES ('613558', 'VENTA DE INSTRUMENTOS MUSICALES '); INSERT INTO gifi (accno,description) VALUES ('613560', 'VENTA DE ARTICULOS EN CASAS DE EMPEŃO Y PRENDERIAS '); INSERT INTO gifi (accno,description) VALUES ('613562', 'VENTA DE EQUIPO FOTOGRAFICO '); INSERT INTO gifi (accno,description) VALUES ('613564', 'VENTA DE EQUIPO OPTICO Y DE PRECISION '); INSERT INTO gifi (accno,description) VALUES ('613566', 'VENTA DE EMPAQUES '); INSERT INTO gifi (accno,description) VALUES ('613568', 'VENTA DE EQUIPO PROFESIONAL Y CIENTIFICO '); INSERT INTO gifi (accno,description) VALUES ('613570', 'VENTA DE LOTERIAS, RIFAS, CHANCE, APUESTAS Y SIMILARES '); INSERT INTO gifi (accno,description) VALUES ('613572', 'REPARACION DE EFECTOS PERSONALES Y ELECTRODOMESTICOS '); INSERT INTO gifi (accno,description) VALUES ('613595', 'VENTA DE OTROS PRODUCTOS '); INSERT INTO gifi (accno,description) VALUES ('613599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('6140', 'HOTELES Y RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('614005', 'HOTELERIA '); INSERT INTO gifi (accno,description) VALUES ('614010', 'CAMPAMENTO Y OTROS TIPOS DE HOSPEDAJE '); INSERT INTO gifi (accno,description) VALUES ('614015', 'RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('614020', 'BARES Y CANTINAS '); INSERT INTO gifi (accno,description) VALUES ('614095', 'ACTIVIDADES CONEXAS '); INSERT INTO gifi (accno,description) VALUES ('614099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('6145', 'TRANSPORTE, ALMACENAMIENTO Y COMUNICACIONES '); INSERT INTO gifi (accno,description) VALUES ('614505', 'SERVICIO DE TRANSPORTE POR CARRETERA '); INSERT INTO gifi (accno,description) VALUES ('614510', 'SERVICIO DE TRANSPORTE POR VIA FERREA '); INSERT INTO gifi (accno,description) VALUES ('614515', 'SERVICIO DE TRANSPORTE POR VIA ACUATICA '); INSERT INTO gifi (accno,description) VALUES ('614520', 'SERVICIO DE TRANSPORTE POR VIA AEREA '); INSERT INTO gifi (accno,description) VALUES ('614525', 'SERVICIO DE TRANSPORTE POR TUBERIAS '); INSERT INTO gifi (accno,description) VALUES ('614530', 'MANIPULACION DE CARGA '); INSERT INTO gifi (accno,description) VALUES ('614535', 'ALMACENAMIENTO Y DEPOSITO '); INSERT INTO gifi (accno,description) VALUES ('614540', 'SERVICIOS COMPLEMENTARIOS PARA EL TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('614545', 'AGENCIAS DE VIAJE '); INSERT INTO gifi (accno,description) VALUES ('614550', 'OTRAS AGENCIAS DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('614555', 'SERVICIO POSTAL Y DE CORREO '); INSERT INTO gifi (accno,description) VALUES ('614560', 'SERVICIO TELEFONICO '); INSERT INTO gifi (accno,description) VALUES ('614565', 'SERVICIO DE TELEGRAFO '); INSERT INTO gifi (accno,description) VALUES ('614570', 'SERVICIO DE TRANSMISION DE DATOS '); INSERT INTO gifi (accno,description) VALUES ('614575', 'SERVICIO DE RADIO Y TELEVISION POR CABLE '); INSERT INTO gifi (accno,description) VALUES ('614580', 'TRANSMISION DE SONIDO E IMAGENES POR CONTRATO '); INSERT INTO gifi (accno,description) VALUES ('614595', 'ACTIVIDADES CONEXAS '); INSERT INTO gifi (accno,description) VALUES ('614599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('6150', 'ACTIVIDAD FINANCIERA '); INSERT INTO gifi (accno,description) VALUES ('615005', 'DE INVERSIONES '); INSERT INTO gifi (accno,description) VALUES ('615010', 'DE SERVICIO DE BOLSA '); INSERT INTO gifi (accno,description) VALUES ('615099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('6155', 'ACTIVIDADES INMOBILIARIAS, EMPRESARIALES Y DE ALQUILER '); INSERT INTO gifi (accno,description) VALUES ('615505', 'ARRENDAMIENTOS DE BIENES INMUEBLES '); INSERT INTO gifi (accno,description) VALUES ('615510', 'INMOBILIARIAS POR RETRIBUCION O CONTRATA '); INSERT INTO gifi (accno,description) VALUES ('615515', 'ALQUILER EQUIPO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('615520', 'ALQUILER MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('615525', 'ALQUILER DE EFECTOS PERSONALES Y ENSERES DOMESTICOS '); INSERT INTO gifi (accno,description) VALUES ('615530', 'CONSULTORIA EN EQUIPO Y PROGRAMAS DE INFORMATICA '); INSERT INTO gifi (accno,description) VALUES ('615535', 'PROCESAMIENTO DE DATOS '); INSERT INTO gifi (accno,description) VALUES ('615540', 'MANTENIMIENTO Y REPARACION DE MAQUINARIA DE OFICINA '); INSERT INTO gifi (accno,description) VALUES ('615545', 'INVESTIGACIONES CIENTIFICAS Y DE DESARROLLO '); INSERT INTO gifi (accno,description) VALUES ('615550', 'ACTIVIDADES EMPRESARIALES DE CONSULTORIA '); INSERT INTO gifi (accno,description) VALUES ('615555', 'PUBLICIDAD '); INSERT INTO gifi (accno,description) VALUES ('615560', 'DOTACION DE PERSONAL '); INSERT INTO gifi (accno,description) VALUES ('615565', 'INVESTIGACION Y SEGURIDAD '); INSERT INTO gifi (accno,description) VALUES ('615570', 'LIMPIEZA DE INMUEBLES '); INSERT INTO gifi (accno,description) VALUES ('615575', 'FOTOGRAFIA '); INSERT INTO gifi (accno,description) VALUES ('615580', 'ENVASE Y EMPAQUE '); INSERT INTO gifi (accno,description) VALUES ('615585', 'FOTOCOPIADO '); INSERT INTO gifi (accno,description) VALUES ('615590', 'MANTENIMIENTO Y REPARACION DE MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('615595', 'ACTIVIDADES CONEXAS '); INSERT INTO gifi (accno,description) VALUES ('615599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('6160', 'ENSEŃANZA '); INSERT INTO gifi (accno,description) VALUES ('616005', 'ACTIVIDADES RELACIONADAS CON LA EDUCACION '); INSERT INTO gifi (accno,description) VALUES ('610595', 'ACTIVIDADES CONEXAS '); INSERT INTO gifi (accno,description) VALUES ('616099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('6165', 'SERVICIOS SOCIALES Y DE SALUD '); INSERT INTO gifi (accno,description) VALUES ('616505', 'SERVICIO HOSPITALARIO '); INSERT INTO gifi (accno,description) VALUES ('616510', 'SERVICIO MEDICO '); INSERT INTO gifi (accno,description) VALUES ('616515', 'SERVICIO ODONTOLOGICO '); INSERT INTO gifi (accno,description) VALUES ('616520', 'SERVICIO DE LABORATORIO '); INSERT INTO gifi (accno,description) VALUES ('616525', 'ACTIVIDADES VETERINARIAS '); INSERT INTO gifi (accno,description) VALUES ('616530', 'ACTIVIDADES DE SERVICIOS SOCIALES '); INSERT INTO gifi (accno,description) VALUES ('616595', 'ACTIVIDADES CONEXAS '); INSERT INTO gifi (accno,description) VALUES ('616599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('6170', 'OTRAS ACTIVIDADES DE SERVICIOS COMUNITARIOS, SOCIALES Y PERSONALES '); INSERT INTO gifi (accno,description) VALUES ('617005', 'ELIMINACION DE DESPERDICIOS Y AGUAS RESIDUALES '); INSERT INTO gifi (accno,description) VALUES ('617010', 'ACTIVIDADES DE ASOCIACION '); INSERT INTO gifi (accno,description) VALUES ('617015', 'PRODUCCION Y DISTRIBUCION DE FILMES Y VIDEOCINTAS '); INSERT INTO gifi (accno,description) VALUES ('617020', 'EXHIBICION DE FILMES Y VIDEOCINTAS '); INSERT INTO gifi (accno,description) VALUES ('617025', 'ACTIVIDAD DE RADIO Y TELEVISION '); INSERT INTO gifi (accno,description) VALUES ('617030', 'ACTIVIDAD TEATRAL, MUSICAL Y ARTISTICA '); INSERT INTO gifi (accno,description) VALUES ('617035', 'GRABACION Y PRODUCCION DE DISCOS '); INSERT INTO gifi (accno,description) VALUES ('617040', 'ENTRETENIMIENTO Y ESPARCIMIENTO '); INSERT INTO gifi (accno,description) VALUES ('617045', 'AGENCIAS DE NOTICIAS '); INSERT INTO gifi (accno,description) VALUES ('617050', 'LAVANDERIAS Y SIMILARES '); INSERT INTO gifi (accno,description) VALUES ('617055', 'PELUQUERIAS Y SIMILARES '); INSERT INTO gifi (accno,description) VALUES ('617060', 'SERVICIOS FUNERARIOS '); INSERT INTO gifi (accno,description) VALUES ('617065', 'ZONAS FRANCAS '); INSERT INTO gifi (accno,description) VALUES ('617095', 'ACTIVIDADES CONEXAS '); INSERT INTO gifi (accno,description) VALUES ('617099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('62', 'COMPRAS '); INSERT INTO gifi (accno,description) VALUES ('6205', 'DE MERCANCIAS '); INSERT INTO gifi (accno,description) VALUES ('620599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('6210', 'DE MATERIAS PRIMAS '); INSERT INTO gifi (accno,description) VALUES ('621099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('6215', 'DE MATERIALES INDIRECTOS '); INSERT INTO gifi (accno,description) VALUES ('621599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('6220', 'COMPRA DE ENERGIA '); INSERT INTO gifi (accno,description) VALUES ('622099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('6225', 'DEVOLUCIONES REBAJAS Y DESCUENTOS EN COMPRAS (CR) '); INSERT INTO gifi (accno,description) VALUES ('622599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('7', 'COSTOS DE PRODUCCION O DE OPERACION '); INSERT INTO gifi (accno,description) VALUES ('71', 'MATERIA PRIMA '); INSERT INTO gifi (accno,description) VALUES ('72', 'MANO DE OBRA DIRECTA '); INSERT INTO gifi (accno,description) VALUES ('73', 'COSTOS INDIRECTOS '); INSERT INTO gifi (accno,description) VALUES ('74', 'CONTRATOS DE SERVICIOS '); INSERT INTO gifi (accno,description) VALUES ('8', 'CUENTAS DE ORDEN DEUDORAS '); INSERT INTO gifi (accno,description) VALUES ('81', 'DERECHOS CONTINGENTES '); INSERT INTO gifi (accno,description) VALUES ('8105', 'BIENES Y VALORES ENTREGADOS EN CUSTODIA '); INSERT INTO gifi (accno,description) VALUES ('810505', 'VALORES MOBILIARIOS '); INSERT INTO gifi (accno,description) VALUES ('810510', 'BIENES MUEBLES '); INSERT INTO gifi (accno,description) VALUES ('810599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('8110', 'BIENES Y VALORES ENTREGADOS EN GARANTIA '); INSERT INTO gifi (accno,description) VALUES ('811005', 'VALORES MOBILIARIOS '); INSERT INTO gifi (accno,description) VALUES ('811010', 'BIENES MUEBLES '); INSERT INTO gifi (accno,description) VALUES ('811015', 'BIENES INMUEBLES '); INSERT INTO gifi (accno,description) VALUES ('811020', 'CONTRATOS DE GANADO EN PARTICIPACION '); INSERT INTO gifi (accno,description) VALUES ('811099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('8115', 'BIENES Y VALORES EN PODER DE TERCEROS '); INSERT INTO gifi (accno,description) VALUES ('811505', 'EN ARRENDAMIENTO '); INSERT INTO gifi (accno,description) VALUES ('811510', 'EN PRESTAMO '); INSERT INTO gifi (accno,description) VALUES ('811515', 'EN DEPOSITO '); INSERT INTO gifi (accno,description) VALUES ('811520', 'EN CONSIGNACION '); INSERT INTO gifi (accno,description) VALUES ('811599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('8120', 'LITIGIOS Y/O DEMANDAS '); INSERT INTO gifi (accno,description) VALUES ('812005', 'EJECUTIVOS '); INSERT INTO gifi (accno,description) VALUES ('812010', 'INCUMPLIMIENTO DE CONTRATOS '); INSERT INTO gifi (accno,description) VALUES ('8125', 'PROMESAS DE COMPRAVENTA '); INSERT INTO gifi (accno,description) VALUES ('8195', 'DIVERSAS '); INSERT INTO gifi (accno,description) VALUES ('819505', 'VALORES ADQUIRIDOS POR RECIBIR '); INSERT INTO gifi (accno,description) VALUES ('819595', 'OTRAS '); INSERT INTO gifi (accno,description) VALUES ('819599', 'AJUSTES POR INFLACION. '); INSERT INTO gifi (accno,description) VALUES ('82', 'DEUDORAS FISCALES '); INSERT INTO gifi (accno,description) VALUES ('83', 'DEUDORAS DE CONTROL '); INSERT INTO gifi (accno,description) VALUES ('8305', 'BIENES RECIBIDOS EN ARRENDAMIENTO FINANCIERO '); INSERT INTO gifi (accno,description) VALUES ('830505', 'BIENES MUEBLES '); INSERT INTO gifi (accno,description) VALUES ('830510', 'BIENES INMUEBLES '); INSERT INTO gifi (accno,description) VALUES ('830599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('8310', 'TITULOS DE INVERSION NO COLOCADOS '); INSERT INTO gifi (accno,description) VALUES ('831005', 'ACCIONES '); INSERT INTO gifi (accno,description) VALUES ('831010', 'BONOS '); INSERT INTO gifi (accno,description) VALUES ('831095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('8315', 'PROPIEDADES PLANTA Y EQUIPO TOTALMENTE DEPRECIADOS, AGOTADOS Y/O AMORTIZADOS '); INSERT INTO gifi (accno,description) VALUES ('831506', 'MATERIALES PROYECTOS PETROLEROS '); INSERT INTO gifi (accno,description) VALUES ('831516', 'CONSTRUCCIONES Y EDIFICACIONES '); INSERT INTO gifi (accno,description) VALUES ('831520', 'MAQUINARIA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('831524', 'EQUIPO DE OFICINA '); INSERT INTO gifi (accno,description) VALUES ('831528', 'EQUIPO DE COMPUTACION Y COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('831532', 'EQUIPO MEDICO - CIENTIFICO '); INSERT INTO gifi (accno,description) VALUES ('831536', 'EQUIPO DE HOTELES Y RESTAURANTES '); INSERT INTO gifi (accno,description) VALUES ('831540', 'FLOTA Y EQUIPO DE TRANSPORTE '); INSERT INTO gifi (accno,description) VALUES ('831544', 'FLOTA Y EQUIPO FLUVIAL Y/O MARITIMO '); INSERT INTO gifi (accno,description) VALUES ('831548', 'FLOTA Y EQUIPO AEREO '); INSERT INTO gifi (accno,description) VALUES ('831552', 'FLOTA Y EQUIPO FERREO '); INSERT INTO gifi (accno,description) VALUES ('831556', 'ACUEDUCTOS, PLANTAS Y REDES '); INSERT INTO gifi (accno,description) VALUES ('831560', 'ARMAMENTO DE VIGILANCIA '); INSERT INTO gifi (accno,description) VALUES ('831562', 'ENVASES Y EMPAQUES '); INSERT INTO gifi (accno,description) VALUES ('831564', 'PLANTACIONES AGRICOLAS Y FORESTALES '); INSERT INTO gifi (accno,description) VALUES ('831568', 'VIAS DE COMUNICACION '); INSERT INTO gifi (accno,description) VALUES ('831572', 'MINAS Y CANTERAS '); INSERT INTO gifi (accno,description) VALUES ('831576', 'POZOS ARTESIANOS '); INSERT INTO gifi (accno,description) VALUES ('831580', 'YACIMIENTOS '); INSERT INTO gifi (accno,description) VALUES ('831584', 'SEMOVIENTES '); INSERT INTO gifi (accno,description) VALUES ('831599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('8320', 'CREDITOS A FAVOR NO UTILIZADOS '); INSERT INTO gifi (accno,description) VALUES ('832005', 'PAIS '); INSERT INTO gifi (accno,description) VALUES ('832010', 'EXTERIOR '); INSERT INTO gifi (accno,description) VALUES ('8325', 'ACTIVOS CASTIGADOS '); INSERT INTO gifi (accno,description) VALUES ('832505', 'INVERSIONES '); INSERT INTO gifi (accno,description) VALUES ('832510', 'DEUDORES '); INSERT INTO gifi (accno,description) VALUES ('832595', 'OTROS ACTIVOS '); INSERT INTO gifi (accno,description) VALUES ('8330', 'TITULOS DE INVERSION AMORTIZADOS '); INSERT INTO gifi (accno,description) VALUES ('833005', 'BONOS '); INSERT INTO gifi (accno,description) VALUES ('833095', 'OTROS '); INSERT INTO gifi (accno,description) VALUES ('8335', 'CAPITALIZACION POR REVALORIZACION DE PATRIMONIO '); INSERT INTO gifi (accno,description) VALUES ('8395', 'OTRAS CUENTAS DEUDORAS DE CONTROL '); INSERT INTO gifi (accno,description) VALUES ('839505', 'CHEQUES POSTFECHADOS '); INSERT INTO gifi (accno,description) VALUES ('839510', 'CERTIFICADOS DE DEPOSITO A TERMINO '); INSERT INTO gifi (accno,description) VALUES ('839515', 'CHEQUES DEVUELTOS '); INSERT INTO gifi (accno,description) VALUES ('839520', 'BIENES Y VALORES EN FIDEICOMISO '); INSERT INTO gifi (accno,description) VALUES ('839525', 'INTERESES SOBRE DEUDAS VENCIDAS '); INSERT INTO gifi (accno,description) VALUES ('839595', 'DIVERSAS '); INSERT INTO gifi (accno,description) VALUES ('839599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('8399', 'AJUSTES POR INFLACION ACTIVOS '); INSERT INTO gifi (accno,description) VALUES ('839905', 'INVERSIONES '); INSERT INTO gifi (accno,description) VALUES ('839910', 'INVENTARIOS '); INSERT INTO gifi (accno,description) VALUES ('839915', 'PROPIEDADES PLANTA Y EQUIPO '); INSERT INTO gifi (accno,description) VALUES ('839920', 'INTANGIBLES '); INSERT INTO gifi (accno,description) VALUES ('839925', 'CARGOS DIFERIDOS '); INSERT INTO gifi (accno,description) VALUES ('839995', 'OTROS ACTIVOS '); INSERT INTO gifi (accno,description) VALUES ('84', 'DERECHOS CONTINGENTES POR CONTRA (CR) '); INSERT INTO gifi (accno,description) VALUES ('85', 'DEUDORAS FISCALES POR CONTRA (CR) '); INSERT INTO gifi (accno,description) VALUES ('86', 'DEUDORAS DE CONTROL POR CONTRA (CR) '); INSERT INTO gifi (accno,description) VALUES ('9', 'CUENTAS DE ORDEN ACREEDORAS '); INSERT INTO gifi (accno,description) VALUES ('91', 'RESPONSABILIDADES CONTINGENTES '); INSERT INTO gifi (accno,description) VALUES ('9105', 'BIENES Y VALORES RECIBIDOS EN CUSTODIA '); INSERT INTO gifi (accno,description) VALUES ('910505', 'VALORES MOBILIARIOS '); INSERT INTO gifi (accno,description) VALUES ('910510', 'BIENES MUEBLES '); INSERT INTO gifi (accno,description) VALUES ('910599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('9110', 'BIENES Y VALORES RECIBIDOS EN GARANTIA '); INSERT INTO gifi (accno,description) VALUES ('911005', 'VALORES MOBILIARIOS '); INSERT INTO gifi (accno,description) VALUES ('911010', 'BIENES MUEBLES '); INSERT INTO gifi (accno,description) VALUES ('911015', 'BIENES INMUEBLES '); INSERT INTO gifi (accno,description) VALUES ('911020', 'CONTRATOS DE GANADO EN PARTICIPACION '); INSERT INTO gifi (accno,description) VALUES ('911099', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('9115', 'BIENES Y VALORES RECIBIDOS DE TERCEROS '); INSERT INTO gifi (accno,description) VALUES ('911505', 'EN ARRENDAMIENTO '); INSERT INTO gifi (accno,description) VALUES ('911510', 'EN PRESTAMO '); INSERT INTO gifi (accno,description) VALUES ('911515', 'EN DEPOSITO '); INSERT INTO gifi (accno,description) VALUES ('911520', 'EN CONSIGNACION '); INSERT INTO gifi (accno,description) VALUES ('911525', 'EN COMODATO '); INSERT INTO gifi (accno,description) VALUES ('911599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('9120', 'LITIGIOS Y/O DEMANDAS '); INSERT INTO gifi (accno,description) VALUES ('912005', 'LABORALES '); INSERT INTO gifi (accno,description) VALUES ('912010', 'CIVILES '); INSERT INTO gifi (accno,description) VALUES ('912015', 'ADMINISTRATIVOS O ARBITRALES '); INSERT INTO gifi (accno,description) VALUES ('912020', 'TRIBUTARIOS '); INSERT INTO gifi (accno,description) VALUES ('9125', 'PROMESAS DE COMPRAVENTA '); INSERT INTO gifi (accno,description) VALUES ('9130', 'CONTRATOS DE ADMINISTRACION DELEGADA '); INSERT INTO gifi (accno,description) VALUES ('9135', 'CUENTAS EN PARTICIPACION '); INSERT INTO gifi (accno,description) VALUES ('9195', 'OTRAS RESPONSABILIDADES CONTINGENTES '); INSERT INTO gifi (accno,description) VALUES ('92', 'ACREEDORAS FISCALES '); INSERT INTO gifi (accno,description) VALUES ('93', 'ACREEDORAS DE CONTROL '); INSERT INTO gifi (accno,description) VALUES ('9305', 'CONTRATOS DE ARRENDAMIENTO FINANCIERO '); INSERT INTO gifi (accno,description) VALUES ('930505', 'BIENES MUEBLES '); INSERT INTO gifi (accno,description) VALUES ('930510', 'BIENES INMUEBLES '); INSERT INTO gifi (accno,description) VALUES ('939505', 'DOCUMENTOS POR COBRAR DESCONTADOS '); INSERT INTO gifi (accno,description) VALUES ('939510', 'CONVENIOS DE PAGO '); INSERT INTO gifi (accno,description) VALUES ('939515', 'CONTRATOS DE CONSTRUCCIONES E INSTALACIONES POR EJECUTAR '); INSERT INTO gifi (accno,description) VALUES ('939520', 'PEDIDOS COLOCADOS '); INSERT INTO gifi (accno,description) VALUES ('939525', 'ADJUDICACIONES PENDIENTES DE LEGALIZAR '); INSERT INTO gifi (accno,description) VALUES ('939530', 'RESERVA ARTICULO 3o. LEY 4/80 '); INSERT INTO gifi (accno,description) VALUES ('939535', 'RESERVA COSTO REPOSICION SEMOVIENTES '); INSERT INTO gifi (accno,description) VALUES ('939599', 'AJUSTES POR INFLACION '); INSERT INTO gifi (accno,description) VALUES ('9399', 'AJUSTES POR INFLACION PATRIMONIO '); INSERT INTO gifi (accno,description) VALUES ('939905', 'CAPITAL SOCIAL '); INSERT INTO gifi (accno,description) VALUES ('939910', 'SUPERAVIT DE CAPITAL '); INSERT INTO gifi (accno,description) VALUES ('939915', 'RESERVAS '); INSERT INTO gifi (accno,description) VALUES ('939925', 'DIVIDENDOS O PARTICIPACIONES DECRETADAS EN ACCIONES, CUOTAS O PARTES DE INTERES SOCIAL '); INSERT INTO gifi (accno,description) VALUES ('939930', 'RESULTADOS DE EJERCICIOS ANTERIORES '); INSERT INTO gifi (accno,description) VALUES ('94', 'RESPONSABILIDADES CONTINGENTES POR CONTRA (DB) '); INSERT INTO gifi (accno,description) VALUES ('95', 'ACREEDORAS FISCALES POR CONTRA (DB) '); INSERT INTO gifi (accno,description) VALUES ('96', 'ACREEDORAS DE CONTROL POR CONTRA (DB) '); INSERT INTO gifi (accno,description) VALUES ('5', 'GASTOS'); commit; ledgersmb/sql/coa/co/chart/0000755000000000000000000000000012060044550014557 5ustar rootrootledgersmb/sql/coa/co/chart/PUC.sql0000755000000000000000000022626111727257007015757 0ustar rootrootbegin; -- -- Plan único de Cuentas de Colombia, elaborado por Rene Real Hernandez (SDI S.A.), Francico Padilla (SDI S.A.), -- Silfredo Godoy Chavez (CaribeNet S.A.), -- Lourdes Mejía Martinez (CaribeNet S.A.) y Dirk Enrique Seiffert (CaribeNet S.A.) -- Si quieres aportar: Contactenos www.caribenet.com - info@caribenet.com -- SELECT account_heading_save(NULL, '1', 'ACTIVO', NULL); SELECT account_heading_save(NULL, '11', 'ACTIVO DISPONIBLE', NULL); SELECT account_heading_save(NULL, '1105', 'CAJA', NULL); SELECT account_heading_save(NULL, '110505', 'CAJA GENERAL', NULL); SELECT account_heading_save(NULL, '110510', 'CAJAS MENORES', NULL); SELECT account_heading_save(NULL, '1110', 'BANCOS', NULL); SELECT account_heading_save(NULL, '111005', 'BANCOS MONEDA NACIONAL', NULL); SELECT account_heading_save(NULL, '1120', 'CUENTAS DE AHORRO', NULL); SELECT account_heading_save(NULL, '112005', 'CUENTAS DE AHORRO EN BANCOS', NULL); SELECT account_heading_save(NULL, '12', 'INVERSIONES', NULL); SELECT account_heading_save(NULL, '1205', 'ACCIONES', NULL); SELECT account_heading_save(NULL, '1210', 'CUOTAS PARTES DE INTERES SOCIAL', NULL); SELECT account_heading_save(NULL, '1215', 'BONOS', NULL); SELECT account_heading_save(NULL, '1220', 'CEDULAS', NULL); SELECT account_heading_save(NULL, '1225', 'CERTIFICADOS', NULL); SELECT account_heading_save(NULL, '1230', 'PAPELES COMERCIALES', NULL); SELECT account_heading_save(NULL, '1235', 'TITULOS', NULL); SELECT account_heading_save(NULL, '1240', 'ACEPTACIONES BANCARIAS O FINANCI', NULL); SELECT account_heading_save(NULL, '1245', 'DERECHOS FIDUCIARIOS', NULL); SELECT account_heading_save(NULL, '13', 'CUENTAS POR COBRAR', NULL); SELECT account_heading_save(NULL, '1305', 'CUENTAS POR COBRAR CLIENTES', NULL); SELECT account_heading_save(NULL, '130505', 'CLIENTES NACIONALES', NULL); SELECT account_heading_save(NULL, '130510', 'CLIENTES DEL EXTERIOR', NULL); SELECT account_heading_save(NULL, '1310', 'CUENTAS CORRIENTES COMERCIALES', NULL); SELECT account_heading_save(NULL, '1330', 'ANTICIPO Y AVANCES', NULL); SELECT account_heading_save(NULL, '133005', 'ANTICIPO A PROVEEDORES', NULL); SELECT account_heading_save(NULL, '133010', 'ANTICIPO A CONTRATISTAS', NULL); SELECT account_heading_save(NULL, '133015', 'ANTICIPO A TRABAJADORES', NULL); SELECT account_heading_save(NULL, '1340', 'PROMESAS DE COMPRAVENTA', NULL); SELECT account_heading_save(NULL, '134005', 'DE BIENES RAICES', NULL); SELECT account_save(NULL,'1340050001','Promesas Compra Venta Bienes Rai','A','1340050001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '1345', 'INGRESOS POR COBRAR', NULL); SELECT account_heading_save(NULL, '1350', 'RETENCIONES SOBRE CONTRATOS', NULL); SELECT account_heading_save(NULL, '135005', 'DE CONTRATOS DE CONSTRUCCION', NULL); SELECT account_heading_save(NULL, '135010', 'DE PRESTACION DE SERVICIOS', NULL); SELECT account_heading_save(NULL, '135095', 'RETENCION SOBRE OTROS CONTRATOS', NULL); SELECT account_heading_save(NULL, '1355', 'ANTICIPO DE IMPUESTOS', NULL); SELECT account_heading_save(NULL, '135505', 'ANTICIPO DE IMPUESTO DE RENTA', NULL); SELECT account_save(NULL,'1355050001','Anticipo de Impuesto de Renta','A','1355050001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '135510', 'ANTICIPO DE IMPTO DE IND. Y CCIO', NULL); SELECT account_save(NULL,'1355100001','Anticipo de Industria y Comercio','A','1355100001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '135515', 'RETENCION EN LA FUENTE', NULL); SELECT account_save(NULL,'1355150002','Retefuente 10% Honorarios','A','1355150002', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1355150004','Retefuente Alquiler Bienes R. 4%','A','1355150004', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1355150005','Retefuente Obras Civiles 1%','A','1355150005', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1355150006','Retefuente 6% servicios','A','1355150006', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1355150007','Retencion en la fuente 3.5%','A','1355150007', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '135517', 'IMPUESTO A LAS VENTAS RETENIDO', NULL); SELECT account_heading_save(NULL, '135518', 'IMPUESTO DE IND. Y CCIO RETENIDO', NULL); SELECT account_save(NULL,'1355180001','Ica Retenido','A','1355180001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '135520', 'SOBRANTE EN LIQUIDACION PRIVADA', NULL); SELECT account_save(NULL,'1355200001','Saldo a Favor en Renta','A','1355200001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1355200002','Sobrante en Declaracion de IVA','A','1355200002', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '1380', 'DEUDORES VARIOS', NULL); SELECT account_heading_save(NULL, '138020', 'CUENTAS POR COBRAR A TERCEROS', NULL); SELECT account_save(NULL,'1380200001','Cuentas por Cobrar a Terceros','A','1380200001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '138095', 'OTROS DEUDORES VARIOS', NULL); SELECT account_save(NULL,'1380950001','Deudores Varios Otros','A','1380950001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '1390', 'DEUDAS DE DIFICIL COBRO', NULL); SELECT account_heading_save(NULL, '1399', 'PROVISIONES', NULL); SELECT account_heading_save(NULL, '139905', 'PROVISION CLIENTES', NULL); SELECT account_save(NULL,'1399050001','Provision cartera Dificil Cobro','A','1399050001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '14', 'INVENTARIOS', NULL); SELECT account_heading_save(NULL, '1410', 'PRODUCTOS EN PROCESO', NULL); SELECT account_heading_save(NULL, '141005', 'PRODUCTOS EN PROCESO', NULL); SELECT account_heading_save(NULL, '141099', 'AJ. POR INFLACION INV. EN PROCES', NULL); SELECT account_heading_save(NULL, '1415', 'OBRAS DE CONSTRUCCION EN CURSO', NULL); SELECT account_heading_save(NULL, '1420', 'CONTRATOS EN EJECUCION', NULL); SELECT account_heading_save(NULL, '142099', 'AJ.POR INFLACION CTOS EN EJECUCI', NULL); SELECT account_heading_save(NULL, '1430', 'PRODUCTOS TERMINADOS', NULL); SELECT account_heading_save(NULL, '143005', 'PRODUCTOS MANUFACTURADOS', NULL); SELECT account_heading_save(NULL, '143099', 'AJ.POR INFLACION INV.PROD.TERMIN', NULL); SELECT account_heading_save(NULL, '1435', 'MERCANCIAS NO FABRICADAS', NULL); SELECT account_heading_save(NULL, '143505', 'MCIA NO FABRICADA POR LA EMPRESA', NULL); SELECT account_heading_save(NULL, '143599', 'AJ.POR INFL.MCIA NO FAB.EMPRESA', NULL); SELECT account_heading_save(NULL, '1465', 'INVENTARIOS EN TRANSITO', NULL); SELECT account_heading_save(NULL, '146505', 'INVENTARIOS EN TRANSITO', NULL); SELECT account_heading_save(NULL, '146599', 'AJ.POR INFLACION INV.EN TRANSITO', NULL); SELECT account_heading_save(NULL, '15', 'PROPIEDAD PLANTA Y EQUIPO', NULL); SELECT account_heading_save(NULL, '1504', 'TERRENOS', NULL); SELECT account_heading_save(NULL, '1508', 'CONSTRUCCIONES EN CURSO', NULL); SELECT account_heading_save(NULL, '1512', 'MAQUINARIA Y EQUIPO EN MONTAJE', NULL); SELECT account_heading_save(NULL, '1516', 'CONSTRUCCIONES Y EDIFICACIONES', NULL); SELECT account_heading_save(NULL, '151610', 'OFICINAS', NULL); SELECT account_heading_save(NULL, '151699', 'AJUSTES POR INFLACION CONSTRUCCI', NULL); SELECT account_heading_save(NULL, '15169910', 'AJ. INFL. OFICINAS - LOCALES', NULL); SELECT account_heading_save(NULL, '1520', 'MAQUINARIA Y EQUIPO', NULL); SELECT account_heading_save(NULL, '152001', 'CONTRATOS YOPAL', NULL); SELECT account_heading_save(NULL, '152002', 'BODEGA', NULL); SELECT account_heading_save(NULL, '152099', 'AJUSTES POR INFLACION', NULL); SELECT account_heading_save(NULL, '15209902', 'AJUSTES POR INFLACION EQ.BODEGA', NULL); SELECT account_heading_save(NULL, '1524', 'EQUIPOS DE OFICINA', NULL); SELECT account_heading_save(NULL, '152405', 'MUEBLES Y ENSERES', NULL); SELECT account_heading_save(NULL, '152410', 'EQUIPOS', NULL); SELECT account_heading_save(NULL, '152499', 'AJUSTES POR INFLACION', NULL); SELECT account_heading_save(NULL, '15249910', 'AJUSTES POR INFLACION', NULL); SELECT account_heading_save(NULL, '1528', 'EQUIPOS DE COMPUTACION Y COMUNIC', NULL); SELECT account_heading_save(NULL, '152805', 'EQUIPOS DE PROCESAMIENTO DE DATO', NULL); SELECT account_save(NULL,'1528050001','Cinco Computadores','A','1528050001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '152899', 'AJUSTES POR INFLACION', NULL); SELECT account_heading_save(NULL, '15289905', 'AJ. INFL. EQ. PROCESAMIENTO DATO', NULL); SELECT account_save(NULL,'1528990501','Aj. por Inflac. Cinco Computador','A','1528990501', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '1540', 'FLOTA Y EQUIPO DE TRANSPORTE', NULL); SELECT account_heading_save(NULL, '154005', 'AUTOS, CAMIONETAS Y CAMPEROS', NULL); SELECT account_heading_save(NULL, '154099', 'AJUSTES POR INFLACION', NULL); SELECT account_heading_save(NULL, '15409905', 'AJ. INFL. AUTOS CAMPEROS CMIONET', NULL); SELECT account_save(NULL,'1540990501','Aj. Infl. Autos y Camperos','A','1540990501', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '1592', 'DEPRECIACION ACUMULADA', NULL); SELECT account_heading_save(NULL, '159205', 'DEPREC.DE CONSTRUCCIONES Y EDIFI', NULL); SELECT account_heading_save(NULL, '159210', 'DEPREC. MAQUINARIA Y EQUIPO', NULL); SELECT account_heading_save(NULL, '159215', 'DEPRECIACION EQUIPO DE OFICINA', NULL); SELECT account_heading_save(NULL, '159220', 'DEPRECIACION EQ. COMPUTACION Y C', NULL); SELECT account_save(NULL,'1592200001','Depreciacion Cinco Computadores','A','1592200001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '159235', 'DEPRECIACION FLOTA DE TRANSPORTE', NULL); SELECT account_heading_save(NULL, '159299', 'AJUSTES POR INFLACION', NULL); SELECT account_save(NULL,'1592990005','Aj.Infl. Construc. y Edificacion','A','1592990005', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1592990010','Aj.Infl. Maquinaria y Equipo','A','1592990010', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1592990015','Aj. Infl. Equipos de Oficina','A','1592990015', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1592990020','Aj. Infl. Eq. Computac. y Comuni','A','1592990020', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1592990035','Aj. Infl. Flota y Eq. de transpo','A','1592990035', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '19', 'VALORIZACIONES', NULL); SELECT account_heading_save(NULL, '1905', 'VALORIZACIONES DE INVERSIONES', NULL); SELECT account_heading_save(NULL, '1910', 'DE PROPIEDAD PLANTA Y EQUIPOS', NULL); SELECT account_heading_save(NULL, '191008', 'DE CONSTRUCCIONES Y EDIFICACIONE', NULL); SELECT account_heading_save(NULL, '1995', 'VALORIZACION DE OTROS ACTIVOS', NULL); SELECT account_heading_save(NULL, '2', 'PASIVOS', NULL); SELECT account_heading_save(NULL, '21', 'OBLIGACIONES FINANCIERAS', NULL); SELECT account_heading_save(NULL, '2105', 'BANCOS NACIONALES', NULL); SELECT account_heading_save(NULL, '210505', 'SOBREGIROS', NULL); SELECT account_save(NULL,'2105050001','Sobregiros Bancarios','L','2105050001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '210510', 'PAGARES', NULL); SELECT account_save(NULL,'2105100001','Pagares','L','2105100001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '2130', 'ENTIDADES FINANCIERAS DEL EXTERI', NULL); SELECT account_heading_save(NULL, '2145', 'OBLIGACIONES GUBERNAMENTALES', NULL); SELECT account_heading_save(NULL, '2195', 'OTRAS OBLIGACIONES', NULL); SELECT account_heading_save(NULL, '219505', 'OBLIGACIONES CON PARTICULARES', NULL); SELECT account_save(NULL,'2195050001','Otras obligaciones con Particula','L','2195050001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '219510', 'OBLIGACIONES COMPA?IAS VINCULADA', NULL); SELECT account_heading_save(NULL, '22', 'PROVEEDORES', NULL); SELECT account_heading_save(NULL, '2205', 'PROVEEDORES NACIONALES', NULL); SELECT account_heading_save(NULL, '220505', 'PROVEEDORES NACIONALES', NULL); SELECT account_heading_save(NULL, '23', 'CUENTAS POR PAGAR', NULL); SELECT account_heading_save(NULL, '2320', 'CUENTAS POR PAGAR A CONTRATISTAS', NULL); SELECT account_heading_save(NULL, '232005', 'CUENTAS POR PAGAR A CONTRATISTAS', NULL); SELECT account_heading_save(NULL, '2335', 'COSTOS Y GASTOS POR PAGAR', NULL); SELECT account_heading_save(NULL, '233505', 'GASTOS FINANCIEROS', NULL); SELECT account_heading_save(NULL, '233510', 'GASTOS LEGALES', NULL); SELECT account_heading_save(NULL, '233515', 'LIBROS SUSCRIPCIONES PERIODICOS', NULL); SELECT account_heading_save(NULL, '233520', 'COMISIONES', NULL); SELECT account_heading_save(NULL, '233525', 'HONORARIOS', NULL); SELECT account_heading_save(NULL, '233530', 'SERVICIOS TECNICOS', NULL); SELECT account_heading_save(NULL, '233535', 'SERVICIOS DE MANTENIMIENTO', NULL); SELECT account_heading_save(NULL, '233540', 'ARRENDAMIENTOS', NULL); SELECT account_heading_save(NULL, '233545', 'TRANSPORTES FLETES Y ACARREOS', NULL); SELECT account_heading_save(NULL, '233550', 'SERVICIOS PUBLICOS', NULL); SELECT account_heading_save(NULL, '233555', 'SEGUROS', NULL); SELECT account_heading_save(NULL, '233560', 'GASTOS DE VIAJE', NULL); SELECT account_heading_save(NULL, '233565', 'GASTOS DE REPRESENTACION Y RELAC', NULL); SELECT account_heading_save(NULL, '233570', 'SERVICIOS ADUANEROS', NULL); SELECT account_heading_save(NULL, '233595', 'OTROS COSTOS Y GASTOS POR PAGAR', NULL); SELECT account_heading_save(NULL, '2355', 'DEUDAS CON SOCIOS Y ACCIONISTAS', NULL); SELECT account_heading_save(NULL, '235505', 'ACCIONISTAS', NULL); SELECT account_heading_save(NULL, '235510', 'SOCIOS', NULL); SELECT account_heading_save(NULL, '2360', 'DIVIDENDOS O PARTICIPACION POR P', NULL); SELECT account_heading_save(NULL, '236005', 'DIVIDENDOS POR PAGAR', NULL); SELECT account_heading_save(NULL, '236010', 'PARTICIPACIONES POR PAGAR', NULL); SELECT account_heading_save(NULL, '2365', 'RETENCION EN LA FUENTE', NULL); SELECT account_heading_save(NULL, '236505', 'SALARIOS Y PAGOS LABORALES', NULL); SELECT account_heading_save(NULL, '236510', 'DIVIDENDO Y/O PARTICIPACIONES', NULL); SELECT account_heading_save(NULL, '236515', 'HONORARIOS', NULL); SELECT account_heading_save(NULL, '236520', 'COMISIONES', NULL); SELECT account_heading_save(NULL, '236525', 'SERVICIOS', NULL); SELECT account_save(NULL,'2365250002','Servicios Hoteleros 3.5%','L','2365250002', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '236530', 'ARRENDAMIENTOS', NULL); SELECT account_save(NULL,'2365300002','Arriendo Inmuebles 4%','L','2365300002', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '236535', 'RENDIMIENTOS FINANCIERSO', NULL); SELECT account_heading_save(NULL, '236540', 'RETENCION POR COMPRAS', NULL); SELECT account_heading_save(NULL, '2368', 'IMPTO DE IND. Y CCIO RETENIDO', NULL); SELECT account_heading_save(NULL, '236801', 'SECTOR INDUSTRIAL', NULL); SELECT account_save(NULL,'2368010003','Demas Activ. Industriales 7xmil','L','2368010003', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '236802', 'SECTOR COMERCIAL', NULL); SELECT account_save(NULL,'2368020004','Demas Activ. Comerciales 7xmil','L','2368020004', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '236803', 'SECTOR SERVICIOS', NULL); SELECT account_save(NULL,'2368030001','Retencin ICA 6xMil','L','2368030001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2368030009','Demas Activ. Servicios 8xmil','L','2368030009', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '2370', 'RETENCIONES Y APORTES DE NOMINA', NULL); SELECT account_heading_save(NULL, '237005', 'APORTES A EPS', NULL); SELECT account_save(NULL,'2370050001','Aportes a EPS','L','2370050001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '237006', 'APORTES A ARP', NULL); SELECT account_heading_save(NULL, '237010', 'APORTES A IDBF, SENA Y CAJAS COM', NULL); SELECT account_heading_save(NULL, '2380', 'ACREEDORES VARIOS', NULL); SELECT account_heading_save(NULL, '238030', 'FONDOS DE CESANTIAS Y/O PENSION', NULL); SELECT account_heading_save(NULL, '238095', 'VARIOS', NULL); SELECT account_heading_save(NULL, '24', 'IMPUESTOS GRAVAMENES Y TASAS', NULL); SELECT account_heading_save(NULL, '2404', 'IMPUESTO DE RENTA', NULL); SELECT account_heading_save(NULL, '240405', 'VIGENCIA FISCAL CORRIENTE', NULL); SELECT account_save(NULL,'2404050001','IMPORENTA VIGENCIA ACTUAL','L','2404050001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '240410', 'VIGENCIAS FISCALES ANTERIORES', NULL); SELECT account_save(NULL,'2404100001','IMPORENTA VIGENCIA ANTERIORES','L','2404100001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '2408', 'IMPUESTO A LAS VENTAS POR PAGAR', NULL); SELECT account_heading_save(NULL, '240805', 'IVA DESCONTABLE', NULL); SELECT account_heading_save(NULL, '240810', 'IVA GENERADO EN VENTAS', NULL); SELECT account_heading_save(NULL, '240815', 'IMPUESTOS POR PAGAR ANTERIORES', NULL); SELECT account_save(NULL,'2408150001','ViGencia Fiscal Anterior','L','2408150001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '2412', 'IMPUESTO DE IND. Y COMERCIO', NULL); SELECT account_heading_save(NULL, '241205', 'VIGENCIA FISCAL CORRIENTE', NULL); SELECT account_save(NULL,'2412050001','ICA POR PAGAR','L','2412050001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '241210', 'VIGENCIAS FISCALES ANTERIORES', NULL); SELECT account_heading_save(NULL, '25', 'OBLIGACIONES LABORALES', NULL); SELECT account_heading_save(NULL, '2505', 'SALARIOS POR PAGAR', NULL); SELECT account_heading_save(NULL, '250505', 'NOMINA POR PAGAR', NULL); SELECT account_heading_save(NULL, '2510', 'CESANTIAS CONSOLIDADAS', NULL); SELECT account_heading_save(NULL, '2515', 'INTERESES SOBRE CESANTIAS', NULL); SELECT account_heading_save(NULL, '2520', 'PRIMA DE SERVICIOS', NULL); SELECT account_heading_save(NULL, '2525', 'VACACIONES CONSOLIDADAS', NULL); SELECT account_heading_save(NULL, '2530', 'PRESTACIONES EXTRALEGALES', NULL); SELECT account_heading_save(NULL, '26', 'PASIVOS ESTIMADOS Y PROVISIONES', NULL); SELECT account_heading_save(NULL, '2605', 'PARA COSTOS Y GASTOS', NULL); SELECT account_heading_save(NULL, '260515', 'HONORARIOS', NULL); SELECT account_heading_save(NULL, '260525', 'TRANSPORTES FLETES Y ACARREOS', NULL); SELECT account_heading_save(NULL, '260530', 'GASTOS DE VIAJE', NULL); SELECT account_heading_save(NULL, '2610', 'PARA OBLIGACIONES LABORALES', NULL); SELECT account_heading_save(NULL, '261005', 'CESANTIAS', NULL); SELECT account_heading_save(NULL, '261010', 'INTERESES SOBRE CESANTIAS', NULL); SELECT account_heading_save(NULL, '261015', 'VACACIONES', NULL); SELECT account_heading_save(NULL, '261020', 'PRIMA DE SERVICIOS', NULL); SELECT account_heading_save(NULL, '2615', 'PARA OBLIGACIONES FISCALES', NULL); SELECT account_heading_save(NULL, '261505', 'DE RENTA Y COMPLEMENTARIOS', NULL); SELECT account_save(NULL,'2615050001','Impuesto de Renta y Complementar','L','2615050001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '261510', 'DE INDUSTRIA Y COMERCIO', NULL); SELECT account_heading_save(NULL, '261595', 'OTROS', NULL); SELECT account_heading_save(NULL, '2630', 'PARA MANTENIMIENTO Y REPARACION', NULL); SELECT account_heading_save(NULL, '2635', 'PARA CONTINGENCIAS', NULL); SELECT account_heading_save(NULL, '263505', 'MULTAS SANCIONES Y LITIGIOS', NULL); SELECT account_heading_save(NULL, '263510', 'INTERESES POR MULTAS Y SANCIONES', NULL); SELECT account_heading_save(NULL, '28', 'OTROS PASIVOS', NULL); SELECT account_heading_save(NULL, '2805', 'ANTICIPOS Y AVANCES RECIBIDOS', NULL); SELECT account_heading_save(NULL, '280505', 'DE CLIENTES', NULL); SELECT account_heading_save(NULL, '280510', 'SOBRE CONTRATOS', NULL); SELECT account_save(NULL,'2805100001','Anticipo Recibido Sobre Contrato','L','2805100001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '280515', 'PARA OBRAS EN PROCESO', NULL); SELECT account_heading_save(NULL, '2815', 'INGRESOS RECIBIDOS PARA TERCEROS', NULL); SELECT account_heading_save(NULL, '281505', 'VALORES RECIBIDOS PARA TERCEROS', NULL); SELECT account_heading_save(NULL, '281510', 'VENTA POR CUENTA DE TERCEROS', NULL); SELECT account_heading_save(NULL, '2825', 'RETENCION A TERCEROS SOBRE CONTR', NULL); SELECT account_heading_save(NULL, '282505', 'CUMPLIMIENTO OBLIGACIONES LABORA', NULL); SELECT account_heading_save(NULL, '3', 'PATRIMONIO', NULL); SELECT account_heading_save(NULL, '31', 'CAPITAL SOCIAL', NULL); SELECT account_heading_save(NULL, '3105', 'CAPITAL SUSCRITO Y PAGADO', NULL); SELECT account_heading_save(NULL, '310505', 'CAPITAL AUTORIZADO', NULL); SELECT account_save(NULL,'3105050001','Capital Suscrito y Pagado','Q','3105050001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '310510', 'CAPITAL POR SUSCRIBIR (DB)', NULL); SELECT account_heading_save(NULL, '310515', 'CAPITAL SUSCRITO POR COBRAR (DB)', NULL); SELECT account_heading_save(NULL, '3115', 'APORTES SOCIALES', NULL); SELECT account_heading_save(NULL, '33', 'RESERVAS', NULL); SELECT account_heading_save(NULL, '3305', 'RESERVAS OBLIGATORIAS', NULL); SELECT account_heading_save(NULL, '330505', 'RESERVA LEGAL', NULL); SELECT account_save(NULL,'3305050001','Reserva Legal','Q','3305050001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '3310', 'RESERVAS ESTATUTARIAS', NULL); SELECT account_heading_save(NULL, '3315', 'RESERVAS OCASIONALES', NULL); SELECT account_heading_save(NULL, '34', 'REVALORIZACION DEL PATRIMONIO', NULL); SELECT account_heading_save(NULL, '3405', 'AJUSTES POR INFLACION', NULL); SELECT account_heading_save(NULL, '340505', 'DE CAPITAL SOCIAL', NULL); SELECT account_save(NULL,'3405050001','AxI CAPITAL','Q','3405050001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '340510', 'DE SUPERAVIT DE CAPITAL', NULL); SELECT account_heading_save(NULL, '340515', 'DE RESERVAS', NULL); SELECT account_save(NULL,'3405150001','AxI RESERVA LEGAL','Q','3405150001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '340520', 'DE RESULTADO DE EJERC. ANTERIORE', NULL); SELECT account_save(NULL,'3405200001','AxI RESULTADOS ANTERIORES','Q','3405200001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '340525', 'DE ACTIVOS DE PERIODO IMPRODUCTI', NULL); SELECT account_heading_save(NULL, '340530', 'DE SANEAMIENTO FISCAL', NULL); SELECT account_heading_save(NULL, '340535', 'DE AJUSTES DECRETO 3019 DE 1989', NULL); SELECT account_heading_save(NULL, '340540', 'DE DIVIDENDOS Y PARTICIPACIONES', NULL); SELECT account_heading_save(NULL, '340545', 'SUPERAVIT METODO DE PARTICIPACIO', NULL); SELECT account_heading_save(NULL, '36', 'RESULTADOS DE EJERCICIO', NULL); SELECT account_heading_save(NULL, '3605', 'UTILIDAD DEL EJERCICIO', NULL); SELECT account_heading_save(NULL, '360505', 'UTILIDAD DEL EJERCICIO', NULL); SELECT account_save(NULL,'3605050001','Utilidad del Ejercicio','Q','3605050001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3605050002','Utilidad de Ajustes por Inflacio','Q','3605050002', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '3610', 'PERDIDAS DEL EJERCICIO', NULL); SELECT account_heading_save(NULL, '361005', 'PERDIDA DEL EJERCICIO', NULL); SELECT account_save(NULL,'3610050001','Perdida del Ejercicio','Q','3610050001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '37', 'RESULTADOS EJERCICIOS ANRERIORES', NULL); SELECT account_heading_save(NULL, '3705', 'UTILIDADES ACUMULADAS', NULL); SELECT account_heading_save(NULL, '370510', 'UTILIDADES ACUMULADAS', NULL); SELECT account_save(NULL,'3705100001','Utilidades Acumuladas','Q','3705100001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '3710', 'PERDIDAS ACUMULADAS', NULL); SELECT account_heading_save(NULL, '371010', 'PERDIDAS ACUMULADAS', NULL); SELECT account_save(NULL,'3710100001','Perdidas Acumuladas','Q','3710100001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '38', 'SUPERAVIT POR VALORIZACIONES', NULL); SELECT account_heading_save(NULL, '3805', 'DE INVERSIONES', NULL); SELECT account_heading_save(NULL, '380505', 'DE ACCIONES', NULL); SELECT account_heading_save(NULL, '380510', 'CUOTAS O PARTES DE INTERES SOCIA', NULL); SELECT account_heading_save(NULL, '3810', 'DE PROPIEDAD PLANTA Y EQUIPO', NULL); SELECT account_heading_save(NULL, '381008', 'CONSTRUCCIONES Y EDIFICACIONES', NULL); SELECT account_save(NULL,'3810080001','Superavit por Valorizacion C y E','Q','3810080001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '3895', 'DE OTROS ACTIVOS', NULL); SELECT account_heading_save(NULL, '4', 'INGRESOS', NULL); SELECT account_heading_save(NULL, '41', 'INGRESOS OPERACIONALES', NULL); SELECT account_heading_save(NULL, '4120', 'INDUSTRIA MANUFACTURERA', NULL); SELECT account_heading_save(NULL, '4130', 'CONSTRUCCION', NULL); SELECT account_heading_save(NULL, '413005', 'PREPARACION DE TERRENOS', NULL); SELECT account_heading_save(NULL, '413010', 'CONSTRUCCION Y OBRAS CIVILES', NULL); SELECT account_heading_save(NULL, '413025', 'ALQUILER DE EQUIPOS CON OPERARIO', NULL); SELECT account_heading_save(NULL, '413095', 'ACTIVIDADES CONEXAS', NULL); SELECT account_heading_save(NULL, '4135', 'COMERCIO AL POR MAYOR', NULL); SELECT account_heading_save(NULL, '413595', 'ACTIVIDADES CONEXAS', NULL); SELECT account_heading_save(NULL, '4150', 'ACTIVIDAD FINANCIERA', NULL); SELECT account_heading_save(NULL, '415030', 'COMISIONES', NULL); SELECT account_heading_save(NULL, '4175', 'DEVOLUCIONES EN VENTAS', NULL); SELECT account_heading_save(NULL, '417505', 'DEVOLUCIONES EN VENTAS', NULL); SELECT account_save(NULL,'4175050001','Devoluciones en Ventas','I','4175050001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4175050002','Descuento en Ventas','I','4175050002', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '42', 'INGRESOS NO OPERACIONALES', NULL); SELECT account_heading_save(NULL, '4205', 'OTRAS VENTAS', NULL); SELECT account_heading_save(NULL, '420505', 'MATERIA PRIMA', NULL); SELECT account_heading_save(NULL, '420510', 'MATERIAL DE DESECHO', NULL); SELECT account_heading_save(NULL, '4210', 'INGRESOS FINANCIEROS', NULL); SELECT account_heading_save(NULL, '421005', 'INTERESES', NULL); SELECT account_heading_save(NULL, '421040', 'DESCUENTOS COMERCIALES CONDICION', NULL); SELECT account_save(NULL,'4210400001','Descuentos Financieros','I','4210400001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '4215', 'DIVIDENDOS Y PARTICIPACIONES', NULL); SELECT account_heading_save(NULL, '4220', 'ARRENDAMIENTOS', NULL); SELECT account_heading_save(NULL, '422010', 'CONSTRUCCIONES Y EDIFICACIONES', NULL); SELECT account_heading_save(NULL, '422015', 'MAQUINARIA Y EQUIPOS', NULL); SELECT account_heading_save(NULL, '4225', 'COMISIONES', NULL); SELECT account_heading_save(NULL, '4230', 'HONORARIOS', NULL); SELECT account_heading_save(NULL, '4235', 'SERVICIOS', NULL); SELECT account_heading_save(NULL, '423595', 'OTROS SERVICIOS', NULL); SELECT account_heading_save(NULL, '4240', 'UTILIDAD EN VENTA DE INVERSIONES', NULL); SELECT account_heading_save(NULL, '4245', 'UTIL.EN VENTA PROP.PLANTA Y EQUI', NULL); SELECT account_heading_save(NULL, '4250', 'RECUPERACIONES', NULL); SELECT account_heading_save(NULL, '425005', 'DEUDAS MALAS', NULL); SELECT account_heading_save(NULL, '425015', 'RECLAMOS', NULL); SELECT account_heading_save(NULL, '4255', 'INDEMNIZACIONES', NULL); SELECT account_heading_save(NULL, '4260', 'PARTICIPACION EN CONCESIONES', NULL); SELECT account_heading_save(NULL, '4265', 'INGRESOS DE EJERCICIOS ANTERIORE', NULL); SELECT account_heading_save(NULL, '4275', 'DEVOLUCIONES EN OTRAS VENTAS', NULL); SELECT account_heading_save(NULL, '4295', 'DIVERSOS', NULL); SELECT account_heading_save(NULL, '429503', 'CERT', NULL); SELECT account_heading_save(NULL, '429505', 'APROVECHAMIENTOS', NULL); SELECT account_heading_save(NULL, '429507', 'AUXILIOS', NULL); SELECT account_heading_save(NULL, '429533', 'MULTAS Y RECARGOS', NULL); SELECT account_heading_save(NULL, '429535', 'PREAVISOS DESCONTADOS', NULL); SELECT account_heading_save(NULL, '429537', 'RECLAMOS', NULL); SELECT account_heading_save(NULL, '429553', 'SOBRANTES DE CAJA', NULL); SELECT account_heading_save(NULL, '429581', 'AJUSTE AL PESO', NULL); SELECT account_heading_save(NULL, '429583', 'LLAMADAS TELEFONICAS', NULL); SELECT account_heading_save(NULL, '47', 'AJUSTES POR INFLACION', NULL); SELECT account_heading_save(NULL, '4705', 'CORRECCION MONETARIA', NULL); SELECT account_heading_save(NULL, '470505', 'INVERSIONES (CR)', NULL); SELECT account_heading_save(NULL, '470510', 'INVENTARIOS (CR)', NULL); SELECT account_save(NULL,'4705100005','Inventario Materia Prima','I','4705100005', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4705100010','Inventario Productos en Proceso','I','4705100010', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4705100015','Obras de construccion en curso','I','4705100015', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4705100020','Inventario contratos en ejecucio','I','4705100020', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4705100030','Inventario Producto terminado','I','4705100030', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4705100035','Inv. Mercancia no Fabricada','I','4705100035', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4705100065','Inventarios en transito','I','4705100065', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '470515', 'PROPIEDAD PLANTA Y EQUIPO (CR)', NULL); SELECT account_save(NULL,'4705150001','Terrenos','I','4705150001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4705150003','Construcciones en Curso','I','4705150003', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4705150004','Maquinaria y Equipo en Montaje','I','4705150004', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4705150005','Construcciones y Edificaciones','I','4705150005', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4705150006','Maquinaria y Equipos','I','4705150006', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4705150007','Equipos de Oficina','I','4705150007', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4705150008','Equipos de Computacion y comunic','I','4705150008', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4705150011','Flota y Equipo de transporte','I','4705150011', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '470540', 'PATRIMONIO', NULL); SELECT account_save(NULL,'4705400001','Aj. por Infl. Patrimonio','I','4705400001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '470545', 'DEPRECIACION ACUMULADA (DB)', NULL); SELECT account_save(NULL,'4705450001','Depreciacion Acumulada (DB)','I','4705450001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '470550', 'DEPRECIACION DIFERIDA (CR)', NULL); SELECT account_heading_save(NULL, '470560', 'AMORTIZACION ACUMULADA (DB)', NULL); SELECT account_heading_save(NULL, '5', 'GASTOS', NULL); SELECT account_heading_save(NULL, '51', 'GASTOS OPERACIONALES DE ADMON.', NULL); SELECT account_heading_save(NULL, '5105', 'GASTOS DE PERSONAL', NULL); SELECT account_heading_save(NULL, '510548', 'BONIFICACION', NULL); SELECT account_heading_save(NULL, '52', 'GASTOS OPERACIONALES DE VENTAS', NULL); SELECT account_heading_save(NULL, '5205', 'GASTOS DE PERSONAL', NULL); SELECT account_heading_save(NULL, '520506', 'SUELDOS', NULL); SELECT account_heading_save(NULL, '520527', 'AUXILIO DE TRANSPORTE', NULL); SELECT account_heading_save(NULL, '520530', 'CESANTIAS', NULL); SELECT account_heading_save(NULL, '520533', 'INTERESES SOBRE CESANTIAS', NULL); SELECT account_save(NULL,'5205330001','Intereses Sobre Cesantias','E','5205330001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '520536', 'PRIMAS DE SERVICIOS', NULL); SELECT account_heading_save(NULL, '520539', 'VACACIONES', NULL); SELECT account_heading_save(NULL, '520548', 'BONIFICACIONES', NULL); SELECT account_save(NULL,'5205480001','Bonificaciones a Empleados','E','5205480001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '520563', 'CAPACITACION AL PERSONAL', NULL); SELECT account_save(NULL,'5205630001','Capacitacion al Personal','E','5205630001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '520568', 'APORTES ARP', NULL); SELECT account_heading_save(NULL, '520569', 'APORTES EPS', NULL); SELECT account_heading_save(NULL, '520570', 'APORTES A FONDO DE PENSIONES/CES', NULL); SELECT account_heading_save(NULL, '520572', 'APORTES CAJAS DE COMPENSACION', NULL); SELECT account_heading_save(NULL, '520575', 'APORTES ICBF', NULL); SELECT account_heading_save(NULL, '520578', 'APORTES SENA', NULL); SELECT account_heading_save(NULL, '520595', 'OTROS GASTOS DE PERSONAL', NULL); SELECT account_save(NULL,'5205950001','Otros Gastos de personal','E','5205950001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '5210', 'HONORARIOS', NULL); SELECT account_heading_save(NULL, '521005', 'JUNTA DIRECTIVA', NULL); SELECT account_heading_save(NULL, '521010', 'REVISORIA FISCAL', NULL); SELECT account_heading_save(NULL, '521015', 'AUDITORIA EXTERNA', NULL); SELECT account_heading_save(NULL, '521025', 'ASESORIA JURIDICA', NULL); SELECT account_heading_save(NULL, '521030', 'ASESORIA FINANCIERA', NULL); SELECT account_heading_save(NULL, '521035', 'ASESORIA TECNICA', NULL); SELECT account_heading_save(NULL, '521095', 'OTROS HONORARIOS', NULL); SELECT account_save(NULL,'5210950001','Estudio y Diseño de Planos','E','5210950001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '5215', 'IMPUESTOS', NULL); SELECT account_heading_save(NULL, '521505', 'INDUSTRIA Y COMERCIO', NULL); SELECT account_save(NULL,'5215050001','Impuesto de Industria y Comercio','E','5215050001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '521510', 'DE TIMBRES', NULL); SELECT account_save(NULL,'5215100001','Impuesto de Timbre','E','5215100001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '521515', 'IMPUESTOS A LA PROPIEDAD RAIZ', NULL); SELECT account_save(NULL,'5215200001','DERECHOS SOBRE INSTRUMENTOS PUBL','E','5215200001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '521540', 'IMPUESTOS SOBRE VEHICULOS', NULL); SELECT account_save(NULL,'5215400001','Impuestos Sobre Vehiculos','E','5215400001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '521595', 'OTROS IMPUESTOS', NULL); SELECT account_heading_save(NULL, '5220', 'ARRENDAMIENTOS', NULL); SELECT account_heading_save(NULL, '522010', 'CONSTRUCCIONES U EDIFICACIONES', NULL); SELECT account_heading_save(NULL, '522015', 'MAQUINARIA Y EQUIPO', NULL); SELECT account_save(NULL,'5220150001','Arriendo Maquinaria y Equipo','E','5220150001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '522025', 'EQUIPOS DE COMPUTACION Y COMUNIC', NULL); SELECT account_save(NULL,'5220250001','Alquiler Eq. Computacion y Comun','E','5220250001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '522040', 'FLOTA Y EQUIPO DE TRANSPORTE', NULL); SELECT account_save(NULL,'5220400001','Alquiler de Vehiculos y Camiones','E','5220400001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '5230', 'SEGUROS', NULL); SELECT account_heading_save(NULL, '523005', 'MANEJO', NULL); SELECT account_heading_save(NULL, '523010', 'CUMPLIMIENTO', NULL); SELECT account_save(NULL,'5230100001','Polizas de Cumplimiento','E','5230100001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '523040', 'FLOTA Y EQUIPO DE TRANSPORTE', NULL); SELECT account_heading_save(NULL, '523075', 'OBLIGATORIO ACCIDENTES DE TRANSI', NULL); SELECT account_heading_save(NULL, '5235', 'SERVICIOS', NULL); SELECT account_heading_save(NULL, '523505', 'ASEO Y VIGILANCIA', NULL); SELECT account_heading_save(NULL, '523515', 'ASSITENCIA TECNICA', NULL); SELECT account_heading_save(NULL, '523520', 'PROCESAMIENTO ELECTRONICO DE DAT', NULL); SELECT account_save(NULL,'5235200001','Procesamiento electronico de Dat','E','5235200001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '523525', 'ACUEDUCTO Y ALCANTARILLADO', NULL); SELECT account_heading_save(NULL, '523530', 'ENERGIA ELECTRICA', NULL); SELECT account_heading_save(NULL, '523535', 'TELEFONO', NULL); SELECT account_heading_save(NULL, '523540', 'CORREO PORTES Y TELEGRAMAS', NULL); SELECT account_heading_save(NULL, '523545', 'FAX Y TELEX', NULL); SELECT account_save(NULL,'5235450001','fax y Telex','E','5235450001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '523550', 'TRANSPORTES FLETES Y ACARREOS', NULL); SELECT account_heading_save(NULL, '523555', 'GAS', NULL); SELECT account_heading_save(NULL, '523560', 'PUBLICIDAD PROPAGANDA Y PROMOCIO', NULL); SELECT account_save(NULL,'5235600001','Publicidad Propaganda y Promocio','E','5235600001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '523595', 'OTROS SERVICIOS', NULL); SELECT account_save(NULL,'5235950002','Fabricacion y Elaboracion','E','5235950002', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5235950004','Capacitacion a Contratistas','E','5235950004', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5235950007','Digitación y archivo documentos','E','5235950007', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '5240', 'GASTOS LEGALES', NULL); SELECT account_heading_save(NULL, '524005', 'NOTARIALES', NULL); SELECT account_heading_save(NULL, '524010', 'REGISTRO MERCANTIL', NULL); SELECT account_save(NULL,'5240100001','Registro Mercantil','E','5240100001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '524015', 'TRAMITES Y LICENCIAS', NULL); SELECT account_heading_save(NULL, '524095', 'OTROS GASTOS LEGALES', NULL); SELECT account_save(NULL,'5240950001','Tramite de Vehiculos','E','5240950001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5240950003','Sobretasa','E','5240950003', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5240950004','Dcmtos Varios en Camara Comercio','E','5240950004', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5240950005','Floio para Libros Legales','E','5240950005', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5240950006','Impuesto para preservar la Segur','E','5240950006', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '5245', 'MANTENIMIENTO Y REPARACIONES', NULL); SELECT account_heading_save(NULL, '524510', 'CONSTRUCCIONES Y EDIFICACIONES', NULL); SELECT account_save(NULL,'5245100001','Construcciones y Edificaciones','E','5245100001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '524515', 'MAQUINARIA Y EQUIPOS', NULL); SELECT account_save(NULL,'5245150001','Equipo de Refrigeracion','E','5245150001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5245150002','Equipos de Ingenieria Civil','E','5245150002', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5245150003','Repuestos y Herramientas','E','5245150003', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '524520', 'EQUIPO DE OFICINA', NULL); SELECT account_save(NULL,'5245200001','Equipo de Oficina','E','5245200001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '524525', 'EQUIPO DE COMPUTACION Y COMUNICA', NULL); SELECT account_save(NULL,'5245250001','Mtto y Rep. Eq. Computacion y Co','E','5245250001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '524540', 'FLOTA Y EQUIPO DE TRANSPORTE', NULL); SELECT account_save(NULL,'5245400001','Mantenimiento de Vehiculos','E','5245400001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '5250', 'ADECUACION E INSTALACION', NULL); SELECT account_heading_save(NULL, '525005', 'INSTALACIONES ELECTRICAS', NULL); SELECT account_save(NULL,'5250050001','Instalaciones Electricas','E','5250050001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '525010', 'ARREGLOS ORNAMENTALES', NULL); SELECT account_heading_save(NULL, '525015', 'REPARACIONES LOCATIVAS', NULL); SELECT account_heading_save(NULL, '525095', 'OTROS ADECUACIONES E INSTALACION', NULL); SELECT account_heading_save(NULL, '5255', 'GASTOS DE VIAJE', NULL); SELECT account_heading_save(NULL, '525505', 'ALOJAMIENTO Y MANUTENCION', NULL); SELECT account_heading_save(NULL, '525515', 'PASAJES AEREOS', NULL); SELECT account_heading_save(NULL, '525520', 'PASAJES TERRESTRES', NULL); SELECT account_save(NULL,'5255200001','Pasajes Terrestres','E','5255200001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '525595', 'OTROS GASTOS DE VIAJE', NULL); SELECT account_save(NULL,'5255950002','Llamadas Telefonicas en Viajes','E','5255950002', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '5260', 'DEPRECIACIONES', NULL); SELECT account_heading_save(NULL, '526005', 'CONSTRUCCIONES Y EDIFICACIONES', NULL); SELECT account_save(NULL,'5260050001','Depreciacion Locales Tequendama','E','5260050001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '526010', 'MAQUINARIA Y EQUIPO', NULL); SELECT account_save(NULL,'5260100001','Depreciacion de maq. y Equipos','E','5260100001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '526015', 'EQUIPOS DE OFICINA', NULL); SELECT account_save(NULL,'5260150001','Depreciacion Equipos de Oficina','E','5260150001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '526020', 'EQUIPOS DE COMPUTACION Y COMUNIC', NULL); SELECT account_save(NULL,'5260200001','Depreciacion Eq. de Computacion','E','5260200001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '526035', 'FLOTA Y EQUIPO DE TRANSPORTE', NULL); SELECT account_save(NULL,'5260350001','Depreciacion de Vehiculos','E','5260350001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '526099', 'AJUSTES POR INLFACION', NULL); SELECT account_save(NULL,'5260990005','Aj. Infl. Construcciones y Edif.','E','5260990005', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5260990010','Aj. Infl. Maquinaria y Equipo','E','5260990010', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5260990015','Aj. Infl. Equipos de Oficina','E','5260990015', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5260990020','Aj. Infl. Eq. Computacion y Com.','E','5260990020', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5260990035','Aj. Infl. Vehiculos','E','5260990035', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '5295', 'GASTOS DIVERSOS', NULL); SELECT account_heading_save(NULL, '529505', 'COMISIONES', NULL); SELECT account_heading_save(NULL, '529510', 'LIBROS SUSCRIPCIONES PERIODICOS', NULL); SELECT account_save(NULL,'5295100001','Libros Suscripciones periodicos','E','5295100001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '529520', 'GASTOS DE REPRESENTACION Y REL.P', NULL); SELECT account_save(NULL,'5295200001','Gastos de Representacion y Rel.P','E','5295200001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '529525', 'ELEMENTOS DE ASEO Y CAFETERIA', NULL); SELECT account_heading_save(NULL, '529530', 'UTILES PAPELERIA Y FOTOCOPIAS', NULL); SELECT account_heading_save(NULL, '529535', 'COMBUSTIBLES Y LUBRICANTES', NULL); SELECT account_heading_save(NULL, '529545', 'TAXIS Y BUSES', NULL); SELECT account_heading_save(NULL, '529550', 'ESTAMPILLAS', NULL); SELECT account_save(NULL,'5295500001','Estampillas','E','5295500001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '529560', 'CASINO Y RESTAURANTE', NULL); SELECT account_heading_save(NULL, '529565', 'PARQUEADEROS', NULL); SELECT account_save(NULL,'5295650001','Parqueaderos','E','5295650001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '529595', 'OTROS GASTOS DIVERSOS', NULL); SELECT account_save(NULL,'5295950001','Cargue y Decargue de Materiales','E','5295950001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5295950002','Autenticaciones','E','5295950002', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5295950004','Ajuste al Peso','E','5295950004', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '5299', 'PROVISIONES', NULL); SELECT account_heading_save(NULL, '529910', 'DEUDORES', NULL); SELECT account_save(NULL,'5299100001','Provision Deudas Dificil Recaudo','E','5299100001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '53', 'GASTOS NO OPERACIONALES', NULL); SELECT account_heading_save(NULL, '5305', 'GASTOS FINANCIEROS', NULL); SELECT account_heading_save(NULL, '530505', 'GASTOS BANCARIOS', NULL); SELECT account_save(NULL,'5305050001','Gastos Bancarios','E','5305050001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '530515', 'COMISIONES', NULL); SELECT account_save(NULL,'5305150001','Comisiones Bancarias','E','5305150001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '530520', 'INTERESES', NULL); SELECT account_save(NULL,'5305200001','Intereses Corriente Ptmos Bancar','E','5305200001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5305200002','Intereses por Sobregiro Bancario','E','5305200002', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5305200003','Intereses de Mora','E','5305200003', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '5315', 'GASTOS EXTRAORDINARIOS', NULL); SELECT account_heading_save(NULL, '531520', 'IMPUESTOS ASUMIDOS', NULL); SELECT account_save(NULL,'5315200001','Impuestos Asumidos','E','5315200001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '531595', 'OTROS GASTOS EXTRAORDINARIOS', NULL); SELECT account_heading_save(NULL, '5395', 'GASTOS DIVERSOS', NULL); SELECT account_heading_save(NULL, '539520', 'MULTAS SANCIONES Y LITIGIOS', NULL); SELECT account_save(NULL,'5395200001','Multas Sanciones y Litigios','E','5395200001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '54', 'IMPUESTO DE RENTA Y COMPLEMENTAR', NULL); SELECT account_heading_save(NULL, '5405', 'IMPUESTO DE RENTA Y COMPLEMENTAR', NULL); SELECT account_heading_save(NULL, '540505', 'IMPUESTO DE RENTA Y COMPLEMENTAR', NULL); SELECT account_save(NULL,'5405050001','Impuesto de Renta y Complementar','E','5405050001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '6', 'COSTO DE VENTA', NULL); SELECT account_heading_save(NULL, '61', 'COSTO DE VENTAS Y PREST. SERVICI', NULL); SELECT account_heading_save(NULL, '6135', 'COMERCIO AL POR MAYOR Y MENOR', NULL); SELECT account_heading_save(NULL, '613554', 'VTA MAQ. EQ. OFIC. Y SOFTWARE', NULL); SELECT account_save(NULL,'6135540001','Costo de Ventas','E','6135540001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '62', 'COMPRAS', NULL); SELECT account_heading_save(NULL, '6205', 'COMPRA DE MERCANCIA', NULL); SELECT account_heading_save(NULL, '6210', 'COMPRA DE MATERIA PRIMA', NULL); SELECT account_heading_save(NULL, '621001', 'COMPRA DE MATERIA PRIMA', NULL); SELECT account_save(NULL,'1305050002','Clientes Nacionales','A','1305050002', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'2408050001','Iva Descontable en compras 16%','L','2408050001', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2408050002','Iva Descontable en servicios 16%','L','2408050002', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2408050003','Iva Descontable Arri. y Hotel 7%','L','2408050003', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2408050004','Iva Descontable en Tiquetes 8%','L','2408050004', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2408050005','Iva Descontable en Servicios 20%','L','2408050005', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2408050010','Iva Descon. Reg. Simplif. 12%','L','2408050010', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'1305050001','Clientes Nacionales','A','1305050001', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1330050001','Anticipo a Proveedores','A','1330050001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1350950001','Contratos de Consultoria','A','1350950001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1465050001','Inventarios en Transito','A','1465050001', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'2205050002','Proveedores Nacionales','L','2205050002', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'2320050001','Cuentas por pagar a Contratistas','L','2320050001', NULL, false, false, string_to_array('AP', ':')); SELECT account_heading_save(NULL, '2315', 'A COMPA??AS VINCULADAS', NULL); SELECT account_save(NULL,'2335950001','Gastos Causados por Pagar','L','2335950001', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'2205050001','Proveedores Nacionales','L','2205050001', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'2365150002','Honorarios Persona Natural 11%','L','2365150002', NULL, false, false, string_to_array('AP_tax:IC_taxservice', ':')); SELECT account_save(NULL,'2365150003','Honorarios Persona Juridica 10%','L','2365150003', NULL, false, false, string_to_array('AP_tax:IC_taxservice', ':')); SELECT account_save(NULL,'5105480001','Bonificaciones a Empleados','E','5105480001', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '142005', 'CONTRATOS EN EJECUCION', NULL); SELECT account_save(NULL,'5220100001','Arriendo Casa','E','5220100001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5255950001','Taxis y Buses','E','5255950001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5235550001','Gas','E','5235550001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5255150001','Pasajes Aereos','E','5255150001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5235250001','Acueducto y Alcantarilldo','E','5235250001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'2368030002','Retencion ICA 8xMil','L','2368030002', NULL, false, false, string_to_array('AP_tax:IC_taxservice', ':')); SELECT account_save(NULL,'2380950001','Cuentas por pagar','L','2380950001', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'1330100001','Anticipo a Contratistas','A','1330100001', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'2408050006','IVA Descontable en compras 20% ','L','2408050006', NULL, false, false, string_to_array('IC_taxservice', ':')); SELECT account_save(NULL,'5295950003','Compra de Medicina Contratistas','E','5295950003', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5295600001','Casino y Restaurante','E','5295600001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5295450001','Taxis y Buses Urbanos','E','5295450001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5295350001','Combustibles y lubricantes','E','5295350001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5295050001','Comisiones','E','5295050001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5255950003','Tasa Aeroportuaria','E','5255950003', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5255050001','Alojamiento y Manutencion','E','5255050001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5250150001','Reparaciones Locativas','E','5250150001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5240950002','Exp. Certif. Libertad y tradicio','E','5240950002', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5240150001','Tramites y Licencias','E','5240150001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5235950006','Mano de Obra OBRAS CIVILES','E','5235950006', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5235950005','Jardineria','E','5235950005', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5235950003','Digitacion de Planos','E','5235950003', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5235950001','Pintura','E','5235950001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5235500001','Transportes Fletes y Acarreos','E','5235500001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5235400001','Correo Portes y Telegramas','E','5235400001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5235150001','Asistencia tecnica','E','5235150001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5235050001','Aseo y Vigilancia','E','5235050001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5215950001','Impuesto de 3 por Mil','E','5215950001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5215150001','Impuestos a la Propiedad raiz','E','5215150001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5210950003','Asesoria Administrativa y de Mer','E','5210950003', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5210950002','Asesoria Contable','E','5210950002', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5210250001','Asesorias Juridicas','E','5210250001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5205780001','Aportes SENA','E','5205780001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5205750001','Aportes ICBF','E','5205750001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5205720001','Aportes cajas de Compensacion','E','5205720001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5205700001','Aportes fondo de Pensiones y Ces','E','5205700001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5205690001','Aportes EPS','E','5205690001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5205680001','Aportes ARP','E','5205680001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5205390001','Vacaciones','E','5205390001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5205360001','Primas de Servicios','E','5205360001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5205300001','Cesantias','E','5205300001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'5205270001','Auxilio de transporte','E','5205270001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'4295050001','Aprovechamiento Material Sobrant','I','4295050001', NULL, false, false, string_to_array('IC_sale:IC_income', ':')); SELECT account_save(NULL,'4210050001','Intereses por Rendimientos Finan','I','4210050001', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'2408100001','Iva Generado por Ingresos 16%','L','2408100001', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2408100002','Iva Generado por Ingresos 7%','L','2408100002', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'6210010001','Compra de Materia Prima','E','6210010001', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'2365400002','Compra Combustibles y Lub. 0.1%','L','2365400002', NULL, false, false, string_to_array('IC_taxservice', ':')); SELECT account_save(NULL,'2365400001','Compras en General 3.5%','L','2365400001', NULL, false, false, string_to_array('IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2365300004','Arriendo Maq. Obra Civil 2%','L','2365300004', NULL, false, false, string_to_array('IC_taxservice', ':')); SELECT account_save(NULL,'2365300003','Arriendo Bienes Muebles 4%','L','2365300003', NULL, false, false, string_to_array('IC_taxservice', ':')); SELECT account_save(NULL,'2365300001','Arriendo Inmuebles 3.5%','L','2365300001', NULL, false, false, string_to_array('IC_taxservice', ':')); SELECT account_save(NULL,'2365250004','Construccion Obra Civil 1%','L','2365250004', NULL, false, false, string_to_array('IC_taxservice', ':')); SELECT account_save(NULL,'2365250003','Transporte de Carga 1%','L','2365250003', NULL, false, false, string_to_array('IC_taxservice', ':')); SELECT account_save(NULL,'2365250001','Servicios en General 6%','L','2365250001', NULL, false, false, string_to_array('IC_taxservice', ':')); SELECT account_save(NULL,'2365200001','Retencion Comision del 11%','L','2365200001', NULL, false, false, string_to_array('IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2365150001','Honorarios Persona Natural 10%','L','2365150001', NULL, false, false, string_to_array('AP_tax:IC_taxservice', ':')); SELECT account_save(NULL,'5295300001','Utiles Papeleria y Fotocopias','E','5295300001', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'5295250001','Elementos de Aseo y Cafeteria','E','5295250001', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'5235300001','Energia Electrica','E','5235300001', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'5235350001','Telefono','E','5235350001', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'1355150003','Retefuente 7% Rendimientos Finan','A','1355150003', NULL, false, false, string_to_array('IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'1355150001','Retefuente 2% Factor multiplicad','A','1355150001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1355170001','Iva Retenido 75% de 16%','A','1355170001', NULL, false, false, string_to_array('IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2365150004','Honorarios Persona Juridica 11%','L','2365150004', NULL, false, false, string_to_array('AR_tax:AP_tax', ':')); SELECT account_save(NULL,'2367050001','Iva retenido reg simplif 12% ','L','236705', NULL, false, false, string_to_array('AP_tax', ':')); SELECT account_heading_save(NULL, '236710', 'IVA RETENIDO AL REGIMEN COMUN ', NULL); SELECT account_heading_save(NULL, '236705', 'IVA RETENIDO AL REGIMEN SIMPLIF. ', NULL); SELECT account_heading_save(NULL, '2367', 'IMPUESTO A LAS VENTAS RETENIDO', NULL); SELECT account_save(NULL,'4295810001','Ajuste al Peso','I','4295810001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5240050001','Gastos Notariales','E','5240050001', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'429581001','Ajuste','I','429581001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4130950001','Consultorias','I','4130950001', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'4130100001','Ingresos por Obras Civiles','I','4130100001', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'4130950002','Interventorias','I','4130950002', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'4220100001','Arriendo de locales y oficinas','I','4220100001', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'4220150001','Arriendo de Maquinaria y Equipos','I','4220150001', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('4235950001', 'Algo', 'A', 'I', 'AR_amount:IC_income', '4235950001'); SELECT account_save(NULL,'5205060001','Sueldos de Personal','E','5205060001', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'2370060001','Aportes a ARP','L','2370060001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2380950002','Otros Acreedores Varios','L','2380950001', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'2335300001','Servicios Tecnicos','L','2335300001', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'2370100001','Aportes a Sena, icbf y Cajas com','L','2370100001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2380300001','Fondos de Cesantias y/o Pension','L','2380300001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2505050001','Salarios por Pagar','L','2505050001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2610050001','Cesantias','L','2610050001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2610100001','Intereses Sobre Cesantias','L','2610100001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2610150001','Vacaciones','L','2610150001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2610200001','Prima de Servicios','L','2610200001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2367100001','Iva retenido al reg comun 16% ','L','236710', NULL, false, false, string_to_array('AR_tax:AP_tax', ':')); SELECT account_save(NULL,'2367050002','Iva retenido Reg Simp.del 7% ','L','236705', NULL, false, false, string_to_array('IC_taxservice', ':')); SELECT account_save(NULL,'2367100002','Iva retenido al reg comun 20% ','L','236710', NULL, false, false, string_to_array('IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2367100003','Iva retenido al reg comun del 7% ','L','236710', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'1410990001','Aj. por Inflacion Inv. en Proces','A','1410990001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1465990001','Aj.por Infl. Inv. en Transito','A','1465990001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1330150001','Anticipo a Trabajadores','A','1330150001', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1420990001','Aj.por Inflacion Ctos en Ejecuci','A','1420990001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1430990001','Aj.por Inflacion Inv.Prod.Termin','A','1430990001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1435990001','Aj.por Infl.Mcia No Fab.Empresa','A','1435990001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1105050001','Caja Mayor','A','1105050001', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1105100001','Caja Menor 1','A','1105100001', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1105100002','Caja Menor 2','A','1105100002', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1105100003','Caja Menor 3','A','1105100003', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1105100004','Caja menor 4','A','1105100004', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1105100005','Caja menor 5','A','1105100005', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1110050013','Banco Ganadero Cta.Cte.xxxxxxxx','A','1110050013', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1110050029','Tequendama Cte. #xxxxxxxx','A','1110050029', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1120050013','Banco Ganadero Ahorro xxxxxxxx','A','1120050013', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1120050019','Banco Colpatria Ahor. xxxxxxxxx','A','1120050019', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1120051302','Bco Ganadero Ahorro xxxxxxxxxx','A','1120051302', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1355150020','Retencion en la Fuente Año Anter','A','1355150020', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1410050001','Muebles','A','1410050001', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1410050002','Inventario 1','A','1410050002', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1410050003','Inventario 2','A','1410050003', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1410050004','Inventario 3','A','1410050004', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1410050005','Inventario 4','A','1410050005', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1410050010','Inventario 5','A','1410050010', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1420050001','Lokesea','A','1420050001', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1430050001','Lokesea','A','1430050001', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1435050001','Lokesea','A','1435050001', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1420050002','Lokesea','A','1420050002', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1516100001','Local #1','A','1516100001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1516100002','Local #2','A','1516100002', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1516100003','Local #3','A','1516100003', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1516990001','Aj. Infl. Local #1','A','1516990001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1435050099','Cuenta Inventario para Lokesea','A','1435050099', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1516991001','Aj. Infl. Local #1','A','1516991001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1516991002','Aj. Infl. Local #2','A','1516991002', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1516991003','Aj. Infl. Local #3','A','1516991003', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1520020001','Lokesea del Inventario','A','1520020001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1520020002','Equipo de Lokeasea','A','1520020002', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1520990201','Aj. por Inflacion Lokesea','A','1520990201', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1520990202','Aj.x Infl. Otro Lokesea','A','1520990202', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1524100001','Aire Acondicionado LG','A','1524100001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1524991001','Aj. por Inflac. Aire Acond. LG','A','1524991001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1592100001','Depreciacion Lokesea','A','1592100001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1540050001','Mazda Blanco Placa ALGO0815','A','1540050001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1592050001','Local #1','A','1592050001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1592050002','Local #2','A','1592050002', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1592050003','Local #3','A','1592050003', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1592100002','Deprec. Otro Lokesea','A','1592100002', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1592150001','Depreciacion Aire LG','A','1592150001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1592350001','Mazda Balnco Placa ALGO0815','A','1592350001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1910080001','Local #1','A','1910080001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1910080002','Local #2','A','1910080002', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1910080003','Local #3','A','1910080003', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2335950002','Cuentas por pagar CaribeNet S.A. (www.caribenet.com)','L','2335950002', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'3115050001','Yo','Q','3115050001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3115050002','Tu','Q','3115050002', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4120270001','Lokeproducimos','I','4120270001', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'4130950003','En que ganamos?','I','4130950003', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'4135950001','Loquevendomos','I','4135950001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4150300001','Vendo hasta mi mama!','I','4150300001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5230750001','Soat - Seguro Obligatorio Vehiculos','E','5230750001', NULL, false, false, string_to_array('', ':')); -- INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '1355150003'), -0.07); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '1355170001'), -0.12); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2365150001'), -0.1); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2365150002'), -0.11); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2365150003'), -0.1); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2365150004'), -0.11); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2365200001'), -0.11); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2365250001'), -0.06); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2365250003'), -0.01); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2365250004'), -0.01); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2365300001'), -0.035); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2365300003'), -0.04); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2365300004'), -0.02); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2365400001'), -0.035); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2365400002'), -0.001); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2367050001'), -0.12); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2367050002'), -0.0525); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2367100001'), -0.12); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2367100002'), -0.15); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2367100003'), -0.0525); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2368030002'), -0.008); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2408050001'), 0.16); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2408050002'), 0.16); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2408050003'), 0.07); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2408050004'), 0.08); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2408050005'), 0.2); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2408050006'), 0.2); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2408050010'), 0.12); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2408100001'), 0.16); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '2408100002'), 0.07); INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (SELECT id FROM chart WHERE accno = '141005001')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (SELECT id FROM chart WHERE accno = '412027001')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (SELECT id FROM chart WHERE accno = '5250150001')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (SELECT id FROM chart WHERE accno = '4705400001')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (SELECT id FROM chart WHERE accno = '530520001')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'COP'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE id IN (select account_id FROM account_link WHERE description = 'AP_paid'); commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/cz/0000755000000000000000000000000012060044550013471 5ustar rootrootledgersmb/sql/coa/cz/chart/0000755000000000000000000000000012060044550014572 5ustar rootrootledgersmb/sql/coa/cz/chart/General.sql0000755000000000000000000015505711730345473016723 0ustar rootrootBEGIN; -- Czech chart of accounts -- Tomas.Fencl@centrum.cz -- -- 3.3.2008 -- Vladimir Botka vlado@netng.org -- customized for http://www.ledgersmb.org/ -- encoding UTF-8 -- -- Needs to be converted to use new framework. Works, though, for now. SELECT account_heading_save(NULL, '0000', '-----', NULL); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10001, '1000', 'Dlouhodobý nehmotný majetek', 'A', 'A', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10033, '3200', 'Umělecká díla a sbírky', 'A', 'A', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10005, '1200', 'Nehmotné výsledky výzkumu a vývoje', 'A', 'A', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10007, '1300', 'Software', 'A', 'A', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10009, '1400', 'Ocenitelná práva', 'A', 'A', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10011, '1800', 'Drobný dlouhodobý nehmotný majetek', 'A', 'A', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10013, '1900', 'Ostatní dlouhodobý nehmotný majetek', 'A', 'A', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10015, '2000', 'Dlouhodobý Hmotný majetek odpisovaný', 'H', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10017, '2100', 'Stavby', 'A', 'A', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10025, '2800', 'Drobný dlouhodobý hmotný majetek', 'A', 'A', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10027, '2900', 'Ostatní dlouhodobý hmotný majetek', 'A', 'A', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10029, '3000', 'Dlouhodobý hmotný majetek neodpisovaný', 'H', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10031, '3100', 'Pozemky', 'A', 'A', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10041, '5000', 'Poskytnuté zálohy na dlouhodobý nehmotný a hmotný majetek', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10043, '5100', 'Poskytnuté zálohy na dlouhodobý nehmotný majetek', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10045, '5200', 'Poskytnuté zálohy na dlouhodobý hmotný majetek', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10049, '6100', 'Podílové cenné papíry a vklady v podnicích s rozhodujícím', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10051, '6200', 'Podílové cenné papíry a vklady v podnicích s podstatným', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10053, '6300', 'Ostatní dlouhodobé cenné papíry a vklady', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10067, '7300', 'Oprávky k softwaru', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10071, '7800', 'Oprávky k drobnému dlouhodobému nehmotnému majetku', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10073, '7900', 'Oprávky k ostatnímu dlouhodobému nehmotnému majetku', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10075, '8000', 'Oprávky k dlouhodobému hmotnému majetku', 'H', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10077, '8100', 'Oprávky ke stavbám', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10085, '8800', 'Oprávky k drobnému dlouhodobému hmotnému majetku', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10087, '8900', 'Oprávky k ostatnímu dlouhodobému hmotnému majetku', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10107, '10000', 'Zásoby', 'H', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10109, '11000', 'Materiál', 'H', 'A', 'IC', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10117, '12000', 'Zásoby vlastní výroby', 'H', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10121, '12200', 'Polotovary vlastní výroby', 'A', 'A', 'IC', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10123, '12300', 'Výrobky', 'A', 'A', 'IC', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10151, '21000', 'Peníze', 'A', 'A', 'AR_paid:AP_paid', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10153, '21100', 'Pokladna', 'A', 'A', 'AR_paid:AP_paid', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10155, '21300', 'Ceniny', 'A', 'A', 'AR_paid:AP_paid', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10171, '24100', 'Emitované krátkodobé dluhopisy', 'A', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10177, '25100', 'Majetkové cenné papíry', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10179, '25200', 'Vlastní akcie a vlastní obchodní podíly', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10183, '25500', 'Vlastní dluhopisy', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10185, '25600', 'Ostatní cenné papíry', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10199, '31000', 'Pohledávky', 'H', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10205, '31300', 'Pohledávky za eskontované cenné papíry', 'A', 'A', 'AR', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10207, '31400', 'Poskytnuté provozní zálohy', 'A', 'A', 'AR', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10209, '31500', 'Ostatní pohledávky', 'A', 'A', 'AR', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10211, '32000', 'Závazky', 'H', 'L', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10213, '32100', 'Dodavatelé', 'A', 'L', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10219, '32500', 'Ostatní závazky', 'A', 'L', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10019, '2200', 'Samostatné movité věci a soubory movitých věcí', 'A', 'A', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10021, '2500', 'Pěstitelské celky trvalých porostů', 'A', 'A', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10023, '2600', 'Základní stádo a tažná zvířata', 'A', 'A', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10035, '4000', 'Pořízení dlouhodobého nehmotného a hmotného majetku', 'A', 'A', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10139, '19200', 'Opravná položka k nedokonèené výrobì', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10255, '34700', 'Ostatní dotace', 'A', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10261, '35300', 'Pohledávky za upsaný vlastní kapitál', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10283, '37000', 'Jiné pohledávky a závazky', 'H', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10287, '37300', 'Nakoupené opce', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10289, '37400', 'Prodané opce', 'A', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10295, '37800', 'Jiné pohledávky', 'A', 'A', 'AR', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10297, '37900', 'Jiné závazky', 'A', 'L', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10311, '38600', 'Kursové rozdíly aktivní', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10313, '38700', 'Kursové rozdíly pasívní', 'A', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10331, '41100', 'Základní kapitál', 'A', 'Q', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10335, '41300', 'Ostatní kapitálové fondy', 'A', 'Q', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10341, '42100', 'Zákonný rezervní fond', 'A', 'Q', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10345, '42300', 'Statutární fondy', 'A', 'Q', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10347, '42700', 'Ostatní fondy', 'A', 'Q', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10357, '45000', 'Rezervy', 'H', 'Q', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10359, '45100', 'Rezervy zákonné', 'A', 'Q', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10361, '45400', 'Rezerva na kursové ztráty', 'A', 'Q', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10363, '45900', 'Ostatní rezervy', 'A', 'Q', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10369, '47000', 'Dlouhodobé závazky', 'H', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10373, '47300', 'Emitované dluhopisy', 'A', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10375, '47400', 'Závazky z pronájmu', 'A', 'L', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10381, '47900', 'Ostatní dlouhodobé závazky', 'A', 'L', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10383, '49000', 'Individuální podnikatel', 'A', 'Q', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10401, '51200', 'Cestovné', 'A', 'E', 'AP_amount:IC_expense', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10403, '51300', 'Náklady na reprezentaci', 'A', 'E', 'AP_amount:IC_expense', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10407, '52000', 'Osobní náklady', 'A', 'E', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10409, '52100', 'Mzdové náklady', 'A', 'E', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10419, '52600', 'Sociální náklady individuálního podnikatele', 'A', 'E', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10421, '52700', 'Zákonné sociální náklady', 'A', 'E', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10423, '52800', 'Ostatní sociální náklady', 'A', 'E', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10433, '54000', 'Jiné provozní náklady', 'A', 'E', 'AP_amount:IC_expense', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10437, '54200', 'Prodaný materiál', 'A', 'E', 'IC_expense', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10439, '54300', 'Dary', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10441, '54400', 'Smluvní pokuty a úroky z prodlení', 'A', 'E', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10443, '54500', 'Ostatní pokuty a penále', 'A', 'E', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10445, '54600', 'Odpis pohledávky', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10447, '54800', 'Ostatní provozní náklady', 'A', 'E', 'AP_amount:IC_expense', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10451, '55100', 'Odpisy dlouhodobého nehmotného a hmotného majetku', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10453, '55200', 'Tvorba zákonných rezerv', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10455, '55400', 'Tvorba ostatních rezerv', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10467, '56100', 'Prodané cenné papíry a vklady', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10469, '56200', 'Úroky', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10471, '56300', 'Kursové ztráty', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10477, '57400', 'Tvorba rezerv', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10487, '58400', 'Tvorba rezerv', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10529, '62000', 'Aktivace', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10537, '62400', 'Aktivace dlouhodobého hmotného majetku', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10539, '64000', 'Jiné provozní výnosy.', 'A', 'I', 'AR_amount:IC_sale:IC_income', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10547, '64600', 'Výnosy z odepsaných pohledávek', 'A', 'I', 'AR_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10549, '64800', 'Jiné provozní výnosy', 'A', 'I', 'AR_amount:IC_sale:IC_income', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10569, '66200', 'Úroky', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10571, '66300', 'Kursové zisky', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10243, '34311', 'DPH snížená vstup', 'A', 'L', 'AP_tax:IC_taxpart:IC_taxservice', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10245, '34312', 'DPH základní vstup', 'A', 'L', 'AP_tax:IC_taxpart:IC_taxservice', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10247, '34321', 'DPH snížená výstup', 'A', 'L', 'AR_tax:IC_taxpart:IC_taxservice', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10249, '34322', 'DPH základní výstup', 'A', 'L', 'AR_tax:IC_taxpart:IC_taxservice', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10003, '1100', 'Zřizovací výdaje', 'A', 'A', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10037, '4100', 'Pořízení dlouhodobého nehmotného majetku', 'A', 'A', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10039, '4200', 'Pořízení dlouhodobého hmotného majetku', 'A', 'A', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10047, '6000', 'Dlouhodobý finanční majetek', 'H', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10055, '6600', 'Pùjčky podnikùm ve skupinì', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10057, '6700', 'Ostatní pùjčky', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10059, '6900', 'Ostatní dlouhodobý finanční majetek', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10061, '7000', 'Oprávky k dlouhodobému nehmotnému majetku', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10063, '7100', 'Oprávky ke zřizovacím výdajùm', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10065, '7200', 'Oprávky k nehmotným výsledkům výzkumu a vývoje', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10069, '7400', 'Oprávky k ocenitelným právům', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10079, '8200', 'Oprávky k samostatným movitým věcem a souborùm movitých věcí', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10081, '8500', 'Oprávky k pěstitelským celkům trvalých porostů', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10083, '8600', 'Oprávky k základnímu stádu a tažným zvířatům', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10089, '9000', 'Opravné položky k dlouhodobému majetku', 'H', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10091, '9100', 'Opravná položka k dlouhodobému nehmotnému majetku', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10093, '9200', 'Opravná položka k dlouhodobému hmotnému majetku', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10095, '9300', 'Opravná položka k dlouhodobému nedokončenému nehmotnému', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10097, '9400', 'Opravná položka k dlouhodobému nedokončenému hmotnému', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10099, '9500', 'Opravná položka k poskytnutým zálohám', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10101, '9600', 'Opravná položka k dlouhodobému finančnímu majetku', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10103, '9700', 'Opravná položka k nabytému majetku', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10105, '9800', 'Oprávky k opravné položce k nabytému majetku', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10111, '11100', 'Pořízení materiálu', 'A', 'A', 'IC', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10113, '11200', 'Materiál na skladě', 'A', 'A', 'IC', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10115, '11900', 'Materiál na cestě', 'A', 'A', 'IC', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10119, '12100', 'Nedokončená výroba', 'A', 'A', 'IC', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10125, '12400', 'Zvířata', 'A', 'A', 'IC', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10127, '13000', 'Zboží', 'H', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10129, '13100', 'Pořízení zboží', 'A', 'A', 'IC', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10131, '13200', 'Zboží na skladě a v prodejnách', 'A', 'A', 'IC', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10133, '13900', 'Zboží na cestě', 'A', 'A', 'IC', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10135, '19000', 'Opravné položky k zásobám', 'H', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10137, '19100', 'Opravná položka k materiálu', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10141, '19300', 'Opravná položka k polotovarům vlastní výroby', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10143, '19400', 'Opravná položka k výrobkùm', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10145, '19500', 'Opravná položka ke zvířatům', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10147, '19600', 'Opravná položka ke zboží', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10149, '20000', 'Finanční účty', 'H', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10157, '22000', 'Účty v bankách', 'H', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10159, '22100', 'Bankovní účty', 'A', 'A', 'AR_paid:AP_paid', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10161, '22200', 'Bankovní účty klientù', 'A', 'A', 'AR_paid:AP_paid', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10163, '23000', 'Běžné bankovní úvěry', 'H', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10165, '23100', 'Krátkodobé bankovní úvěry', 'A', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10167, '23200', 'Eskontní úvěry', 'A', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10169, '24000', 'Jiné krátkodobé finanční výpomoci', 'H', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10173, '24900', 'Ostatní krátkodobé finanční výpomoci', 'A', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10175, '25000', 'Krátkodobý finanční majetek', 'H', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10181, '25300', 'Dlužné cenné papíry', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10187, '26000', 'Převody mezi finančními účty', 'H', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10189, '26100', 'Peníze na cestě', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10191, '29000', 'Opravné položky ke krátkodobému finančnímu majetku', 'H', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10193, '29100', 'Opravná položka k majetkovým cenným papírùm', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10195, '29300', 'Opravná položka k dlužným cenným papírům', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10197, '30000', 'Zúčtovací vztahy', 'H', 'H', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10201, '31100', 'Odběratelé', 'A', 'A', 'AR', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10203, '31200', 'Směnky k inkasu', 'A', 'A', 'AR', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10215, '32200', 'Směnky k úhradě', 'A', 'L', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10217, '32400', 'Přijaté zálohy', 'A', 'L', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10221, '32600', ' Závazky vůči klientům', 'A', 'L', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10223, '32700', ' Závazky vůči trhům', 'A', 'L', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10225, '33000', 'Zúčtování se zaměstnanci a institucemi', 'H', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10227, '33100', 'Zaměstnanci', 'A', 'L', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10229, '33300', 'Ostatní závazky vůči zaměstnancům', 'A', 'L', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10231, '33500', 'Pohledávky za zaměstnanci', 'A', 'A', 'AR', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10233, '33600', 'Zůčtování s institucemi sociálního zabezpečení a zp', 'A', 'L', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10235, '34000', 'Zůčtování daní a dotací', 'H', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10237, '34100', 'Daň z příjmu', 'A', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10239, '34200', 'Ostatní přímé daně', 'A', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10241, '34300', 'Daň z přidané hodnoty - zúčtování', 'A', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10251, '34500', 'Ostatní daně a poplatky', 'A', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10253, '34600', 'Dotace ze státního rozpočtu', 'A', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10257, '35000', 'Pohledávky ke společníkům a sdružení', 'H', 'A', 'AR', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10259, '35100', 'Pohledávky k podnikům ve skupině', 'A', 'A', 'AR', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10263, '35400', 'Pohledávky za společníky při úhradě ztráty', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10265, '35500', 'Ostatní pohledávky za společníky', 'A', 'A', 'AR', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10267, '35800', 'Pohledávky k účastníkùm sdružení', 'A', 'A', 'AR', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10269, '36000', 'Závazky ke společníkům a sdružení', 'H', 'L', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10271, '36100', 'Závazky k podnikům ve skupině', 'A', 'L', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10273, '36400', 'Závazky ke společníkům při rozdělování zisku', 'A', 'L', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10275, '36500', 'Ostatní závazky ke společníkům', 'A', 'L', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10277, '36600', 'Závazky ke společníkům a členům družstva ze závislé', 'A', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10279, '36700', 'Závazky z upsaných nesplacených cenných papírů a vkladů', 'A', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10281, '36800', 'Závazky k účastníkům sdružení', 'A', 'L', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10285, '37100', 'Odložená daňová pohledávka a závazek', 'A', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10291, '37500', 'Pohledávky z emitovaných dluhopisů', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10293, '37700', ' Zúčtování obchodů', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10299, '38000', 'Přechodné účty aktiv a pasiv', 'H', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10301, '38100', 'Náklady příštích období', 'A', 'A', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10303, '38200', 'Komplexní náklady příštích období', 'A', 'A', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10305, '38300', 'Výdaje příštích období', 'A', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10307, '38400', 'Výnosy příštích období', 'A', 'L', 'AR', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10309, '38500', 'Příjmy příštích období', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10315, '38800', 'Dohadné účty aktivní', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10317, '38900', 'Dohadné účty pasívní', 'A', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10319, '39000', 'Opravná položka k zúčtovacím vztahům a vnitřní zúčtování', 'H', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10321, '39100', 'Opravná položka k pohledávkám', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10323, '39500', 'Vnitřní zúčtování', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10325, '39800', 'Spojovací účet při sdružení', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10327, '40000', 'Kapitálové účty a dlouhodobé závazky', 'H', 'Q', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10329, '41000', 'Základní kapitál a kapitálové fondy', 'H', 'Q', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10333, '41200', 'Emisní ážio', 'A', 'Q', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10337, '41400', 'Oceňovací rozdíly z přecenění majetku a závazků', 'A', 'Q', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10339, '42000', 'Fondy ze zisku a převedené hospodářské výsledky', 'H', 'Q', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10343, '42200', 'Nedělitelný fond', 'A', 'Q', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10349, '42800', 'Nerozdělený zisk minulých let', 'A', 'Q', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10351, '42900', 'Neuhrazená ztráta minulých let', 'A', 'Q', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10353, '43000', 'Hospodářský výsledek', 'H', 'Q', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10355, '43100', 'Hospodářský výsledek ve schvalovacím řízení', 'A', 'Q', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10365, '46000', 'Bankovní úvěry', 'H', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10367, '46100', 'Bankovní úvěry', 'A', 'L', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10371, '47100', 'Dlouhodobé závazky k podnikům ve skupině', 'A', 'L', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10377, '47500', 'Dlouhodobé přijaté zálohy', 'A', 'L', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10379, '47800', 'Dlouhodobé směnky k úhradě', 'A', 'L', 'AP', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10385, '49100', 'Účet individuálního podnikatele', 'A', 'Q', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10387, '50000', 'Spotřebované nákupy', 'A', 'E', 'AP_amount:IC_expense', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10389, '50100', 'Spotřeba materiálu', 'A', 'E', 'AP_amount:IC_expense', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10391, '50200', 'Spotřeba energie', 'A', 'E', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10393, '50300', 'Spotřeba ostatních neskladovatelných dodávek', 'A', 'E', 'AP_amount:IC_expense', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10395, '50400', 'Prodané zboží', 'A', 'E', 'AP_amount:IC_expense', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10397, '51000', 'Služby', 'A', 'E', 'AP_amount:IC_expense', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10399, '51100', 'Opravy a udržování', 'A', 'E', 'AP_amount:IC_expense', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10405, '51800', 'Ostatní služby', 'A', 'E', 'AP_amount:IC_expense', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10411, '52200', 'Příjmy společníků a členů družstva ze závislé činnosti', 'A', 'E', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10413, '52300', 'Odměny členům orgánů společnosti a družstva', 'A', 'E', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10415, '52400', 'Zákonné sociální pojištění', 'A', 'E', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10417, '52500', 'Ostatní sociální pojištění', 'A', 'E', 'AP_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10425, '53000', 'Daně a poplatky', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10427, '53100', 'Daň silniční', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10429, '53200', 'Daň z nemovitostí', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10431, '53800', 'Ostatní daně a poplatky', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10435, '54100', 'Zůstatková cena prodaného dlouhodobého nehmotného a hmotného', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10449, '55000', 'Odpisy, rezervy a opravné položky provozních nákladů', 'H', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10457, '55500', 'Zúčtování komplexních nákladů příštích období', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10459, '55700', 'Zúčtování oprávky k opravné položce k nabytému majetku', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10461, '55800', 'Tvorba zákonných opravných položek', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10463, '55900', 'Tvorba opravných položek', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10465, '56000', 'Finanční náklady', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10473, '56800', 'Ostatní finanční náklady', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10475, '57000', 'Rezervy a opravné položky finančních nákladù', 'H', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10479, '57900', 'Tvorba opravných položek', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10481, '58000', 'Mimořádné náklady', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10483, '58100', 'Náklady na změnu metody', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10485, '58200', 'Manka a škody', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10489, '58800', 'Ostatní mimořádné náklady', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10491, '58900', 'Tvorba opravných položek', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10493, '59000', 'Daně z příjmù a převodové účty', 'H', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10495, '59100', 'Daň z příjmu z běžné činnosti - splatná', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10497, '59200', 'Daň z příjmu z běžné činnosti - odložená', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10499, '59300', 'Daň z příjmu z mimořádné činnosti - splatná', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10501, '59400', 'Daň z příjmu z mimořádné činnosti - odložená', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10503, '59500', 'Dodatečné odvody daně z příjmu', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10505, '59600', 'Převod podílu na hospodářském výsledku společníkùm', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10507, '59700', 'Převod provozních nákladů', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10509, '59800', 'Převod finančních nákladù', 'A', 'E', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10511, '60000', 'Tržby za vlastní výkony a zboží', 'A', 'I', 'AR_amount:IC_sale:IC_income', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10513, '60100', 'Tržby za vlastní výrobky', 'A', 'I', 'AR_amount:IC_sale', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10515, '60200', 'Tržby z prodeje služeb', 'A', 'I', 'AR_amount:IC_income', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10517, '60400', 'Tržby za zboží', 'A', 'I', 'AR_amount:IC_sale', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10519, '61000', 'Změny stavu vnitropodnikových zásob', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10521, '61100', 'Změna stavu nedokončené výroby', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10523, '61200', 'Změna stavu polotovarů', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10525, '61300', 'Změna stavu výrobků', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10527, '61400', 'Změna stavu zvířat', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10531, '62100', 'Aktivace materiálu a zboží', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10533, '62200', 'Aktivace vnitropodnikových služeb', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10535, '62300', 'Aktivace dlouhodobého nehmotného majetku', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10541, '64100', 'Tržby z prodeje dlouhodobého nehmotného a hmotného majetku', 'A', 'I', 'AR_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10543, '64200', 'Tržby z prodeje materiálu', 'A', 'I', 'AR_amount:IC_sale', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10545, '64400', 'Smluvní pokuty a úroky z prodlení', 'A', 'I', 'AR_amount', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10551, '65000', 'Zúčtování rezerv a opravných položek provozních výnosů', 'H', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10553, '65200', 'Zúčtování zákonných rezerv', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10555, '65400', 'Zúčtování ostatních rezerv', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10557, '65500', 'Zúčtování komplexních nákladů příětích období', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10559, '65700', 'Zúčtování oprávky k opravné položce k nabytému majetku', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10561, '65800', 'Zúčtování zákonných opravných položek', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10563, '65900', 'Zúčtování opravných položek', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10565, '66000', 'Finanční výnosy', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10567, '66100', 'Tržby z prodeje cenných papírů a vkladů', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10573, '66500', 'Výnosy z dlouhodobého finančního majetku', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10575, '66600', 'Výnosy z krátkodobého finančního majetku', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10577, '66800', 'Ostatní finanční výnosy', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10579, '67000', 'Zúčtování rezerv a opravných položek finančních výnosů', 'H', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10581, '67400', 'Zúčtování rezerv', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10583, '67900', 'Zúčtování opravných položek', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10585, '68000', 'Mimořádné výnosy', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10587, '68100', 'Výnosy ze změny metody', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10589, '68400', 'Zúčtování rezerv', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10591, '68800', 'Ostatní mimořádné výnosy', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10593, '68900', 'Zúčtování opravných položek', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10595, '69000', 'Převodové účty', 'H', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10597, '69700', 'Převod provozních výnosů', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10599, '69800', 'Převod finančních výnosů', 'A', 'I', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10601, '70000', 'Účty rozvažné', 'H', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10603, '70100', 'Počáteční účet rozvažný', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10605, '70200', 'Konečný účet rozvažný', 'A', 'A', '', '', false); INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno, contra) values (10607, '71000', 'Účet zisků a ztrát', 'A', 'A', '', '', false); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE id IN (select account_id FROM account_link WHERE description = 'AP_paid'); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '34311'),0.05); insert into tax (chart_id,rate) values ((select id from chart where accno = '34312'),0.19); insert into tax (chart_id,rate) values ((select id from chart where accno = '34321'),0.05); insert into tax (chart_id,rate) values ((select id from chart where accno = '34322'),0.19); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '13200')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '60000')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '50000')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '99998')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '99999')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'CZK'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); -- commit; -- UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/au/0000755000000000000000000000000012060044550013462 5ustar rootrootledgersmb/sql/coa/au/chart/0000755000000000000000000000000012060044550014563 5ustar rootrootledgersmb/sql/coa/au/chart/General-00000.sql0000755000000000000000000002072611726630426017343 0ustar rootrootbegin; -- Australia chart of accounts -- sample only -- SELECT account_heading_save(NULL, '10000', 'BANK AND CASH ACCOUNTS', NULL); SELECT account_save(NULL,'10001','Bank Account','A','100', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'10010','Petty Cash','A','100', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno in ('10001', '10010'); SELECT account_heading_save(NULL, '11000', 'CUSTOMERS AND SETTLEMENT ACCOUNTS', NULL); SELECT account_save(NULL,'11001','Accounts Receivables','A','110', NULL, false, false, string_to_array('AR', ':')); SELECT account_heading_save(NULL, '12000', 'OTHER CURRENT ASSETS', NULL); SELECT account_save(NULL,'12001','Allowance for doubtful accounts','A','120', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '15000', 'INVENTORY ASSETS', NULL); SELECT account_save(NULL,'15001','Inventory / General','A','150', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'15002','Inventory / Aftermarket Parts','A','150', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL, '16000', 'STATUTORY DEBTORS', NULL); SELECT account_save(NULL,'16001','INPUT GST','L','160', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_heading_save(NULL, '18000', 'CAPITAL ASSETS', NULL); SELECT account_save(NULL,'18001','Land and Buildings','A','180', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'18002','Accumulated Amortization -Land & Buildings','A','180', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'18003','Office Furniture & Equipment','A','180', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'18004','Accumulated Amortization -Furniture & Equipment','A','180', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'18005','Vehicle','A','180', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'18006','Accumulated Amortization -Vehicle','A','180', NULL, true, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '20000', 'CURRENT LIABILITIES', NULL); SELECT account_save(NULL,'20001','Accounts Payable','L','200', NULL, false, false, string_to_array('AP', ':')); SELECT account_heading_save(NULL, '21000', 'STATUTORY CREDITORS', NULL); SELECT account_save(NULL,'21001','Corporate Taxes Payable','L','210', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'21002','OUTPUT GST','L','210', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'21003','GST Settlement Account','L','210', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '22000', 'PAYROLL ACCOUNTS', NULL); SELECT account_save(NULL,'22001','Workers Net Salary Payable','L','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'22002','PAYG Witholding Payable','L','220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'22003','Superannuation Plan Payable','L','220', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '26000', 'LONG TERM LIABILITIES', NULL); SELECT account_save(NULL,'26001','Bank Loans','L','260', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'26002','Loans from Shareholders','L','260', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_heading_save(NULL, '33000', 'SHARE CAPITAL', NULL); SELECT account_save(NULL,'33001','Common Shares','Q','330', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '40000', 'SALES REVENUE', NULL); SELECT account_save(NULL,'40001','Sales / General','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'40002','Sales / Aftermarket Parts','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL, '41000', 'CONSULTING REVENUE', NULL); SELECT account_save(NULL,'41001','Consulting','I','410', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL, '42000', 'OTHER REVENUE', NULL); SELECT account_save(NULL,'42001','Interest and Financial Income','I','420', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'42002','Foreign Exchange Gain','I','420', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '50000', 'COST OF GOODS SOLD', NULL); SELECT account_save(NULL,'50001','Purchases','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'50002','COGS / General','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'50003','COGS / Aftermarket Parts','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'50004','Freight','E','500', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL, '54000', 'PAYROLL EXPENSES', NULL); SELECT account_save(NULL,'54001','Wages & Salaries','E','540', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'54002','PAYG Tax Expense','E','540', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'54003','Superannuation Plan Expense','E','540', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '56000', 'GENERAL & ADMINISTRATIVE EXPENSES', NULL); SELECT account_save(NULL,'56001','Accounting & Legal','E','560', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'56002','Advertising & Promotions','E','560', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'56003','Amortization Expense','E','560', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'56004','Income Taxes','E','560', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'56005','Insurance','E','560', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'56006','Office Supplies','E','560', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'56007','Rent and Rates','E','560', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'56008','Repair & Maintenance','E','560', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'56009','Telephone, Fax and Internet','E','560', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'56010','Travel & Entertainment','E','560', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'56011','Utilities','E','560', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'56012','Registrations','E','560', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'56013','Licenses','E','560', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL, '58000', 'OTHER EXPENSES', NULL); SELECT account_save(NULL,'58001','Interest & Bank Charges','E','580', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'58002','Foreign Exchange Loss','E','580', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'58003','Bad Debts','E','580', NULL, false, false, string_to_array('', ':')); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '16001'),0.1); insert into tax (chart_id,rate) values ((select id from chart where accno = '21002'),0.1); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '15001')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '40001')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '50001')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '42002')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '58002')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'AUD:USD:EUR'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/au/chart/General-0000.sql0000755000000000000000000003265311726630426017265 0ustar rootrootbegin; SELECT account_heading_save(NULL, '2000', 'CURRENT LIABILITIES', NULL); SELECT account_heading_save(NULL, '2600', 'LONG TERM LIABILITIES', NULL); SELECT account_heading_save(NULL, '4000', 'SALES REVENUE', NULL); SELECT account_heading_save(NULL, '5000', 'COST OF GOODS SOLD', NULL); SELECT account_heading_save(NULL, '5400', 'PAYROLL EXPENSES', NULL); SELECT account_heading_save(NULL, '5600', 'GENERAL & ADMINISTRATIVE EXPENSES', NULL); SELECT account_heading_save(NULL, '6000', 'CAR EXPENSES', NULL); SELECT account_heading_save(NULL, '4300', 'OTHER REVENUE', NULL); SELECT account_save(NULL,'5470','Staff Amenities','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '1500', 'STOCK ON HAND', NULL); SELECT account_heading_save(NULL, '3300', 'EQUITY', NULL); SELECT account_save(NULL,'1520','SOH / Leather','A','1500', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL, '1000', 'CURRENT ASSETS', NULL); SELECT account_save(NULL,'1820','Plant & Equipment - at Cost','A','1800', NULL, false, false, string_to_array('AP_amount', ':')); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, contra) VALUES ('1825', 'Less: Accumulated Depreciation', 'A', 'A', '', '1800', '1'); SELECT account_save(NULL,'1840','Motor Vehicles - at Cost','A','1800', NULL, false, false, string_to_array('AP_amount', ':')); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, contra) VALUES ('1845', 'Less: Accumulated Depreciation', 'A', 'A', '', '1800', '1'); SELECT account_heading_save(NULL, '1800', 'CAPITAL ASSETS', NULL); SELECT account_save(NULL,'1060','Cheque Account','A','1000', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno = '1060'; SELECT account_save(NULL,'1205','Less: Provision Doubtful Debts','A','1000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1210','Trade Debtors / Australia - with GST','A','1000', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1220','Trade Debtors / Exports - GST free','A','1000', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1230','GST / Refund','A','1000', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'1530','SOH / PVC','A','1500', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1540','SOH / Fabrics','A','1500', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1550','SOH / Metal Hardware / Fasteners / Accessories','A','1500', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1560','SOH / Paint / Glue / Dye','A','1500', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1570','SOH / Threads / Tapes / Cords / Laces','A','1500', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1580','SOH / Other Goods','A','1500', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'2100','Trade Creditors','L','2000', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'2160','Taxation - Payable','L','2000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2210','Workers Compensation - Payable','L','2000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2250','Superannuation - Payable','L','2000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2260','Insurance - Payable','L','2000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2290','GST / Payable','L','2000', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2300','GST Payments / Refunds','L','2000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2310','GST Adjustments','L','2000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3350','Issued & Paid up Capital','Q','3300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3370','Opening Account Balance','Q','3300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3380','Credit Payments / Holding Account','Q','', NULL, false, false, string_to_array('AR_paid', ':')); SELECT account_save(NULL,'4020','Sales / Manufactured Products','I','4000', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'4030','Sales / General','I','4000', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'4410','Shop Labour','I','4000', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'4420','Design / Patternmaking','I','4000', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'4430','Shipping & Handling','I','4000', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'4440','Interest Received','I','4000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4450','Foreign Exchange Profit','I','4000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4460','Mark-Up / Price Adjustment','I','4000', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'4470','Computer Consultancy / Training','I','4000', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'2620','Bank Loans','L','2000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2640','Hire Purchase','L','2000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'2650','Other Loans','L','2000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5020','COGS / Leather','E','5000', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'5030','COGS / PVC','E','5000', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'5040','COGS / Fabrics','E','5000', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'5050','COGS / Metal Hardware / Fasteners / Accessories','E','5000', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'5060','COGS / Paint / Glue / Dye','E','5000', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'5070','COGS / Threads / Tapes / Cords / Laces','E','5000', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'5080','COGS / Other Goods','E','5000', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'5410','Wages','E','5000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5430','Superannuation','E','5000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5440','Workers Compensation','E','5000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5605','External labour costs','E','5000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'5610','Accountancy','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5611','Legal Fees','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5613','Postage / Printing / Stationery','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5614','Freight and Cartage','E','5000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'5615','Advertising & Promotions','E','5000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'5620','Bad Debts','E','5000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5650','Capital Cost Allowance Expense','E','5000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5660','Interest Expenses','E','5000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5670','Depreciation Expenses','E','5000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5680','Taxation','E','5000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5685','Insurance','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5686','Security','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5690','Bank Fees And Charges','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5695','Other Fees And Charges','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5700','Office Supplies','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5760','Rent on Land & Buildings','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5765','Repairs & Maintenance','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5766','Fixtures & Fittings','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5770','Replacements (tools, etc)','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5780','Telephone','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5782','Computer Expenses','E','5000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'5783','Research & Development','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5785','Travel, Accommodation & Conference','E','5000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5790','Hire / Rent of Plant & Equipment ','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5795','Registration & Insurance','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5800','Licenses','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5810','Foreign Exchange Loss','E','5000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5811','Electricity','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5812','Gas','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5813','Sundry Expenses','E','5000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'5820','Goods & Services for own Use','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'6010','M/V Commercial - Fuels / Oils / Parts','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'6020','M/V Commercial - Repairs','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'6040','M/V Commercial - Reg / Insurance','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'6080','M/V Private Use - Interest Expenses','E','5000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6090','M/V Private Use - Other Expenses','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'6070','M/V Private Use - Depreciation Expenses','E','5000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6050','M/V Commercial - Depreciation Expenses','E','5000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6060','M/V Commercial - Interest Expenses','E','5000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1065','Cash / Paid From Private Accounts','Q','1000', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'3360','Payments for G & S for own Use','Q','3300', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'5830','Discounts / Refunds / Rounding','E','5000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'3390','Retained Profits','Q','3300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5840','Fines - NON DEDUCTIBLE EXPENSES','E','', NULL, false, false, string_to_array('', ':')); -- INSERT INTO tax (chart_id, rate, taxnumber) VALUES ((SELECT id FROM chart WHERE accno = '1230'), 0.1, ''); INSERT INTO tax (chart_id, rate, taxnumber) VALUES ((SELECT id FROM chart WHERE accno = '2290'), 0.1, ''); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (SELECT id FROM chart WHERE accno = '1520')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (SELECT id FROM chart WHERE accno = '4020')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (SELECT id FROM chart WHERE accno = '5020')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (SELECT id FROM chart WHERE accno = '4450')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (SELECT id FROM chart WHERE accno = '5810')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'AUD'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); -- commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/de/0000755000000000000000000000000012060044550013445 5ustar rootrootledgersmb/sql/coa/de/gifi/0000755000000000000000000000000012060044550014363 5ustar rootrootledgersmb/sql/coa/de/gifi/DATEV-SKR03.sql0000755000000000000000000013623010573165441016571 0ustar rootrootbegin; -- DATEV SKR03 -- INSERT INTO gifi (accno,description) VALUES ('0000100', 'Aufwand Geschäftsbetrieb'); INSERT INTO gifi (accno,description) VALUES ('0000200', 'Aufwendungen Umstellung a.d.Euro'); INSERT INTO gifi (accno,description) VALUES ('0001000', 'Konzession,gewerb.Schutzre.u.Werten'); INSERT INTO gifi (accno,description) VALUES ('0001500', 'Konzessionen'); INSERT INTO gifi (accno,description) VALUES ('0002700', 'EDV-Software'); INSERT INTO gifi (accno,description) VALUES ('0003500', 'Geschäfts-oder Firmenwert'); INSERT INTO gifi (accno,description) VALUES ('0003800', 'Anzahlungen a.Geschäft-o.Firmenwert'); INSERT INTO gifi (accno,description) VALUES ('0003900', 'Anz.a.immaterielle Vermögsgegenstän'); INSERT INTO gifi (accno,description) VALUES ('0004000', 'Verschmelzungsmehrwert'); INSERT INTO gifi (accno,description) VALUES ('0005000', 'Grundstücke,grundstücksgl.Rechte..'); INSERT INTO gifi (accno,description) VALUES ('0006000', 'Grundstücke u.grundstgl.Rech.o.Baut'); INSERT INTO gifi (accno,description) VALUES ('0008000', 'Bauten a.eig. Grundstücken,Grgl.Rec'); INSERT INTO gifi (accno,description) VALUES ('0008500', 'Grundstückswert eige.bebau.Grundst.'); INSERT INTO gifi (accno,description) VALUES ('0009000', 'Geschäftsbauten'); INSERT INTO gifi (accno,description) VALUES ('0010000', 'Fabrikbauten'); INSERT INTO gifi (accno,description) VALUES ('0011000', 'Garagen'); INSERT INTO gifi (accno,description) VALUES ('0011100', 'Außenanlagen'); INSERT INTO gifi (accno,description) VALUES ('0011200', 'Hof-und Wegebefestigung'); INSERT INTO gifi (accno,description) VALUES ('0011500', 'Andere Bauten'); INSERT INTO gifi (accno,description) VALUES ('0012000', 'Geschäfts-,Fabrik-,andere Bau.imBau'); INSERT INTO gifi (accno,description) VALUES ('0012900', 'Anz.Geschäfts-,Fabrik u. and.Bauten'); INSERT INTO gifi (accno,description) VALUES ('0015000', 'Wohnbauten im Bau'); INSERT INTO gifi (accno,description) VALUES ('0016000', 'Bauten auf fremden Grundstücken'); INSERT INTO gifi (accno,description) VALUES ('0016500', 'Geschäftsbauten'); INSERT INTO gifi (accno,description) VALUES ('0017000', 'Fabrikbauten'); INSERT INTO gifi (accno,description) VALUES ('0017500', 'Garagen'); INSERT INTO gifi (accno,description) VALUES ('0017600', 'Außenanlage'); INSERT INTO gifi (accno,description) VALUES ('0020000', 'Techn.Anlagen und Maschinen'); INSERT INTO gifi (accno,description) VALUES ('0021000', 'Maschinen'); INSERT INTO gifi (accno,description) VALUES ('0022000', 'Maschinengebundene Werkzeuge'); INSERT INTO gifi (accno,description) VALUES ('0024000', 'Maschinelle Anlagen'); INSERT INTO gifi (accno,description) VALUES ('0028000', 'Betriebsvorrichtung'); INSERT INTO gifi (accno,description) VALUES ('0029000', 'Techn.Anlagen u.Maschinen im Bau'); INSERT INTO gifi (accno,description) VALUES ('0029900', 'Anz.a.techn.Anlagen und Maschinen'); INSERT INTO gifi (accno,description) VALUES ('0030000', 'Andere Anlagen,Betrieb-Geschäftsaus'); INSERT INTO gifi (accno,description) VALUES ('0031000', 'Andere Anlagen'); INSERT INTO gifi (accno,description) VALUES ('0032000', 'PKW'); INSERT INTO gifi (accno,description) VALUES ('0035000', 'LKW'); INSERT INTO gifi (accno,description) VALUES ('0040000', 'Betriebsausstattung'); INSERT INTO gifi (accno,description) VALUES ('0041000', 'Geschäftsausstattung'); INSERT INTO gifi (accno,description) VALUES ('0042000', 'Büroeinrichtung'); INSERT INTO gifi (accno,description) VALUES ('0043000', 'Ladeneinrichtung'); INSERT INTO gifi (accno,description) VALUES ('0048000', 'Geringwertige Wirtschaftsg.b.800DM'); INSERT INTO gifi (accno,description) VALUES ('0049000', 'Sons.Betriebs- Geschäftsausstattung'); INSERT INTO gifi (accno,description) VALUES ('0049800', 'And. Anlagen,Betrieb/Geschäf.im Bau'); INSERT INTO gifi (accno,description) VALUES ('0049900', 'Anz.and.Anlagen,Betrieb.Geschäftsau'); INSERT INTO gifi (accno,description) VALUES ('0050000', 'Anteile a.verb.Unternehmen'); INSERT INTO gifi (accno,description) VALUES ('0050400', 'Ant.a.herr.o.m.Mehrh.bet.Ges.schaft'); INSERT INTO gifi (accno,description) VALUES ('0050500', 'Ausleihung an verb.Unternehmen'); INSERT INTO gifi (accno,description) VALUES ('0051000', 'Beteiligungen'); INSERT INTO gifi (accno,description) VALUES ('0051300', 'Typisch stille Beteiligungen'); INSERT INTO gifi (accno,description) VALUES ('0051600', 'Atypische stille Beteiligungen'); INSERT INTO gifi (accno,description) VALUES ('0052000', 'Ausl.a.Untern.m.Beteiligungsverhält'); INSERT INTO gifi (accno,description) VALUES ('0052500', 'Wertpapiere des Anlagevermögens'); INSERT INTO gifi (accno,description) VALUES ('0054000', 'Sonstige Ausleihungen'); INSERT INTO gifi (accno,description) VALUES ('0057000', 'Genossenschaftsan.z.langf.Verbleib'); INSERT INTO gifi (accno,description) VALUES ('0059500', 'Rückdeckansp.Lebensvers.langf.Verbl'); INSERT INTO gifi (accno,description) VALUES ('0060000', 'Anleihen-nicht konvertibel'); INSERT INTO gifi (accno,description) VALUES ('0063000', 'Verbindl.gegenüber Kreditinstituten'); INSERT INTO gifi (accno,description) VALUES ('0070000', 'Verbind.gegenüber verb.Unternehmern'); INSERT INTO gifi (accno,description) VALUES ('0071500', 'Verbind.gegen.Untern.m.Beteili.Verh'); INSERT INTO gifi (accno,description) VALUES ('0073000', 'Verbindlichkeiten gegen. Gesellscha'); INSERT INTO gifi (accno,description) VALUES ('0076000', 'Darl.typ.stiller Gesellschafter'); INSERT INTO gifi (accno,description) VALUES ('0078000', 'Partiarische Darlehen'); INSERT INTO gifi (accno,description) VALUES ('0080000', 'Gezeichnetes Kapital'); INSERT INTO gifi (accno,description) VALUES ('0080100', 'Ausst.Einl.a.d.gezeichnete Kapital'); INSERT INTO gifi (accno,description) VALUES ('0084000', 'Kapitalrücklage'); INSERT INTO gifi (accno,description) VALUES ('0084600', 'Gesetzliche Rücklage'); INSERT INTO gifi (accno,description) VALUES ('0085000', 'Rücklage für eigene Anteile'); INSERT INTO gifi (accno,description) VALUES ('0085100', 'Satzungsmäßige Rücklagen'); INSERT INTO gifi (accno,description) VALUES ('0086000', 'Gewinnvortrag vor Verwendung'); INSERT INTO gifi (accno,description) VALUES ('0086800', 'Verlustvortrag vor Verwendung'); INSERT INTO gifi (accno,description) VALUES ('0086900', 'Vortrag auf neue Rechnungen'); INSERT INTO gifi (accno,description) VALUES ('0087000', 'Festkapital'); INSERT INTO gifi (accno,description) VALUES ('0088000', 'Variables Kapital'); INSERT INTO gifi (accno,description) VALUES ('0089000', 'Gesellschafter-Darlehen'); INSERT INTO gifi (accno,description) VALUES ('0090000', 'Kommandit-Kapital'); INSERT INTO gifi (accno,description) VALUES ('0091000', 'Verlustausgleichskonto'); INSERT INTO gifi (accno,description) VALUES ('0092000', 'Gesellschafter-Darlehen'); INSERT INTO gifi (accno,description) VALUES ('0093000', 'Sonderposten mit Rücklagenanteil'); INSERT INTO gifi (accno,description) VALUES ('0093100', 'Sopo m.Rückl.ant.nach §6b EstG'); INSERT INTO gifi (accno,description) VALUES ('0093200', 'Sopo m.Rückl.ant.Abschn.35 EstR'); INSERT INTO gifi (accno,description) VALUES ('0093500', 'Sopo aus Währungsumstellung Euro'); INSERT INTO gifi (accno,description) VALUES ('0094700', 'Sopo m.Rückl.ant. §7g Abs.1 EstG'); INSERT INTO gifi (accno,description) VALUES ('0094800', 'Sopo m.Rückl.ant. §7g Abs.3,7 EstG'); INSERT INTO gifi (accno,description) VALUES ('0095500', 'Steuerrückstellung'); INSERT INTO gifi (accno,description) VALUES ('0095700', 'Gewerbesteuerrückstellung'); INSERT INTO gifi (accno,description) VALUES ('0096300', 'Körperschaftssteuerrückstellung'); INSERT INTO gifi (accno,description) VALUES ('0096900', 'Rückstellung für latente Steuern'); INSERT INTO gifi (accno,description) VALUES ('0097000', 'Sonstige Rückstellungen'); INSERT INTO gifi (accno,description) VALUES ('0097400', 'Rückstellungen für Gewährleistungen'); INSERT INTO gifi (accno,description) VALUES ('0097600', 'Rücks.f.drohe.Verl.schweb.Geschäft'); INSERT INTO gifi (accno,description) VALUES ('0097700', 'Rücks.f.Abschluß-u.Prüfungskosten'); INSERT INTO gifi (accno,description) VALUES ('0097800', 'Aufwandsrückstellungen'); INSERT INTO gifi (accno,description) VALUES ('0098000', 'Aktive Rechnungsabgrenzung'); INSERT INTO gifi (accno,description) VALUES ('0098300', 'Abgrenzung aktive latente Steuern'); INSERT INTO gifi (accno,description) VALUES ('0098600', 'Damnum/Disagio'); INSERT INTO gifi (accno,description) VALUES ('0099000', 'Passive Rechnungsabgrenzung'); INSERT INTO gifi (accno,description) VALUES ('0099200', 'Wertberichtigungen'); INSERT INTO gifi (accno,description) VALUES ('0099600', 'Pauschalwertb.m.Restlaufzeit v. 1J.'); INSERT INTO gifi (accno,description) VALUES ('0099800', 'Einzelwertber.m.Restlaufzeit v.1 J.'); INSERT INTO gifi (accno,description) VALUES ('0100000', 'Kasse'); INSERT INTO gifi (accno,description) VALUES ('0110000', 'Postbank'); INSERT INTO gifi (accno,description) VALUES ('0120000', 'Bank'); INSERT INTO gifi (accno,description) VALUES ('0121000', 'Dresdner Bank AG'); INSERT INTO gifi (accno,description) VALUES ('0121009', 'Verrechnungskonto Dresdner Bank AG'); INSERT INTO gifi (accno,description) VALUES ('0122000', 'Deutsche Bank AG'); INSERT INTO gifi (accno,description) VALUES ('0130000', 'Wechsel a. Lieferungen u.Leistungen'); INSERT INTO gifi (accno,description) VALUES ('0131000', 'Besitzwechsel geg.verb.Unternehmen'); INSERT INTO gifi (accno,description) VALUES ('0132000', 'Besitzw.geg.Untern.m.Beteiligungsve'); INSERT INTO gifi (accno,description) VALUES ('0132700', 'Finanzwechsel'); INSERT INTO gifi (accno,description) VALUES ('0133000', 'Schecks (Eingang)'); INSERT INTO gifi (accno,description) VALUES ('0133300', 'Schecks (Ausgang)'); INSERT INTO gifi (accno,description) VALUES ('0133500', 'Überweisungen (unterwegs)'); INSERT INTO gifi (accno,description) VALUES ('0134000', 'Anteile verb.Untern.-Umlaufvermögen'); INSERT INTO gifi (accno,description) VALUES ('0134400', 'Anteil an herr.m.betei.Gesellschaft'); INSERT INTO gifi (accno,description) VALUES ('0134500', 'Eigene Anteile'); INSERT INTO gifi (accno,description) VALUES ('0134800', 'Sonstige Wertpapiere'); INSERT INTO gifi (accno,description) VALUES ('0136000', 'Geldtransit'); INSERT INTO gifi (accno,description) VALUES ('0136100', 'Geldtransit (Überweisungen)'); INSERT INTO gifi (accno,description) VALUES ('0136200', 'Geldtransit,Bankeinzug/Lastschrift'); INSERT INTO gifi (accno,description) VALUES ('0136300', 'Scheck / Wechsel'); INSERT INTO gifi (accno,description) VALUES ('0140000', 'Ford. a.Lieferungen und Leistungen'); INSERT INTO gifi (accno,description) VALUES ('0141100', 'Forderungssammelkonto Vorausre.'); INSERT INTO gifi (accno,description) VALUES ('0141200', 'Forderungssammelkonto Anzahlungen'); INSERT INTO gifi (accno,description) VALUES ('0146000', 'Zweifelhafte Forderungen'); INSERT INTO gifi (accno,description) VALUES ('0147000', 'Forder.a.Liefe.u.Leis.geg.verb.Unte'); INSERT INTO gifi (accno,description) VALUES ('0147800', 'Wertb.a.Ford.m.Rest.1j.geg.verb.Unt'); INSERT INTO gifi (accno,description) VALUES ('0148000', 'Lief.u.Leis.geg.Untern.m.Beteiligve'); INSERT INTO gifi (accno,description) VALUES ('0148800', 'Wertb.a.Ford.m.Rest.1j.Beteiligungs'); INSERT INTO gifi (accno,description) VALUES ('0149000', 'Forderung a.Leis.u.Lief.geg.Gesells'); INSERT INTO gifi (accno,description) VALUES ('0150000', 'Sonstige Vermögensgegenstände'); INSERT INTO gifi (accno,description) VALUES ('0150300', 'Forde.geg.Vorstandsm.u.Geschäftsfüh'); INSERT INTO gifi (accno,description) VALUES ('0150800', 'Forderungen gegen Gesellschafter'); INSERT INTO gifi (accno,description) VALUES ('0151000', 'Geleistete Anzahlung auf Vorräte'); INSERT INTO gifi (accno,description) VALUES ('0151100', 'Geleistete Anzahlungen 7%'); INSERT INTO gifi (accno,description) VALUES ('0151700', 'Geleistete Anzahlung 16%'); INSERT INTO gifi (accno,description) VALUES ('0152500', 'Kautionen'); INSERT INTO gifi (accno,description) VALUES ('0153000', 'Forderungen gegen Personal'); INSERT INTO gifi (accno,description) VALUES ('0154000', 'Steuerüberzahlungen'); INSERT INTO gifi (accno,description) VALUES ('0154500', 'Umsatzsteuerforderungen'); INSERT INTO gifi (accno,description) VALUES ('0154800', 'Vorsteuer im Folgejahr abziehbar'); INSERT INTO gifi (accno,description) VALUES ('0154900', 'Körperschaftsteuerrückforderung'); INSERT INTO gifi (accno,description) VALUES ('0155000', 'Darlehen'); INSERT INTO gifi (accno,description) VALUES ('0156000', 'Aufzuteilende Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('0156500', 'Aufzuteilende Vorsteuer 16%'); INSERT INTO gifi (accno,description) VALUES ('0157000', 'Abziehbare Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('0157100', 'Abziebare Vorsteuer 7%'); INSERT INTO gifi (accno,description) VALUES ('0157200', 'Abziehb. VorSt innergemein. Erwerb'); INSERT INTO gifi (accno,description) VALUES ('0157300', 'Abziehb.VorSt. innergem.Erwerb 16%'); INSERT INTO gifi (accno,description) VALUES ('0157500', 'Abziehbare Vorsteuer 16%'); INSERT INTO gifi (accno,description) VALUES ('0157800', 'Berichtigung d.Vorstabzugs früh.J.'); INSERT INTO gifi (accno,description) VALUES ('0157900', 'Vorsteuer 0%'); INSERT INTO gifi (accno,description) VALUES ('0158400', 'abziehb.VorSt IG Erwerb Neufahrzeug'); INSERT INTO gifi (accno,description) VALUES ('0158800', 'Bezahlte Einfuhrumsatzsteuer'); INSERT INTO gifi (accno,description) VALUES ('0159000', 'Durchlaufende Posten'); INSERT INTO gifi (accno,description) VALUES ('0159400', 'Forderungen geg. verb. Unternehmen'); INSERT INTO gifi (accno,description) VALUES ('0159700', 'Ford.geg.Untern.m.Beteiligungsverh.'); INSERT INTO gifi (accno,description) VALUES ('0160000', 'Verbindlichkeiten aus Lief.u.Leist.'); INSERT INTO gifi (accno,description) VALUES ('0160100', 'Verbindlichkeiten a.Lief.und Leist.'); INSERT INTO gifi (accno,description) VALUES ('0163000', 'Verbindl.Lief.u.Leist.gegü.verb.Unt'); INSERT INTO gifi (accno,description) VALUES ('0164000', 'Verb.L.u.L gegü.Unter.Beteiligungsv'); INSERT INTO gifi (accno,description) VALUES ('0165000', 'Verb.L.u.L gegü.Gesellschaftern'); INSERT INTO gifi (accno,description) VALUES ('0166000', 'Schuldwechsel'); INSERT INTO gifi (accno,description) VALUES ('0170000', 'Sonstige Verbindlichkeiten'); INSERT INTO gifi (accno,description) VALUES ('0170500', 'Darlehen'); INSERT INTO gifi (accno,description) VALUES ('0170900', 'Gewinnverfügungskonto stiller Ges.'); INSERT INTO gifi (accno,description) VALUES ('0171000', 'Erhaltene Anzahlungen-Verbindlichke'); INSERT INTO gifi (accno,description) VALUES ('0171100', 'Erhaltene,versteuert Anzahlungen 7%'); INSERT INTO gifi (accno,description) VALUES ('0171700', 'Erhaltene,versteuerte Anzahl. 16%'); INSERT INTO gifi (accno,description) VALUES ('0171900', 'Erhaltene Anzahlungen bis 1j.'); INSERT INTO gifi (accno,description) VALUES ('0172200', 'Erhaltene Anzahlung'); INSERT INTO gifi (accno,description) VALUES ('0172300', 'Verbindlichkeiten S-konto Vorausre.'); INSERT INTO gifi (accno,description) VALUES ('0173200', 'Erhaltene Kautionen'); INSERT INTO gifi (accno,description) VALUES ('0174100', 'Verbindl.a.Lohn-und Kirchensteuer'); INSERT INTO gifi (accno,description) VALUES ('0175500', 'Lohn-und Gehaltsverrechnung'); INSERT INTO gifi (accno,description) VALUES ('0175800', 'USt-Abzugsverfahren 16%'); INSERT INTO gifi (accno,description) VALUES ('0175900', 'Ust 0%'); INSERT INTO gifi (accno,description) VALUES ('0176000', 'Umsatzsteuer nicht fällig'); INSERT INTO gifi (accno,description) VALUES ('0176100', 'Umsatzsteuer nicht fällig 7%'); INSERT INTO gifi (accno,description) VALUES ('0176200', 'Umsatzsteuer nicht fällig EG Lief.'); INSERT INTO gifi (accno,description) VALUES ('0177000', 'Umsatzsteuer'); INSERT INTO gifi (accno,description) VALUES ('0177100', 'Umsatzsteuer 7%'); INSERT INTO gifi (accno,description) VALUES ('0177200', 'Umsatzsteuer aus innergem. Erwerb'); INSERT INTO gifi (accno,description) VALUES ('0177300', 'Umsatzsteuer innergem.Erwerb 16%'); INSERT INTO gifi (accno,description) VALUES ('0177500', 'Umsatzsteuer 16%'); INSERT INTO gifi (accno,description) VALUES ('0177700', 'Ust aus im Inland stpfl. EG-Lief16%'); INSERT INTO gifi (accno,description) VALUES ('0178000', 'Umsatzsteuer-Vorauszahlungen'); INSERT INTO gifi (accno,description) VALUES ('0178100', 'Umsatzsteuer-Vorauszahlung 1/11'); INSERT INTO gifi (accno,description) VALUES ('0178300', 'In Rechn unberecht.ausgew.gesch Ust'); INSERT INTO gifi (accno,description) VALUES ('0178400', 'Ust IG Erwerb Neufahrzeug o.Ust ID'); INSERT INTO gifi (accno,description) VALUES ('0178800', 'Einfuhrumsatzsteuer augeschoben bis'); INSERT INTO gifi (accno,description) VALUES ('0178900', 'Umsatzsteuer laufendes Jahr'); INSERT INTO gifi (accno,description) VALUES ('0179000', 'Umsatzsteuer Vorjahr'); INSERT INTO gifi (accno,description) VALUES ('0179100', 'Umsatzsteuer frühere Jahre'); INSERT INTO gifi (accno,description) VALUES ('0179200', 'Sonstige Verrechnungskonten'); INSERT INTO gifi (accno,description) VALUES ('0180000', 'Privatentnahme allgemein'); INSERT INTO gifi (accno,description) VALUES ('0181000', 'Privatsteuern'); INSERT INTO gifi (accno,description) VALUES ('0189000', 'Privateinlagen'); INSERT INTO gifi (accno,description) VALUES ('0200000', 'Außerordentliche Aufwendung'); INSERT INTO gifi (accno,description) VALUES ('0201000', 'Betriebsfremde Aufwendungen'); INSERT INTO gifi (accno,description) VALUES ('0202000', 'Periodenfremde Aufwendungen'); INSERT INTO gifi (accno,description) VALUES ('0210000', 'Zinsen und ähnl.Aufwendungen'); INSERT INTO gifi (accno,description) VALUES ('0210300', 'Steuerl.abzugsfähig,and.Nebenl.Steu'); INSERT INTO gifi (accno,description) VALUES ('0210400', 'Steuerl.nicht.abzugsf.ande.Nl.z.Ste'); INSERT INTO gifi (accno,description) VALUES ('0210700', 'Zinsaufwendung-betriebliche Steuern'); INSERT INTO gifi (accno,description) VALUES ('0210800', 'Zinsaufwendung-Personsteuer'); INSERT INTO gifi (accno,description) VALUES ('0210900', 'Zinsaufwendungen an verb.Unternehm.'); INSERT INTO gifi (accno,description) VALUES ('0211000', 'Zinsaufwendung f.kurzf.Verbindlichk'); INSERT INTO gifi (accno,description) VALUES ('0212000', 'Zinsaufwendung f.langf.Verbindlichk'); INSERT INTO gifi (accno,description) VALUES ('0213000', 'Diskontaufwendung'); INSERT INTO gifi (accno,description) VALUES ('0215000', 'Aufwendungen aus Kursdifferenzen'); INSERT INTO gifi (accno,description) VALUES ('0216500', 'Aufw.a.d.Währungsumstell.a.d.Euro'); INSERT INTO gifi (accno,description) VALUES ('0217000', 'Nicht abziehbare Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('0217100', 'Nicht abziehbare Vorsteuer 7%'); INSERT INTO gifi (accno,description) VALUES ('0217500', 'Nicht abziehbare Vorsteuer 16%'); INSERT INTO gifi (accno,description) VALUES ('0220000', 'Körperschaftssteuer'); INSERT INTO gifi (accno,description) VALUES ('0220300', 'Körperschaftssteuer für Vorjahr'); INSERT INTO gifi (accno,description) VALUES ('0220500', 'Anrechb.Körperschaftsst.vereinn.Kap'); INSERT INTO gifi (accno,description) VALUES ('0220800', 'Solidaritätszuschlag'); INSERT INTO gifi (accno,description) VALUES ('0220900', 'Solidaritätszuschlag für Vorjahr'); INSERT INTO gifi (accno,description) VALUES ('0221000', 'Kapitalertragssteuer'); INSERT INTO gifi (accno,description) VALUES ('0221300', 'Anrechb.Solidaritätszusch.a.Zinsabs'); INSERT INTO gifi (accno,description) VALUES ('0221500', 'Zinsabschlagsteuer'); INSERT INTO gifi (accno,description) VALUES ('0221800', 'Anrechb.Solidari.zuschlag a.Zinsabs'); INSERT INTO gifi (accno,description) VALUES ('0228000', 'Stnachzahl.Vorj.v.Einkomm u.Ertrag'); INSERT INTO gifi (accno,description) VALUES ('0228200', 'Sterstat.Vorj.Steuer v.Eink.u.Ertrag'); INSERT INTO gifi (accno,description) VALUES ('0228400', 'Ertr.a.d.Aufl.v.Rücks.f.St.v.Ein.Er'); INSERT INTO gifi (accno,description) VALUES ('0228500', 'Steuernachzahlung Vorj.f.sons.Steue'); INSERT INTO gifi (accno,description) VALUES ('0228700', 'Steuererstattung Vorj.f.sons.Steuer'); INSERT INTO gifi (accno,description) VALUES ('0228900', 'Erträge a.d.Aufl.v. Rück.f.sons.Ste'); INSERT INTO gifi (accno,description) VALUES ('0230000', 'Sonstige Aufwendungen'); INSERT INTO gifi (accno,description) VALUES ('0231000', 'Anlagenabgänge - bei Buchverlust'); INSERT INTO gifi (accno,description) VALUES ('0231500', 'Anlagenabgänge-Buchgewinn'); INSERT INTO gifi (accno,description) VALUES ('0232000', 'Verluste Abgang Gegenst.d.Anlagever'); INSERT INTO gifi (accno,description) VALUES ('0232500', 'Verlust a.d.Abg.v.Gegens.d.Umlaufve'); INSERT INTO gifi (accno,description) VALUES ('0234000', 'Einstellungen Sopo m.Rückanlageant.'); INSERT INTO gifi (accno,description) VALUES ('0234500', 'Einstellungen Sopo m.R.(Sonderafa)'); INSERT INTO gifi (accno,description) VALUES ('0237500', 'Grundsteuer'); INSERT INTO gifi (accno,description) VALUES ('0240000', 'Forderungsverlust-übliche Höhe'); INSERT INTO gifi (accno,description) VALUES ('0241000', 'Einstellungen Sopo m.Rückl.(§7g )'); INSERT INTO gifi (accno,description) VALUES ('0243000', 'Forderungsverluste-unüblich hoch'); INSERT INTO gifi (accno,description) VALUES ('0245000', 'Einstell.i.d.Pauschalwertbe.z.Forde'); INSERT INTO gifi (accno,description) VALUES ('0245100', 'Einstell.i.d.Einzelwertb.z.Forderun'); INSERT INTO gifi (accno,description) VALUES ('0249000', 'Aufwendung aus Verlustübernahme'); INSERT INTO gifi (accno,description) VALUES ('0249200', 'Abgef.Gewinn aufgr.e.Gewinngemeinsc'); INSERT INTO gifi (accno,description) VALUES ('0249300', 'Abgef.Gewinnant.an stille Gesellsch'); INSERT INTO gifi (accno,description) VALUES ('0249500', 'Einst.Kapitalrückl.n.Vorschr.vere.K'); INSERT INTO gifi (accno,description) VALUES ('0249600', 'Einstellungen in die gesetzl.Rückla'); INSERT INTO gifi (accno,description) VALUES ('0250000', 'Außerordentliche Erträge'); INSERT INTO gifi (accno,description) VALUES ('0251000', 'Betriebsfremde Erträge n.außerorden'); INSERT INTO gifi (accno,description) VALUES ('0252000', 'Periodenfremde Erträge nicht außero'); INSERT INTO gifi (accno,description) VALUES ('0260000', 'Erträge aus Beteiligten'); INSERT INTO gifi (accno,description) VALUES ('0261700', 'Gewinn a.Anteila.nicht stbef.Kapita'); INSERT INTO gifi (accno,description) VALUES ('0261900', 'Erträge a.Beteil.a.verb.Untérnehmer'); INSERT INTO gifi (accno,description) VALUES ('0262000', 'Erträge a.anderen Wertp u.Ausl.Fina'); INSERT INTO gifi (accno,description) VALUES ('0265000', 'Sonstige Zinsen und ähnliche Erträge'); INSERT INTO gifi (accno,description) VALUES ('0265700', 'Zinserträge-betriebliche Steuern'); INSERT INTO gifi (accno,description) VALUES ('0265800', 'Zinserträge-Körperschaftssteuer'); INSERT INTO gifi (accno,description) VALUES ('0265900', 'Sons.Zinsen u.ähl.Ertr.a.verb.Unter'); INSERT INTO gifi (accno,description) VALUES ('0266000', 'Erträge aus Kursdifferenzen'); INSERT INTO gifi (accno,description) VALUES ('0266500', 'Erträge a.d.Währungumst.a.d. Euro'); INSERT INTO gifi (accno,description) VALUES ('0267000', 'Diskonerträge'); INSERT INTO gifi (accno,description) VALUES ('0270000', 'Sonstige Erträge'); INSERT INTO gifi (accno,description) VALUES ('0270500', 'Sons.Erträge betrieb. u. regelmäßig'); INSERT INTO gifi (accno,description) VALUES ('0271000', 'Ertrag a.d.Zuschreib.d.Anlagevermög'); INSERT INTO gifi (accno,description) VALUES ('0271500', 'Ertr.a.Zuschreib.d.Umlaufvermögens'); INSERT INTO gifi (accno,description) VALUES ('0272000', 'Ertr.a.d.Abgang v.Gegens.d.Anlageve'); INSERT INTO gifi (accno,description) VALUES ('0272500', 'Ertr.a.d.Abg.v.Gegenst.d.Umlaufverm'); INSERT INTO gifi (accno,description) VALUES ('0273000', 'Ertr.a.Herab.d.Pauschal.z.Forderung'); INSERT INTO gifi (accno,description) VALUES ('0273100', 'Ertr.a.Herab.d.Einzelw.z.Forderunge'); INSERT INTO gifi (accno,description) VALUES ('0273200', 'Ertr. aus abgeschriebenen Forderung'); INSERT INTO gifi (accno,description) VALUES ('0273500', 'Ertr.a.d.Auflösung v.Rückstellungen'); INSERT INTO gifi (accno,description) VALUES ('0273600', 'Ertr.a.d.steuerl.niedrig.Bewertung'); INSERT INTO gifi (accno,description) VALUES ('0273700', 'Ertr.a.d..Aufl.v.Sonderp.m.Rücklage'); INSERT INTO gifi (accno,description) VALUES ('0273800', 'Ertr.a.d.Aufl.v.Sopo.m.Rücklageant.'); INSERT INTO gifi (accno,description) VALUES ('0273900', 'Erträge Aufl. Sopo m.R.(Ansparafa)'); INSERT INTO gifi (accno,description) VALUES ('0274000', 'Erträge Auflösung Sopo (stfreie Rü)'); INSERT INTO gifi (accno,description) VALUES ('0274100', 'Ertr.a.d.Aufl.v.Sonderp.m.Rücklagen'); INSERT INTO gifi (accno,description) VALUES ('0274200', 'Versicherungsentschädigungen'); INSERT INTO gifi (accno,description) VALUES ('0274300', 'Investitionszuschüsse-steuerpflicht'); INSERT INTO gifi (accno,description) VALUES ('0274400', 'Investitionszulage-steuerfrei'); INSERT INTO gifi (accno,description) VALUES ('0274500', 'Erträge aus Kapitalherabsetzung'); INSERT INTO gifi (accno,description) VALUES ('0279000', 'Erträge aus Verlustübernahme'); INSERT INTO gifi (accno,description) VALUES ('0279200', 'Erhalt.Gewinne aufgr.e.Gewinngemein'); INSERT INTO gifi (accno,description) VALUES ('0279400', 'Erhalt.Gewinn aufgr.e.GAV-TeilGAV'); INSERT INTO gifi (accno,description) VALUES ('0279500', 'Entnahme aus der Kapitalrücklage'); INSERT INTO gifi (accno,description) VALUES ('0279600', 'Entnahme a.d. gesetzlichen Rücklage'); INSERT INTO gifi (accno,description) VALUES ('0286000', 'Gewinnvortrag nach Verwendung'); INSERT INTO gifi (accno,description) VALUES ('0286800', 'Verlustvortrag nach Verwendung'); INSERT INTO gifi (accno,description) VALUES ('0286900', 'Vortrag auf neue Rechnungen'); INSERT INTO gifi (accno,description) VALUES ('0287000', 'Vorabausschüttung'); INSERT INTO gifi (accno,description) VALUES ('0289200', 'Verrechnete kalkulatorische Zinsen'); INSERT INTO gifi (accno,description) VALUES ('0289300', 'Verrechnete kalkulatorische AfA'); INSERT INTO gifi (accno,description) VALUES ('0299000', 'Aufwendung/Erträge Umrechnungsdiff'); INSERT INTO gifi (accno,description) VALUES ('0300000', 'Roh,-Hilfs,-und Betriebsstoffe'); INSERT INTO gifi (accno,description) VALUES ('0309000', 'Energiestoffe (Fertigung)'); INSERT INTO gifi (accno,description) VALUES ('0310000', 'Fremdleistungen'); INSERT INTO gifi (accno,description) VALUES ('0315000', 'Leist.v.ausländ.Untern.(0-Regelung)'); INSERT INTO gifi (accno,description) VALUES ('0320000', 'Wareneingang'); INSERT INTO gifi (accno,description) VALUES ('0330000', 'Wareneingang 7% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('0340000', 'Wareneingang 16% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('0342000', 'Innergemein.Erwerb 7% VorSt u. Ust'); INSERT INTO gifi (accno,description) VALUES ('0342500', 'Innergem.Erwerb 16% VorSt u. Ust'); INSERT INTO gifi (accno,description) VALUES ('0355000', 'Steuerfreier innergem.Erwerb'); INSERT INTO gifi (accno,description) VALUES ('0360000', 'Nicht abziehbare Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('0370000', 'Nachlässe'); INSERT INTO gifi (accno,description) VALUES ('0371000', 'Nachlässe 7% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('0372000', 'Nachlässe 16% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('0373000', 'Erhaltene Skonti'); INSERT INTO gifi (accno,description) VALUES ('0373100', 'Erhaltene Skonti 7% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('0373500', 'Erhaltene Skonti 16% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('0374000', 'Erhaltene Boni'); INSERT INTO gifi (accno,description) VALUES ('0375000', 'Erhaltene Boni 7% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('0376000', 'Erhaltene Boni 16% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('0377000', 'Erhaltene Rabatte'); INSERT INTO gifi (accno,description) VALUES ('0378000', 'Erhaltene Rabatte 7% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('0379000', 'Erhaltene Rabatte 16% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('0380000', 'Anschaffungsnebenkosten'); INSERT INTO gifi (accno,description) VALUES ('0383000', 'Leergut'); INSERT INTO gifi (accno,description) VALUES ('0385000', 'Zölle und Einfuhrabgaben'); INSERT INTO gifi (accno,description) VALUES ('0396000', 'Bestandsver.Roh-,Hilfs-.Betriebs.'); INSERT INTO gifi (accno,description) VALUES ('0397000', 'Bestand Roh-,Hilfs-,u.Betriebsstoff'); INSERT INTO gifi (accno,description) VALUES ('0398000', 'Bestand Waren'); INSERT INTO gifi (accno,description) VALUES ('0399000', 'Verrechnete Stoffkosten'); INSERT INTO gifi (accno,description) VALUES ('0400000', 'Material-und Stoffverbrauch'); INSERT INTO gifi (accno,description) VALUES ('0410000', 'Löhne und Gehälter'); INSERT INTO gifi (accno,description) VALUES ('0412400', 'Geschäftsführ.gehälter GmbH-Gesell.'); INSERT INTO gifi (accno,description) VALUES ('0412500', 'Ehegattengehalt'); INSERT INTO gifi (accno,description) VALUES ('0412600', 'Tantiemen'); INSERT INTO gifi (accno,description) VALUES ('0412700', 'Geschäftsführergehälter'); INSERT INTO gifi (accno,description) VALUES ('0412800', 'Vergütung a.angestellte Mitunterneh'); INSERT INTO gifi (accno,description) VALUES ('0413000', 'Gesetzlich soziale Aufwendungen'); INSERT INTO gifi (accno,description) VALUES ('0413700', 'Gesetz.sozi.Aufw.f.Mitunternehmen'); INSERT INTO gifi (accno,description) VALUES ('0413800', 'Beiträge zur Berufsgenossenschaftr'); INSERT INTO gifi (accno,description) VALUES ('0414500', 'Freiwillige sozi.Aufw.lohnsteuerfr.'); INSERT INTO gifi (accno,description) VALUES ('0414900', 'Pauschale Lohnsteuera.sons.Bezüge'); INSERT INTO gifi (accno,description) VALUES ('0415000', 'Krankengeldzuschüsse'); INSERT INTO gifi (accno,description) VALUES ('0416000', 'Versorgungskasse'); INSERT INTO gifi (accno,description) VALUES ('0416500', 'Aufwendung f.Altersversorgung'); INSERT INTO gifi (accno,description) VALUES ('0417000', 'Vermögenswirksame Leistungen'); INSERT INTO gifi (accno,description) VALUES ('0417500', 'Fahrtkostenerst.Wohnung/Arbeitsstät'); INSERT INTO gifi (accno,description) VALUES ('0419000', 'Aushilfslöhne'); INSERT INTO gifi (accno,description) VALUES ('0419900', 'Lohnsteuer für Aushilfe'); INSERT INTO gifi (accno,description) VALUES ('0420000', 'Raumkosten'); INSERT INTO gifi (accno,description) VALUES ('0421000', 'Miete'); INSERT INTO gifi (accno,description) VALUES ('0422000', 'Pacht'); INSERT INTO gifi (accno,description) VALUES ('0423000', 'Heizung'); INSERT INTO gifi (accno,description) VALUES ('0424000', 'Gas,Strom, Wasser'); INSERT INTO gifi (accno,description) VALUES ('0425000', 'Reinigung'); INSERT INTO gifi (accno,description) VALUES ('0426000', 'Instandhaltung betrieb.Räume'); INSERT INTO gifi (accno,description) VALUES ('0427000', 'Abgaben f.betrieb.genutz.Grundstück'); INSERT INTO gifi (accno,description) VALUES ('0428000', 'Sonstige Raumkosten'); INSERT INTO gifi (accno,description) VALUES ('0430000', 'Nicht abziehbare Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('0430100', 'Nicht abziehbare Vorsteuer 7%'); INSERT INTO gifi (accno,description) VALUES ('0430500', 'Nicht abziehbare Vorsteuer 16%'); INSERT INTO gifi (accno,description) VALUES ('0432000', 'Gewerbesteuer'); INSERT INTO gifi (accno,description) VALUES ('0434000', 'Sonstige Betriebssteuern'); INSERT INTO gifi (accno,description) VALUES ('0435000', 'Verbrauchssteuer'); INSERT INTO gifi (accno,description) VALUES ('0435500', 'Ökosteuer'); INSERT INTO gifi (accno,description) VALUES ('0436000', 'Versicherungen'); INSERT INTO gifi (accno,description) VALUES ('0437000', 'Nettoprä.f.Rückd.künf.Versorgungsle'); INSERT INTO gifi (accno,description) VALUES ('0438000', 'Beiträge'); INSERT INTO gifi (accno,description) VALUES ('0439000', 'Sonstige Abgaben'); INSERT INTO gifi (accno,description) VALUES ('0439600', 'Steuerl.abzugs.Verspä.u.Zwangsgelde'); INSERT INTO gifi (accno,description) VALUES ('0450000', 'Fahrzugkosten'); INSERT INTO gifi (accno,description) VALUES ('0451000', 'Kfz-Steuer'); INSERT INTO gifi (accno,description) VALUES ('0452000', 'Kfz-Versicherungen'); INSERT INTO gifi (accno,description) VALUES ('0453000', 'Laufende Kfz-Betriebskosten'); INSERT INTO gifi (accno,description) VALUES ('0454000', 'Kfz-Reparaturen'); INSERT INTO gifi (accno,description) VALUES ('0455000', 'Garagenmiete'); INSERT INTO gifi (accno,description) VALUES ('0457000', 'Fremdfahrzeuge'); INSERT INTO gifi (accno,description) VALUES ('0458000', 'Sonstige Kfz-Kosten'); INSERT INTO gifi (accno,description) VALUES ('0460000', 'Werbe-und Reisekosten'); INSERT INTO gifi (accno,description) VALUES ('0461000', 'Werbekosten'); INSERT INTO gifi (accno,description) VALUES ('0463000', 'Geschenke bis 75 DM'); INSERT INTO gifi (accno,description) VALUES ('0463500', 'Geschenke bis 75 DM'); INSERT INTO gifi (accno,description) VALUES ('0463800', 'Geschenke ausschließl.betrieb.genut'); INSERT INTO gifi (accno,description) VALUES ('0464000', 'Repräsentationskosten'); INSERT INTO gifi (accno,description) VALUES ('0465000', 'Bewirtungskosten'); INSERT INTO gifi (accno,description) VALUES ('0465300', 'Aufmerksamkeiten'); INSERT INTO gifi (accno,description) VALUES ('0465400', 'Nicht abzugsfähige Bewirtungskosten'); INSERT INTO gifi (accno,description) VALUES ('0465500', 'Nicht abzugsfähige Betriebsausgaben'); INSERT INTO gifi (accno,description) VALUES ('0466000', 'Reisekosten Arbeitnehmer'); INSERT INTO gifi (accno,description) VALUES ('0466300', 'Reisekosten Arbeitn.m.Vorsteuerabzu'); INSERT INTO gifi (accno,description) VALUES ('0466400', 'Reisekosten Arbeitn.Verpflegungmehr'); INSERT INTO gifi (accno,description) VALUES ('0466600', 'Reisekosten Arbeitn.Übernachtungsau'); INSERT INTO gifi (accno,description) VALUES ('0466800', 'Kilometerentgelderstattung Arbeitne'); INSERT INTO gifi (accno,description) VALUES ('0467000', 'Reisekosten Unternehmer'); INSERT INTO gifi (accno,description) VALUES ('0467400', 'Reisekosten Untern.Verpflegungsmehr'); INSERT INTO gifi (accno,description) VALUES ('0467600', 'Reisekosten Untern.Übernachtungsauf'); INSERT INTO gifi (accno,description) VALUES ('0467800', 'Kilometererstattungsgeld Unternehme'); INSERT INTO gifi (accno,description) VALUES ('0470000', 'Kosten der Warenabgabe'); INSERT INTO gifi (accno,description) VALUES ('0471000', 'Verpackungsmaterial'); INSERT INTO gifi (accno,description) VALUES ('0473000', 'Ausgangsfracht'); INSERT INTO gifi (accno,description) VALUES ('0475000', 'Transportversicherung'); INSERT INTO gifi (accno,description) VALUES ('0476000', 'Verkaufsprovision'); INSERT INTO gifi (accno,description) VALUES ('0478000', 'Fremdarbeiten'); INSERT INTO gifi (accno,description) VALUES ('0479000', 'Aufwand für Gewährleistungen'); INSERT INTO gifi (accno,description) VALUES ('0480900', 'Sonstige Reparaturen u.Instandhalt.'); INSERT INTO gifi (accno,description) VALUES ('0481000', 'Mietleasing'); INSERT INTO gifi (accno,description) VALUES ('0481500', 'Kaufleasing'); INSERT INTO gifi (accno,description) VALUES ('0482000', 'AfA a.Aufw.f.d.Inga.u.Erw.Geschäfts'); INSERT INTO gifi (accno,description) VALUES ('0482100', 'AfA a.Aufw.f.d.Währungsumst.a.Euro'); INSERT INTO gifi (accno,description) VALUES ('0482200', 'Abschreibungen a.immat.Vermögensgeg'); INSERT INTO gifi (accno,description) VALUES ('0482400', 'Abschreibung a.d.Geschäft-o.Firmenw'); INSERT INTO gifi (accno,description) VALUES ('0482600', 'Außerplan.AfA a.immat.Vermögensgeg.'); INSERT INTO gifi (accno,description) VALUES ('0483000', 'Abschreibungen auf Sachanlagen'); INSERT INTO gifi (accno,description) VALUES ('0484000', 'Außerplanmäßig Abschr.a.Sachanlagen'); INSERT INTO gifi (accno,description) VALUES ('0485000', 'Abschr.a.Sachanl.steuerl.Sondervors'); INSERT INTO gifi (accno,description) VALUES ('0485500', 'Sofortabschreibung GWG'); INSERT INTO gifi (accno,description) VALUES ('0486000', 'Abschreibungen auf aktivierte GWG'); INSERT INTO gifi (accno,description) VALUES ('0487000', 'Abschreibungen auf Finanzanlagen'); INSERT INTO gifi (accno,description) VALUES ('0487500', 'Abschr.a.Wertp.d.Umlaufvermögens'); INSERT INTO gifi (accno,description) VALUES ('0490000', 'Sonstige betriebliche Aufwendungen'); INSERT INTO gifi (accno,description) VALUES ('0490500', 'Sons.Aufw.betriebl. und regelmäßig'); INSERT INTO gifi (accno,description) VALUES ('0490900', 'Fremdleistungen'); INSERT INTO gifi (accno,description) VALUES ('0491000', 'Porto'); INSERT INTO gifi (accno,description) VALUES ('0492000', 'Telefon'); INSERT INTO gifi (accno,description) VALUES ('0492500', 'Telefax'); INSERT INTO gifi (accno,description) VALUES ('0493000', 'Bürobedarf'); INSERT INTO gifi (accno,description) VALUES ('0494000', 'Zeitschriften, Bücher'); INSERT INTO gifi (accno,description) VALUES ('0494500', 'Fortbildungskosten'); INSERT INTO gifi (accno,description) VALUES ('0494600', 'Freiwillige Sozialleistungen'); INSERT INTO gifi (accno,description) VALUES ('0495000', 'Rechts- und Beratungskosten'); INSERT INTO gifi (accno,description) VALUES ('0495500', 'Buchführungskosten'); INSERT INTO gifi (accno,description) VALUES ('0495700', 'Abschluß- und Prüfungskosten'); INSERT INTO gifi (accno,description) VALUES ('0496000', 'Mieten für Einrichtungen'); INSERT INTO gifi (accno,description) VALUES ('0497000', 'Nebenkosten des Geldverkehrs'); INSERT INTO gifi (accno,description) VALUES ('0498000', 'Betriebsbedarf'); INSERT INTO gifi (accno,description) VALUES ('0498500', 'Werkzeuge und Kleingeräte'); INSERT INTO gifi (accno,description) VALUES ('0498600', 'Sonstige Aufwendungen (Ausbuchung)'); INSERT INTO gifi (accno,description) VALUES ('0499000', 'Kalkulatorischer Unternehmerlohn'); INSERT INTO gifi (accno,description) VALUES ('0499200', 'Kalkulatorische Zinsen'); INSERT INTO gifi (accno,description) VALUES ('0499300', 'Kalkulatorische Aschreibungen'); INSERT INTO gifi (accno,description) VALUES ('0499600', 'Herstellungskosten'); INSERT INTO gifi (accno,description) VALUES ('0499700', 'Verwaltungskosten'); INSERT INTO gifi (accno,description) VALUES ('0499800', 'Vertriebskosten'); INSERT INTO gifi (accno,description) VALUES ('0700000', 'Unfertige Erzeu.unfert.Leistungen'); INSERT INTO gifi (accno,description) VALUES ('0705000', 'Unfertige Erzeugnisse'); INSERT INTO gifi (accno,description) VALUES ('0708000', 'Unfertige Leistungen'); INSERT INTO gifi (accno,description) VALUES ('0709000', 'In Ausführung befindl. Bauaufträge'); INSERT INTO gifi (accno,description) VALUES ('0709500', 'In Arbeit befindliche Aufträge'); INSERT INTO gifi (accno,description) VALUES ('0710000', 'Fertige Erzeugnisse und Waren'); INSERT INTO gifi (accno,description) VALUES ('0711000', 'Fertige Erzeugnisse (Bestand)'); INSERT INTO gifi (accno,description) VALUES ('0714000', 'Waren (Bestand)'); INSERT INTO gifi (accno,description) VALUES ('0810000', 'Steuerfreie Umsätze §4Nr.8ff UstG'); INSERT INTO gifi (accno,description) VALUES ('0811000', 'Sonstige steuerfreie Umsätze Inland'); INSERT INTO gifi (accno,description) VALUES ('0812000', 'Steuerfreie Umsätze §4Nr.1a UstG'); INSERT INTO gifi (accno,description) VALUES ('0812500', 'Steuerfrei innergem. Lieferungen'); INSERT INTO gifi (accno,description) VALUES ('0813000', 'Liefe.d.1.Abnehm.innergem.Dreiecksg'); INSERT INTO gifi (accno,description) VALUES ('0815000', 'Sonstige steuerfreie Umsätze'); INSERT INTO gifi (accno,description) VALUES ('0819000', 'Sonstige Erlöse (Ausbuchung 0%)'); INSERT INTO gifi (accno,description) VALUES ('0819100', 'Sonstige Erlöse (Ausbuchung 16%)'); INSERT INTO gifi (accno,description) VALUES ('0819200', 'Sonstige Erlöse (Ausbuchung 7%)'); INSERT INTO gifi (accno,description) VALUES ('0820000', 'Erlöse'); INSERT INTO gifi (accno,description) VALUES ('0830000', 'Erlöse 7%USt'); INSERT INTO gifi (accno,description) VALUES ('0831000', 'Erlöse Inland stpfl. EG-Lieferung7%'); INSERT INTO gifi (accno,description) VALUES ('0831500', 'Erlös Inland stpfl.EG-Lieferung 16%'); INSERT INTO gifi (accno,description) VALUES ('0833900', 'Erl.EG-Land stpfl.so.Leist.(0-Regl)'); INSERT INTO gifi (accno,description) VALUES ('0840000', 'Erlöse 16% USt.'); INSERT INTO gifi (accno,description) VALUES ('0850000', 'Provisionserlöse'); INSERT INTO gifi (accno,description) VALUES ('0852000', 'Erlöse Abfallverwertung'); INSERT INTO gifi (accno,description) VALUES ('0854000', 'Erlös Leergut'); INSERT INTO gifi (accno,description) VALUES ('0859000', 'Verrechnete sons. Sachbezüge'); INSERT INTO gifi (accno,description) VALUES ('0859100', 'Sachbezüge 7% Ust (Waren)'); INSERT INTO gifi (accno,description) VALUES ('0859500', 'Sachbezüge 16% Ust (Waren)'); INSERT INTO gifi (accno,description) VALUES ('0860000', 'Sonstige Erlöse betriebl.u.regelmäß'); INSERT INTO gifi (accno,description) VALUES ('0861000', 'Verrechnete sonstige Sachbezüge'); INSERT INTO gifi (accno,description) VALUES ('0861100', 'Verr.sons.Sachbezüge 16%USt(Kfz-Ge)'); INSERT INTO gifi (accno,description) VALUES ('0861400', 'Verrechnete sons.Sachbezüge o. USt'); INSERT INTO gifi (accno,description) VALUES ('0862500', 'Sons. Erlöse betriebl.u.reg.steuerf'); INSERT INTO gifi (accno,description) VALUES ('0865000', 'Erlöse Zinsen und Diskotspesen'); INSERT INTO gifi (accno,description) VALUES ('0870000', 'Erlösschmälerungen'); INSERT INTO gifi (accno,description) VALUES ('0871000', 'Erlösschmälerung 7% USt.'); INSERT INTO gifi (accno,description) VALUES ('0872000', 'Erlösschmälerung 16% USt.'); INSERT INTO gifi (accno,description) VALUES ('0872400', 'Erlösschmäler.a.stfrei.IG Lieferung'); INSERT INTO gifi (accno,description) VALUES ('0872500', 'Erlösschmä.Inl.stpfl.EG-Lief. 7%USt'); INSERT INTO gifi (accno,description) VALUES ('0872600', 'Erlösschmä.Inl.stpfl.EG-Lief.16%USt'); INSERT INTO gifi (accno,description) VALUES ('0872700', 'Erlösschmä.and.EG Land stpfl.Liefer'); INSERT INTO gifi (accno,description) VALUES ('0873000', 'Gewährte Skonti'); INSERT INTO gifi (accno,description) VALUES ('0873100', 'Gewährte Skonti 7% USt'); INSERT INTO gifi (accno,description) VALUES ('0873500', 'Gewährte Skonti 16% USt.'); INSERT INTO gifi (accno,description) VALUES ('0874000', 'Gewährte Boni'); INSERT INTO gifi (accno,description) VALUES ('0875000', 'Gewährte Boni 7% USt.'); INSERT INTO gifi (accno,description) VALUES ('0876000', 'Gewährte Boni 16% USt.'); INSERT INTO gifi (accno,description) VALUES ('0877000', 'Gewährte Rabatte'); INSERT INTO gifi (accno,description) VALUES ('0878000', 'Gewährte Rabatte 7% USt.'); INSERT INTO gifi (accno,description) VALUES ('0879000', 'Gewährte Rabatte 16% Ust.'); INSERT INTO gifi (accno,description) VALUES ('0880000', 'Erlöse aus Anlagenverkäufen'); INSERT INTO gifi (accno,description) VALUES ('0880100', 'Erlöse aus Anlagenverkäufen 16%USt.'); INSERT INTO gifi (accno,description) VALUES ('0882000', 'Erlöse aus Anlageverkäufen 16%Ust'); INSERT INTO gifi (accno,description) VALUES ('0882900', 'Erl.a.Anlagenverk.bei Buchgewinn'); INSERT INTO gifi (accno,description) VALUES ('0890000', 'Unentgeldliche Wertabgaben'); INSERT INTO gifi (accno,description) VALUES ('0890500', 'Entnahme v. Gegenst.o.USt.'); INSERT INTO gifi (accno,description) VALUES ('0891000', 'Entnahme außerhalb d.Untern.16%USt.'); INSERT INTO gifi (accno,description) VALUES ('0891500', 'Entnah.d.U.Zweckaußerh.d.Untn 7%USt'); INSERT INTO gifi (accno,description) VALUES ('0891800', 'Entn.d.Untern.außerh.d.Untern.o.USt'); INSERT INTO gifi (accno,description) VALUES ('0892000', 'Verw.v.Gegens.außerh.Untern.16%USt.'); INSERT INTO gifi (accno,description) VALUES ('0892500', 'Unentgeldl.Erbring.sons.Leis.16%USt'); INSERT INTO gifi (accno,description) VALUES ('0893200', 'Unentgelt.Erbring.sons.Leist. 7%Ust'); INSERT INTO gifi (accno,description) VALUES ('0893500', 'Unentgeltl.Zuwend.v.Gegens. 16% Ust'); INSERT INTO gifi (accno,description) VALUES ('0893900', 'Unentgeldl.Zuw.v.Gegens.ohne Ust'); INSERT INTO gifi (accno,description) VALUES ('0894000', 'Unentgeltl.Zuw.v Waren 16% Ust'); INSERT INTO gifi (accno,description) VALUES ('0894500', 'Unentgeltl.Zuw.von Waren 7% Ust'); INSERT INTO gifi (accno,description) VALUES ('0895000', 'Nicht steuerbare Umsätze'); INSERT INTO gifi (accno,description) VALUES ('0895500', 'Umsatzsteuervergütungen'); INSERT INTO gifi (accno,description) VALUES ('0896000', 'Bestandsveränderung-unfertige Erzeu'); INSERT INTO gifi (accno,description) VALUES ('0897000', 'Bestandsveränderung-unfertige Leist'); INSERT INTO gifi (accno,description) VALUES ('0897500', 'Bestandsverä.i.Ausfü.befi.Bauaufträ'); INSERT INTO gifi (accno,description) VALUES ('0897700', 'Bestandsverä.i.Arbeit befindl.Auftr'); INSERT INTO gifi (accno,description) VALUES ('0898000', 'Bestandsverä.fertige Erzeugnisse'); INSERT INTO gifi (accno,description) VALUES ('0899000', 'Andere aktivierte Eigenleistungen'); INSERT INTO gifi (accno,description) VALUES ('0900000', 'Saldenverträge,Sachkonten'); INSERT INTO gifi (accno,description) VALUES ('0900800', 'Saldenverträge,Debitoren'); INSERT INTO gifi (accno,description) VALUES ('0900900', 'Saldenverträge,Kreditoren'); INSERT INTO gifi (accno,description) VALUES ('0906000', 'Offene Posten aus 1990'); INSERT INTO gifi (accno,description) VALUES ('0906900', 'Offene Posten aus 1999'); INSERT INTO gifi (accno,description) VALUES ('0907000', 'Offene Posten aus 2000'); INSERT INTO gifi (accno,description) VALUES ('0909000', 'Summenvortragskonto'); INSERT INTO gifi (accno,description) VALUES ('0922000', 'Gezeichnetes kapital in DM'); INSERT INTO gifi (accno,description) VALUES ('0922100', 'Gezeichnetes Kapital in Euro'); INSERT INTO gifi (accno,description) VALUES ('0923000', 'Baukostenzuschüsse'); INSERT INTO gifi (accno,description) VALUES ('0923200', 'Investitionszulagen'); INSERT INTO gifi (accno,description) VALUES ('0923400', 'Investitionszuschüsse'); INSERT INTO gifi (accno,description) VALUES ('0924500', 'Forde.a.Anlageverk.sons.Vermögensge'); INSERT INTO gifi (accno,description) VALUES ('0925000', 'Eigenkapitalersetzende Ges''terdarl.'); INSERT INTO gifi (accno,description) VALUES ('0926000', 'Kurzfristige Rückstellung'); INSERT INTO gifi (accno,description) VALUES ('0926200', 'Mittelfristige Rückstellung'); INSERT INTO gifi (accno,description) VALUES ('0926400', 'Langfristige Rückstellungen'); INSERT INTO gifi (accno,description) VALUES ('0928000', 'Bemessungsgrundlage IG Erwerb 16%'); INSERT INTO gifi (accno,description) VALUES ('0928100', 'Gegenkonto Bmsgrl. IG Erwerb 16%'); INSERT INTO gifi (accno,description) VALUES ('0928200', 'Bemessungsgrundlage IG Erwerb 7%'); INSERT INTO gifi (accno,description) VALUES ('0928400', 'Gegenkonto Bmsgrl. IG Erwerb 7%'); INSERT INTO gifi (accno,description) VALUES ('0988100', 'Verrechnungskonto Abgang'); INSERT INTO gifi (accno,description) VALUES ('0988200', 'Verrechnungskonto erh. Anzahlungen'); INSERT INTO gifi (accno,description) VALUES ('0988210', 'Verrechnungskto Anzahlungen netto'); INSERT INTO gifi (accno,description) VALUES ('0988220', 'Verrechnungskto.Anzahlungen brutto'); INSERT INTO gifi (accno,description) VALUES ('0988300', 'Verrechnungskonto gel.Anzahlungen'); INSERT INTO gifi (accno,description) VALUES ('0988400', 'Statistisches Konto Konzern AfA'); INSERT INTO gifi (accno,description) VALUES ('0988500', 'Statistisches Konto kalkulator.AfA'); INSERT INTO gifi (accno,description) VALUES ('0988600', 'Statistisches Konto außerplanm AfA'); INSERT INTO gifi (accno,description) VALUES ('0988700', 'Statistisches Konto AfA (Konzern)'); INSERT INTO gifi (accno,description) VALUES ('0988800', 'Statistisches Konto Sonderafa'); INSERT INTO gifi (accno,description) VALUES ('0988900', 'Statistisches Konto AfA (SBil)'); INSERT INTO gifi (accno,description) VALUES ('0989800', 'Statistisches Konto AfA (Kalkul.)'); INSERT INTO gifi (accno,description) VALUES ('0989900', 'Statistisches Konto AfA'); INSERT INTO gifi (accno,description) VALUES ('0999999', 'Fehlerauffangkonto'); commit; ledgersmb/sql/coa/de/gifi/General.sql0000755000000000000000000000241510573165441016500 0ustar rootrootbegin; -- Einfacher Kontoplan für Deutschland -- INSERT INTO gifi (accno,description) VALUES ('A0', 'Anlagevermögen'); INSERT INTO gifi (accno,description) VALUES ('A1-1', 'Warenbestand'); INSERT INTO gifi (accno,description) VALUES ('A1-2', 'Forderungen'); INSERT INTO gifi (accno,description) VALUES ('A1-3', 'Liquide Mittel'); INSERT INTO gifi (accno,description) VALUES ('A1-4', 'Aktive Rechnungsabgrenzung'); INSERT INTO gifi (accno,description) VALUES ('E', 'Erträge'); INSERT INTO gifi (accno,description) VALUES ('K0', 'Wareneinsatz'); INSERT INTO gifi (accno,description) VALUES ('K1', 'Personalkosten'); INSERT INTO gifi (accno,description) VALUES ('K2', 'Raumkosten'); INSERT INTO gifi (accno,description) VALUES ('K3', 'Sonstige Kosten'); INSERT INTO gifi (accno,description) VALUES ('NA', 'Neutrale Aufwendungen'); INSERT INTO gifi (accno,description) VALUES ('NE', 'Neutrale Erlöse'); INSERT INTO gifi (accno,description) VALUES ('P0', 'Eigenkapital'); INSERT INTO gifi (accno,description) VALUES ('P1', 'Rückstellungen'); INSERT INTO gifi (accno,description) VALUES ('P2', 'Fremdkapital Langfristig'); INSERT INTO gifi (accno,description) VALUES ('P3', 'Fremdkapital Kurzfristig'); INSERT INTO gifi (accno,description) VALUES ('P4', 'Passive Rechnungsabgrenzung'); commit; ledgersmb/sql/coa/de/gifi/SKR03.sql0000755000000000000000000031645310573165441015737 0ustar rootrootbegin; -- Kontenrahmen für Deutschland -- INSERT INTO gifi (accno,description) VALUES ('0001', 'Aufw. f. die Ingangsetzung u. Erweit. des Geschäftsbetr.'); INSERT INTO gifi (accno,description) VALUES ('0002', 'Aufw. f. die Währungsumstellung auf den EURO'); INSERT INTO gifi (accno,description) VALUES ('0010', 'Konzess., gew. Schutzr. u. ähnl. Rechte/Werte sowie Liz.'); INSERT INTO gifi (accno,description) VALUES ('0015', 'Konzessionen'); INSERT INTO gifi (accno,description) VALUES ('0020', 'Gewerbliche Schutzrechte'); INSERT INTO gifi (accno,description) VALUES ('0025', 'Ähnliche Rechte und Werte'); INSERT INTO gifi (accno,description) VALUES ('0027', 'EDV-Software'); INSERT INTO gifi (accno,description) VALUES ('0030', 'Lizenzen an gewerbl. Schutzr. u. ähnl. Rechten u. Werten'); INSERT INTO gifi (accno,description) VALUES ('0035', 'Geschäfts- oder Firmenwert'); INSERT INTO gifi (accno,description) VALUES ('0038', 'Anzahlungen auf Geschäfts- oder Firmenwert'); INSERT INTO gifi (accno,description) VALUES ('0039', 'Anzahlungen auf immaterielle Vermögensgegenstände'); INSERT INTO gifi (accno,description) VALUES ('0040', 'Verschmelzungsmehrwert'); INSERT INTO gifi (accno,description) VALUES ('0050', 'Grundst., gl. Rechte/Bauten einschl. Bauten a. fr. Grundst.'); INSERT INTO gifi (accno,description) VALUES ('0060', 'Grundstücke und grundstücksgleiche Rechte ohne Bauten'); INSERT INTO gifi (accno,description) VALUES ('0065', 'Unbebaute Grundstücke'); INSERT INTO gifi (accno,description) VALUES ('0070', 'Grundstücksgleiche Rechte (Erbbaurecht, Dauerwohnrecht)'); INSERT INTO gifi (accno,description) VALUES ('0075', 'Grundstücke mit Substanzverzehr'); INSERT INTO gifi (accno,description) VALUES ('0079', 'Anzahl. a. Grundst. u. grundstücksgl. Rechte ohne Bauten'); INSERT INTO gifi (accno,description) VALUES ('0080', 'Bauten auf eigenen Grundst. und grundstücksgl. Rechten'); INSERT INTO gifi (accno,description) VALUES ('0085', 'Grundstückswerte eigener bebauter Grundsstücke'); INSERT INTO gifi (accno,description) VALUES ('0090', 'Geschäftsbauten'); INSERT INTO gifi (accno,description) VALUES ('0100', 'Fabrikbauten'); INSERT INTO gifi (accno,description) VALUES ('0110', 'Garagen'); INSERT INTO gifi (accno,description) VALUES ('0111', 'Außenanlagen'); INSERT INTO gifi (accno,description) VALUES ('0112', 'Hof- u. Wegebefestigungen'); INSERT INTO gifi (accno,description) VALUES ('0113', 'Einrichtungen für Geschäfts- u. Fabrikbauten'); INSERT INTO gifi (accno,description) VALUES ('0115', 'Andere Bauten'); INSERT INTO gifi (accno,description) VALUES ('0120', 'Geschäfts-, Fabrik- u. andere Bauten im Bau'); INSERT INTO gifi (accno,description) VALUES ('0129', 'Anz. a. Geschäfts-, Fabrik-, u.a. Bauten a. eig. Grundst+Rechte'); INSERT INTO gifi (accno,description) VALUES ('0140', 'Wohnbauten'); INSERT INTO gifi (accno,description) VALUES ('0145', 'Garagen'); INSERT INTO gifi (accno,description) VALUES ('0146', 'Außenanlagen'); INSERT INTO gifi (accno,description) VALUES ('0147', 'Hof- und Wegebefestigungen'); INSERT INTO gifi (accno,description) VALUES ('0148', 'Einrichtungen für Wohnbauten'); INSERT INTO gifi (accno,description) VALUES ('0150', 'Wohnbauten im Bau'); INSERT INTO gifi (accno,description) VALUES ('0159', 'Anz. auf Wohnbauten auf eig. Grundstücken u. grundst.gl. Rechten'); INSERT INTO gifi (accno,description) VALUES ('0160', 'Bauten auf fremden Grundstücken'); INSERT INTO gifi (accno,description) VALUES ('0165', 'Geschäftsbauten'); INSERT INTO gifi (accno,description) VALUES ('0170', 'Fabrikbauten'); INSERT INTO gifi (accno,description) VALUES ('0175', 'Garagen'); INSERT INTO gifi (accno,description) VALUES ('0176', 'Außenanlagen'); INSERT INTO gifi (accno,description) VALUES ('0177', 'Hof- und Wegebefestigen'); INSERT INTO gifi (accno,description) VALUES ('0178', 'Einrichtungen für Geschäfts- und Fabrikbauten'); INSERT INTO gifi (accno,description) VALUES ('0179', 'Andere Bauten'); INSERT INTO gifi (accno,description) VALUES ('0180', 'Geschäfts-, Fabrik- und andere Bauten im Bau'); INSERT INTO gifi (accno,description) VALUES ('0189', 'Anzahl. a. Geschäfts-, Fabrik-, u.a. Bauten a. fr. Grundst.'); INSERT INTO gifi (accno,description) VALUES ('0190', 'Wohnbauten'); INSERT INTO gifi (accno,description) VALUES ('0191', 'Garagen'); INSERT INTO gifi (accno,description) VALUES ('0192', 'Außenanlagen'); INSERT INTO gifi (accno,description) VALUES ('0193', 'Hof- und Wegebefestigungen'); INSERT INTO gifi (accno,description) VALUES ('0194', 'Einrichtungen für Wohnbauten'); INSERT INTO gifi (accno,description) VALUES ('0195', 'Wohnbauten im Bau'); INSERT INTO gifi (accno,description) VALUES ('0199', 'Anzahlungen auf Wohnbauten auf fremden Grundstücken'); INSERT INTO gifi (accno,description) VALUES ('0200', 'Technische Anlagen und Maschinen'); INSERT INTO gifi (accno,description) VALUES ('0210', 'Maschinen'); INSERT INTO gifi (accno,description) VALUES ('0220', 'Maschinengebundene Werkzeuge'); INSERT INTO gifi (accno,description) VALUES ('0240', 'Maschinelle Anlagen'); INSERT INTO gifi (accno,description) VALUES ('0260', 'Transportanlagen und ähnliches'); INSERT INTO gifi (accno,description) VALUES ('0280', 'Betriebsvorrichtungen'); INSERT INTO gifi (accno,description) VALUES ('0290', 'Technische Anlagen und Maschinen im Bau'); INSERT INTO gifi (accno,description) VALUES ('0299', 'Anzahlungen auf technische Anlagen und Maschinen'); INSERT INTO gifi (accno,description) VALUES ('0300', 'Andere Anlagen, Betriebs- und Geschäftsausstattung'); INSERT INTO gifi (accno,description) VALUES ('0310', 'Andere Anlagen'); INSERT INTO gifi (accno,description) VALUES ('0320', 'Pkw'); INSERT INTO gifi (accno,description) VALUES ('0350', 'Lkw'); INSERT INTO gifi (accno,description) VALUES ('0380', 'Sonstige Transportmittel'); INSERT INTO gifi (accno,description) VALUES ('0400', 'Betriebsausstattung'); INSERT INTO gifi (accno,description) VALUES ('0410', 'Geschäftsausstattung'); INSERT INTO gifi (accno,description) VALUES ('0420', 'Büroeinrichtung'); INSERT INTO gifi (accno,description) VALUES ('0430', 'Ladeneinrichtung'); INSERT INTO gifi (accno,description) VALUES ('0440', 'Werkzeuge'); INSERT INTO gifi (accno,description) VALUES ('0450', 'Einbauten'); INSERT INTO gifi (accno,description) VALUES ('0460', 'Gerüst- und Schalungsmaterial'); INSERT INTO gifi (accno,description) VALUES ('0480', 'Geringwertige Wirtschaftsgüter bis DM 800,-'); INSERT INTO gifi (accno,description) VALUES ('0490', 'Sonstige Betriebs- und Geschäftsausstattung'); INSERT INTO gifi (accno,description) VALUES ('0498', 'Andere Anlagen, Betriebs- und Geschäftsausstatt. im Bau'); INSERT INTO gifi (accno,description) VALUES ('0499', 'Anzahl. a. andere Anlagen, Betriebs- u. Geschäftsausstatt.'); INSERT INTO gifi (accno,description) VALUES ('0500', 'Anteile an verbundenen Unternehmen (Anlagevermögen)'); INSERT INTO gifi (accno,description) VALUES ('0504', 'Anteile an herrschender oder mit Mehrheit beteiligter Gesellschaft'); INSERT INTO gifi (accno,description) VALUES ('0505', 'Ausleihungen an verbundene Unternehmen'); INSERT INTO gifi (accno,description) VALUES ('0510', 'Beteiligungen'); INSERT INTO gifi (accno,description) VALUES ('0513', 'Typisch stille Beteiligungen'); INSERT INTO gifi (accno,description) VALUES ('0516', 'Atypisch stille Beteiligungen'); INSERT INTO gifi (accno,description) VALUES ('0517', 'Andere Beteiligungen an Kapitalgesellschaften'); INSERT INTO gifi (accno,description) VALUES ('0518', 'Andere Beteiligungen an Personengesellschaften'); INSERT INTO gifi (accno,description) VALUES ('0519', 'Beteiligung einer GmbH&CoKG an einer Komplementär GmbH'); INSERT INTO gifi (accno,description) VALUES ('0520', 'Ausleihung an Untern. m.d.e. Beteiligungsverhältnis besteht'); INSERT INTO gifi (accno,description) VALUES ('0525', 'Wertpapiere des Anlagevermögens'); INSERT INTO gifi (accno,description) VALUES ('0530', 'Wertpapiere mit Gewinnbeteiligungsansprüchen'); INSERT INTO gifi (accno,description) VALUES ('0535', 'Festverzinsliche Wertpapiere'); INSERT INTO gifi (accno,description) VALUES ('0540', 'Sonstige Ausleihungen'); INSERT INTO gifi (accno,description) VALUES ('0550', 'Darlehen / Sonstige Ausleihungen'); INSERT INTO gifi (accno,description) VALUES ('0570', 'Genossenschaftsanteile zum langfristigen Verbleib'); INSERT INTO gifi (accno,description) VALUES ('0580', 'Ausleihungen an Gesellschafter'); INSERT INTO gifi (accno,description) VALUES ('0590', 'Ausleihungen an nahestehende Personen'); INSERT INTO gifi (accno,description) VALUES ('0595', 'Rückdeckungsanspr. a. Lebensvers. z. langfrist. Verbleib'); INSERT INTO gifi (accno,description) VALUES ('0600', 'Anleihen nicht konvertibel'); INSERT INTO gifi (accno,description) VALUES ('0601', 'Anleihen nicht konvertibel - Restlaufzeit bis 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('0605', 'Anleihen nicht konvertibel - Restlaufzeit 1 bis 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('0610', 'Anleihen nicht konvertibel - Restlaufzeit größer 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('0615', 'Anleihen konvertibel'); INSERT INTO gifi (accno,description) VALUES ('0616', 'Anleihen konvertibel - Restlaufzeit bis 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('0620', 'Anleihen konvertibel - Restlaufzeit 1 bis 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('0625', 'Anleihen konvertibel - Restlaufzeit größer 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('0630', 'Verbindlichkeiten gegenüber Kreditinstituten'); INSERT INTO gifi (accno,description) VALUES ('0631', 'Verb. gg. Kreditinstituten - Restlaufz. bis 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('0640', 'Verb. gg. Kreditinstituten - Restlaufz. 1 bis 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('0650', 'Verb. gg. Kreditinstituten - Restlaufz. größer 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('0660', 'Verbindlichkeiten gg. Kreditinst. aus TZ-Verträgen'); INSERT INTO gifi (accno,description) VALUES ('0661', 'Verb. gg. Kreditinst. aus TZ-Verträgen - Restl. bis 1 J.'); INSERT INTO gifi (accno,description) VALUES ('0670', 'Verb. gg. Kreditinst. aus TZ-Verträgen - Restl. 1 bis 5 J.'); INSERT INTO gifi (accno,description) VALUES ('0680', 'Verb. gg. Kreditinst. aus TZ-Verträgen - Restl. größer 5 J.'); INSERT INTO gifi (accno,description) VALUES ('0700', 'Verbindlichkeiten gg. verbundenen Unternehmen'); INSERT INTO gifi (accno,description) VALUES ('0701', 'Verb. gg. verbundenen Unternehmen - Restlaufz. b. 1 J.'); INSERT INTO gifi (accno,description) VALUES ('0705', 'Verb. gg. verbundenen Unternehmen - Restlaufz. 1 b. 5 J.'); INSERT INTO gifi (accno,description) VALUES ('0710', 'Verb. gg. verb. Untern. - Restlaufz. gr. 5 J.'); INSERT INTO gifi (accno,description) VALUES ('0715', 'Verb. gg. Untern. mit denen ein Beteiligungsverh. besteht'); INSERT INTO gifi (accno,description) VALUES ('0716', 'Verb. gg. U. m.d.e. Beteiligungsv. best. - Restl. b. 1 J'); INSERT INTO gifi (accno,description) VALUES ('0720', 'Verb. gg. U. m.d.e. Beteiligungsv. best. - Restl. 1 b. 5 J'); INSERT INTO gifi (accno,description) VALUES ('0725', 'Verb. gg. U. m.d.e. Beteiligungsv. best. - Restl. gr. 5 J'); INSERT INTO gifi (accno,description) VALUES ('0730', 'Verbindlichkeiten gegenüber Gesellschaftern'); INSERT INTO gifi (accno,description) VALUES ('0731', 'Verb. gg. Gesellschaftern - Restlaufz. bis 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('0740', 'Verb. gg. Gesellschaftern - Restlaufz. 1 bis 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('0750', 'Verb. gg. Gesellschaftern - Restlaufz. größer 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('0755', 'Verb. gg. Gesellschaftern für offene Ausschüttungen'); INSERT INTO gifi (accno,description) VALUES ('0760', 'Darlehen typisch stiller Gesellschafter'); INSERT INTO gifi (accno,description) VALUES ('0761', 'Darlehen typ. stiller Gesellschafter - Restlaufz. bis 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('0764', 'Darlehen typ. stiller Gesellschafter - Restlaufz. 1 bis 5 J.'); INSERT INTO gifi (accno,description) VALUES ('0767', 'Darlehen typ. stiller Gesellschafter - Restlaufz. größer 5 J.'); INSERT INTO gifi (accno,description) VALUES ('0770', 'Darlehen atypisch stiller Gesellschafter'); INSERT INTO gifi (accno,description) VALUES ('0771', 'Darlehen atyp. stiller Gesellsch.- Restlaufz. bis 1 J.'); INSERT INTO gifi (accno,description) VALUES ('0774', 'Darlehen atyp. stiller Gesellsch.- Restlaufz. 1 bis 5 J.'); INSERT INTO gifi (accno,description) VALUES ('0777', 'Darlehen atyp. stiller Gesellsch.- Restlaufz. größer 5 J.'); INSERT INTO gifi (accno,description) VALUES ('0780', 'Partiarische Darlehen'); INSERT INTO gifi (accno,description) VALUES ('0781', 'Partiarische Darlehen - Restlaufzeit bis 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('0784', 'Partiarische Darlehen - Restlaufzeit 1 bis 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('0787', 'Partiarische Darlehen - Restlaufzeit größer 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('0800', 'Gezeichnetes Kapital'); INSERT INTO gifi (accno,description) VALUES ('0801', 'Ausst. Einl. a.d. gez. Kapital, nicht eingef. (Aktivausw.)'); INSERT INTO gifi (accno,description) VALUES ('0810', 'Ausst. Einl. a.d. gez. Kapital, eingeford. (Aktivausw.)'); INSERT INTO gifi (accno,description) VALUES ('0820', 'Ausst. Einl. a.d. gez. Kapital, nicht eingef. (Passivausw.)'); INSERT INTO gifi (accno,description) VALUES ('0830', 'Ausst. Einl. a.d. gez. Kapital, eingef. (Passivausw.)'); INSERT INTO gifi (accno,description) VALUES ('0839', 'Eingeforderte Nachschüsse'); INSERT INTO gifi (accno,description) VALUES ('0840', 'Kapitalrücklage'); INSERT INTO gifi (accno,description) VALUES ('0841', 'Kapitalrückl. durch Ausgabe von Anteilen über Nennbetrag'); INSERT INTO gifi (accno,description) VALUES ('0842', 'Kap.Rückl. Schuldver. f. Wandl.- u. Optionsr. z. Erw. v. Ant'); INSERT INTO gifi (accno,description) VALUES ('0843', 'Kapitalrückl. d. Zuzahl. gg. Gewähr e. Vorzuges f. Anteile'); INSERT INTO gifi (accno,description) VALUES ('0844', 'Kapitalrückl. d. andere Zuzahlungen in das Eigenkapital'); INSERT INTO gifi (accno,description) VALUES ('0845', 'Eingefordertes Nachschußkapital'); INSERT INTO gifi (accno,description) VALUES ('0846', 'Gesetzliche Rücklage'); INSERT INTO gifi (accno,description) VALUES ('0847', 'Gesetzliche Rücklage 50/45% Vorbelastung'); INSERT INTO gifi (accno,description) VALUES ('0848', 'Gesetzliche Rücklage 30% Vorbelastung'); INSERT INTO gifi (accno,description) VALUES ('0849', 'Gesetzliche Rücklage 0% Vorbelastung'); INSERT INTO gifi (accno,description) VALUES ('0850', 'Rücklage für eigene Anteile'); INSERT INTO gifi (accno,description) VALUES ('0851', 'Satzungsmäßige Rücklagen'); INSERT INTO gifi (accno,description) VALUES ('0852', 'Satzungsmäßige Rücklage 50/45% Vorbelastung'); INSERT INTO gifi (accno,description) VALUES ('0853', 'Satzungsmäßige Rücklage 30% Vorbelastung'); INSERT INTO gifi (accno,description) VALUES ('0854', 'Satzungsmäßige Rücklage 0% Vorbelastung'); INSERT INTO gifi (accno,description) VALUES ('0855', 'Andere Gewinnrücklagen 50/45% Vorbelastung'); INSERT INTO gifi (accno,description) VALUES ('0856', 'Eigenkapitalanteil von Wertaufholungen'); INSERT INTO gifi (accno,description) VALUES ('0857', 'Eigenkapitalanteil von Preissteigerungsrücklagen'); INSERT INTO gifi (accno,description) VALUES ('0858', 'Andere Gewinnrücklagen 30% Vorbelastung'); INSERT INTO gifi (accno,description) VALUES ('0859', 'Andere Gewinnrücklagen 0% Vorbelastung'); INSERT INTO gifi (accno,description) VALUES ('0860', 'Gewinnvortrag vor Verwendung'); INSERT INTO gifi (accno,description) VALUES ('0862', 'Gewinnvortrag 50/45% Vorbelastung'); INSERT INTO gifi (accno,description) VALUES ('0864', 'Gewinnvortrag 30% Vorbelastung'); INSERT INTO gifi (accno,description) VALUES ('0866', 'Gewinnvortrag 0% Vorbelastung'); INSERT INTO gifi (accno,description) VALUES ('0868', 'Verlustvortrag vor Verwendung'); INSERT INTO gifi (accno,description) VALUES ('0869', 'Vorträge auf neue Rechnung (Bilanz)'); INSERT INTO gifi (accno,description) VALUES ('0870', 'Festkapital (Personenges. Vollhafter / Einzelu.)'); INSERT INTO gifi (accno,description) VALUES ('0880', 'Variables Kapital (Personenges. Vollhaft. / Einzelu.)'); INSERT INTO gifi (accno,description) VALUES ('0890', 'Gesellsch.-Darlehen (Personenges. Vollhaft. / Einzelu.)'); INSERT INTO gifi (accno,description) VALUES ('0900', 'Kommandit-Kapital (Personenges. Teilhafter)'); INSERT INTO gifi (accno,description) VALUES ('0910', 'Verlustausgleichskonto (Personenges. Teilhafter)'); INSERT INTO gifi (accno,description) VALUES ('0920', 'Gesellschafter-Darlehen (Personenges. Teilhafter)'); INSERT INTO gifi (accno,description) VALUES ('0930', 'Sonderposten mit Rücklageanteil'); INSERT INTO gifi (accno,description) VALUES ('0931', 'Sonderposten mit Rücklageanteil §6b EStG'); INSERT INTO gifi (accno,description) VALUES ('0932', 'Sonderposten mit Rücklageanteil Abschnitt 35 EStR'); INSERT INTO gifi (accno,description) VALUES ('0933', 'Sonderposten mit Rücklageanteil §6dEStG'); INSERT INTO gifi (accno,description) VALUES ('0934', 'Sonderposten mit Rücklageanteil §1 EntwLStG'); INSERT INTO gifi (accno,description) VALUES ('0935', 'Sonderposten mit Rücklageanteil §3 Ausl-InvG'); INSERT INTO gifi (accno,description) VALUES ('0936', 'Sonderposten mit Rücklageanteil §7d EStG'); INSERT INTO gifi (accno,description) VALUES ('0937', 'Sonderposten mit Rücklageanteil §79 EStDV'); INSERT INTO gifi (accno,description) VALUES ('0938', 'Sonderposten mit Rücklageanteil §80 EStDV'); INSERT INTO gifi (accno,description) VALUES ('0939', 'Sonderposten mit Rücklageanteil §81 EStDV'); INSERT INTO gifi (accno,description) VALUES ('0940', 'Sonderposten mit Rücklageanteil §82 EStDV'); INSERT INTO gifi (accno,description) VALUES ('0941', 'Sonderposten mit Rücklageanteil §82a EStDV'); INSERT INTO gifi (accno,description) VALUES ('0942', 'Sonderposten mit Rücklageanteil §82d EStDV'); INSERT INTO gifi (accno,description) VALUES ('0943', 'Sonderposten mit Rücklageanteil §82e EStDV'); INSERT INTO gifi (accno,description) VALUES ('0944', 'Sonderposten mit Rücklageanteil §14 BerlinFG'); INSERT INTO gifi (accno,description) VALUES ('0945', 'Sonderposten mit Rücklageanteil §3 ZonenRFG / §4-6 FördergebietsG'); INSERT INTO gifi (accno,description) VALUES ('0946', 'Sonderposten mit Rücklageanteil §52 Abs. 5 EStG'); INSERT INTO gifi (accno,description) VALUES ('0947', 'Sonderposten mit Rücklageanteil §7g Abs. 1 EStG'); INSERT INTO gifi (accno,description) VALUES ('0948', 'Sonderposten mit Rücklageanteil §7g Abs. 3 EStG'); INSERT INTO gifi (accno,description) VALUES ('0949', 'Sonderposten mit Rücklageanteil §74 EStDV'); INSERT INTO gifi (accno,description) VALUES ('0950', 'Rückstellungen für Pensionen und ähnliche Verpflichtungen'); INSERT INTO gifi (accno,description) VALUES ('0955', 'Steuerrückstellungen'); INSERT INTO gifi (accno,description) VALUES ('0957', 'Gewerbesteuerrückstellung'); INSERT INTO gifi (accno,description) VALUES ('0963', 'Körperschaftsteuerrückstellung'); INSERT INTO gifi (accno,description) VALUES ('0969', 'Rückstellungen für latente Steuern'); INSERT INTO gifi (accno,description) VALUES ('0970', 'Sonstige Rückstellungen'); INSERT INTO gifi (accno,description) VALUES ('0971', 'Rückst. unterl. Aufw. Instandhalt., Nachhol. in 3 Mon'); INSERT INTO gifi (accno,description) VALUES ('0972', 'Rückst. unterl. Aufw. Instandhalt., Nachhol. in 4-12 Mon'); INSERT INTO gifi (accno,description) VALUES ('0973', 'Rückstellungen für Abraum- und Abfallbeseitigung'); INSERT INTO gifi (accno,description) VALUES ('0974', 'Rückstellungen für Gewährleistungen'); INSERT INTO gifi (accno,description) VALUES ('0976', 'Rückst. f. drohende Verluste a. schwebenden Geschäften'); INSERT INTO gifi (accno,description) VALUES ('0977', 'Rückstellungen für Abschluß- und Prüfungskosten'); INSERT INTO gifi (accno,description) VALUES ('0978', 'Aufwandsrückstellungen gemäß § 249 Abs. 2 HGB'); INSERT INTO gifi (accno,description) VALUES ('0979', 'Rückstellungen für den Umweltschutz'); INSERT INTO gifi (accno,description) VALUES ('0980', 'Aktive Rechnungsabgrenzung'); INSERT INTO gifi (accno,description) VALUES ('0983', 'Abgrenzung aktive latente Steuern'); INSERT INTO gifi (accno,description) VALUES ('0984', 'Als Aufwand berücks. Zölle u. Verbrauchsst. a. Vorräte'); INSERT INTO gifi (accno,description) VALUES ('0985', 'Als Aufwand berücks. Umsatzsteuer auf Anzahlungen'); INSERT INTO gifi (accno,description) VALUES ('0986', 'Damnum / Disagio'); INSERT INTO gifi (accno,description) VALUES ('0990', 'Passive Rechnungsabgrenzung'); INSERT INTO gifi (accno,description) VALUES ('0992', 'Wertber.n (zur unterjährigen Kostenverrechnung f. BWA)'); INSERT INTO gifi (accno,description) VALUES ('0996', 'Pauschalwertberichtigung a. Ford. - Restlaufz. bis 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('0997', 'Pauschalwertberichtigung a. Ford. - Restlaufz. größer 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('0998', 'Einzelwertberichtigung a. Ford. - Restlaufz. bis 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('0999', 'Einzelwertberichtigung a. Ford. - Restlaufz. größer 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('1000', 'Kasse'); INSERT INTO gifi (accno,description) VALUES ('1010', 'Nebenkasse 1'); INSERT INTO gifi (accno,description) VALUES ('1020', 'Nebenkasse 2'); INSERT INTO gifi (accno,description) VALUES ('1100', 'Postgiro'); INSERT INTO gifi (accno,description) VALUES ('1110', 'Postgiro 1'); INSERT INTO gifi (accno,description) VALUES ('1120', 'Postgiro 2'); INSERT INTO gifi (accno,description) VALUES ('1130', 'Postgiro 3'); INSERT INTO gifi (accno,description) VALUES ('1190', 'LZB-Guthaben'); INSERT INTO gifi (accno,description) VALUES ('1195', 'Bundesbankguthaben'); INSERT INTO gifi (accno,description) VALUES ('1200', 'Bank-Giro'); INSERT INTO gifi (accno,description) VALUES ('1210', 'Bank-Giro 1'); INSERT INTO gifi (accno,description) VALUES ('1220', 'Bank-Giro 2'); INSERT INTO gifi (accno,description) VALUES ('1230', 'Bank-Giro 3'); INSERT INTO gifi (accno,description) VALUES ('1300', 'Wechsel aus Lieferungen und Leistungen'); INSERT INTO gifi (accno,description) VALUES ('1301', 'Wechsel aus Lieferungen u. Leistungen - Restlaufz. bis 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1302', 'Wechsel aus Lieferungen u. Leistungen - Restl. größer 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1305', 'Wechsel aus Lieferungen u. Leistungen, bundesbankfähig'); INSERT INTO gifi (accno,description) VALUES ('1310', 'Besitzwechsel gg. verbundenen Unternehmen'); INSERT INTO gifi (accno,description) VALUES ('1311', 'Besitzwechsel gg. verbundenen Untern. - Restl. b. 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1312', 'Besitzwechsel gg. verbundenen Untern. - Restl. gr. 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1315', 'Besitzwechsel gg. verb. Unternehmen, bundesbankfähig'); INSERT INTO gifi (accno,description) VALUES ('1320', 'Besitzwechsel gg. Untern. m.d.e. Beteiligungsverh. best.'); INSERT INTO gifi (accno,description) VALUES ('1321', 'Besitzwechsel gg. U. m.d.e. Beteilig. best. - Restl. b. 1 J'); INSERT INTO gifi (accno,description) VALUES ('1322', 'Besitzwechsel gg. U. m.d.e. Beteilig. best. - Restl. gr. 1 J'); INSERT INTO gifi (accno,description) VALUES ('1325', 'Besitzwechsel gg. U. m.d.e. Beteilig. best., bundsbankfähig'); INSERT INTO gifi (accno,description) VALUES ('1327', 'Finanzwechsel'); INSERT INTO gifi (accno,description) VALUES ('1330', 'Schecks'); INSERT INTO gifi (accno,description) VALUES ('1340', 'Anteile an verb. Unternehmen (Umlaufvermögen)'); INSERT INTO gifi (accno,description) VALUES ('1344', 'Anteile an herrschender oder mit Mehrheit beteiligter Gesellschaft'); INSERT INTO gifi (accno,description) VALUES ('1345', 'Eigene Anteile'); INSERT INTO gifi (accno,description) VALUES ('1348', 'Sonstige Wertpapiere'); INSERT INTO gifi (accno,description) VALUES ('1350', 'GmbH-Anteile zum kurzfristigen Verbleib'); INSERT INTO gifi (accno,description) VALUES ('1352', 'Genossenschaftsanteile zum kurzfristigen Verbleib'); INSERT INTO gifi (accno,description) VALUES ('1355', 'Ansprüche aus Rückdeckungsversicherungen'); INSERT INTO gifi (accno,description) VALUES ('1360', 'Geldtransit Bank'); INSERT INTO gifi (accno,description) VALUES ('1361', 'Geldtransit Bank 1'); INSERT INTO gifi (accno,description) VALUES ('1362', 'Geldtransit Bank 2'); INSERT INTO gifi (accno,description) VALUES ('1363', 'Geldtransit Bank 3'); INSERT INTO gifi (accno,description) VALUES ('1369', 'Interne Umbuchung'); INSERT INTO gifi (accno,description) VALUES ('1370', 'Verrechnungskonto Gewinnermittlung §4/3 EStG, ergebniswirksam'); INSERT INTO gifi (accno,description) VALUES ('1371', 'Verrechnungskonto für Gewinnermittl. §4/3EStG, nicht ergebniswirksam'); INSERT INTO gifi (accno,description) VALUES ('1380', 'Überleitungskonto Kostenstelle'); INSERT INTO gifi (accno,description) VALUES ('1390', 'Verrechnungskonto Ist-Versteuerung'); INSERT INTO gifi (accno,description) VALUES ('1400', 'Forderungen aus Lief. und Leist. Kundengruppe 0'); INSERT INTO gifi (accno,description) VALUES ('1401', 'Forderungen aus Lief. und Leist. Kundengruppe 1'); INSERT INTO gifi (accno,description) VALUES ('1402', 'Forderungen aus Lief. und Leist. Kundengruppe 2'); INSERT INTO gifi (accno,description) VALUES ('1410', 'Forderungen aus Lief. und Leist. ohne Kontokorrent'); INSERT INTO gifi (accno,description) VALUES ('1450', 'Forderungen nach §11, Abs.1 Satz 2 EStG für § 4/3 EStG'); INSERT INTO gifi (accno,description) VALUES ('1451', 'Ford.a.Lief.u.Leist. ohne Kontokorrent - Restlaufz. b. 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1455', 'Ford.a.Lief.u.Leist. ohne Kontokorrent - Restlaufz. gr.1 J.'); INSERT INTO gifi (accno,description) VALUES ('1460', 'Zweifelhafte Forderungen'); INSERT INTO gifi (accno,description) VALUES ('1461', 'Zweifelhafte Forderungen - Restlaufzeit bis 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('1465', 'Zweifelhafte Forderungen - Restlaufzeit größer 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('1470', 'Ford.a.Lief.u.Leist. gg. verbundenen Unternehmen'); INSERT INTO gifi (accno,description) VALUES ('1471', 'Ford.a.Lief.u.Leist. gg. verb. Untern. - Restl. bis 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1475', 'Ford.a.Lief.u.Leist. gg. verb. Untern. - Restl. größer 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1478', 'Wertber. a. Ford.a.L.u.L. gg. verb. U. - Restl. b. 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1479', 'Wertber. a. Ford.a.L.u.L. gg. verb. U. - Restl. gr. 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1480', 'Ford.a.L.u.L. gg. Untern. m.d.e. Beteiligungsverh. best.'); INSERT INTO gifi (accno,description) VALUES ('1481', 'Ford.a.L.u.L. gg. U. m.d.e. Beteilig. best. - Restl. b. 1 J'); INSERT INTO gifi (accno,description) VALUES ('1485', 'Ford.a.L.u.L. gg. U. m.d.e. Beteilig. best. - Restl. gr. 1 J'); INSERT INTO gifi (accno,description) VALUES ('1488', 'Wertber. a. Ford. Restl. b. 1 J. gg. U. m.d.e. Beteilig.'); INSERT INTO gifi (accno,description) VALUES ('1489', 'Wertber. a. Ford. Restl. gr. 1 J. gg. U. m.d.e. Beteilig.'); INSERT INTO gifi (accno,description) VALUES ('1490', 'Ford.a.Lief.u.Leist. gegen Gesellschafter'); INSERT INTO gifi (accno,description) VALUES ('1491', 'Ford.a.Lief.u.Leist. gg. Gesellsch.- Restlaufz. bis 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1495', 'Ford.a.Lief.u.Leist. gg. Gesellsch.- Restlaufz. größer 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1499', 'Gegenkonto 14510-14980 bei Aufteilung Debitoren'); INSERT INTO gifi (accno,description) VALUES ('1500', 'Sonstige Vermögensgegenstände'); INSERT INTO gifi (accno,description) VALUES ('1501', 'Sonstige Vermögensgegenstände - Restlaufz. bis 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('1502', 'Sonstige Vermögensgegenstände - Restlaufz. größer 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('1503', 'Ford. gg. Vorstandsmitgl. u. Geschäftsf. - Restl. b. 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1504', 'Ford. gg. Vorstandsmitgl. u. Geschäftsf. - Restl. gr. 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1505', 'Ford. gg. Aufsichtsrats- u. Beiratsmitgl. - Restl. b. 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1506', 'Ford. gg. Aufsichtsrats- u. Beiratsmitgl. - Restl. gr. 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1507', 'Ford. gg. Gesellschafter - Restlaufzeit bis 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('1508', 'Ford. gg. Gesellschafter - Restlaufzeit größer 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('1510', 'Geleistete Anzahlungen auf Vorräte'); INSERT INTO gifi (accno,description) VALUES ('1511', 'Geleistete Anzahlungen, 7% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('1516', 'Geleistete Anzahlungen, 15% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('1517', 'Geleistete Anzahlungen, 16% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('1521', 'Agenturwarenabrechnung'); INSERT INTO gifi (accno,description) VALUES ('1525', 'Kautionen'); INSERT INTO gifi (accno,description) VALUES ('1526', 'Kautionen - Restlaufzeit bis 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('1527', 'Kautionen - Restlaufzeit größer 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('1530', 'Forderungen gegen Personal'); INSERT INTO gifi (accno,description) VALUES ('1531', 'Forderungen gegen Personal - Restlaufzeit bis 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('1537', 'Forderungen gegen Personal - Restlaufzeit größer 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('1540', 'Steuerüberzahlungen'); INSERT INTO gifi (accno,description) VALUES ('1542', 'Steuererstattungsansprüche gg. anderen EU-Ländern'); INSERT INTO gifi (accno,description) VALUES ('1545', 'Umsatzsteuerforderungen'); INSERT INTO gifi (accno,description) VALUES ('1547', 'Forderungen aus entrichteten Verbrauchssteuern'); INSERT INTO gifi (accno,description) VALUES ('1548', 'Vorsteuer im Folgejahr abziehbar'); INSERT INTO gifi (accno,description) VALUES ('1549', 'Körperschaftsteuerrückforderung'); INSERT INTO gifi (accno,description) VALUES ('1550', 'Darlehen'); INSERT INTO gifi (accno,description) VALUES ('1551', 'Darlehen - Restlaufzeit bis 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('1555', 'Darlehen - Restlaufzeit größer 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('1560', 'Aufzuteilende Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('1561', 'Aufzuteilende Vorsteuer, 7%'); INSERT INTO gifi (accno,description) VALUES ('1562', 'Aufzuteilende Vorsteuer aus ig. Erwerb'); INSERT INTO gifi (accno,description) VALUES ('1565', 'Aufzuteilende Vorsteuer, 16 %'); INSERT INTO gifi (accno,description) VALUES ('1566', 'Aufzuteilende Vorsteuer, 15 %'); INSERT INTO gifi (accno,description) VALUES ('1570', 'Abziehbare Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('1571', 'Abziehbare Vorsteuer, 7%'); INSERT INTO gifi (accno,description) VALUES ('1572', 'Abziehbare Vorsteuer aus ig. Erwerb'); INSERT INTO gifi (accno,description) VALUES ('1573', 'Abziehbare Vorsteuer aus ig. Erwerb, 16%'); INSERT INTO gifi (accno,description) VALUES ('1575', 'Abziehbare Vorsteuer, 16%'); INSERT INTO gifi (accno,description) VALUES ('1576', 'Abziehbare Vorsteuer, 15%'); INSERT INTO gifi (accno,description) VALUES ('1577', 'Vorsteuer nach allg. Durchschnittssätzen UStVA KZ 63'); INSERT INTO gifi (accno,description) VALUES ('1578', 'Berichtigung des VSt-Abzugs früherer Jahre UStVA KZ 64'); INSERT INTO gifi (accno,description) VALUES ('1580', 'Gegenkonto Vorsteuer § 4/3 EStG'); INSERT INTO gifi (accno,description) VALUES ('1581', 'Auflösung Vorsteuer aus Vorjahr § 4/3 EStG'); INSERT INTO gifi (accno,description) VALUES ('1584', 'Abziehb. VSt. a. ig. Erw. v. Neufahrz. v. Lief. ohne USt-ID'); INSERT INTO gifi (accno,description) VALUES ('1586', 'Kürzung BerlinFG'); INSERT INTO gifi (accno,description) VALUES ('1588', 'Bezahlte Einfuhrumsatzsteuer'); INSERT INTO gifi (accno,description) VALUES ('1590', 'Durchlaufende Posten'); INSERT INTO gifi (accno,description) VALUES ('1593', 'Verrechnungskto erhalt. Anzahl. b. Buchung ü. Kundenkto'); INSERT INTO gifi (accno,description) VALUES ('1594', 'Forderungen gegen verbundene Unternehmen'); INSERT INTO gifi (accno,description) VALUES ('1595', 'Ford. gg. verbundene Unternehmen - Restlaufz. b. 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1596', 'Ford. gg. verbundene Unternehmen - Restlaufz. gr. 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1597', 'Ford. gg. Untern. mit denen ein Beteiligungsverh. besteht'); INSERT INTO gifi (accno,description) VALUES ('1598', 'Ford. gg. U. m.d.e. Beteiligungsv. best. - Restl. b. 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1599', 'Ford. gg. U. m.d.e. Beteiligungsv. best. - Restl. gr. 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1600', 'Verb. aus Lief. und Leist. Lieferantengruppe 0'); INSERT INTO gifi (accno,description) VALUES ('1601', 'Verb. aus Lief. und Leist. Lieferantengruppe 1'); INSERT INTO gifi (accno,description) VALUES ('1602', 'Verb. aus Lief. und Leist. Lieferantengruppe 2'); INSERT INTO gifi (accno,description) VALUES ('1610', 'Verb.a.L.u.L. ohne Kontokorrent'); INSERT INTO gifi (accno,description) VALUES ('1624', 'Verbindlichkeiten aus Lief. u. Leist. für Investitionen für §4/3 EStG'); INSERT INTO gifi (accno,description) VALUES ('1625', 'Verb.a.L.u.L. ohne Kontokorrent - Restl. b. 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1626', 'Verb.a.L.u.L. ohne Kontokorrent - Restlaufz. 1 bis 5 J.'); INSERT INTO gifi (accno,description) VALUES ('1628', 'Verb.a.L.u.L. ohne Kontokorrent - Restlaufz. größer 5 J.'); INSERT INTO gifi (accno,description) VALUES ('1630', 'Verb.a.Lief.u.Leist. gg. verbundenen Unternehmen'); INSERT INTO gifi (accno,description) VALUES ('1631', 'Verb.a.L.u.L. gg. verb. Untern. - Restlaufz. bis 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1635', 'Verb.a.L.u.L. gg. verb. Untern. - Restlaufz. 1 bis 5 J.'); INSERT INTO gifi (accno,description) VALUES ('1638', 'Verb.a.L.u.L. gg. verb. Untern. - Restlaufz. größer 5 J.'); INSERT INTO gifi (accno,description) VALUES ('1640', 'Verb.a.L.u.L. gg. Untern. m.d.e. Beteiligungsverh. best.'); INSERT INTO gifi (accno,description) VALUES ('1641', 'Verb.a.L.u.L. gg. U. m.d.e. Beteilig. best. - Restl. b. 1 J'); INSERT INTO gifi (accno,description) VALUES ('1645', 'Verb.a.L.u.L. gg. U. m.d.e. Beteilig. best. - Restl. 1 b 5 J'); INSERT INTO gifi (accno,description) VALUES ('1648', 'Verb.a.L.u.L. gg. U. m.d.e. Beteilig. best. - Restl. gr. 5 J'); INSERT INTO gifi (accno,description) VALUES ('1650', 'Verb.a.Lief.u.Leist. gegen Gesellschaftern'); INSERT INTO gifi (accno,description) VALUES ('1651', 'Verb.a.Lief.u.Leist. gg. Gesellsch. - Restl. bis 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1655', 'Verb.a.Lief.u.Leist. gg. Gesellsch. - Restl. 1 bis 5 J.'); INSERT INTO gifi (accno,description) VALUES ('1658', 'Verb.a.Lief.u.Leist. gg. Gesellsch. - Restl. größer 5 J.'); INSERT INTO gifi (accno,description) VALUES ('1659', 'Gegenkonto 16250-16580 bei Aufteilung Kreditoren-Konto'); INSERT INTO gifi (accno,description) VALUES ('1660', 'Schuldwechsel'); INSERT INTO gifi (accno,description) VALUES ('1661', 'Schuldwechsel - Restlaufzeit bis 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('1680', 'Schuldwechsel - Restlaufzeit 1 bis 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('1690', 'Schuldwechsel - Restlaufzeit größer 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('1700', 'Sonstige Verbindlichkeiten'); INSERT INTO gifi (accno,description) VALUES ('1701', 'Sonstige Verbindlichkeiten - Restlaufzeit bis 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('1702', 'Sonstige Verbindlichkeiten - Restlaufzeit 1 bis 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('1703', 'Sonstige Verbindlichkeiten - Restlaufzeit größer 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('1704', 'Sonstige Verbindlichkeiten, z.B. nach §11,Abs.2,2 EStG für §4/3'); INSERT INTO gifi (accno,description) VALUES ('1705', 'Darlehen'); INSERT INTO gifi (accno,description) VALUES ('1706', 'Darlehen - Restlaufzeit bis 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('1707', 'Darlehen - Restlaufzeit 1 bis 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('1708', 'Darlehen - Restlaufzeit größer 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('1709', 'Gewinnverfügungskonto stiller Gesellschafter'); INSERT INTO gifi (accno,description) VALUES ('1710', 'Erhaltene Anzahlungen (Verbindlichkeiten)'); INSERT INTO gifi (accno,description) VALUES ('1711', 'Erhaltene verst. Anzahl., 7% USt (Verbindlichkeiten)'); INSERT INTO gifi (accno,description) VALUES ('1716', 'Erhaltene verst. Anzahl., 15% USt (Verbindlichkeiten)'); INSERT INTO gifi (accno,description) VALUES ('1717', 'Erhaltene verst. Anzahl., 16% USt (Verbindlichkeiten)'); INSERT INTO gifi (accno,description) VALUES ('1719', 'Erhaltene Anzahlungen - Restlaufzeit bis 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('1720', 'Erhaltene Anzahlungen - Restlaufzeit 1 bis 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('1721', 'Erhaltene Anzahlungen - Restlaufzeit größer 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('1722', 'Erhaltene Anzahlungen (von Vorräten offen abgesetzt)'); INSERT INTO gifi (accno,description) VALUES ('1731', 'Agenturwarenabrechnung'); INSERT INTO gifi (accno,description) VALUES ('1732', 'Erhaltene Kautionen'); INSERT INTO gifi (accno,description) VALUES ('1733', 'Erhaltene Kautionen - Restlaufzeit bis 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('1734', 'Erhaltene Kautionen - Restlaufzeit 1 bis 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('1735', 'Erhaltene Kautionen - Restlaufzeit größer 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('1736', 'Verbindlichkeiten aus Betriebsteuern und Abgaben'); INSERT INTO gifi (accno,description) VALUES ('1737', 'Verb. aus Betriebsteuern u. Abgaben - Restlaufz. bis 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1738', 'Verb. aus Betriebsteuern u. Abgaben - Restlaufz. 1 bis 5 J.'); INSERT INTO gifi (accno,description) VALUES ('1739', 'Verb. aus Betriebsteuern u. Abgaben - Restl. größer 5 J.'); INSERT INTO gifi (accno,description) VALUES ('1740', 'Verbindlichkeiten aus Lohn und Gehalt'); INSERT INTO gifi (accno,description) VALUES ('1741', 'Verbindlichkeiten aus Lohn- und Kirchensteuer'); INSERT INTO gifi (accno,description) VALUES ('1742', 'Verbindlichkeiten im Rahmen der sozialen Sicherheit'); INSERT INTO gifi (accno,description) VALUES ('1743', 'Verb. im Rahmen der sozialen Sicherheit - Restl. bis 1 J.'); INSERT INTO gifi (accno,description) VALUES ('1744', 'Verb. im Rahmen der sozialen Sicherheit - Restl. 1 bis 5 J.'); INSERT INTO gifi (accno,description) VALUES ('1745', 'Verb. im Rahmen der sozialen Sicherheit - Restl. gr. 5 J.'); INSERT INTO gifi (accno,description) VALUES ('1746', 'Verbindlichkeiten aus Einbehaltungen'); INSERT INTO gifi (accno,description) VALUES ('1747', 'Verbindlichkeiten für Verbrauchssteuern'); INSERT INTO gifi (accno,description) VALUES ('1750', 'Verbindlichkeiten aus Vermögensbildung'); INSERT INTO gifi (accno,description) VALUES ('1751', 'Verb. aus Vermögensbildung - Restlaufz. bis 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('1752', 'Verb. aus Vermögensbildung - Restlaufz. 1 bis 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('1753', 'Verb. aus Vermögensbildung - Restlaufz. größer 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('1755', 'Lohn- und Gehaltsverrechnung'); INSERT INTO gifi (accno,description) VALUES ('1758', 'Umsatzsteuerabzugsverfahren, 16% Umsatzsteuer'); INSERT INTO gifi (accno,description) VALUES ('1759', 'Umsatzsteuerabzugsverfahren, 15% Umsatzsteuer'); INSERT INTO gifi (accno,description) VALUES ('1760', 'Umsatzsteuer nicht fällig'); INSERT INTO gifi (accno,description) VALUES ('1761', 'Umsatzsteuer nicht fällig , 7%'); INSERT INTO gifi (accno,description) VALUES ('1762', 'Umsatzsteuer nicht fällig a.i. Inland steuerpfl. EU-Lief.'); INSERT INTO gifi (accno,description) VALUES ('1763', 'Umsatzsteuer nicht fällig a.i. Inland steuerpfl. EU-Lief., 16%'); INSERT INTO gifi (accno,description) VALUES ('1765', 'Umsatzsteuer nicht fällig, 16%'); INSERT INTO gifi (accno,description) VALUES ('1766', 'Umsatzsteuer nicht fällig, 15%'); INSERT INTO gifi (accno,description) VALUES ('1767', 'Umsatzsteuer a.i. and. EU-Land steuerpfl. Lief.'); INSERT INTO gifi (accno,description) VALUES ('1768', 'Umsatzsteuer a.i. and. EU-Land steuerpfl. sonst. Lief./Werkl.'); INSERT INTO gifi (accno,description) VALUES ('1769', 'Steuerzahlungen an andere EU-Länder'); INSERT INTO gifi (accno,description) VALUES ('1770', 'Umsatzsteuer'); INSERT INTO gifi (accno,description) VALUES ('1771', 'Umsatzsteuer, 7%'); INSERT INTO gifi (accno,description) VALUES ('1772', 'Umsatzsteuer aus ig. Erwerb'); INSERT INTO gifi (accno,description) VALUES ('1773', 'Umsatzsteuer aus ig. Erwerb, 16%'); INSERT INTO gifi (accno,description) VALUES ('1775', 'Umsatzsteuer, 16%'); INSERT INTO gifi (accno,description) VALUES ('1776', 'Umsatzsteuer, 15%'); INSERT INTO gifi (accno,description) VALUES ('1777', 'Umsatzsteuer aus im Inland steuerpfl. EU-Lieferungen'); INSERT INTO gifi (accno,description) VALUES ('1778', 'Umsatzsteuer aus im Inland steuerpfl. EU-Lieferungen, 16%'); INSERT INTO gifi (accno,description) VALUES ('1779', 'Umsatzsteuer aus ig. Erwerb ohne Vorsteuerabzug'); INSERT INTO gifi (accno,description) VALUES ('1780', 'Umsatzsteuer - Vorauszahlungen'); INSERT INTO gifi (accno,description) VALUES ('1781', 'Umsatzsteuer - Vorauszahlungen 1/11'); INSERT INTO gifi (accno,description) VALUES ('1782', 'Nachsteuer, UStVA KZ 65'); INSERT INTO gifi (accno,description) VALUES ('1783', 'In Rechnung unber. ausgewiesene und geschuldete Steuer, UStVA KZ 69'); INSERT INTO gifi (accno,description) VALUES ('1784', 'Umsatzsteuer aus ig. Erw. v. Neufahrz. v. Lief. ohne USt-ID'); INSERT INTO gifi (accno,description) VALUES ('1788', 'Einfuhrumsatzsteuer aufgeschoben bis'); INSERT INTO gifi (accno,description) VALUES ('1789', 'Umsatzsteuer laufendes Jahr'); INSERT INTO gifi (accno,description) VALUES ('1790', 'Umsatzsteuer Vorjahr'); INSERT INTO gifi (accno,description) VALUES ('1791', 'Umsatzsteuer frühere Jahre'); INSERT INTO gifi (accno,description) VALUES ('1792', 'Abgrenzung für Grundstücke'); INSERT INTO gifi (accno,description) VALUES ('1794', 'Abgrenzung für immaterielle Vermögensgegenstände'); INSERT INTO gifi (accno,description) VALUES ('1795', 'Abgrenzung für Bauten auf eigenen Grundstücken'); INSERT INTO gifi (accno,description) VALUES ('1796', 'Abgrenzung für andere Anlagen, B.u.G. Ausstattung'); INSERT INTO gifi (accno,description) VALUES ('1797', 'Abgrenzung für Bauten auf fremden Grundstücken'); INSERT INTO gifi (accno,description) VALUES ('1798', 'Abgrenzung für technische Anlagen und Maschinen'); INSERT INTO gifi (accno,description) VALUES ('1799', 'Sonstige Verrechnungskonten (Interimskonten)'); INSERT INTO gifi (accno,description) VALUES ('1793', 'Verrechnungskto geleist. Anzahl. bei Buchung über Lief.Kto.'); INSERT INTO gifi (accno,description) VALUES ('1800', 'Privatentn. allg. (Privat Vollhafter / Einzelunternehmer)'); INSERT INTO gifi (accno,description) VALUES ('1810', 'Privatsteuern (Privat Vollhafter / Einzelunternehmer)'); INSERT INTO gifi (accno,description) VALUES ('1820', 'Sonderausg. beschr. abzugsf. (Privat Vollhaft./Einzelu.)'); INSERT INTO gifi (accno,description) VALUES ('1830', 'Sonderausg. unbeschr. abzugsf. (Privat Vollhaft./Einzelu.)'); INSERT INTO gifi (accno,description) VALUES ('1840', 'Privatspenden (Privat Vollhafter / Einzelunternehmer)'); INSERT INTO gifi (accno,description) VALUES ('1850', 'Außergewöhnliche Belastungen (Privat Vollhaft. / Einzelunt.)'); INSERT INTO gifi (accno,description) VALUES ('1860', 'Grundstücksaufwand (Privat Vollhafter / Einzelunternehmer)'); INSERT INTO gifi (accno,description) VALUES ('1870', 'Grundstücksertrag (Privat Vollhafter / Einzelunternehmer)'); INSERT INTO gifi (accno,description) VALUES ('1880', 'Eigenverbrauch (Privat Vollhafter / Einzelunternehmer)'); INSERT INTO gifi (accno,description) VALUES ('1890', 'Privateinlagen (Privat Vollhafter / Einzelunternehmer)'); INSERT INTO gifi (accno,description) VALUES ('1900', 'Privatentnahmen allgemein (Privat Teilhafter)'); INSERT INTO gifi (accno,description) VALUES ('1910', 'Privatsteuern (Privat Teilhafter)'); INSERT INTO gifi (accno,description) VALUES ('1920', 'Sonderausgaben beschränkt abzugsf. (Privat Teilhafter)'); INSERT INTO gifi (accno,description) VALUES ('1930', 'Sonderausgaben unbeschränkt abzugsf. (Privat Teilhafter)'); INSERT INTO gifi (accno,description) VALUES ('1940', 'Privatspenden (Privat Teilhafter)'); INSERT INTO gifi (accno,description) VALUES ('1950', 'Außergewöhnliche Belastungen (Privat Teilhafter)'); INSERT INTO gifi (accno,description) VALUES ('1960', 'Grundstücksaufwand (Privat Teilhafter)'); INSERT INTO gifi (accno,description) VALUES ('1970', 'Grundstücksertrag (Privat Teilhafter)'); INSERT INTO gifi (accno,description) VALUES ('1980', 'Eigenverbrauch (Privat Teilhafter)'); INSERT INTO gifi (accno,description) VALUES ('1990', 'Privateinlagen (Privat Teilhafter)'); INSERT INTO gifi (accno,description) VALUES ('2000', 'Außerordentliche Aufwendungen'); INSERT INTO gifi (accno,description) VALUES ('2010', 'Betriebsfremde Aufw. (soweit nicht außerordentlich)'); INSERT INTO gifi (accno,description) VALUES ('2020', 'Periodenfremde Aufw. (soweit nicht außerordentlich)'); INSERT INTO gifi (accno,description) VALUES ('2100', 'Zinsen und ähnliche Aufwendungen'); INSERT INTO gifi (accno,description) VALUES ('2103', 'Steuerlich abzugsfähige, andere Nebenleistungen zu Steuern'); INSERT INTO gifi (accno,description) VALUES ('2104', 'Steuerlich nicht abzugsfähige, andere Nebenleistungen zu Steuern'); INSERT INTO gifi (accno,description) VALUES ('2107', 'Zinsaufwendungen §233a AO betriebliche Steuern'); INSERT INTO gifi (accno,description) VALUES ('2108', 'Zinsaufw. §233a, §234, §237 AO Personenst. §8 GewStG'); INSERT INTO gifi (accno,description) VALUES ('2109', 'Zinsaufwendungen an verbundene Unternehmen'); INSERT INTO gifi (accno,description) VALUES ('2110', 'Zinsaufwendungen für kurzfristige Verbindlichkeiten'); INSERT INTO gifi (accno,description) VALUES ('2118', 'In Dauerschuldzins. umqualif. Zinsen a. kurzfristige Verb.'); INSERT INTO gifi (accno,description) VALUES ('2119', 'Zinsaufw. f. kurzfristige Verb. an verbunden Unternehmen'); INSERT INTO gifi (accno,description) VALUES ('2120', 'Zinsaufwendungen für langfristige Verbindlichkeiten'); INSERT INTO gifi (accno,description) VALUES ('2127', 'Renten u. dauernde Last. a. Gründung/Erwerb §8GewStG'); INSERT INTO gifi (accno,description) VALUES ('2128', 'Zinsaufw. an Mitu. f. Hingabe v. langfrist. Kapital §15 EStG'); INSERT INTO gifi (accno,description) VALUES ('2129', 'Zinsaufw. f. langfristige Verb. an verbundene Unternehmen'); INSERT INTO gifi (accno,description) VALUES ('2130', 'Diskontaufwendungen'); INSERT INTO gifi (accno,description) VALUES ('2139', 'Diskontaufwendungen an verbundene Unternehmen'); INSERT INTO gifi (accno,description) VALUES ('2140', 'Zinsähnliche Aufwendungen'); INSERT INTO gifi (accno,description) VALUES ('2149', 'Zinsähnliche Aufwendungen an verbundene Unternehmen'); INSERT INTO gifi (accno,description) VALUES ('2150', 'Aufwendungen aus Kursdifferenzen'); INSERT INTO gifi (accno,description) VALUES ('2170', 'Nicht abziehb. VSt a. Zinsen u. ähnl. Aufw.'); INSERT INTO gifi (accno,description) VALUES ('2171', 'Nicht abziehb. VSt, 7% a. Zinsen u. ähnl. Aufw.'); INSERT INTO gifi (accno,description) VALUES ('2175', 'Nicht abziehb. VSt. 16% a. Zinsen u. ähnl. Aufw.'); INSERT INTO gifi (accno,description) VALUES ('2176', 'Nicht abziehb. VSt, 15% a. Zinsen u. ähnl. Aufw.'); INSERT INTO gifi (accno,description) VALUES ('2200', 'Körperschaftsteuer'); INSERT INTO gifi (accno,description) VALUES ('2203', 'Körperschaftsteuer für Vorjahre'); INSERT INTO gifi (accno,description) VALUES ('2205', 'Anrechenbare Körperschaftssteuer auf vereinnahmte Kapitalerträge'); INSERT INTO gifi (accno,description) VALUES ('2208', 'Solidaritätszuschlag'); INSERT INTO gifi (accno,description) VALUES ('2209', 'Solidaritätszuschlag für Vorjahre'); INSERT INTO gifi (accno,description) VALUES ('2210', 'Kapitalertragsteuer'); INSERT INTO gifi (accno,description) VALUES ('2213', 'Anrechenbarer Solidaritätszuschlag auf Kapitalertragssteuer'); INSERT INTO gifi (accno,description) VALUES ('2215', 'Zinsabschlagsteuer'); INSERT INTO gifi (accno,description) VALUES ('2218', 'Anrechenbarer Solidaritätszuschlag auf Zinsabschlagsteuer'); INSERT INTO gifi (accno,description) VALUES ('2223', 'Vermögensteuer für Vorjahre'); INSERT INTO gifi (accno,description) VALUES ('2280', 'Steuernachz. Vorjahre f. Steuern v. Einkommen u. Ertrag'); INSERT INTO gifi (accno,description) VALUES ('2282', 'Steuererstatt. Vorjahre f. Steuern v. Einkommen u. Ertrag'); INSERT INTO gifi (accno,description) VALUES ('2284', 'Erträge a. Aufl. v. Rückst. f. Steuern v. Eink. u. Ertrag'); INSERT INTO gifi (accno,description) VALUES ('2285', 'Steuernachzahlung Vorjahre für sonstige Steuern'); INSERT INTO gifi (accno,description) VALUES ('2287', 'Steuererstattung Vorjahre für sonstige Steuern'); INSERT INTO gifi (accno,description) VALUES ('2289', 'Erträge a. d. Auflösung v. Rückstell. f. sonstige Steuern'); INSERT INTO gifi (accno,description) VALUES ('2300', 'Sonstige Aufwendungen'); INSERT INTO gifi (accno,description) VALUES ('2307', 'Sonstige Aufwendungen betriebsfremd und regelmäßig'); INSERT INTO gifi (accno,description) VALUES ('2309', 'Sonstige Aufwendungen unregelmäßig'); INSERT INTO gifi (accno,description) VALUES ('2310', 'Anlagenabgänge (Restbuchwert und Buchverlust)'); INSERT INTO gifi (accno,description) VALUES ('2315', 'Anlagenabgänge (Restbuchwert bei Buchgewinn)'); INSERT INTO gifi (accno,description) VALUES ('2320', 'Verluste a. Abgang v. Gegenst. d. Anlagevermögens'); INSERT INTO gifi (accno,description) VALUES ('2325', 'Verluste a. Abgang v. Gegenst. d. Umlaufv. (außer Vorräte)'); INSERT INTO gifi (accno,description) VALUES ('2340', 'Einstell. in Sonderpost. m. Rücklageant. (steuerfr. Rückl.)'); INSERT INTO gifi (accno,description) VALUES ('2341', 'Einstell. in Sonderpost. m. Rücklageant. (Ansparabschreibungen)'); INSERT INTO gifi (accno,description) VALUES ('2345', 'Einstell. in Sonderpost. m. Rücklageant. (Sonderabschr.)'); INSERT INTO gifi (accno,description) VALUES ('2350', 'Grundstücksaufwendungen'); INSERT INTO gifi (accno,description) VALUES ('2375', 'Grundsteuer'); INSERT INTO gifi (accno,description) VALUES ('2380', 'Spenden, steuerlich nicht absetzbar'); INSERT INTO gifi (accno,description) VALUES ('2381', 'Beiträge u. Spenden f. wissenschaftl. u. kulturelle Zwecke'); INSERT INTO gifi (accno,description) VALUES ('2382', 'Beiträge u. Spenden f. mildtätige Zwecke'); INSERT INTO gifi (accno,description) VALUES ('2383', 'Beiträge u. Spenden f. kirchl., religiöse u. gemeinn. Zwecke'); INSERT INTO gifi (accno,description) VALUES ('2384', 'Beiträge u. Spenden an politische Parteien'); INSERT INTO gifi (accno,description) VALUES ('2385', 'Nicht abziehbare Hälfte der Aufsichtsratsvergütungen'); INSERT INTO gifi (accno,description) VALUES ('2386', 'Abziehbare Aufsichtsratsvergütungen'); INSERT INTO gifi (accno,description) VALUES ('2400', 'Forderungsverluste (übliche Höhe)'); INSERT INTO gifi (accno,description) VALUES ('2401', 'Forderungsverluste, 7% USt (übliche Höhe)'); INSERT INTO gifi (accno,description) VALUES ('2402', 'Ford.Verl. a. steuerfr. EU-Lief. (übliche Höhe)'); INSERT INTO gifi (accno,description) VALUES ('2403', 'Ford.Verl. a.i. Inl. steuerpfl. EU-Lief., 7% USt (übl. Höhe)'); INSERT INTO gifi (accno,description) VALUES ('2404', 'Ford.Verl. a.i. Inl. steuerpfl. EU-Lief., 15%+16%USt (übl. Höhe)'); INSERT INTO gifi (accno,description) VALUES ('2405', 'Forderungsverluste, 15%+16% USt (übliche Höhe)'); INSERT INTO gifi (accno,description) VALUES ('2406', 'Forderungsverluste, 16% USt (übliche Höhe)'); INSERT INTO gifi (accno,description) VALUES ('2407', 'Forderungsverluste, 15% USt (übliche Höhe)'); INSERT INTO gifi (accno,description) VALUES ('2408', 'Ford.Verl. a.i. Inl. steuerpfl. EU-Lief., 16%USt (übl. Höhe)'); INSERT INTO gifi (accno,description) VALUES ('2409', 'Ford.Verl. a.i. Inl. steuerpfl. EU-Lief., 15%USt (übl. Höhe)'); INSERT INTO gifi (accno,description) VALUES ('2430', 'Forderungsverlust unüblich hoch'); INSERT INTO gifi (accno,description) VALUES ('2450', 'Einstellungen in Pauschalwertberichtigung zu Forderungen'); INSERT INTO gifi (accno,description) VALUES ('2451', 'Einstellungen in Einzelwertberichtigung zu Forderungen'); INSERT INTO gifi (accno,description) VALUES ('2490', 'Aufwendungen aus Verlustübernahme'); INSERT INTO gifi (accno,description) VALUES ('2492', 'Abgef. Gew. aufgrund einer Gewinngemeinschaft'); INSERT INTO gifi (accno,description) VALUES ('2493', 'Abgef. Gew. a. stille Gesellschafter §8 GewStG'); INSERT INTO gifi (accno,description) VALUES ('2494', 'Abgef. Gew. a. Gewinn- oder Teilgewinnabführungsvertr.'); INSERT INTO gifi (accno,description) VALUES ('2495', 'Einst. in die Kapitalrückl. n. Vorschr. d. vereinf. Kap.Herabs.'); INSERT INTO gifi (accno,description) VALUES ('2496', 'Einst. in die gesetzliche Rücklage'); INSERT INTO gifi (accno,description) VALUES ('2497', 'Einst. in die satzungsmäßige Rücklage'); INSERT INTO gifi (accno,description) VALUES ('2498', 'Einst. in die Rücklage für eigene Anteile'); INSERT INTO gifi (accno,description) VALUES ('2499', 'Einst. in andere Gewinnrücklagen'); INSERT INTO gifi (accno,description) VALUES ('2500', 'Außerordentliche Erträge'); INSERT INTO gifi (accno,description) VALUES ('2510', 'Betriebsfremde Erträge (soweit nicht außerordentlich)'); INSERT INTO gifi (accno,description) VALUES ('2520', 'Periodenfremde Erträge (soweit nicht außerordentlich)'); INSERT INTO gifi (accno,description) VALUES ('2600', 'Erträge aus Beteiligungen'); INSERT INTO gifi (accno,description) VALUES ('2617', 'Gewinne a.Ant. an nicht steuerbefr. inländischen KG §9Nr.2aGewStG'); INSERT INTO gifi (accno,description) VALUES ('2618', 'Gewinnanteile aus Mitunternehmerschaften §9 GewStG'); INSERT INTO gifi (accno,description) VALUES ('2619', 'Erträge aus Beteiligungen an verbundenen Unternehmen'); INSERT INTO gifi (accno,description) VALUES ('2620', 'Ertr. a. and. Wertpap. u. Ausl. d. Finanzanlageverm.'); INSERT INTO gifi (accno,description) VALUES ('2649', 'Ertr. a. and. Wertpap. u. Ausl. d. Fin.Anl.Verm. a. verb. U.'); INSERT INTO gifi (accno,description) VALUES ('2650', 'Sonstige Zinsen und ähnliche Erträge'); INSERT INTO gifi (accno,description) VALUES ('2657', 'Zinserträge §233a AO betriebliche Steuern'); INSERT INTO gifi (accno,description) VALUES ('2658', 'Zinserträge §233a AO Körperschaftsteuer / Vermögensteuer'); INSERT INTO gifi (accno,description) VALUES ('2659', 'Sonstige Zinsen u. ähnliche Erträge aus verb. Unternehmen'); INSERT INTO gifi (accno,description) VALUES ('2660', 'Erträge aus Kursdifferenzen'); INSERT INTO gifi (accno,description) VALUES ('2670', 'Diskonterträge'); INSERT INTO gifi (accno,description) VALUES ('2679', 'Diskonterträge aus verbundenen Unternehmen'); INSERT INTO gifi (accno,description) VALUES ('2680', 'Zinsähnliche Erträge'); INSERT INTO gifi (accno,description) VALUES ('2689', 'Zinsähnliche Erträge aus verbundenen Unternehmen'); INSERT INTO gifi (accno,description) VALUES ('2700', 'Sonstige Erträge'); INSERT INTO gifi (accno,description) VALUES ('2705', 'Sonstige Erträge betrieblich und regelmäßig'); INSERT INTO gifi (accno,description) VALUES ('2707', 'Sonstige Erträge betriebsfremd und regelmäßig'); INSERT INTO gifi (accno,description) VALUES ('2709', 'Sonstige Erträge unregelmäßig'); INSERT INTO gifi (accno,description) VALUES ('2710', 'Erträge aus Zuschreibungen des Anlagevermögens'); INSERT INTO gifi (accno,description) VALUES ('2715', 'Erträge aus Zuschreibungen des Umlaufvermögens'); INSERT INTO gifi (accno,description) VALUES ('2720', 'Ertr. a. Abgang v. Gegenst. d. Anlagevermögens'); INSERT INTO gifi (accno,description) VALUES ('2725', 'Ertr. a. Abgang v. Gegenst. d. Umlaufv.s (außer Vorräte)'); INSERT INTO gifi (accno,description) VALUES ('2730', 'Ertr. a. Herabs. d. Pauschalwertber. zu Forderungen'); INSERT INTO gifi (accno,description) VALUES ('2731', 'Ertr. a. Herabs. d. Einzelwertber. zu Forderungen'); INSERT INTO gifi (accno,description) VALUES ('2732', 'Erträge aus abgeschriebenen Forderungen'); INSERT INTO gifi (accno,description) VALUES ('2735', 'Erträge aus der Auflösung von Rückstellungen'); INSERT INTO gifi (accno,description) VALUES ('2739', 'Erträge aus der Auflösung von Sonderpost. m. Rücklageant. (Ansparabschr.)'); INSERT INTO gifi (accno,description) VALUES ('2740', 'Ertr. a. Aufl. v. Sonderp. m. Rückl.Ant. (steuerfr. Rückl.)'); INSERT INTO gifi (accno,description) VALUES ('2741', 'Ertr. a. Aufl. v. Sonderp. m. Rückl.Ant. (Sonderabschr.)'); INSERT INTO gifi (accno,description) VALUES ('2742', 'Versicherungsentschädigungen'); INSERT INTO gifi (accno,description) VALUES ('2743', 'Investitionszuschüsse (steuerpflichtig)'); INSERT INTO gifi (accno,description) VALUES ('2744', 'Investitionszulagen (steuerfrei)'); INSERT INTO gifi (accno,description) VALUES ('2745', 'Erträge aus Kapitalherabsetzung'); INSERT INTO gifi (accno,description) VALUES ('2750', 'Grundstückserträge'); INSERT INTO gifi (accno,description) VALUES ('2780', 'Steuererstattung Vorjahre f. Steuern vom Eink. u. Ertrag'); INSERT INTO gifi (accno,description) VALUES ('2785', 'Steuererstattung Vorjahre f. sonstige Steuern'); INSERT INTO gifi (accno,description) VALUES ('2790', 'Erträge aus Verlustübernahme'); INSERT INTO gifi (accno,description) VALUES ('2792', 'Erh. Gew. aufgrund einer Gewinngemeinschaft'); INSERT INTO gifi (accno,description) VALUES ('2794', 'Erh. Gew. aufgrund eines Gew.- oder Teilgew.Abführ.Vertr.'); INSERT INTO gifi (accno,description) VALUES ('2795', 'Entnahmen aus der Kapitalrücklage'); INSERT INTO gifi (accno,description) VALUES ('2796', 'Entnahmen aus der gesetzlichen Rücklage'); INSERT INTO gifi (accno,description) VALUES ('2797', 'Entnahmen aus satzungsgemäßen Rücklagen'); INSERT INTO gifi (accno,description) VALUES ('2798', 'Entnahmen aus der Rücklage für eigene Anteile'); INSERT INTO gifi (accno,description) VALUES ('2799', 'Entnahmen aus anderen Gewinnrücklagen'); INSERT INTO gifi (accno,description) VALUES ('2860', 'Gewinnvortrag nach Verwendung'); INSERT INTO gifi (accno,description) VALUES ('2862', 'Gewinnvortrag 50/45% Vorbelastung'); INSERT INTO gifi (accno,description) VALUES ('2864', 'Gewinnvortrag 30% Vorbelastung'); INSERT INTO gifi (accno,description) VALUES ('2866', 'Gewinnvortrag 0% Vorbelastung'); INSERT INTO gifi (accno,description) VALUES ('2868', 'Verlustvortrag nach Verwendung'); INSERT INTO gifi (accno,description) VALUES ('2869', 'Vorträge auf neue Rechnung (GuV)'); INSERT INTO gifi (accno,description) VALUES ('2870', 'Ausschüttung'); INSERT INTO gifi (accno,description) VALUES ('2890', 'Verrechneter kalkulatorischer Unternehmerlohn'); INSERT INTO gifi (accno,description) VALUES ('2891', 'Verrechnete kalkulatorische Miete und Pacht'); INSERT INTO gifi (accno,description) VALUES ('2892', 'Verrechnete kalkulatorische Zinsen'); INSERT INTO gifi (accno,description) VALUES ('2893', 'Verrechnete kalkulatorische Abschreibung'); INSERT INTO gifi (accno,description) VALUES ('2894', 'Verrechnete kalkulatorische Wagnisse'); INSERT INTO gifi (accno,description) VALUES ('2895', 'Verrechneter kalkulatorischer Lohn für unentgeltliche Mitarbeiter'); INSERT INTO gifi (accno,description) VALUES ('3000', 'Roh-, Hilfs- und Betriebsstoffe'); INSERT INTO gifi (accno,description) VALUES ('3090', 'Energiestoffe (Fertigung)'); INSERT INTO gifi (accno,description) VALUES ('3100', 'Fremdleistungen'); INSERT INTO gifi (accno,description) VALUES ('3150', 'Leistungen von ausländischen Unternehmen (Nullregelung)'); INSERT INTO gifi (accno,description) VALUES ('3200', 'Wareneingang'); INSERT INTO gifi (accno,description) VALUES ('3300', 'Wareneingang, 7% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3340', 'Wareneingang, 15% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3400', 'Wareneingang, 15%+16% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3410', 'Wareneingang, 16% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3420', 'Innergem. Erwerb, 7% VSt u. 7% USt'); INSERT INTO gifi (accno,description) VALUES ('3425', 'Innergem. Erwerb, 15%+16% VSt u. 15%+16% USt'); INSERT INTO gifi (accno,description) VALUES ('3430', 'Innergem. Erwerb, ohne VSt-Abzug u. 7% USt'); INSERT INTO gifi (accno,description) VALUES ('3431', 'Innergem. Erwerb, 16% VSt u. 16% Ust'); INSERT INTO gifi (accno,description) VALUES ('3433', 'Innergem. Erwerb, 15% VSt u. 15% Ust'); INSERT INTO gifi (accno,description) VALUES ('3435', 'Innergem. Erwerb, ohne VSt-Abzug u. 15%+16% USt'); INSERT INTO gifi (accno,description) VALUES ('3436', 'Innergem. Erwerb, ohne VSt-Abzug u. 16% Ust'); INSERT INTO gifi (accno,description) VALUES ('3437', 'Innergem. Erwerb, ohne VSt-Abzug u. 15% Ust'); INSERT INTO gifi (accno,description) VALUES ('3440', 'Innergem. Erw. v. Neufahrz. v. Lief. ohne USt-ID, 15%+16% USt'); INSERT INTO gifi (accno,description) VALUES ('3441', 'Innergem. Erw. v. Neufahrz. v. Lief. ohne USt-ID, 16% Ust'); INSERT INTO gifi (accno,description) VALUES ('3442', 'Innergem. Erw. v. Neufahrz. v. Lief. ohne USt-ID, 15% Ust'); INSERT INTO gifi (accno,description) VALUES ('3500', 'Wareneingang, 5% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3530', 'Wareneingang, 9% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3540', 'Wareneingang, 9,5% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3550', 'Steuerfreier innergemeinschaftlicher Erwerb'); INSERT INTO gifi (accno,description) VALUES ('3600', 'Nicht abziehbare Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3610', 'Nicht abziehbare Vorsteuer, 7%'); INSERT INTO gifi (accno,description) VALUES ('3650', 'Nicht abziehbare Vorsteuer, 16%'); INSERT INTO gifi (accno,description) VALUES ('3660', 'Nicht abziehbare Vorsteuer, 15%'); INSERT INTO gifi (accno,description) VALUES ('3700', 'Nachlässe'); INSERT INTO gifi (accno,description) VALUES ('3710', 'Nachlässe, 7% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3720', 'Nachlässe, 15%+16% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3722', 'Nachlässe, 16% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3723', 'Nachlässe, 15% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3724', 'Nachlässe aus ig. Erwerb, 7% VSt und 7% USt'); INSERT INTO gifi (accno,description) VALUES ('3725', 'Nachlässe aus ig. Erwerb, 15%+16% VSt und 15%+16% USt'); INSERT INTO gifi (accno,description) VALUES ('3726', 'Nachlässe aus ig. Erwerb, 16% VSt und 16% Ust'); INSERT INTO gifi (accno,description) VALUES ('3727', 'Nachlässe aus ig. Erwerb, 15% VSt und 15% Ust'); INSERT INTO gifi (accno,description) VALUES ('3730', 'Erhaltene Skonti'); INSERT INTO gifi (accno,description) VALUES ('3731', 'Erhaltene Skonti, 7% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3735', 'Erhaltene Skonti, 16% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3736', 'Erhaltene Skonti, 15% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3740', 'Erhaltene Boni'); INSERT INTO gifi (accno,description) VALUES ('3750', 'Erhaltene Boni, 7% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3760', 'Erhaltene Boni, 15%+16% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3762', 'Erhaltene Boni, 16% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3764', 'Erhaltene Boni, 15% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3770', 'Erhaltene Rabatte'); INSERT INTO gifi (accno,description) VALUES ('3780', 'Erhaltene Rabatte, 7% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3790', 'Erhaltene Rabatte, 15%+16% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3792', 'Erhaltene Rabatte, 16% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3794', 'Erhaltene Rabatte, 15% Vorsteuer'); INSERT INTO gifi (accno,description) VALUES ('3800', 'Anschaffungsnebenkosten'); INSERT INTO gifi (accno,description) VALUES ('3830', 'Leergut'); INSERT INTO gifi (accno,description) VALUES ('3850', 'Zölle und Einfuhrabgaben'); INSERT INTO gifi (accno,description) VALUES ('3960', 'Bestandsv. Roh-, Hilfs- u. Betriebsstoffe / bezogene Waren'); INSERT INTO gifi (accno,description) VALUES ('3970', 'Bestand Roh-, Hilfs- und Betriebsstoffe'); INSERT INTO gifi (accno,description) VALUES ('3980', 'Bestand Waren'); INSERT INTO gifi (accno,description) VALUES ('3990', 'Verrechnete Stoffkosten'); INSERT INTO gifi (accno,description) VALUES ('4000', 'Material- und Stoffverbrauch'); INSERT INTO gifi (accno,description) VALUES ('4100', 'Löhne und Gehälter'); INSERT INTO gifi (accno,description) VALUES ('4110', 'Löhne'); INSERT INTO gifi (accno,description) VALUES ('4120', 'Gehälter'); INSERT INTO gifi (accno,description) VALUES ('4124', 'Geschäftsführergehälter der GmbH-Gesellschafter'); INSERT INTO gifi (accno,description) VALUES ('4125', 'Ehegattengehalt'); INSERT INTO gifi (accno,description) VALUES ('4126', 'Tantiemen'); INSERT INTO gifi (accno,description) VALUES ('4127', 'Geschäftsführergehälter'); INSERT INTO gifi (accno,description) VALUES ('4128', 'Vergütungen an angestellte Mitunternehmer §15 EStG'); INSERT INTO gifi (accno,description) VALUES ('4130', 'Gesetzliche soziale Aufwendungen'); INSERT INTO gifi (accno,description) VALUES ('4137', 'Gesetzliche soziale Aufw. für Mitunternehmer §15 EStG'); INSERT INTO gifi (accno,description) VALUES ('4138', 'Beiträge zur Berufsgenossenschaft'); INSERT INTO gifi (accno,description) VALUES ('4139', 'Ausgleichsabgabe i. S. d. Schwerbehindertengesetzes'); INSERT INTO gifi (accno,description) VALUES ('4140', 'Freiw. soziale Aufwendungen (lohnsteuerfrei)'); INSERT INTO gifi (accno,description) VALUES ('4145', 'Freiw. soziale Aufwendungen (lohnsteuerpflichtig)'); INSERT INTO gifi (accno,description) VALUES ('4149', 'Pauschale Lohnsteuer auf s. Bezüge (z.B. Fahrtkostenzuschuß)'); INSERT INTO gifi (accno,description) VALUES ('4150', 'Krankengeldzuschüsse'); INSERT INTO gifi (accno,description) VALUES ('4160', 'Versorgungskassen'); INSERT INTO gifi (accno,description) VALUES ('4165', 'Aufwendungen für die Altersversorgung'); INSERT INTO gifi (accno,description) VALUES ('4167', 'Pauschale Lohnsteuer auf s. Bezüge (z.B. Direktversicherung)'); INSERT INTO gifi (accno,description) VALUES ('4168', 'Aufw. f. die Altersversorgung f. Mitunternehmer §15 EStG'); INSERT INTO gifi (accno,description) VALUES ('4169', 'Aufwendungen für Unterstützung'); INSERT INTO gifi (accno,description) VALUES ('4170', 'Vermögenswirksame Leistungen'); INSERT INTO gifi (accno,description) VALUES ('4175', 'Fahrtkostenerstattung - Wohnung / Arbeitsstätte'); INSERT INTO gifi (accno,description) VALUES ('4180', 'Bedienungsgelder'); INSERT INTO gifi (accno,description) VALUES ('4190', 'Aushilfslöhne'); INSERT INTO gifi (accno,description) VALUES ('4199', 'Lohnsteuer für Aushilfen'); INSERT INTO gifi (accno,description) VALUES ('4200', 'Raumkosten'); INSERT INTO gifi (accno,description) VALUES ('4210', 'Miete'); INSERT INTO gifi (accno,description) VALUES ('4218', 'Gewerbesteuerlich zu berücks. Miete §8 GewStG'); INSERT INTO gifi (accno,description) VALUES ('4219', 'Vergütung an Mitu. f. mietw. Überl. v. Wirtschaftsg. §15EStG'); INSERT INTO gifi (accno,description) VALUES ('4220', 'Pacht'); INSERT INTO gifi (accno,description) VALUES ('4228', 'Gewerbesteuerlich zu berücks. Pacht §8 GewStG'); INSERT INTO gifi (accno,description) VALUES ('4229', 'Vergütung an Mitu. f. pachtw. Überl. v. Wirtschaftsg.§15EStG'); INSERT INTO gifi (accno,description) VALUES ('4230', 'Heizung'); INSERT INTO gifi (accno,description) VALUES ('4240', 'Gas, Strom, Wasser (Verwaltung, Vertrieb)'); INSERT INTO gifi (accno,description) VALUES ('4250', 'Reinigung'); INSERT INTO gifi (accno,description) VALUES ('4260', 'Instandhaltung betrieblicher Räume'); INSERT INTO gifi (accno,description) VALUES ('4270', 'Abgaben für betrieblich genutzten Grundbesitz'); INSERT INTO gifi (accno,description) VALUES ('4280', 'Sonstige Raumkosten'); INSERT INTO gifi (accno,description) VALUES ('4300', 'Nicht abziehb. VSt a. sonst. betriebl. Aufw./AfA'); INSERT INTO gifi (accno,description) VALUES ('4301', 'Nicht abziehb. VSt, 7% a. sonst. betriebl. Aufw./AfA'); INSERT INTO gifi (accno,description) VALUES ('4305', 'Nicht abziehb. VSt, 16% a. sonst. betriebl. Aufw./AfA'); INSERT INTO gifi (accno,description) VALUES ('4306', 'Nicht abziehb. VSt, 15% a. sonst. betriebl. Aufw./AfA'); INSERT INTO gifi (accno,description) VALUES ('4320', 'Gewerbesteuer (Vorauszahlung)'); INSERT INTO gifi (accno,description) VALUES ('4330', 'Gewerbeertragsteuer'); INSERT INTO gifi (accno,description) VALUES ('4335', 'Gewerbekapitalsteuer'); INSERT INTO gifi (accno,description) VALUES ('4340', 'Sonstige Betriebsteuern'); INSERT INTO gifi (accno,description) VALUES ('4350', 'Verbrauchsteuer'); INSERT INTO gifi (accno,description) VALUES ('4360', 'Versicherungen'); INSERT INTO gifi (accno,description) VALUES ('4370', 'Nettoprämie für Rückdeckung künftiger Versorgungsleistungen'); INSERT INTO gifi (accno,description) VALUES ('4380', 'Beiträge'); INSERT INTO gifi (accno,description) VALUES ('4390', 'Sonstige Abgaben'); INSERT INTO gifi (accno,description) VALUES ('4396', 'Steuerlich abzugsfähige Verspätungszuschläge und Zwangsgelder'); INSERT INTO gifi (accno,description) VALUES ('4397', 'Steuerlich nicht abzugsfähige Verspätungszuschläge und Zwangsgelder'); INSERT INTO gifi (accno,description) VALUES ('4400', 'Besondere Kosten (zur freien Verfügung)'); INSERT INTO gifi (accno,description) VALUES ('4500', 'Fahrzeugkosten'); INSERT INTO gifi (accno,description) VALUES ('4510', 'Kfz-Steuern'); INSERT INTO gifi (accno,description) VALUES ('4520', 'Kfz-Versicherungen'); INSERT INTO gifi (accno,description) VALUES ('4530', 'Laufende Kfz-Betriebskosten'); INSERT INTO gifi (accno,description) VALUES ('4540', 'Kfz-Reparaturen'); INSERT INTO gifi (accno,description) VALUES ('4550', 'Garagenmieten'); INSERT INTO gifi (accno,description) VALUES ('4570', 'Fremdfahrzeuge'); INSERT INTO gifi (accno,description) VALUES ('4580', 'Sonstige Kfz-Kosten'); INSERT INTO gifi (accno,description) VALUES ('4600', 'Werbe- und Reisekosten'); INSERT INTO gifi (accno,description) VALUES ('4610', 'Werbekosten'); INSERT INTO gifi (accno,description) VALUES ('4630', 'Geschenke bis DM 75,00'); INSERT INTO gifi (accno,description) VALUES ('4635', 'Geschenke über DM 75,00'); INSERT INTO gifi (accno,description) VALUES ('4638', 'Geschenke ausschließlich betrieblich genutzt'); INSERT INTO gifi (accno,description) VALUES ('4640', 'Repräsentationskosten'); INSERT INTO gifi (accno,description) VALUES ('4650', 'Bewirtungskosten'); INSERT INTO gifi (accno,description) VALUES ('4653', 'Aufwerksamkeiten'); INSERT INTO gifi (accno,description) VALUES ('4654', 'Nicht abzugsfähige Bewirtungskosten'); INSERT INTO gifi (accno,description) VALUES ('4655', 'Nicht abzugsfähige Betriebsausgaben'); INSERT INTO gifi (accno,description) VALUES ('4660', 'Reisekosten Arbeitnehmer'); INSERT INTO gifi (accno,description) VALUES ('4666', 'Reisekost. Arbeitn., 12,3%/13,1% VSt Verpfl.Mehr- / Übern.Aufw.'); INSERT INTO gifi (accno,description) VALUES ('4667', 'Reisekost. Arbeitn., 9,8%/10,5% VSt Gesamtpauschal.'); INSERT INTO gifi (accno,description) VALUES ('4670', 'Reisekosten Unternehmer'); INSERT INTO gifi (accno,description) VALUES ('4675', 'Reisekosten Unternehmer, 9,8/10,5% VSt sonst.Gesamtpauschal.'); INSERT INTO gifi (accno,description) VALUES ('4676', 'Reisekost. Untern., 12,3%/13,1% VSt Verpfl.Mehr- / Übern.Aufw.'); INSERT INTO gifi (accno,description) VALUES ('4677', 'Reisekosten Unternehmer, 9,8%/10,5% VSt Verpfl.Mehraufw. Gesamtpauschal.'); INSERT INTO gifi (accno,description) VALUES ('4678', 'Km-Geld Erstattung, Unternehmer, 5,7%/6,1% VSt'); INSERT INTO gifi (accno,description) VALUES ('4685', 'Km-Geld-Erstattung, Arbeitnehmer 8,2%/8,7% VSt'); INSERT INTO gifi (accno,description) VALUES ('4700', 'Kosten der Warenabgabe'); INSERT INTO gifi (accno,description) VALUES ('4710', 'Verpackungsmaterial'); INSERT INTO gifi (accno,description) VALUES ('4730', 'Ausgangsfrachten'); INSERT INTO gifi (accno,description) VALUES ('4750', 'Transportversicherungen'); INSERT INTO gifi (accno,description) VALUES ('4760', 'Verkaufsprovisionen'); INSERT INTO gifi (accno,description) VALUES ('4780', 'Fremdarbeiten'); INSERT INTO gifi (accno,description) VALUES ('4790', 'Aufwand für Gewährleistungen'); INSERT INTO gifi (accno,description) VALUES ('4800', 'Reparat. u. Inst. v. Maschinen u. technischen Anlagen'); INSERT INTO gifi (accno,description) VALUES ('4805', 'Reparat. u. Inst. v. and. Anl. d. Betr.- u. Geschäftsausst.'); INSERT INTO gifi (accno,description) VALUES ('4809', 'Sonstige Reparaturen und Instandhaltungen'); INSERT INTO gifi (accno,description) VALUES ('4810', 'Mietleasing'); INSERT INTO gifi (accno,description) VALUES ('4814', 'Gewerbesteuerl. zu berücksicht. Mietleasing §8 GewStG'); INSERT INTO gifi (accno,description) VALUES ('4815', 'Kaufleasing'); INSERT INTO gifi (accno,description) VALUES ('4820', 'Abschr. a. Aufw. f.d. Ingangs. u. Erw. des Geschäftsbetr.'); INSERT INTO gifi (accno,description) VALUES ('4822', 'Abschr. a. immaterielle Vermögensgegenstände'); INSERT INTO gifi (accno,description) VALUES ('4824', 'Abschreibung auf den Geschäfts- oder Firmenwert'); INSERT INTO gifi (accno,description) VALUES ('4826', 'Außerplanm. Abschr. a. immaterielle Vermögensgegenstände'); INSERT INTO gifi (accno,description) VALUES ('4830', 'Abschreibungen auf Sachanlagen'); INSERT INTO gifi (accno,description) VALUES ('4840', 'Außerplanm. Abschreibungen auf Sachanlagen'); INSERT INTO gifi (accno,description) VALUES ('4850', 'Abschr. a. Sachanl. aufgrund steuerl. Sondervorschriften'); INSERT INTO gifi (accno,description) VALUES ('4855', 'Sofortabschreibung geringwertiger Wirtschaftsgüter'); INSERT INTO gifi (accno,description) VALUES ('4860', 'Abschreibung auf aktivierte, geringwertige Wirtschaftsgüter'); INSERT INTO gifi (accno,description) VALUES ('4865', 'Außerplanmäßige Abschr. a. aktivierte GWG'); INSERT INTO gifi (accno,description) VALUES ('4870', 'Abschreibungen auf Finanzanlagen'); INSERT INTO gifi (accno,description) VALUES ('4872', 'Abschr. aufgrund v. Verlustant. an Mitunt. §8 GewStG'); INSERT INTO gifi (accno,description) VALUES ('4874', 'Abschr. a. Finanzanl. aufgrund steuerl. Sondervorschriften'); INSERT INTO gifi (accno,description) VALUES ('4875', 'Abschreibungen auf Wertpapiere des Umlaufvermögens'); INSERT INTO gifi (accno,description) VALUES ('4879', 'Vorwegn. künft. Wertschw. bei Wertpapieren des Umlaufv.'); INSERT INTO gifi (accno,description) VALUES ('4880', 'Abschr. a. Umlaufv. ohne Wertpapiere (soweit unübl. Höhe)'); INSERT INTO gifi (accno,description) VALUES ('4882', 'Abschr. a. Umlaufv. steuerrechtl. bedingt (unübl. Höhe)'); INSERT INTO gifi (accno,description) VALUES ('4885', 'Vorwegn. künft. Wertschw. Uml.V. auß. Vorr./Wertp. d. Uml.V.'); INSERT INTO gifi (accno,description) VALUES ('4886', 'Abschr. a. Uml.V. auß. Vorr./Wertp. d. Uml.V. (übl. Höhe)'); INSERT INTO gifi (accno,description) VALUES ('4887', 'Abschr. a. Umlaufv., steuerrechtlich bedingt (übl. Höhe)'); INSERT INTO gifi (accno,description) VALUES ('4890', 'Vorwegn. künftiger Wertschw. im Umlaufv. (unübl. Höhe)'); INSERT INTO gifi (accno,description) VALUES ('4900', 'Sonstige betriebliche Aufwendungen'); INSERT INTO gifi (accno,description) VALUES ('4905', 'Sonstige Aufwendungen betrieblich und regelmäßig'); INSERT INTO gifi (accno,description) VALUES ('4910', 'Porto'); INSERT INTO gifi (accno,description) VALUES ('4920', 'Telefon'); INSERT INTO gifi (accno,description) VALUES ('4925', 'Telefax, Fernschreiber'); INSERT INTO gifi (accno,description) VALUES ('4930', 'Bürobedarf'); INSERT INTO gifi (accno,description) VALUES ('4940', 'Zeitschriften, Bücher'); INSERT INTO gifi (accno,description) VALUES ('4945', 'Fortbildungskosten'); INSERT INTO gifi (accno,description) VALUES ('4946', 'Freiwillige Sozialleistungen'); INSERT INTO gifi (accno,description) VALUES ('4948', 'Vergütungen an freiberufliche Mitunternehmer §15 EStG'); INSERT INTO gifi (accno,description) VALUES ('4950', 'Rechts- und Beratungskosten'); INSERT INTO gifi (accno,description) VALUES ('4955', 'Buchführungskosten'); INSERT INTO gifi (accno,description) VALUES ('4957', 'Abschluß- und Prüfungskosten'); INSERT INTO gifi (accno,description) VALUES ('4960', 'Mieten für Einrichtungen'); INSERT INTO gifi (accno,description) VALUES ('4968', 'Gewerbest. zu berücks. Miete f. Einrichtungen §8 GewStG'); INSERT INTO gifi (accno,description) VALUES ('4969', 'Aufwendungen für Abraum- und Abfallbeseitigung'); INSERT INTO gifi (accno,description) VALUES ('4970', 'Nebenkosten des Geldverkehrs'); INSERT INTO gifi (accno,description) VALUES ('4980', 'Betriebsbedarf'); INSERT INTO gifi (accno,description) VALUES ('4985', 'Werkzeuge und Kleingeräte'); INSERT INTO gifi (accno,description) VALUES ('4990', 'Kalkulatorischer Unternehmerlohn'); INSERT INTO gifi (accno,description) VALUES ('4991', 'Kalkulatorische Miete und Pacht'); INSERT INTO gifi (accno,description) VALUES ('4992', 'Kalkulatorischer Zinsen'); INSERT INTO gifi (accno,description) VALUES ('4993', 'Kalkulatorische Abschreibungen'); INSERT INTO gifi (accno,description) VALUES ('4994', 'Kalkulatorische Wagnisse'); INSERT INTO gifi (accno,description) VALUES ('4995', 'Kalkulatorischer Lohn für unentgeltliche Mitarbeiter'); INSERT INTO gifi (accno,description) VALUES ('4996', 'Herstellungskosten'); INSERT INTO gifi (accno,description) VALUES ('4997', 'Verwaltungskosten'); INSERT INTO gifi (accno,description) VALUES ('4998', 'Vertriebskosten'); INSERT INTO gifi (accno,description) VALUES ('4999', 'Gegenkonto 49960-49980'); INSERT INTO gifi (accno,description) VALUES ('7000', 'Unfertige Erzeugnisse, unfertige Leistungen (Bestand)'); INSERT INTO gifi (accno,description) VALUES ('7050', 'Unfertige Erzeugnisse (Bestand)'); INSERT INTO gifi (accno,description) VALUES ('7080', 'Unfertige Leistungen (Bestand)'); INSERT INTO gifi (accno,description) VALUES ('7090', 'In Ausführung befindliche Bauaufträge'); INSERT INTO gifi (accno,description) VALUES ('7095', 'In Arbeit befindliche Bauaufträge'); INSERT INTO gifi (accno,description) VALUES ('7100', 'Fertige Erzeugnisse und Waren (Bestand)'); INSERT INTO gifi (accno,description) VALUES ('7110', 'Fertige Erzeugnisse (Bestand)'); INSERT INTO gifi (accno,description) VALUES ('7140', 'Fertige Waren (Bestand)'); INSERT INTO gifi (accno,description) VALUES ('8000', 'Erlöse (zur freien Verfügung)'); INSERT INTO gifi (accno,description) VALUES ('8100', 'Steuerfreie Umsätze o. VSt-Abzug §4 Nr.8 ff. UStG'); INSERT INTO gifi (accno,description) VALUES ('8110', 'Sonstige steuerfreie o. VSt-Abzug Umsätze Inland'); INSERT INTO gifi (accno,description) VALUES ('8120', 'Steuerfreie Umsätze m. VSt-Abzug §4 Nr.1a, 1c, 2-7 UStG'); INSERT INTO gifi (accno,description) VALUES ('8125', 'Steuerfreie innergem. Lief. §4 Nr.1b UStG'); INSERT INTO gifi (accno,description) VALUES ('8130', 'Lieferung d. ersten Abnehmers bei innergem. Dreiecksgesch. §25 b Abs. 2 UStG'); INSERT INTO gifi (accno,description) VALUES ('8135', 'Steuerfreie ig. Lief. v. Neufahrz. an Abn. ohne UST-ID'); INSERT INTO gifi (accno,description) VALUES ('8140', 'Steuerfreie Umsätze Offshore usw.'); INSERT INTO gifi (accno,description) VALUES ('8150', 'Sonstige steuerfreie Umsätze Ausland (§4,2-7)'); INSERT INTO gifi (accno,description) VALUES ('8195', 'Erlöse aus Geldspielautomaten, 16% Ust'); INSERT INTO gifi (accno,description) VALUES ('8196', 'Erlöse aus Geldspielautomaten, 15%/16% USt'); INSERT INTO gifi (accno,description) VALUES ('8197', 'Erlöse aus Geldspielautomaten, 15% Ust'); INSERT INTO gifi (accno,description) VALUES ('8200', 'Erlöse'); INSERT INTO gifi (accno,description) VALUES ('8300', 'Erlöse, 7% USt'); INSERT INTO gifi (accno,description) VALUES ('8310', 'Erlöse a.i.Inland steuerpfl. EU-Lieferungen, 7% USt'); INSERT INTO gifi (accno,description) VALUES ('8315', 'Erlöse a.i.Inland steuerpfl. EU-Lieferungen, 15%/16% USt'); INSERT INTO gifi (accno,description) VALUES ('8320', 'Erlöse a.i. anderen EU-Land steuerpfl. Lieferungen'); INSERT INTO gifi (accno,description) VALUES ('8330', 'Erlöse a.i.Inland steuerpfl. EU-Lieferungen, 16% Ust'); INSERT INTO gifi (accno,description) VALUES ('8335', 'Erlöse a.i.Inland steuerpfl. EU-Lieferungen, 15% Ust'); INSERT INTO gifi (accno,description) VALUES ('8339', 'Erlöse a.i. and. EU-Land steuerpfl. sonst. Leist. (Nullreg.)'); INSERT INTO gifi (accno,description) VALUES ('8340', 'Erlöse, 15% Ust'); INSERT INTO gifi (accno,description) VALUES ('8400', 'Erlöse, 15%/16% USt'); INSERT INTO gifi (accno,description) VALUES ('8410', 'Erlöse, 16% Ust'); INSERT INTO gifi (accno,description) VALUES ('8500', 'Provisionserlöse'); INSERT INTO gifi (accno,description) VALUES ('8504', 'Provisionserlöse steuerfrei (§4 Nr.8ff UStG)'); INSERT INTO gifi (accno,description) VALUES ('8505', 'Provisionserlöse steuerfrei (§4 Nr.5 UStG)'); INSERT INTO gifi (accno,description) VALUES ('8506', 'Provisionserlöse, 7% USt'); INSERT INTO gifi (accno,description) VALUES ('8507', 'Provisionserlöse, 15% Ust'); INSERT INTO gifi (accno,description) VALUES ('8508', 'Provisionserlöse, 15%/16% USt'); INSERT INTO gifi (accno,description) VALUES ('8509', 'Provisionserlöse, 16% Ust'); INSERT INTO gifi (accno,description) VALUES ('8520', 'Erlöse Abfallverwertung'); INSERT INTO gifi (accno,description) VALUES ('8540', 'Erlöse Leergut'); INSERT INTO gifi (accno,description) VALUES ('8590', 'Verrechnete Sachbezüge (keine Waren)'); INSERT INTO gifi (accno,description) VALUES ('8591', 'Sachbezüge, 7% USt (Waren)'); INSERT INTO gifi (accno,description) VALUES ('8595', 'Sachbezüge, 15%/16% USt (Waren)'); INSERT INTO gifi (accno,description) VALUES ('8596', 'Sachbezüge, 16% USt (Waren)'); INSERT INTO gifi (accno,description) VALUES ('8597', 'Sachbezüge, 15% USt (Waren)'); INSERT INTO gifi (accno,description) VALUES ('8600', 'Sonstige Erlöse betrieblich und regelmäßig'); INSERT INTO gifi (accno,description) VALUES ('8610', 'Verrechnete sonstige Sachbezüge'); INSERT INTO gifi (accno,description) VALUES ('8611', 'Verrechnete sonstige Sachbezüge 15%/16% USt (z.B. Kfz. Gestellung)'); INSERT INTO gifi (accno,description) VALUES ('8612', 'Verrechnete sonstige Sachbezüge 16% USt (z.B. Kfz. Gestellung)'); INSERT INTO gifi (accno,description) VALUES ('8613', 'Verrechnete sonstige Sachbezüge 15% USt (z.B. Kfz. Gestellung)'); INSERT INTO gifi (accno,description) VALUES ('8614', 'Verrechnete sonstige Sachbezüge, ohne Umsatzsteuer'); INSERT INTO gifi (accno,description) VALUES ('8625', 'Sonstige Erlöse betrieblich und regelmäßig, steuerfrei'); INSERT INTO gifi (accno,description) VALUES ('8630', 'Sonstige Erlöse betrieblich und regelmäßig, 7% USt'); INSERT INTO gifi (accno,description) VALUES ('8640', 'Sonstige Erlöse betrieblich und regelmäßig, 15%/16% USt'); INSERT INTO gifi (accno,description) VALUES ('8645', 'Sonstige Erlöse betrieblich und regelmäßig, 16% Ust'); INSERT INTO gifi (accno,description) VALUES ('8647', 'Sonstige Erlöse betrieblich und regelmäßig, 15% Ust'); INSERT INTO gifi (accno,description) VALUES ('8650', 'Erlöse Zinsen und Diskontspesen'); INSERT INTO gifi (accno,description) VALUES ('8660', 'Erlöse Zinsen und Diskontspesen aus verbundenen Unternehmen'); INSERT INTO gifi (accno,description) VALUES ('8700', 'Erlösschmälerungen'); INSERT INTO gifi (accno,description) VALUES ('8705', 'Erlösschmälerungen aus steuerfreien Umsätzen §4 Nr. 1a UStG'); INSERT INTO gifi (accno,description) VALUES ('8710', 'Erlösschmälerungen, 7% USt'); INSERT INTO gifi (accno,description) VALUES ('8720', 'Erlösschmälerungen, 15%/16% USt'); INSERT INTO gifi (accno,description) VALUES ('8722', 'Erlösschmälerungen, 16% Ust'); INSERT INTO gifi (accno,description) VALUES ('8723', 'Erlösschmälerungen, 15% Ust'); INSERT INTO gifi (accno,description) VALUES ('8724', 'Erlösschmälerungen aus steuerfreien innergm. Lieferungen'); INSERT INTO gifi (accno,description) VALUES ('8725', 'Erlösschmäl. a. im Inland steuerpfl. EU-Lieferungen, 7% USt'); INSERT INTO gifi (accno,description) VALUES ('8726', 'Erlösschmäl. a. im Inland steuerpfl. EU-Lieferungen, 15%/16% USt'); INSERT INTO gifi (accno,description) VALUES ('8727', 'Erlösschmäl. a. im anderen EU-Land steuerpfl. Lief.'); INSERT INTO gifi (accno,description) VALUES ('8728', 'Erlösschmäl. a. im Inland steuerpfl. EU-Lieferungen, 16% Ust'); INSERT INTO gifi (accno,description) VALUES ('8729', 'Erlösschmäl. a. im Inland steuerpfl. EU-Lieferungen, 15% Ust'); INSERT INTO gifi (accno,description) VALUES ('8730', 'Gewährte Skonti'); INSERT INTO gifi (accno,description) VALUES ('8731', 'Gewährte Skonti, 7% USt'); INSERT INTO gifi (accno,description) VALUES ('8735', 'Gewährte Skonti, 16% Ust'); INSERT INTO gifi (accno,description) VALUES ('8736', 'Gewährte Skonti, 15% USt'); INSERT INTO gifi (accno,description) VALUES ('8740', 'Gewährte Boni'); INSERT INTO gifi (accno,description) VALUES ('8750', 'Gewährte Boni, 7% USt'); INSERT INTO gifi (accno,description) VALUES ('8760', 'Gewährte Boni, 15%/16% USt'); INSERT INTO gifi (accno,description) VALUES ('8762', 'Gewährte Boni, 16% Ust'); INSERT INTO gifi (accno,description) VALUES ('8764', 'Gewährte Boni, 15% Ust'); INSERT INTO gifi (accno,description) VALUES ('8770', 'Gewährte Rabatte'); INSERT INTO gifi (accno,description) VALUES ('8780', 'Gewährte Rabatte, 7% USt'); INSERT INTO gifi (accno,description) VALUES ('8790', 'Gewährte Rabatte, 15%/16% USt'); INSERT INTO gifi (accno,description) VALUES ('8792', 'Gewährte Rabatte, 16% Ust'); INSERT INTO gifi (accno,description) VALUES ('8794', 'Gewährte Rabatte, 15% Ust'); INSERT INTO gifi (accno,description) VALUES ('8800', 'Erlöse aus Anlagenverkäufen'); INSERT INTO gifi (accno,description) VALUES ('8801', 'Erlöse aus Anlagenverkäufen 15%/16% USt (bei Buchverlust)'); INSERT INTO gifi (accno,description) VALUES ('8810', 'Erlöse aus Anlagenverkäufen 16% USt (bei Buchverlust)'); INSERT INTO gifi (accno,description) VALUES ('8815', 'Erlöse aus Anlagenverkäufen 15% USt (bei Buchverlust)'); INSERT INTO gifi (accno,description) VALUES ('8820', 'Erlöse aus Anlagenverkäufen 15%/16% USt (bei Buchgewinn)'); INSERT INTO gifi (accno,description) VALUES ('8829', 'Erlöse aus Anlagenverkäufen (bei Buchgewinn)'); INSERT INTO gifi (accno,description) VALUES ('8830', 'Erlöse aus Anlagenverkäufen 16% USt (bei Buchgewinn)'); INSERT INTO gifi (accno,description) VALUES ('8835', 'Erlöse aus Anlagenverkäufen 15% USt (bei Buchgewinn)'); INSERT INTO gifi (accno,description) VALUES ('8840', 'Erträge aus Kursdifferenzen'); INSERT INTO gifi (accno,description) VALUES ('8900', 'Eigenverbrauch'); INSERT INTO gifi (accno,description) VALUES ('8905', 'Entnahme Gegenstände ohne USt'); INSERT INTO gifi (accno,description) VALUES ('8908', 'Entnahme von Gegenstände, 16% USt §1 Abs.1 Nr.2a UStG'); INSERT INTO gifi (accno,description) VALUES ('8909', 'Entnahme von Gegenstände, 15% USt §1 Abs.1 Nr.2a UStG'); INSERT INTO gifi (accno,description) VALUES ('8910', 'Entnahme von Gegenstände, 15%/16% USt §1 Abs.1 Nr.2a UStG'); INSERT INTO gifi (accno,description) VALUES ('8915', 'Entnahme von Gegenstände, 7% USt §1 Abs.1 Nr.2a UStG'); INSERT INTO gifi (accno,description) VALUES ('8920', 'Entnahme v. sonst. Leist., 15%/16% USt §1 A.1 Nr.2b UStG'); INSERT INTO gifi (accno,description) VALUES ('8930', 'Entnahme v. sonst. Leist., 7% USt §1 A.1 Nr.2b UStG'); INSERT INTO gifi (accno,description) VALUES ('8937', 'Entnahme v. sonst. Leist., 16% USt §1 A.1 Nr.2b UStG'); INSERT INTO gifi (accno,description) VALUES ('8938', 'Entnahme v. sonst. Leist., 15% USt §1 A.1 Nr.2b UStG'); INSERT INTO gifi (accno,description) VALUES ('8939', 'Entnahme v. sonst. Leist., ohne USt §1 A.1 Nr.2b UStG'); INSERT INTO gifi (accno,description) VALUES ('8940', 'Eigenverbr., 15%/16% Ust §4 A.1 Nr.5 1-7, A.7 EStG'); INSERT INTO gifi (accno,description) VALUES ('8941', 'Eigenverbr., 7% Ust §4 A.1 Nr.5 1-7, A.7 EStG'); INSERT INTO gifi (accno,description) VALUES ('8942', 'Eigenverbr., 16% Ust §4 A.1 Nr.5 1-7, A.7 EStG'); INSERT INTO gifi (accno,description) VALUES ('8943', 'Eigenverbr., 15% Ust §4 A.1 Nr.5 1-7, A.7 EStG'); INSERT INTO gifi (accno,description) VALUES ('8944', 'Eigenverbr., ohne Ust §4 A.1 Nr.5 1-7, A.7 EStG'); INSERT INTO gifi (accno,description) VALUES ('8945', 'Unentgeltl. Leist. v. Ges. an Ges., 15%/16% USt §1A.1 Nr.3 UStG'); INSERT INTO gifi (accno,description) VALUES ('8946', 'Unentgeltl. Leist. v. Ges. an Ges., 7% USt §1A.1 Nr.3 UStG'); INSERT INTO gifi (accno,description) VALUES ('8947', 'Unentgeltl. Leist. v. Ges. an Ges., 16% USt §1A.1 Nr.3 UStG'); INSERT INTO gifi (accno,description) VALUES ('8948', 'Unentgeltl. Leist. v. Ges. an Ges., 15% USt §1A.1 Nr.3 UStG'); INSERT INTO gifi (accno,description) VALUES ('8949', 'Unentgeltl. Leist. v. Ges. an Ges., ohne USt §1A.1 Nr.3 UStG'); INSERT INTO gifi (accno,description) VALUES ('8950', 'Nicht steuerbare Umsätze'); INSERT INTO gifi (accno,description) VALUES ('8955', 'Umsatzsteuervergütungen'); INSERT INTO gifi (accno,description) VALUES ('8960', 'Bestandsveränd. - unfertige Erzeugnisse'); INSERT INTO gifi (accno,description) VALUES ('8970', 'Bestandsveränd. - unfertige Leistungen'); INSERT INTO gifi (accno,description) VALUES ('8975', 'Bestandsveränd. - in Ausführung befindliche Bauaufträge'); INSERT INTO gifi (accno,description) VALUES ('8977', 'Bestandsveränd. - in Arbeit befindliche Aufträge'); INSERT INTO gifi (accno,description) VALUES ('8980', 'Bestandsveränd. - fertige Erzeugnisse'); INSERT INTO gifi (accno,description) VALUES ('8990', 'Bestandsveränd. - andere aktivierte Eigenleistungen'); INSERT INTO gifi (accno,description) VALUES ('9000', 'Saldenvorträge Sachkonten'); INSERT INTO gifi (accno,description) VALUES ('9008', 'Saldenvorträge Debitoren'); INSERT INTO gifi (accno,description) VALUES ('9009', 'Saldenvorträge Kreditoren'); INSERT INTO gifi (accno,description) VALUES ('9060', 'Offene Posten aus 1990'); INSERT INTO gifi (accno,description) VALUES ('9085', 'Offene Posten aus 1985'); INSERT INTO gifi (accno,description) VALUES ('9086', 'Offene Posten aus 1986'); INSERT INTO gifi (accno,description) VALUES ('9087', 'Offene Posten aus 1987'); INSERT INTO gifi (accno,description) VALUES ('9088', 'Offene Posten aus 1988'); INSERT INTO gifi (accno,description) VALUES ('9089', 'Offene Posten aus 1989'); INSERT INTO gifi (accno,description) VALUES ('9090', 'Summenvortragskonto'); INSERT INTO gifi (accno,description) VALUES ('9091', 'Offene Posten aus 1991'); INSERT INTO gifi (accno,description) VALUES ('9092', 'Offene Posten aus 1992'); INSERT INTO gifi (accno,description) VALUES ('9093', 'Offene Posten aus 1993'); INSERT INTO gifi (accno,description) VALUES ('9094', 'Offene Posten aus 1994'); INSERT INTO gifi (accno,description) VALUES ('9095', 'Offene Posten aus 1995'); INSERT INTO gifi (accno,description) VALUES ('9096', 'Offene Posten aus 1996'); INSERT INTO gifi (accno,description) VALUES ('9097', 'Offene Posten aus 1997'); INSERT INTO gifi (accno,description) VALUES ('9098', 'Offene Posten aus 1998'); INSERT INTO gifi (accno,description) VALUES ('9100', 'Saldovortragskonto der Statistikkonten'); INSERT INTO gifi (accno,description) VALUES ('9101', 'Verkaufstage'); INSERT INTO gifi (accno,description) VALUES ('9102', 'Anzahl der Barkunden'); INSERT INTO gifi (accno,description) VALUES ('9103', 'Beschäftigte Personen'); INSERT INTO gifi (accno,description) VALUES ('9104', 'Unbezahlte Personen'); INSERT INTO gifi (accno,description) VALUES ('9105', 'Verkaufskräfte'); INSERT INTO gifi (accno,description) VALUES ('9106', 'Geschäftsraum qm'); INSERT INTO gifi (accno,description) VALUES ('9107', 'Verkaufsraum qm'); INSERT INTO gifi (accno,description) VALUES ('9108', 'Veränderungsrate positiv'); INSERT INTO gifi (accno,description) VALUES ('9109', 'Veränderungsrate negativ'); INSERT INTO gifi (accno,description) VALUES ('9110', 'Plan-WE (in Prozent)'); INSERT INTO gifi (accno,description) VALUES ('9120', 'Erweiterungsinvestitionen'); INSERT INTO gifi (accno,description) VALUES ('9135', 'Auftragseingang im Geschäftsjahr'); INSERT INTO gifi (accno,description) VALUES ('9140', 'Auftragsbestand'); INSERT INTO gifi (accno,description) VALUES ('9190', 'Gegenkonto für statistische Mengeneinheiten Konten 91010-91190'); INSERT INTO gifi (accno,description) VALUES ('9199', 'Gegenkonto zu 91200, 91350-91400'); INSERT INTO gifi (accno,description) VALUES ('9200', 'Beschäftigte Personen'); INSERT INTO gifi (accno,description) VALUES ('9209', 'Gegenkonto zu 92000'); INSERT INTO gifi (accno,description) VALUES ('9210', 'Produktive Löhne'); INSERT INTO gifi (accno,description) VALUES ('9219', 'Gegenkonto zu 92100'); INSERT INTO gifi (accno,description) VALUES ('9230', 'Baukostenzuschüsse'); INSERT INTO gifi (accno,description) VALUES ('9232', 'Investitionszulagen'); INSERT INTO gifi (accno,description) VALUES ('9234', 'Investitionszuschüsse'); INSERT INTO gifi (accno,description) VALUES ('9239', 'Gegenkonto zu 92300-92380'); INSERT INTO gifi (accno,description) VALUES ('9240', 'Investitionsverbindlichkeiten bei den Leistungsverbindlichkeiten'); INSERT INTO gifi (accno,description) VALUES ('9244', 'Gegenkonto zu 92400'); INSERT INTO gifi (accno,description) VALUES ('9245', 'Forderungen aus Anlagenverkäufen bei den sonstigen Vermögensgegenst.'); INSERT INTO gifi (accno,description) VALUES ('9249', 'Gegenkonto zu 92450'); INSERT INTO gifi (accno,description) VALUES ('9250', 'Eigenkapitalersetzende Gesellschafterdarlehen'); INSERT INTO gifi (accno,description) VALUES ('9255', 'Ungesicherte Gesellschafterdarlehen mit Restlaufzeit > 5 Jahre'); INSERT INTO gifi (accno,description) VALUES ('9259', 'Gegenkonto zu 92500-92580'); INSERT INTO gifi (accno,description) VALUES ('9260', 'Kurzfristige Rückstellungen'); INSERT INTO gifi (accno,description) VALUES ('9262', 'Mittelfristige Rückstellungen'); INSERT INTO gifi (accno,description) VALUES ('9264', 'Langfristige Rückstellungen'); INSERT INTO gifi (accno,description) VALUES ('9269', 'Gegenkonto zu 92600-92680'); INSERT INTO gifi (accno,description) VALUES ('9270', 'Gegenkonto zu 92710-92780'); INSERT INTO gifi (accno,description) VALUES ('9271', 'Verb. a. d. Begebung u. Übertragung v. Wechseln'); INSERT INTO gifi (accno,description) VALUES ('9272', 'Verb. a. d. Begebung u. Übertr. v. Wechseln gg. verb. U.'); INSERT INTO gifi (accno,description) VALUES ('9273', 'Verb. a. Bürgsch., Wechsel- u. Scheckbürgsch.'); INSERT INTO gifi (accno,description) VALUES ('9274', 'Verb. a. Bürgsch., Wechsel- u. Scheckbürgsch. gg. verb. U.'); INSERT INTO gifi (accno,description) VALUES ('9275', 'Verb. aus Gewährleistungsverträgen'); INSERT INTO gifi (accno,description) VALUES ('9276', 'Verb. aus Gewährleistungsverträgen gg. verbund. Untern.'); INSERT INTO gifi (accno,description) VALUES ('9277', 'Haftung a. d. Best. von Sicherheiten für fremde Verbindl.'); INSERT INTO gifi (accno,description) VALUES ('9278', 'Haftung a.d. Best. v. Sicherh. f. fr. Verbindl. gg. verb. U.'); INSERT INTO gifi (accno,description) VALUES ('9280', 'Gegenkonto zu 92810-92840'); INSERT INTO gifi (accno,description) VALUES ('9281', 'Verpflichtungen aus Miet- und Leasingverträgen'); INSERT INTO gifi (accno,description) VALUES ('9282', 'Verpflichtungen aus Miet- und Leasingverträgen gg. verb. Unternehm.'); INSERT INTO gifi (accno,description) VALUES ('9283', 'Andere Verpflichtungen gem. §285 Nr.3 HGB'); INSERT INTO gifi (accno,description) VALUES ('9284', 'Andere Verpflichtungen gem. §285 Nr.3 HGB gg. verb. Unternehmen'); INSERT INTO gifi (accno,description) VALUES ('9410', 'Aussteh. Einl. §26 A.3 DMBilG nicht eingef. (Aktivausw.)'); INSERT INTO gifi (accno,description) VALUES ('9411', 'Aussteh. Einl. §26 A.3 DMBilG eingef. (Aktivausweis)'); INSERT INTO gifi (accno,description) VALUES ('9413', 'Aufw. f. Ingangs. u. Erw. d. Gesch.Betr. §31A.1 Nr.2 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9415', 'Nichtentgeltl. erw. immat. Verm.Gegenst. §31A.1 Nr.1 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9416', 'Nutzungsrechte gem. § 9 Abs.3 Satz 2 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9420', 'Ford. gg. verb. Untern. a. Ausgleichsverb. gem. §25 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9421', 'Ford. gg. verb. U. a. Ausgl.Verb. §25 DMBilG Restl. b. 1 J.'); INSERT INTO gifi (accno,description) VALUES ('9422', 'Ford. gg. verb. U. a. Ausgl.Verb. §25 DMBilG Restl. gr. 1 J.'); INSERT INTO gifi (accno,description) VALUES ('9426', 'Eingeforderte Einlagen §26 Abs. 3 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9427', 'Ausgleichsforderungen §24 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9428', 'Ausgleichsford. §24 DMBilG - Restlaufz. bis 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('9429', 'Ausgleichsford. §24 DMBilG - Restlaufz. größer 1 Jahr'); INSERT INTO gifi (accno,description) VALUES ('9430', 'Ford. nach dem VermG §7 Abs. 6 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9431', 'Ford. nach dem VermG §7 A.6 DMBilG - Restl. bis 1 J.'); INSERT INTO gifi (accno,description) VALUES ('9432', 'Ford. nach dem VermG §7 A.6 DMBilG - Restl. gr. 1 J.'); INSERT INTO gifi (accno,description) VALUES ('9433', 'Vermögensvorteile §31 Abs.1 Nr. 3 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9434', 'Kapitalentwertungskonto'); INSERT INTO gifi (accno,description) VALUES ('9435', 'Kapitalentwertungskonto §28 Abs.1 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9436', 'Kapitalentwertungskonto §26 Abs.4 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9438', 'Sonderverlustkonto aus Rückstellungen §17 Abs.4 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9440', 'Beteiligunsentwertungskonto §24 Abs.5 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9445', 'Vorläufige Gewinnrücklage §31 Abs.1 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9446', 'Sonderrücklage §7 Abs.6 Satz 2 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9447', 'Sonderrücklage §17 Abs.4 Satz 3 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9448', 'Sonderrücklage §24 Abs. 5 Satz 3 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9449', 'Sonderrücklage §27 Abs. 2 Satz 3 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9450', 'Rückst. f. Umweltbeeinträchtigung §17 A.2a DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9451', 'Nachrangiges Kapital §16 Abs. 3 Satz 2 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9453', 'Berichtig. v. Wertans. §36 DMBilG - Erhöhung d. Aktiva'); INSERT INTO gifi (accno,description) VALUES ('9454', 'Berichtig. v. Wertans. §36 DMBilG - Verm. d. Aktivp.'); INSERT INTO gifi (accno,description) VALUES ('9455', 'Berichtig. v. Wertans. §36 DMBilG - Erhöhung d. Passiva'); INSERT INTO gifi (accno,description) VALUES ('9456', 'Berichtig. v. Wertans. §36 DMBilG - Verm. d. Passivp.'); INSERT INTO gifi (accno,description) VALUES ('9457', 'Verb. gg. verb. Untern. a. Ausgleichsford. gem. §24 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9458', 'Verb. gg. verb. U. a. Ausgl.Ford. §24 DMBilG Restl. b. 1 J.'); INSERT INTO gifi (accno,description) VALUES ('9459', 'Verb. gg. verb. U. a. Ausgl.Ford. §24 DMBilG Restl. 1 b. 5 J'); INSERT INTO gifi (accno,description) VALUES ('9460', 'Verb. gg. verb. U. a. Ausgl.Ford. §24 DMBilG Restl. gr. 5 J'); INSERT INTO gifi (accno,description) VALUES ('9462', 'Verb. gg. verb. Untern. §26 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9463', 'Verb. gg. verb. Untern. §26 DMBilG - Restl. bis 1 J.'); INSERT INTO gifi (accno,description) VALUES ('9464', 'Verb. gg. verb. Untern. §26 DMBilG - Restl. 1 bis 5 J.'); INSERT INTO gifi (accno,description) VALUES ('9465', 'Verb. gg. verb. Untern. §26 DMBilG - Restl. größer 5 J.'); INSERT INTO gifi (accno,description) VALUES ('9467', 'Ausgleichsverbindlichkeiten §25 Abs.1 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9468', 'Ausgleichsverb. §25 Abs.1 DMBilG - Restlaufz. bis 1 J.'); INSERT INTO gifi (accno,description) VALUES ('9469', 'Ausgleichsverb. §25 A.1 DMBilG - Restlaufz. 1 bis 5 J.'); INSERT INTO gifi (accno,description) VALUES ('9470', 'Ausgleichsverb. §25 A.1 DMBilG - Restlaufz. größer 5 J.'); INSERT INTO gifi (accno,description) VALUES ('9472', 'Verb. nach dem VermG §7 Abs.6 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9473', 'Verb. nach dem VermG §7 A.6 DMBilG - Restl. bis 1 J.'); INSERT INTO gifi (accno,description) VALUES ('9474', 'Verb. nach dem VermG §7 A.6 DMBilG - Restl. 1 bis 5 J.'); INSERT INTO gifi (accno,description) VALUES ('9475', 'Verb. nach dem VermG §7 A.6 DMBilG - Restl. größer 5 J.'); INSERT INTO gifi (accno,description) VALUES ('9476', 'Verb. aus Rückzahlungsverpfl. 17 Abs.4a DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9477', 'Verb. a. Rückzahlg.Verpfl. - Restl. b. 1 J. §17 A.4a DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9478', 'Verb. a. Rückzahlg.Verpfl. - Restl. 1 b. 5 J. §17A.4a DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9479', 'Verb. a. Rückzahlg.Verpfl. - Restl. gr. 5 J. §17 A.4a DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9480', 'Auflösung Kapitalentwertungskonto §28 A.2 Satz 4 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9481', 'Entnahmen a. vorläufigen Gewinnrücklagen §31 A.6 DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9482', 'Entnahmen a. Sonderrückl. zum Ausgleich von Verlusten'); INSERT INTO gifi (accno,description) VALUES ('9486', 'Abschreibungen auf Ausgleichsforderungen DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9487', 'Erträge aus der Auflösung von Rückstellungen DMBilG'); INSERT INTO gifi (accno,description) VALUES ('9500', 'Anteil für Konto 09000-09090'); INSERT INTO gifi (accno,description) VALUES ('9510', 'Anteil für Konto 09100-09190'); INSERT INTO gifi (accno,description) VALUES ('9520', 'Anteil für Konto 09200-09290'); INSERT INTO gifi (accno,description) VALUES ('9530', 'Anteil für Konto 08300-08390'); INSERT INTO gifi (accno,description) VALUES ('9540', 'Anteil für Konto 08100-08190'); INSERT INTO gifi (accno,description) VALUES ('9570', 'Anteil für Konto 08700-08790'); INSERT INTO gifi (accno,description) VALUES ('9580', 'Anteil für Konto 08800-08890'); INSERT INTO gifi (accno,description) VALUES ('9590', 'Anteil für Konto 08900-08990'); INSERT INTO gifi (accno,description) VALUES ('9600', 'Name des Gesellschafters (Vollhafter)'); INSERT INTO gifi (accno,description) VALUES ('9610', 'Tätigkeitsvergütung (Vollhafter)'); INSERT INTO gifi (accno,description) VALUES ('9620', 'Tantieme (Vollhafter)'); INSERT INTO gifi (accno,description) VALUES ('9630', 'Darlehensverzinsung (Vollhafter)'); INSERT INTO gifi (accno,description) VALUES ('9640', 'Gebrauchsüberlassung (Vollhafter)'); INSERT INTO gifi (accno,description) VALUES ('9650', 'Sonstige Vergütungen (Vollhafter)'); INSERT INTO gifi (accno,description) VALUES ('9690', 'Restanteil (Vollhafter)'); INSERT INTO gifi (accno,description) VALUES ('9700', 'Name des Gesellschafters (Teilhafter)'); INSERT INTO gifi (accno,description) VALUES ('9710', 'Tätigkeitsvergütung (Teilhafter)'); INSERT INTO gifi (accno,description) VALUES ('9720', 'Tantieme (Teilhafter)'); INSERT INTO gifi (accno,description) VALUES ('9730', 'Darlehensverzinsung (Teilhafter)'); INSERT INTO gifi (accno,description) VALUES ('9740', 'Gebrauchsüberlassung (Teilhafter)'); INSERT INTO gifi (accno,description) VALUES ('9750', 'Sonstige Vergütungen (Teilhafter)'); INSERT INTO gifi (accno,description) VALUES ('9790', 'Restanteil (Teilhafter)'); INSERT INTO gifi (accno,description) VALUES ('9890', 'Statistisches Konto für passive Lohnveredelung'); INSERT INTO gifi (accno,description) VALUES ('9899', 'Gegenkonto zu 9890'); commit; ledgersmb/sql/coa/de/chart/0000755000000000000000000000000012060044550014546 5ustar rootrootledgersmb/sql/coa/de/chart/DATEV-SKR03.sql0000755000000000000000000007021711726633756016770 0ustar rootrootbegin; -- DATEV SKR03 -- SELECT account_heading_save(NULL, '0000000', '', NULL); SELECT account_save(NULL,'0002700','EDV-Software','A','0002700', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0010000','Fabrikbauten','A','0010000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0011000','Garagen','A','0011000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0011100','Außenanlagen','A','0011100', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0011200','Hof-und Wegebefestigung','A','0011200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0011500','Andere Bauten','A','0011500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0016500','Geschäftsbauten','A','0016500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0008500','Grundstückswert eige.bebau.Grundst.','A','0008500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0009000','Geschäftsbauten','A','0009000', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '0016000', 'Bauten auf fremden Grundstücken', NULL); SELECT account_save(NULL,'0017000','Fabrikbauten','A','0017000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0017500','Garagen','A','0017500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0017600','Außenanlage','A','0017600', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '0020000', 'Techn.Anlagen und Maschinen', NULL); SELECT account_save(NULL,'0021000','Maschinen','A','0021000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0022000','Maschinengebundene Werkzeuge','A','0022000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0024000','Maschinelle Anlagen','A','0024000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0028000','Betriebsvorrichtung','A','0028000', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '0030000', 'Andere Anlagen,Betrieb-und Geschäftsaus', NULL); SELECT account_save(NULL,'0031000','Andere Anlagen','A','0031000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0032000','PKW','A','0032000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0035000','LKW','A','0035000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0040000','Betriebsausstattung','A','0040000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0041000','Geschäftsausstattung','A','0041000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0042000','Büroeinrichtung','A','0042000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0043000','Ladeneinrichtung','A','0043000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0048000','Geringwertige Wirtschaftsg.b.410EUR','A','0048000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0049000','Sons.Betriebs- Geschäftsausstattung','A','0049000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0050400','Ant.a.herr.o.m.Mehrh.bet.Ges.schaft','A','0050400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0051300','Typisch stille Beteiligungen','A','0051300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0063100','- Restlaufzeit bis 1 Jahr','L','0063100', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0051600','Atypische stille Beteiligungen','A','0051600', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0064000','- Restlaufzeit 1 bis 5 Jahre','L','0064000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0065000','- Restlaufzeit größer als 5 Jahre','L','0065000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0099600','Pauschalwertb.m.Restlaufzeit v. 1J.','A','0099600', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0140000','Ford. a.Lieferungen und Leistungen','A','0140000', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'0080000','Gezeichnetes Kapital','Q','0080000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0150000','Sonstige Vermögensgegenstände','A','0150000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0153000','Forderungen gegen Personal','A','0153000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0154500','Umsatzsteuerforderungen','A','0154500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0100000','Kasse','A','0100000', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'0120000','Bank','A','0120000', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'0096300','Körperschaftssteuerrückstellung','Q','0096300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0095500','Steuerrückstellung','Q','0095500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0095700','Gewerbesteuerrückstellung','Q','0095700', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0080100','Ausst.Einl.a.d.gezeichnete Kapital','Q','0080100', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0084000','Kapitalrücklage','Q','0084000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0086000','Gewinnvortrag vor Verwendung','Q','0086000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0086900','Vortrag auf neue Rechnungen','Q','0086900', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '0000500', 'Sachanlagen', NULL); SELECT account_heading_save(NULL, '0050000', 'Finanzanlagen', NULL); SELECT account_save(NULL,'0051000','Beteiligungen','A','0051000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0063000','Verbindl.gegenüber Kreditinstituten','L','0063000', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '0060000', 'Verbindlichkeiten', NULL); SELECT account_save(NULL,'0086800','Verlustvortrag vor Verwendung','L','0086800', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0097000','Sonstige Rückstellungen','L','0097000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0097400','Rückstellungen für Gewährleistungen','L','0097400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0097700','Rücks.f.Abschluß-u.Prüfungskosten','L','0097700', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0097800','Aufwandsrückstellungen','L','0097800', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0098000','Aktive Rechnungsabgrenzung','A','0098000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0099000','Passive Rechnungsabgrenzung','L','0099000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0099200','Wertberichtigungen','A','0099200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0099800','Einzelwertber.m.Restlaufzeit v.1 J.','A','0099800', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0146000','Zweifelhafte Forderungen','A','0146000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0151000','Geleistete Anzahlung auf Vorräte','A','0151000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0151100','Geleistete Anzahlungen 7%','A','0151100', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0151700','Geleistete Anzahlung 16%','A','0151700', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0152500','Kautionen','A','0152500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0154000','Steuerüberzahlungen','A','0154000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0157000','Abziehbare Vorsteuer','A','0157000', NULL, false, false, string_to_array('AR_tax:AP_tax', ':')); SELECT account_save(NULL,'0160000','Verbindlichkeiten aus Lief.u.Leist.','L','0160000', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'0174100','Verbindl.a.Lohn-und Kirchensteuer','L','0174100', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0178000','Umsatzsteuer-Vorauszahlungen','L','0178000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0178100','Umsatzsteuer-Vorauszahlung 1/11','L','0178100', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0178900','Umsatzsteuer laufendes Jahr','L','0178900', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0179000','Umsatzsteuer Vorjahr','L','0179000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0179100','Umsatzsteuer frühere Jahre','L','0179100', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0180000','Privatentnahme allgemein','Q','0180000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0189000','Privateinlagen','Q','0189000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0210000','Zinsen und ähnl.Aufwendungen','E','0210000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0211000','Zinsaufwendung f.kurzf.Verbindlichk','E','0211000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0212000','Zinsaufwendung f.langf.Verbindlichk','E','0212000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0221000','Kapitalertragssteuer','E','0221000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0231000','Anlagenabgänge - bei Buchverlust','E','0231000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0231500','Anlagenabgänge-Buchgewinn','I','0231500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0237500','Grundsteuer','E','0237500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0245000','Einstell.i.d.Pauschalwertbe.z.Forde','E','0245000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0245100','Einstell.i.d.Einzelwertb.z.Forderun','E','0245100', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0250000','Außerordentliche Erträge','I','0250000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0251000','Betriebsfremde Erträge n.außerorden','I','0251000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0252000','Periodenfremde Erträge nicht außero','I','0252000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0270000','Sonstige Erträge','I','0270000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0272000','Ertr.a.d.Abgang v.Gegens.d.Anlageve','I','0272000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0272500','Ertr.a.d.Abg.v.Gegenst.d.Umlaufverm','I','0272500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0273000','Ertr.a.Herab.d.Pauschal.z.Forderung','I','0273000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0273100','Ertr.a.Herab.d.Einzelw.z.Forderunge','I','0273100', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0273200','Ertr. aus abgeschriebenen Forderung','I','0273200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0274200','Versicherungsentschädigungen','I','0274200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0286000','Gewinnvortrag nach Verwendung','L','0286000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0286800','Verlustvortrag nach Verwendung','L','0286800', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0286900','Vortrag auf neue Rechnungen','L','0286900', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0375000','Erhaltene Boni 7% Vorsteuer','I','0375000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0376000','Erhaltene Boni 16% Vorsteuer','I','0376000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0380000','Anschaffungsnebenkosten','E','0380000', NULL, false, false, string_to_array('IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'0383000','Leergut','E','0383000', NULL, false, false, string_to_array('IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'0385000','Zölle und Einfuhrabgaben','E','0385000', NULL, false, false, string_to_array('IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'0396000','Bestandsver.Roh-,Hilfs-.Betriebs.','E','0396000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0397000','Bestand Roh-,Hilfs-,u.Betriebsstoff','A','0397000', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'0398000','Bestand Waren','E','0398000', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'0399000','Verrechnete Stoffkosten','E','0399000', NULL, false, false, string_to_array('IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'0400000','Material-und Stoffverbrauch','E','0400000', NULL, false, false, string_to_array('IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'0410000','Löhne und Gehälter','E','0410000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0412500','Ehegattengehalt','E','0412500', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0340000','Wareneingang 16% Vorsteuer','E','0340000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0342000','Innergemein.Erwerb 7% VorSt u. Ust','E','0342000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0342500','Innergem.Erwerb 16% VorSt u. Ust','E','0342500', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0373100','Erhaltene Skonti 7% Vorsteuer','I','0373100', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'0373500','Erhaltene Skonti 16% Vorsteuer','I','0373500', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'0330000','Wareneingang 7% Vorsteuer','E','0330000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0413000','Gesetzlich soziale Aufwendungen','E','0413000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0413800','Beiträge zur Berufsgenossenschaftr','E','0413800', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0414500','Freiwillige sozi.Aufw.lohnsteuerfr.','E','0414500', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0414900','Pauschale Lohnsteuera.sons.Bezüge','E','0414900', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0416500','Aufwendung f.Altersversorgung','E','0416500', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0417000','Vermögenswirksame Leistungen','E','0417000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0420000','Raumkosten','E','0420000', NULL, false, false, string_to_array('AP_amount:AP_tax', ':')); SELECT account_save(NULL,'0417500','Fahrtkostenerst.Wohnung/Arbeitsstät','E','0417500', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0419000','Aushilfslöhne','E','0419000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0419900','Lohnsteuer für Aushilfe','E','0419900', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0159000','Durchlaufende Posten','A','0159000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0422000','Pacht','E','0422000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0423000','Heizung','E','0423000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0424000','Gas,Strom, Wasser','E','0424000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0425000','Reinigung','E','0425000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0426000','Instandhaltung betrieb.Räume','E','0426000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0428000','Sonstige Raumkosten','E','0428000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0432000','Gewerbesteuer','E','0432000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0434000','Sonstige Betriebssteuern','E','0434000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0436000','Versicherungen','E','0436000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0438000','Beiträge','E','0438000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0439000','Sonstige Abgaben','E','0439000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0450000','Fahrzugkosten','E','0450000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0451000','Kfz-Steuer','E','0451000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0452000','Kfz-Versicherungen','E','0452000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0453000','Laufende Kfz-Betriebskosten','E','0453000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0454000','Kfz-Reparaturen','E','0454000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0455000','Garagenmiete','E','0455000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0457000','Fremdfahrzeuge','E','0457000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0458000','Sonstige Kfz-Kosten','E','0458000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0461000','Werbekosten','E','0461000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0463000','Geschenke bis 40 EUR','E','0463000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0463500','Geschenke über 40 EUR','E','0463500', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0464000','Repräsentationskosten','E','0464000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0465000','Bewirtungskosten','E','0465000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0465400','Nicht abzugsfähige Bewirtungskosten','E','0465400', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0465500','Nicht abzugsfähige Betriebsausgaben','E','0465500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0466300','Reisekosten Arbeitn.m.Vorsteuerabzu','E','0466300', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0466600','Reisekosten Arbeitn.Übernachtungsau','E','0466600', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0466800','Kilometerentgelderstattung Arbeitne','E','0466800', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0467400','Reisekosten Untern.Verpflegungsmehr','E','0467400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0467600','Reisekosten Untern.Übernachtungsauf','E','0467600', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0467800','Kilometererstattungsgeld Unternehme','E','0467800', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0470000','Kosten der Warenabgabe','E','0470000', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'0471000','Verpackungsmaterial','E','0471000', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'0473000','Ausgangsfracht','E','0473000', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'0475000','Transportversicherung','E','0475000', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'0476000','Verkaufsprovision','E','0476000', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'0478000','Fremdarbeiten','E','0478000', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'0479000','Aufwand für Gewährleistungen','E','0479000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0480900','Sonstige Reparaturen u.Instandhalt.','E','0480900', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0481000','Mietleasing','E','0481000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0481500','Kaufleasing','E','0481500', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0482000','AfA a.Aufw.f.d.Inga.u.Erw.Geschäfts','E','0482000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0482100','AfA a.Aufw.f.d.Währungsumst.a.Euro','E','0482100', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0483000','Abschreibungen auf Sachanlagen','E','0483000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0485500','Sofortabschreibung GWG','E','0485500', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0491000','Porto','E','0491000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0492000','Telefon','E','0492000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0492500','Telefax','E','0492500', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0493000','Bürobedarf','E','0493000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0494000','Zeitschriften, Bücher','E','0494000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0494500','Fortbildungskosten','E','0494500', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0494600','Freiwillige Sozialleistungen','E','0494600', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0495000','Rechts- und Beratungskosten','E','0495000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0495500','Buchführungskosten','E','0495500', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0495700','Abschluß- und Prüfungskosten','E','0495700', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0496000','Mieten für Einrichtungen','E','0496000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0497000','Nebenkosten des Geldverkehrs','E','0497000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0498000','Betriebsbedarf','E','0498000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0498500','Werkzeuge und Kleingeräte','E','0498500', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0498600','Sonstige Aufwendungen (Ausbuchung)','E','0498600', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'0700000','Unfertige Erzeu.unfert.Leistungen','A','0700000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0136000','Geldtransit','A','0136000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0705000','Unfertige Erzeugnisse','A','0705000', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'0708000','Unfertige Leistungen','A','0708000', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'0711000','Fertige Erzeugnisse (Bestand)','A','0711000', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'0714000','Waren (Bestand)','A','0714000', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'0873100','Gewährte Skonti 7% USt','I','0873100', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'0873500','Gewährte Skonti 16% USt.','I','0873500', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'0875000','Gewährte Boni 7% USt.','I','0875000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0876000','Gewährte Boni 16% USt.','I','0876000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0882000','Erlöse aus Anlageverkäufen 16%Ust','I','0882000', NULL, false, false, string_to_array('IC_sale', ':')); SELECT account_save(NULL,'0895500','Umsatzsteuervergütungen','I','0895500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0890500','Entnahme v. Gegenst.o.USt.','I','0890500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0900000','Saldenverträge,Sachkonten','A','0900000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0900800','Saldenverträge,Debitoren','A','0900800', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0900900','Saldenverträge,Kreditoren','L','0900900', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0266000','Erträge aus Kursdifferenzen','I','0266000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0215000','Aufwendungen aus Kursdifferenzen','E','0215000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0850000','Provisionserlöse','I','0850000', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'0157100','Abziebare Vorsteuer 7%','A','0157100', NULL, false, false, string_to_array('AP_tax', ':')); SELECT account_save(NULL,'0157500','Abziehbare Vorsteuer 16%','A','0157500', NULL, false, false, string_to_array('AP_tax:AP_paid', ':')); SELECT account_save(NULL,'0177100','Umsatzsteuer 7%','L','0177100', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'0177500','Umsatzsteuer 16%','L','0177500', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'0830000','Erlöse 7%USt','I','0830000', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'0840000','Erlöse 16% USt.','I','0840000', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_heading_save(NULL, '950', 'Rückstellungen', NULL); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '0398000')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '0840000')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '0399000')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '0266000')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '0215000')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'EUR:USD'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); -- INSERT INTO tax (chart_id,rate) VALUES ((SELECT id FROM chart WHERE accno = '0157100'),0.07); INSERT INTO tax (chart_id,rate) VALUES ((SELECT id FROM chart WHERE accno = '0157500'),0.16); INSERT INTO tax (chart_id,rate) VALUES ((SELECT id FROM chart WHERE accno = '0177100'),0.07); INSERT INTO tax (chart_id,rate) VALUES ((SELECT id FROM chart WHERE accno = '0177500'),0.16); commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno = '0120000'; ledgersmb/sql/coa/de/chart/General.sql0000755000000000000000000005477011726633756016710 0ustar rootrootbegin; -- Einfacher Deutscher Kontenrahmen => Very Easy German Default Chart -- Vorbereitet von / Prepared by Paul Tammes May 9th, 2002. Kommentar / Comments : finance@bermuda-holding.com -- Englische Texte für eigene Zwecke und um Refernz in LedgerSMB Dokumentation zu erleichtern. -- English terms used mostly for my own reference and to make lookup in LedgerSMB documentation easier. -- GIFI-codes werden benutzt/misbraucht um die art der Rechnung zu deuten, Fehler nicht ausgeschlossen denn -- Ich bin kein Deutscher Steuerberater ;-( -- GIFI field codes re-used for following specs: -- Link: Achtung, sehr wenig benutzt da mir die Kentnisse zum Deutschen System fehlen. Sehr gut aufpassen und wenn -- Ihr Fehler oder Praktische TIPS hat: gerne! -- Link: used to a minimum, update and customization may well be needed! -- A0 = Anlagevermögen / Fixed Assets -- A1-1 = Warenbestand / Inventory -- A1-2 = Forderungen / Liabilities -- A1-3 = Liquide Mittel / Assets -- A1-4 = Aktive Rechnungsabgrenzung / Closing Account results -- E = Erträge / Income -- K0 = Wareneinsatz / COGS -- K1 = Personalkosten / Salaries etc -- K2 = Raumkosten / Rental etc -- K3 = Sonstige Kosten / Various costs -- NA = Neutrale Aufwendungen / Neutral Costs -- NE - Neutrale Erlöse / Neutral Income -- P0 = Eigenkapital / Equity -- P1 = Rückstellungen / Reserves -- P2 = Fremdkapital Langfristig / Liabilities Long Term -- P3 = Fremdkapital Kurzfristig / Liabilities Short Term -- P4 = Passive Rechnungsabgrenzung / Closing Account results -- -- A0 SELECT account_heading_save(NULL,'0000','ANLAGEVERMÖGEN', NULL); SELECT account_save(NULL,'0100','Konzessionen & Lizenzen','A','A0', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0135','EDV-Programme','A','A0', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0440','Maschinen','A','A0', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0500','Betriebsausstattung','A','A0', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0520','PKW','A','A0', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0650','Büroeinrichtung','A','A0', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0670','GWG','A','A0', NULL, false, false, string_to_array('', ':')); -- A1-1 SELECT account_heading_save(NULL,'1100','WARENBESTAND', NULL); SELECT account_save(NULL,'1140','Warenbestand','A','A1-1', NULL, false, false, string_to_array('IC', ':')); -- A1-2 SELECT account_heading_save(NULL,'1200','FORDERUNGEN', NULL); SELECT account_save(NULL,'1201','Geleistete Anzahlungen','A','A1-2', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1210','Forderungen ohne Kontokorrent','A','A1-2', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1300','Sonstige Forderungen','A','A1-2', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1400','Anrechenbare Vorsteuer','A','A1-2', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'1401','Anrechenbare Vorsteuer 7%','A','A1-2', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'1402','Vorsteuer ig Erwerb','A','A1-2', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'1403','Vorsteuer ig Erwerb 16%','A','A1-2', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'1405','Anrechenbare Vorsteuer 16%','A','A1-2', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'1406','Anrechenbare Vorsteuer 15%','A','A1-2', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'1433','bezahlte Einfuhrumsatzsteuer','A','A1-2', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'1370','Ungeklärte Posten','A','A1-2', NULL, false, false, string_to_array('', ':')); -- A1-3 SELECT account_heading_save(NULL,'1600','LIQUIDE MITTEL', NULL); SELECT account_save(NULL,'1601','Kasse','A','A1-3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1700','Postgiro','A','A1-3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1800','Bank','A','A1-3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1810','Bank USD','A','A1-3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1820','Kreditkarten','A','A1-3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1890','Geldtransit','A','A1-3', NULL, false, false, string_to_array('', ':')); -- A1-4 SELECT account_save(NULL,'1900','Aktive Rechnungsabgrenzung','A','A1-4', NULL, false, false, string_to_array('', ':')); -- P0 SELECT account_heading_save(NULL,'2000','EIGENKAPITAL', NULL); SELECT account_save(NULL,'2001','Eigenkapital','Q','P0', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2100','Privatentnahmen','Q','P0', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2150','Privatsteuern','Q','P0', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2180','Privateinlagen','Q','P0', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2200','Sonderausgaben beschr.abzugsf.','Q','P0', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2900','Gezeichnetes Kapital','Q','P0', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2910','Ausstehende Einlagen','Q','P0', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2970','Gewinnvortrag vor Verwendung','Q','P0', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2978','Verlustvortrag vor Verwendung','Q','P0', NULL, false, false, string_to_array('', ':')); -- P1 SELECT account_heading_save(NULL,'3000','RÜCKSTELLUNGEN', NULL); SELECT account_save(NULL,'3030','Gewerbesteuerrückstellung','L','P1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3070','Sonstige Rückstellungen','L','P1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3095','Rückstellung für Abschlusskosten','L','P1', NULL, false, false, string_to_array('', ':')); -- P2 SELECT account_heading_save(NULL,'3100','FREMDKAPITAL LANGFRISTIG', NULL); SELECT account_save(NULL,'3160','Bankdarlehen','L','P2', NULL, false, false, string_to_array('', ':')); -- P3 SELECT account_heading_save(NULL,'3200','FREMDKAPITAL KURZFRISTIG', NULL); SELECT account_save(NULL,'3280','Erhaltene Anzahlungen','L','P3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3310','Kreditoren ohne Kontokorrent','L','P3', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'3500','Sonstige Verbindlichkeiten','L','P3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3560','Darlehen','L','P3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3700','Verbindl. Betr.steuern u.Abgaben','L','P3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3720','Verbindlichkeiten Löhne und Gehälter','L','P3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3730','Verbindlichkeiten Lohnsteuer','L','P3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3740','Verbindlichkeiten Sozialversicherung','L','P3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3800','Umsatzsteuer','L','P3', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'3801','Umsatzsteuer 7%','L','P3', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'3802','Umsatzsteuer ig. Erwerb','L','P3', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'3803','Umsatzsteuer ig. Erwerb 16%','L','P3', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'3805','Umsatzsteuer 16%','L','P3', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'3806','Umsatzsteuer 15%','L','P3', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'3815','Umsatzsteuer nicht fällig 16%','L','P3', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'3816','Umsatzsteuer nicht fällig 15%','L','P3', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'3820','Umsatzsteuer-Vorauszahlungen','L','P3', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'3841','Umsatzsteuer Vorjahr','L','P3', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); -- P4 SELECT account_save(NULL,'3900','Aktive Rechnungsabgrenzung','L','P4', NULL, false, false, string_to_array('', ':')); -- K0 SELECT account_heading_save(NULL,'5100','WARENEINGANG', NULL); SELECT account_save(NULL,'5200','Wareneingang ohne Vorsteuer','E','K0', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5300','Wareneingang 7%','E','K0', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5400','Wareneingang 15%','E','K0', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5420','ig.Erwerb 7% VoSt. und 7% USt.','E','K0', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5425','ig.Erwerb 15% VoSt. und 15% USt.','E','K0', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5731','Erhaltene Skonti 7% Vorsteuer','E','K0', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5736','Erhaltene Skonti 15% Vorsteuer','E','K0', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5800','Anschaffungsnebenkosten','E','K0', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5900','Fremdarbeiten','E','K0', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); -- K1 SELECT account_heading_save(NULL,'6000','PERSONALKOSTEN', NULL); SELECT account_heading_save(NULL,'6001','Personalkosten', NULL); SELECT account_save(NULL,'6010','Löhne','E','K1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6020','Gehälter','E','K1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6030','Aushilfslöhne','E','K1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6040','Lohnsteuer Aushilfen','E','K1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6080','Vermögenswirksame Leistungen','E','K1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6090','Fahrtkostenerst.Whg./Arbeitsstätte','E','K1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6110','Sozialversicherung','E','K1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6120','Berufsgenossenschaft','E','K1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6130','Freiw. Soz. Aufw. LSt- u. Soz.Vers.frei','E','K1', NULL, false, false, string_to_array('', ':')); -- K2 SELECT account_heading_save(NULL,'6300','RAUMKOSTEN', NULL); SELECT account_save(NULL,'6310','Miete','E','K2', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'6315','Pacht','E','K2', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'6320','Heizung','E','K2', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'6325','Gas Strom Wasser','E','K2', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'6330','Reinigung','E','K2', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'6335','Instandhaltung betriebliche Räume','E','K2', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'6345','Sonstige Raumkosten','E','K2', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); -- K3 SELECT account_heading_save(NULL,'6400','SONSTIGE KOSTEN', NULL); SELECT account_save(NULL,'6402','Abschreibungen','E','K3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6403','Kaufleasing','E','K3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6404','Sofortabschreibung GWG','E','K3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6405','Sonstige Kosten','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6410','Versicherung','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6420','Beiträge und Gebühren','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6430','Sonstige Abgaben','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6470','Rep. und Instandhaltung BGA','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6520','Kfz-Versicherung','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6530','Lfd. Kfz-Kosten','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6540','Kfz-Reparaturen','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6560','Fremdfahrzeuge','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6570','Sonstige Kfz-Kosten','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6600','Werbung','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6610','Kundengeschenke bis DM 75.','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6620','Kundengeschenke über DM 75.-','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6630','Repräsentationkosten','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6640','Bewirtungskosten','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6644','Nicht abzugsf.Bewirtungskosten','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6650','Reisekosten Arbeitnehmer','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6660','Reisekosten Arbeitnehmer 12.3%','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6665','Reisekosten Arbeitnehmer 9.8%','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6670','Reisekosten Unternehmer','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6680','Reisekosten Unternehmer 12.3%','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6685','Reisekosten Unternehmer 9.8%','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6688','Reisekosten Unternehmer 5.7%','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6690','Km-Geld-Erstattung 8.2%','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6710','Verpackungsmaterial','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6740','Ausgangsfrachten','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6780','Fremdarbeiten','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6800','Porto','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6805','Telefon','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6815','Bürobedarf','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6820','Zeitschriften & Bücher','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6825','Rechts- und Beratungskosten','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6835','Mieten für Einrichtungen','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6840','Mietleasing','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6845','Werkzeuge und Kleingeräte','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6850','Betriebsbedarf','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6852','Gastättenbedarf','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6855','Nebenkosten des Geldverkehrs','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6880','Aufwendungen aus Kursdifferenzen','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'6885','Erlöse aus Anlageverk.(Buchverlust)','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7610','Gewerbesteuer','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7685','Kfz-Steuer','E','K3', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); -- E SELECT account_heading_save(NULL, '8100', 'ERTRÄGE', NULL); SELECT account_save(NULL,'8120','Steuerfreie Umsätze 4 Nr. 1a UStG.','I','E', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'8125','Steuerfreie ig. Lieferungen 1b UStG.','I','E', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'8200','Erlöse ohne Umsatzsteuer','I','E', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'8300','Erlöse 7% Umsatzsteuer','I','E', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'8400','Erlöse 15% Umsatzsteuer','I','E', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'8500','Provisionserlöse','I','E', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'8630','Entnahme sonstg. Leistungen 7% USt.','I','E', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'8640','Entnahme sonstg. Leistungen 15% USt.','I','E', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'8731','Gew. Skonti 7% USt.','I','E', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'8736','Gew. Skonti 15% USt.','I','E', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'8840','Erträge aus Kursdifferenzen','I','E', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'8845','Erlöse aus Anlageverk. (Buchgewinn)','I','E', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'8900','Erträge aus Abgang von Anlageverm.','I','E', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); -- NA SELECT account_heading_save(NULL,'9300','NEUTRALE AUFWENDUNGEN', NULL); SELECT account_save(NULL,'9310','Zinsen kurzfr. Verbindlichkeiten','E','NA', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9320','Zinsen langfr. Verbindlichkeiten','E','NA', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9500','Ausserordentl.Aufwendungen','E','NA', NULL, false, false, string_to_array('', ':')); -- NE SELECT account_heading_save(NULL,'9600','NEUTRALE ERTRÄGE', NULL); SELECT account_heading_save(NULL,'9610','Guthabenzinsen', NULL); SELECT account_heading_save(NULL,'9700','Ausserordentl.Erträge', NULL); -- -- Default settings -- insert into tax (chart_id,rate) values ((select id from chart where accno = '3801'),0.07); insert into tax (chart_id,rate) values ((select id from chart where accno = '3805'),0.16); insert into tax (chart_id,rate) values ((select id from chart where accno = '3806'),0.15); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '1140')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '8120')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '5800')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '8840')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '6880')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'EUR'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); -- commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno BETWEEN '1700' AND '1820'; ledgersmb/sql/coa/de/chart/SKR03.sql0000755000000000000000000010760411726633756016130 0ustar rootrootbegin; -- General COA -- SELECT account_heading_save(NULL, '000', '-----', NULL); SELECT account_save(NULL,'420','Büroeinrichtung','A','420', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'430','Ladeneinrichtung','A','430', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'440','Werkzeuge','A','440', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'450','Einbauten','A','450', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'460','Gerüst- und Schalungsmaterial','A','460', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'480','Geringwertige Wirtschaftsgüter bis DM 800,-','A','480', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'490','Sonstige Betriebs- und Geschäftsausstattung','A','490', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'650','Verb. gg. Kreditinstituten - Restlaufz. größer 5 Jahre','L','650', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1000','Kasse','A','1000', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1200','Bank-Giro','A','1200', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1400','Forderungen aus Lief. und Leist. Kundengruppe 0','A','1400', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1540','Steuerüberzahlungen','A','1540', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1542','Steuererstattungsansprüche gg. anderen EU-Ländern','A','1542', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1545','Umsatzsteuerforderungen','A','1545', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1548','Vorsteuer im Folgejahr abziehbar','A','1548', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1570','Abziehbare Vorsteuer','A','1570', NULL, false, false, string_to_array('AR_tax:AP_tax', ':')); SELECT account_save(NULL,'1571','Abziehbare Vorsteuer, 7%','A','1571', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'1575','Abziehbare Vorsteuer, 16%','A','1575', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'1576','Abziehbare Vorsteuer, 15%','A','1576', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'1577','Vorsteuer nach allg. Durchschnittssätzen UStVA KZ 63','A','1577', NULL, false, false, string_to_array('AR_tax:AP_tax', ':')); SELECT account_save(NULL,'1775','Umsatzsteuer, 16%','L','1775', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'1776','Umsatzsteuer, 15%','L','1776', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'1780','Umsatzsteuer - Vorauszahlungen','L','1780', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1781','Umsatzsteuer - Vorauszahlungen 1/11','L','1781', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1782','Nachsteuer, UStVA KZ 65','L','1782', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1789','Umsatzsteuer laufendes Jahr','L','1789', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1790','Umsatzsteuer Vorjahr','L','1790', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1791','Umsatzsteuer frühere Jahre','L','1791', NULL, false, false, string_to_array('', ':')); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1820','Sonderausg. beschr. abzugsf. (Privat Vollhaft./Einzelu.)','A','','','1820'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1830','Sonderausg. unbeschr. abzugsf. (Privat Vollhaft./Einzelu.)','A','','','1830'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1840','Privatspenden (Privat Vollhafter / Einzelunternehmer)','A','','','1840'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1850','Außergewöhnliche Belastungen (Privat Vollhaft. / Einzelunt.)','A','','','1850'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1890','Privateinlagen (Privat Vollhafter / Einzelunternehmer)','A','','','1890'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('2010','Betriebsfremde Aufw. (soweit nicht außerordentlich)','A','','','2010'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('2020','Periodenfremde Aufw. (soweit nicht außerordentlich)','A','','','2020'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('2100','Zinsen und ähnliche Aufwendungen','A','','','2100'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('2103','Steuerlich abzugsfähige, andere Nebenleistungen zu Steuern','A','','','2103'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('2104','Steuerlich nicht abzugsfähige, andere Nebenleistungen zu Steuern','A','','','2104'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('2107','Zinsaufwendungen §233a AO betriebliche Steuern','A','','','2107'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('2108','Zinsaufw. §233a, §234, §237 AO Personenst. §8 GewStG','A','','','2108'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('2109','Zinsaufwendungen an verbundene Unternehmen','A','','','2109'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('2110','Zinsaufwendungen für kurzfristige Verbindlichkeiten','A','','','2110'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3410','Wareneingang, 16% Vorsteuer','A','','','3410'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3736','Erhaltene Skonti, 16% Vorsteuer','A','','','3736'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3740','Erhaltene Boni','A','','','3740'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3750','Erhaltene Boni, 7% Vorsteuer','A','','','3750'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3760','Erhaltene Boni, 15%+16% Vorsteuer','A','','','3760'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3762','Erhaltene Boni, 16% Vorsteuer','A','','','3762'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3764','Erhaltene Boni, 15% Vorsteuer','A','','','3764'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3800','Anschaffungsnebenkosten','A','','','3800'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3830','Leergut','A','','','3830'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3850','Zölle und Einfuhrabgaben','A','','','3850'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3960','Bestandsv. Roh-, Hilfs- u. Betriebsstoffe / bezogene Waren','A','','','3960'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3970','Bestand Roh-, Hilfs- und Betriebsstoffe','A','','','3970'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3980','Bestand Waren','A','','','3980'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3990','Verrechnete Stoffkosten','A','','','3990'); SELECT account_save(NULL,'4000','Material- und Stoffverbrauch','E','4000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4100','Löhne und Gehälter','E','4100', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4110','Löhne','E','4110', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4120','Gehälter','E','4120', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4124','Geschäftsführergehälter der GmbH-Gesellschafter','E','4124', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4125','Ehegattengehalt','E','4125', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4126','Tantiemen','E','4126', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4127','Geschäftsführergehälter','E','4127', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4128','Vergütungen an angestellte Mitunternehmer §15 EStG','E','4128', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4130','Gesetzliche soziale Aufwendungen','E','4130', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4137','Gesetzliche soziale Aufw. für Mitunternehmer §15 EStG','E','4137', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4138','Beiträge zur Berufsgenossenschaft','E','4138', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'1360','Geldtransit Bank 1','A','1360', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4140','Freiw. soziale Aufwendungen (lohnsteuerfrei)','E','4140', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4145','Freiw. soziale Aufwendungen (lohnsteuerpflichtig)','E','4145', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4149','Pauschale Lohnsteuer auf s. Bezüge (z.B. Fahrtkostenzuschuß)','E','4149', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4150','Krankengeldzuschüsse','E','4150', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4160','Versorgungskassen','E','4160', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4165','Aufwendungen für die Altersversorgung','E','4165', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4167','Pauschale Lohnsteuer auf s. Bezüge (z.B. Direktversicherung)','E','4167', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4168','Aufw. f. die Altersversorgung f. Mitunternehmer §15 EStG','E','4168', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4169','Aufwendungen für Unterstützung','E','4169', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4170','Vermögenswirksame Leistungen','E','4170', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4175','Fahrtkostenerstattung - Wohnung / Arbeitsstätte','E','4175', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4180','Bedienungsgelder','E','4180', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4190','Aushilfslöhne','E','4190', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4199','Lohnsteuer für Aushilfen','E','4199', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4200','Raumkosten','E','4200', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4210','Miete','E','4210', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4218','Gewerbesteuerlich zu berücks. Miete §8 GewStG','E','4218', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4219','Vergütung an Mitu. f. mietw. Überl. v. Wirtschaftsg. §15EStG','E','4219', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4220','Pacht','E','4220', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4228','Gewerbesteuerlich zu berücks. Pacht §8 GewStG','E','4228', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4229','Vergütung an Mitu. f. pachtw. Überl. v. Wirtschaftsg.§15EStG','E','4229', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4230','Heizung','E','4230', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4240','Gas, Strom, Wasser (Verwaltung, Vertrieb)','E','4240', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4250','Reinigung','E','4250', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4260','Instandhaltung betrieblicher Räume','E','4260', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4270','Abgaben für betrieblich genutzten Grundbesitz','E','4270', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4280','Sonstige Raumkosten','E','4280', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4320','Gewerbesteuer (Vorauszahlung)','E','4320', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4330','Gewerbeertragsteuer','E','4330', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4335','Gewerbekapitalsteuer','E','4335', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4340','Sonstige Betriebsteuern','E','4340', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4350','Verbrauchsteuer','E','4350', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4360','Versicherungen','E','4360', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4380','Beiträge','E','4380', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4390','Sonstige Abgaben','E','4390', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4396','Steuerlich abzugsfähige Verspätungszuschläge und Zwangsgelder','E','4396', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4397','Steuerlich nicht abzugsfähige Verspätungszuschläge und Zwangsgelder','E','4397', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4400','Besondere Kosten (zur freien Verfügung)','E','4400', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4500','Fahrzeugkosten','E','4500', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4510','Kfz-Steuern','E','4510', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4520','Kfz-Versicherungen','E','4520', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4530','Laufende Kfz-Betriebskosten','E','4530', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4540','Kfz-Reparaturen','E','4540', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4550','Garagenmieten','E','4550', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4570','Fremdfahrzeuge','E','4570', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4580','Sonstige Kfz-Kosten','E','4580', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4600','Werbe- und Reisekosten','E','4600', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4610','Werbekosten','E','4610', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4630','Geschenke bis DM 75,00','E','4630', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4635','Geschenke über DM 75,00','E','4635', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4638','Geschenke ausschließlich betrieblich genutzt','E','4638', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4640','Repräsentationskosten','E','4640', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4650','Bewirtungskosten','E','4650', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4653','Aufwerksamkeiten','E','4653', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4654','Nicht abzugsfähige Bewirtungskosten','E','4654', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4655','Nicht abzugsfähige Betriebsausgaben','E','4655', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4660','Reisekosten Arbeitnehmer','E','4660', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4666','Reisekost. Arbeitn., 12,3%/13,1% VSt Verpfl.Mehr- / Übern.Aufw.','E','4666', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4667','Reisekost. Arbeitn., 9,8%/10,5% VSt Gesamtpauschal.','E','4667', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4670','Reisekosten Unternehmer','E','4670', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4675','Reisekosten Unternehmer, 9,8/10,5% VSt sonst.Gesamtpauschal.','E','4675', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4676','Reisekost. Untern., 12,3%/13,1% VSt Verpfl.Mehr- / Übern.Aufw.','E','4676', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4677','Reisekosten Unternehmer, 9,8%/10,5% VSt Verpfl.Mehraufw. Gesamtpauschal.','E','4677', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4678','Km-Geld Erstattung, Unternehmer, 5,7%/6,1% VSt','E','4678', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4685','Km-Geld-Erstattung, Arbeitnehmer 8,2%/8,7% VSt','E','4685', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4700','Kosten der Warenabgabe','E','4700', NULL, false, false, string_to_array('AP_amount:IC_expense:IC_cogs', ':')); SELECT account_save(NULL,'4710','Verpackungsmaterial','E','4710', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4730','Ausgangsfrachten','E','4730', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4750','Transportversicherungen','E','4750', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4760','Verkaufsprovisionen','E','4760', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4780','Fremdarbeiten','E','4780', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4790','Aufwand für Gewährleistungen','E','4790', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4800','Reparat. u. Inst. v. Maschinen u. technischen Anlagen','E','4800', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4805','Reparat. u. Inst. v. and. Anl. d. Betr.- u. Geschäftsausst.','E','4805', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4809','Sonstige Reparaturen und Instandhaltungen','E','4809', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4810','Mietleasing','E','4810', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4815','Kaufleasing','E','4815', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4820','Abschr. a. Aufw. f.d. Ingangs. u. Erw. des Geschäftsbetr.','E','4820', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4822','Abschr. a. immaterielle Vermögensgegenstände','E','4822', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4824','Abschreibung auf den Geschäfts- oder Firmenwert','E','4824', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4826','Außerplanm. Abschr. a. immaterielle Vermögensgegenstände','E','4826', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4830','Abschreibungen auf Sachanlagen','E','4830', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4840','Außerplanm. Abschreibungen auf Sachanlagen','E','4840', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4850','Abschr. a. Sachanl. aufgrund steuerl. Sondervorschriften','E','4850', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4855','Sofortabschreibung geringwertiger Wirtschaftsgüter','E','4855', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4860','Abschreibung auf aktivierte, geringwertige Wirtschaftsgüter','E','4860', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4865','Außerplanmäßige Abschr. a. aktivierte GWG','E','4865', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4870','Abschreibungen auf Finanzanlagen','E','4870', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4872','Abschr. aufgrund v. Verlustant. an Mitunt. §8 GewStG','E','4872', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4874','Abschr. a. Finanzanl. aufgrund steuerl. Sondervorschriften','E','4874', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4875','Abschreibungen auf Wertpapiere des Umlaufvermögens','E','4875', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4880','Abschr. a. Umlaufv. ohne Wertpapiere (soweit unübl. Höhe)','E','4880', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4882','Abschr. a. Umlaufv. steuerrechtl. bedingt (unübl. Höhe)','E','4882', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4887','Abschr. a. Umlaufv., steuerrechtlich bedingt (übl. Höhe)','E','4887', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4890','Vorwegn. künftiger Wertschw. im Umlaufv. (unübl. Höhe)','E','4890', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4900','Sonstige betriebliche Aufwendungen','E','4900', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4905','Sonstige Aufwendungen betrieblich und regelmäßig','E','4905', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4910','Porto','E','4910', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4920','Telefon','E','4920', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4925','Telefax, Fernschreiber','E','4925', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4930','Bürobedarf','E','4930', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4940','Zeitschriften, Bücher','E','4940', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4945','Fortbildungskosten','E','4945', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4946','Freiwillige Sozialleistungen','E','4946', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4948','Vergütungen an freiberufliche Mitunternehmer §15 EStG','E','4948', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4950','Rechts- und Beratungskosten','E','4950', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4955','Buchführungskosten','E','4955', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4957','Abschluß- und Prüfungskosten','E','4957', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4960','Mieten für Einrichtungen','E','4960', NULL, false, false, string_to_array('AP_amount', ':')); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4968','Gewerbest. zu berücks. Miete f. Einrichtungen §8 GewStG','A','','','4968'); SELECT account_save(NULL,'4969','Aufwendungen für Abraum- und Abfallbeseitigung','E','4969', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4970','Nebenkosten des Geldverkehrs','E','4970', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4980','Betriebsbedarf','E','4980', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4985','Werkzeuge und Kleingeräte','E','4985', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4996','Herstellungskosten','E','4996', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4997','Verwaltungskosten','E','4997', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4998','Vertriebskosten','E','4998', NULL, false, false, string_to_array('AP_amount', ':')); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4999','Gegenkonto 49960-49980','A','','','4999'); SELECT account_save(NULL,'7140','Fertige Waren (Bestand)','A','7140', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'8100','Steuerfreie Umsätze o. VSt-Abzug §4 Nr.8 ff. UStG','I','8100', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'8500','Provisionserlöse','I','8500', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'8504','Provisionserlöse steuerfrei (§4 Nr.8ff UStG)','I','8504', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'8505','Provisionserlöse steuerfrei (§4 Nr.5 UStG)','I','8505', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'8506','Provisionserlöse, 7% USt','I','8506', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'8507','Provisionserlöse, 15% Ust','I','8507', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'8508','Provisionserlöse, 15%/16% USt','I','8508', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'8509','Provisionserlöse, 16% Ust','I','8509', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'8591','Sachbezüge, 7% USt (Waren)','I','8591', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'8595','Sachbezüge, 15%/16% USt (Waren)','I','8595', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'8596','Sachbezüge, 16% USt (Waren)','I','8596', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'8597','Sachbezüge, 15% USt (Waren)','I','8597', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'8630','Sonstige Erlöse betrieblich und regelmäßig, 7% USt','I','8630', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'8645','Sonstige Erlöse betrieblich und regelmäßig, 16% Ust','I','8645', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8730','Gewährte Skonti','A','','','8730'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8731','Gewährte Skonti, 7% USt','A','','','8731'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8735','Gewährte Skonti, 16% Ust','A','','','8735'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8740','Gewährte Boni','A','','','8740'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8750','Gewährte Boni, 7% USt','A','','','8750'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8762','Gewährte Boni, 16% Ust','A','','','8762'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8770','Gewährte Rabatte','A','','','8770'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8780','Gewährte Rabatte, 7% USt','A','','','8780'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8792','Gewährte Rabatte, 16% Ust','A','','','8792'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8800','Erlöse aus Anlagenverkäufen','A','','','8800'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8801','Erlöse aus Anlagenverkäufen 15%/16% USt (bei Buchverlust)','A','','','8801'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8810','Erlöse aus Anlagenverkäufen 16% USt (bei Buchverlust)','A','','','8810'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8815','Erlöse aus Anlagenverkäufen 15% USt (bei Buchverlust)','A','','','8815'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8820','Erlöse aus Anlagenverkäufen 15%/16% USt (bei Buchgewinn)','A','','','8820'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8829','Erlöse aus Anlagenverkäufen (bei Buchgewinn)','A','','','8829'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8830','Erlöse aus Anlagenverkäufen 16% USt (bei Buchgewinn)','A','','','8830'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8835','Erlöse aus Anlagenverkäufen 15% USt (bei Buchgewinn)','A','','','8835'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8900','Eigenverbrauch','A','','','8900'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8905','Entnahme Gegenstände ohne USt','A','','','8905'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8908','Entnahme von Gegenstände, 16% USt §1 Abs.1 Nr.2a UStG','A','','','8908'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8909','Entnahme von Gegenstände, 15% USt §1 Abs.1 Nr.2a UStG','A','','','8909'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8910','Entnahme von Gegenstände, 15%/16% USt §1 Abs.1 Nr.2a UStG','A','','','8910'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8915','Entnahme von Gegenstände, 7% USt §1 Abs.1 Nr.2a UStG','A','','','8915'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8920','Entnahme v. sonst. Leist., 15%/16% USt §1 A.1 Nr.2b UStG','A','','','8920'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8930','Entnahme v. sonst. Leist., 7% USt §1 A.1 Nr.2b UStG','A','','','8930'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8937','Entnahme v. sonst. Leist., 16% USt §1 A.1 Nr.2b UStG','A','','','8937'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8938','Entnahme v. sonst. Leist., 15% USt §1 A.1 Nr.2b UStG','A','','','8938'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8939','Entnahme v. sonst. Leist., ohne USt §1 A.1 Nr.2b UStG','A','','','8939'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8941','Eigenverbr., 7% Ust §4 A.1 Nr.5 1-7, A.7 EStG','A','','','8941'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8942','Eigenverbr., 16% Ust §4 A.1 Nr.5 1-7, A.7 EStG','A','','','8942'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8944','Eigenverbr., ohne Ust §4 A.1 Nr.5 1-7, A.7 EStG','A','','','8944'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8950','Nicht steuerbare Umsätze','A','','','8950'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8955','Umsatzsteuervergütungen','A','','','8955'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8960','Bestandsveränd. - unfertige Erzeugnisse','A','','','8960'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8970','Bestandsveränd. - unfertige Leistungen','A','','','8970'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8975','Bestandsveränd. - in Ausführung befindliche Bauaufträge','A','','','8975'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8977','Bestandsveränd. - in Arbeit befindliche Aufträge','A','','','8977'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8980','Bestandsveränd. - fertige Erzeugnisse','A','','','8980'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8990','Bestandsveränd. - andere aktivierte Eigenleistungen','A','','','8990'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('9000','Saldenvorträge Sachkonten','A','','','9000'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('9008','Saldenvorträge Debitoren','A','','','9008'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('9009','Saldenvorträge Kreditoren','A','','','9009'); INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('9100','Saldovortragskonto der Statistikkonten','A','','','9100'); SELECT account_save(NULL,'1800','Privatentn. allg. (Privat Vollhafter / Einzelunternehmer)','Q','1800', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2000','Außerordentliche Aufwendungen','A','2000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1600','Verb. aus Lief. und Leist. Lieferantengruppe 0','L','1600', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'3400','Wareneingang, 16% Vorsteuer','E','3400', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8400','Umsatzerlöse 16%','I','8400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'8840','Erträge aus Kursdifferenzen','I','8840', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '1571'),0.07); insert into tax (chart_id,rate) values ((select id from chart where accno = '1575'),0.16); insert into tax (chart_id,rate) values ((select id from chart where accno = '1576'),0.15); insert into tax (chart_id,rate) values ((select id from chart where accno = '1775'),0.16); insert into tax (chart_id,rate) values ((select id from chart where accno = '1776'),0.15); insert into tax (chart_id,rate) values ((select id from chart where accno = '3400'),0.16); insert into tax (chart_id,rate) values ((select id from chart where accno = '8400'),0.16); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '7140')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '8400')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '4700')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '8840')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '8840')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'EUR:USD'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); -- commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno = '1200'; ledgersmb/sql/coa/us/0000755000000000000000000000000012060044550013504 5ustar rootrootledgersmb/sql/coa/us/gifi/0000755000000000000000000000000012060044550014422 5ustar rootrootledgersmb/sql/coa/us/gifi/UCOA-Form990.sql0000755000000000000000000001316410573160304017050 0ustar rootrootbegin; INSERT INTO gifi (accno, description) VALUES ('PartIV-B,82b', 'Part IV-B, 82b'); INSERT INTO gifi (accno, description) VALUES ('10a&102', 'Line 10a & 102'); INSERT INTO gifi (accno, description) VALUES ('10b&102', 'Line 10b & 102'); INSERT INTO gifi (accno, description) VALUES ('11&103', 'Line 11 & 103'); INSERT INTO gifi (accno, description) VALUES ('16', 'Line 16'); INSERT INTO gifi (accno, description) VALUES ('1a&(9a)', 'Line 1a & (9a)'); INSERT INTO gifi (accno, description) VALUES ('1a', 'Line 1a'); INSERT INTO gifi (accno, description) VALUES ('1b', 'Line 1b'); INSERT INTO gifi (accno, description) VALUES ('1c', 'Line 1c'); INSERT INTO gifi (accno, description) VALUES ('1d', 'Line 1d'); INSERT INTO gifi (accno, description) VALUES ('2&93(a)', 'Line 2 & 93(a)'); INSERT INTO gifi (accno, description) VALUES ('2&93(g)', 'Line 2 & 93(g)'); INSERT INTO gifi (accno, description) VALUES ('2&93f', 'Line 2 & 93f'); INSERT INTO gifi (accno, description) VALUES ('20', 'Line 20'); INSERT INTO gifi (accno, description) VALUES ('21&67', 'Line 21 & 67'); INSERT INTO gifi (accno, description) VALUES ('21&68', 'Line 21 & 68'); INSERT INTO gifi (accno, description) VALUES ('21&69', 'Line 21 & 69'); INSERT INTO gifi (accno, description) VALUES ('22', 'Line 22'); INSERT INTO gifi (accno, description) VALUES ('23', 'Line 23'); INSERT INTO gifi (accno, description) VALUES ('24', 'Line 24'); INSERT INTO gifi (accno, description) VALUES ('25', 'Line 25'); INSERT INTO gifi (accno, description) VALUES ('26', 'Line 26'); INSERT INTO gifi (accno, description) VALUES ('27', 'Line 27'); INSERT INTO gifi (accno, description) VALUES ('28', 'Line 28'); INSERT INTO gifi (accno, description) VALUES ('29', 'Line 29'); INSERT INTO gifi (accno, description) VALUES ('3&94', 'Line 3 & 94'); INSERT INTO gifi (accno, description) VALUES ('30', 'Line 30'); INSERT INTO gifi (accno, description) VALUES ('31', 'Line 31'); INSERT INTO gifi (accno, description) VALUES ('32', 'Line 32'); INSERT INTO gifi (accno, description) VALUES ('33', 'Line 33'); INSERT INTO gifi (accno, description) VALUES ('34', 'Line 34'); INSERT INTO gifi (accno, description) VALUES ('35', 'Line 35'); INSERT INTO gifi (accno, description) VALUES ('36', 'Line 36'); INSERT INTO gifi (accno, description) VALUES ('37', 'Line 37'); INSERT INTO gifi (accno, description) VALUES ('38', 'Line 38'); INSERT INTO gifi (accno, description) VALUES ('39', 'Line 39'); INSERT INTO gifi (accno, description) VALUES ('4&95', 'Line 4 & 95'); INSERT INTO gifi (accno, description) VALUES ('40', 'Line 40'); INSERT INTO gifi (accno, description) VALUES ('41', 'Line 41'); INSERT INTO gifi (accno, description) VALUES ('42', 'Line 42'); INSERT INTO gifi (accno, description) VALUES ('43', 'Line 43'); INSERT INTO gifi (accno, description) VALUES ('45', 'Line 45'); INSERT INTO gifi (accno, description) VALUES ('46', 'Line 46'); INSERT INTO gifi (accno, description) VALUES ('47a', 'Line 47a'); INSERT INTO gifi (accno, description) VALUES ('47b', 'Line 47b'); INSERT INTO gifi (accno, description) VALUES ('48a', 'Line 48a'); INSERT INTO gifi (accno, description) VALUES ('48b', 'Line 48b'); INSERT INTO gifi (accno, description) VALUES ('49', 'Line 49'); INSERT INTO gifi (accno, description) VALUES ('5&96', 'Line 5 & 96'); INSERT INTO gifi (accno, description) VALUES ('50', 'Line 50'); INSERT INTO gifi (accno, description) VALUES ('51a', 'Line 51a'); INSERT INTO gifi (accno, description) VALUES ('51b', 'Line 51b'); INSERT INTO gifi (accno, description) VALUES ('52', 'Line 52'); INSERT INTO gifi (accno, description) VALUES ('53', 'Line 53'); INSERT INTO gifi (accno, description) VALUES ('54', 'Line 54'); INSERT INTO gifi (accno, description) VALUES ('55a', 'Line 55a'); INSERT INTO gifi (accno, description) VALUES ('55b', 'Line 55b'); INSERT INTO gifi (accno, description) VALUES ('56', 'Line 56'); INSERT INTO gifi (accno, description) VALUES ('57a', 'Line 57a'); INSERT INTO gifi (accno, description) VALUES ('57b', 'Line 57b'); INSERT INTO gifi (accno, description) VALUES ('58', 'Line 58'); INSERT INTO gifi (accno, description) VALUES ('60', 'Line 60'); INSERT INTO gifi (accno, description) VALUES ('61', 'Line 61'); INSERT INTO gifi (accno, description) VALUES ('62', 'Line 62'); INSERT INTO gifi (accno, description) VALUES ('63', 'Line 63'); INSERT INTO gifi (accno, description) VALUES ('64a', 'Line 64a'); INSERT INTO gifi (accno, description) VALUES ('64b', 'Line 64b'); INSERT INTO gifi (accno, description) VALUES ('65', 'Line 65'); INSERT INTO gifi (accno, description) VALUES ('6a&97a', 'Line 6a & 97a'); INSERT INTO gifi (accno, description) VALUES ('6a&97b', 'Line 6a & 97b'); INSERT INTO gifi (accno, description) VALUES ('6a&98', 'Line 6a & 98'); INSERT INTO gifi (accno, description) VALUES ('6b&97a', 'Line 6b & 97a'); INSERT INTO gifi (accno, description) VALUES ('6b&97b', 'Line 6b & 97b'); INSERT INTO gifi (accno, description) VALUES ('6b&98', 'Line 6b & 98'); INSERT INTO gifi (accno, description) VALUES ('7&99', 'Line 7 & 99'); INSERT INTO gifi (accno, description) VALUES ('8a-(A)&100', 'Line 8a-(A) & 100'); INSERT INTO gifi (accno, description) VALUES ('8a-(B)&100', 'Line 8a-(B) & 100'); INSERT INTO gifi (accno, description) VALUES ('8b-(A)&100', 'Line 8b-(A) & 100'); INSERT INTO gifi (accno, description) VALUES ('8b-(B)&100', 'Line 8b-(B) & 100'); INSERT INTO gifi (accno, description) VALUES ('9a&101', 'Line 9a & 101'); INSERT INTO gifi (accno, description) VALUES ('PartIV-A&82b', 'Part IV-A & 82b'); INSERT INTO gifi (accno, description) VALUES ('PartIV-A', 'Part IV-A'); INSERT INTO gifi (accno, description) VALUES ('capitalized', 'capitalized'); INSERT INTO gifi (accno, description) VALUES ('contra1a', 'contra Line 1a'); commit; ledgersmb/sql/coa/us/gifi/UCOA-Form990EZ.sql0000755000000000000000000000264410573160304017310 0ustar rootrootbegin; INSERT INTO gifi (accno, description) VALUES ('1&(6a)', 'Line 1 & (6a)'); INSERT INTO gifi (accno, description) VALUES ('1', 'Line 1'); INSERT INTO gifi (accno, description) VALUES ('10', 'Line 10'); INSERT INTO gifi (accno, description) VALUES ('11', 'Line 11'); INSERT INTO gifi (accno, description) VALUES ('12', 'Line 12'); INSERT INTO gifi (accno, description) VALUES ('13', 'Line 13'); INSERT INTO gifi (accno, description) VALUES ('14', 'Line 14'); INSERT INTO gifi (accno, description) VALUES ('15', 'Line 15'); INSERT INTO gifi (accno, description) VALUES ('16', 'Line 16'); INSERT INTO gifi (accno, description) VALUES ('2', 'Line 2'); INSERT INTO gifi (accno, description) VALUES ('21&27', 'Line 21 & 27'); INSERT INTO gifi (accno, description) VALUES ('22', 'Line 22'); INSERT INTO gifi (accno, description) VALUES ('23', 'Line 23'); INSERT INTO gifi (accno, description) VALUES ('24', 'Line 24'); INSERT INTO gifi (accno, description) VALUES ('26', 'Line 26'); INSERT INTO gifi (accno, description) VALUES ('3', 'Line 3'); INSERT INTO gifi (accno, description) VALUES ('4', 'Line 4'); INSERT INTO gifi (accno, description) VALUES ('5a', 'Line 5a'); INSERT INTO gifi (accno, description) VALUES ('5b', 'Line 5b'); INSERT INTO gifi (accno, description) VALUES ('6a', 'Line 6a'); INSERT INTO gifi (accno, description) VALUES ('8', 'Line 8'); INSERT INTO gifi (accno, description) VALUES ('capitalized', 'capitalized'); commit; ledgersmb/sql/coa/us/chart/0000755000000000000000000000000012060044550014605 5ustar rootrootledgersmb/sql/coa/us/chart/Service.sql0000755000000000000000000001613511726631300016742 0ustar rootrootbegin; -- US_Service_Company COA -- modify as needed -- SELECT account_heading_save(NULL,'1000','CURRENT ASSETS', NULL); SELECT account_save(NULL,'1060','Checking Account','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1065','Petty Cash','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno in ('1060', '1065'); SELECT account_save(NULL,'1200','Accounts Receivables','A','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1205','Allowance for doubtful accounts','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'1500','INVENTORY ASSETS', NULL); SELECT account_save(NULL,'1520','Inventory','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL,'1800','CAPITAL ASSETS', NULL); SELECT account_save(NULL,'1820','Office Furniture & Equipment','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1825','Accum. Amort. -Furn. & Equip.','A','', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'1840','Vehicle','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1845','Accum. Amort. -Vehicle','A','', NULL, true, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'2000','CURRENT LIABILITIES', NULL); SELECT account_save(NULL,'2100','Accounts Payable','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_heading_save(NULL,'2600','LONG TERM LIABILITIES', NULL); SELECT account_save(NULL,'2620','Bank Loans','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2680','Loans from Shareholders','L','', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_heading_save(NULL,'3300','SHARE CAPITAL', NULL); SELECT account_save(NULL,'3350','Common Shares','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'3500','RETAINED EARNINGS', NULL); SELECT account_save(NULL,'3590','Retained Earnings - prior years','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'4000','CONSULTING REVENUE', NULL); SELECT account_save(NULL,'4020','Consulting','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL,'4400','OTHER REVENUE', NULL); SELECT account_save(NULL,'4410','General Sales','I','', NULL, false, false, string_to_array('AR_amount:IC_income:IC_sale', ':')); SELECT account_save(NULL,'4440','Interest','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4450','Foreign Exchange Gain','I','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5000','EXPENSES', NULL); SELECT account_save(NULL,'5020','Purchases','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_heading_save(NULL,'5400','PAYROLL EXPENSES', NULL); SELECT account_save(NULL,'5410','Wages & Salaries','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5600','GENERAL & ADMINISTRATIVE EXPENSES', NULL); SELECT account_save(NULL,'5610','Accounting & Legal','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5615','Advertising & Promotions','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5620','Bad Debts','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5660','Amortization Expense','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5685','Insurance','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5690','Interest & Bank Charges','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5700','Office Supplies','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5760','Rent','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5765','Repair & Maintenance','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5780','Telephone','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5785','Travel & Entertainment','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5790','Utilities','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5795','Registrations','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5800','Licenses','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5810','Foreign Exchange Loss','E','', NULL, false, false, string_to_array('', ':')); -- SELECT account_save(NULL,'2110','Accrued Income Tax - Federal','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2120','Accrued Income Tax - State','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2130','Accrued Franchise Tax','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2140','Accrued Real & Personal Prop Tax','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2150','Sales Tax','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2210','Accrued Wages','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5510','Inc Tax Exp - Federal','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5520','Inc Tax Exp - State','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5530','Taxes - Real Estate','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5540','Taxes - Personal Property','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5550','Taxes - Franchise','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5560','Taxes - Foreign Withholding','E','', NULL, false, false, string_to_array('', ':')); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '2150'),0.05); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '1520')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '4410')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '5020')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '4450')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '5810')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'USD:CAD:EUR'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'lbs'); -- commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/us/chart/UCOA-Form990.sql0000755000000000000000000006346011726631300017237 0ustar rootrootbegin; -- UCOA Form 990 -- SELECT account_heading_save(NULL,'1000','Cash', NULL); SELECT account_save(NULL,'1010','Cash in bank-operating','A','45', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1020','Cash in bank-payroll','A','45', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'1040','Petty cash','A','45', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1070','Savings & short-term investments','A','46', NULL, false, false, string_to_array('', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno in ('1010', '1020', '1040', '1070'); SELECT account_heading_save(NULL,'1100','Accounts receivable', NULL); SELECT account_save(NULL,'1110','Accounts receivable','A','47a', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1115','Doubtful accounts allowance','A','47b', NULL, true, false, string_to_array('AR_paid', ':')); SELECT account_heading_save(NULL,'1200','Contributions receivable', NULL); SELECT account_save(NULL,'1210','Pledges receivable','A','48a', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1215','Doubtful pledges allowance','A','48b', NULL, true, false, string_to_array('AR_paid', ':')); SELECT account_save(NULL,'1225','Discounts - long-term pledges','A','48a', NULL, true, false, string_to_array('AR_paid', ':')); SELECT account_save(NULL,'1240','Grants receivable','A','49', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1245','Discounts - long-term grants','A','49', NULL, true, false, string_to_array('AR_paid', ':')); SELECT account_heading_save(NULL,'1300','Other receivables', NULL); SELECT account_save(NULL,'1310','Employee & trustee receivables','A','50', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1320','Notes/loans receivable','A','51a', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1325','Doubtful notes/loans allowance','A','51b', NULL, true, false, string_to_array('AR_paid', ':')); SELECT account_heading_save(NULL,'1400','Other assets', NULL); SELECT account_save(NULL,'1410','Inventories for sale','A','52', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1420','Inventories for use','A','52', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1450','Prepaid expenses','A','53', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1460','Accrued revenues','A','47a', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'1500','Investments', NULL); SELECT account_save(NULL,'1510','Marketable securities ','A','54', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1530','Land held for investment','A','55a', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1540','Buildings held for investment','A','55a', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1545','Accum deprec - bldg investment','A','55b', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'1580','Investments - other','A','56', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'1600','Fixed operating assets', NULL); SELECT account_save(NULL,'1610','Land - operating','A','57a', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1620','Buildings - operating','A','57a', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1630','Leasehold improvements','A','57a', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1640','Furniture, fixtures, & equip','A','57a', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1650','Vehicles','A','57a', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1660','Construction in progress','A','57a', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'1700','Accum deprec - fixed operating assets', NULL); SELECT account_save(NULL,'1725','Accum deprec - building','A','57b', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'1735','Accum amort - leasehold improvements','A','57b', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'1745','Accum deprec - furn,fix,equip','A','57b', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'1755','Accum deprec - vehicles','A','57b', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'1810','Other long-term assets','A','58', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1850','Split-interest agreements','A','58', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1910','Collections - art, etc','A','58', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1950','Funds held in trust by others','A','58', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'2000','Payables', NULL); SELECT account_save(NULL,'2010','Accounts payable','L','60', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'2020','Grants & allocations payable','L','61', NULL, false, false, string_to_array('AP', ':')); SELECT account_heading_save(NULL,'2100','Accrued liabilities', NULL); SELECT account_save(NULL,'2110','Accrued payroll','L','60', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2120','Accrued paid leave','L','60', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2130','Accrued payroll taxes','L','60', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2140','Accrued sales taxes','L','60', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2150','Accrued expenses - other','L','60', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'2300','Unearned/deferred revenue', NULL); SELECT account_save(NULL,'2310','Deferred contract revenue','L','62', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2350','Unearned/deferred revenue - other','L','62', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2410','Refundable advances','L','62', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'2500','Short-term notes & loans payable', NULL); SELECT account_save(NULL,'2510','Trustee & employee loans payable','L','63', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2550','Line of credit','L','65', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2560','Current portion - long-term loan','L','65', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2570','Short-term liabilities - other','L','65', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2610',' Split-interest liabilities','L','65', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'2700','Long-term notes & loans payable', NULL); SELECT account_save(NULL,'2710','Bonds payable','L','64a', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2730','Mortgages payable','L','64b', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2750','Capital leases','L','64b', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2770','Long-term liabilities - other','L','64a', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2810','Gov\'t-owned fixed assets liability','L','65', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2910','Custodial funds','L','65', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'3000','Unrestricted net assets', NULL); SELECT account_save(NULL,'3010','Unrestricted net assets','Q','21&67', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3020','Board-designated net assets','Q','21&67', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3030','Board designated quasi-endowment','Q','21&67', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3040','Fixed operating net assets','Q','21&67', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'3100','Temporarily restricted net assets', NULL); SELECT account_save(NULL,'3110','Use restricted net assets','Q','21&68', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3120','Time restricted net assets','Q','21&68', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'3200','Permanently restricted net assets', NULL); SELECT account_save(NULL,'3210','Endowment net assets','Q','21&69', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'4000','Revenue from direct contributions', NULL); SELECT account_save(NULL,'4010','Individual/small business contributions','I','1a', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'4020','Corporate contributions','I','1a', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'4070','Legacies & bequests','I','1a', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4075','Uncollectible pledges - estimated','I','contra1a', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'4085','Long-term pledges discount','I','contra1a', NULL, true, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'4100','Donated goods & services revenue', NULL); SELECT account_save(NULL,'4110','Donated professional services-GAAP','I','PartIV-A&82b', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4120','Donated other services - non-GAAP','I','PartIV-A&82b', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4130','Donated use of facilities','I','PartIV-A&82b', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4140','Gifts in kind - goods','I','1d', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'4150','Donated art, etc','I','1d', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL,'4200','Revenue from non-government grants', NULL); SELECT account_save(NULL,'4210','Corporate/business grants','I','1a', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4230','Foundation/trust grants','I','1a', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4250','Nonprofit organization grants','I','1a', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4255','Discounts - long-term grants','I','contra1a', NULL, true, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'4300','Revenue from split-interest agreements', NULL); SELECT account_save(NULL,'4310','Split-interest agreement contributions','I','1a', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4350','Gain (loss) split-interest agreements','I','20', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'4400','Revenue from indirect contributions', NULL); SELECT account_save(NULL,'4410','United Way or CFC contributions','I','1b', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4420','Affiliated organizations revenue','I','1b', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4430','Fundraising agencies revenue','I','1b', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_heading_save(NULL,'4500','Revenue from government grants', NULL); SELECT account_save(NULL,'4510','Agency (government) grants','I','1c', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4520','Federal grants','I','1c', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4530','State grants','I','1c', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4540','Local government grants','I','1c', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_heading_save(NULL,'5000','Revenue from government agencies', NULL); SELECT account_save(NULL,'5010','Agency (government) contracts/fees','I','2&93(g)', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'5020','Federal contracts/fees','I','2&93(g)', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'5030','State contracts/fees','I','2&93(g)', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'5040','Local government contracts/fees','I','2&93(g)', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'5080','Medicare/Medicaid payments','I','2&93f', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5100','Revenue from program-related sales & fees', NULL); SELECT account_save(NULL,'5180','Program service fees','I','2&93(a)', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'5185','Bad debts, est - program fees','I','2&93(a)', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5200','Revenue from dues', NULL); SELECT account_save(NULL,'5210','Membership dues-individuals','I','3&94', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'5220','Assessments and dues-organizations','I','3&94', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL,'5300','Revenue from investments', NULL); SELECT account_save(NULL,'5310','Interest-savings/short-term investments','I','4&95', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'5320','Dividends & interest - securities','I','5&96', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'5330','Real estate rent - debt-financed','I','6a&97a', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5335','Real estate rental cost - debt-financed','I','6b&97a', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5340','Real estate rent - not debt-financed','I','6a&97b', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5345','Real estate rental cost - not debt-financed','I','6b&97b', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5350','Personal property rent','I','6a&98', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5355','Personal property rental cost','I','6b&98', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'5360','Other investment income','I','7&99', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'5370','Securities sales - gross','I','8a-(A)&100', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5375','Securities sales cost ','I','8b-(A)&100', NULL, true, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5400','Revenue from other sources', NULL); SELECT account_save(NULL,'5410','Non-inventory sales - gross','I','8a-(B)&100', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'5415','Non-inventory sales cost ','I','8b-(B)&100', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'5440','Gross sales - inventory','I','10a&102', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'5445','Cost of inventory sold ','I','10b&102', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'5450','Advertising revenue','I','11&103', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'5460','Affiliate revenues from other entities','I','11&103', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'5490','Misc revenue','I','11&103', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_heading_save(NULL,'5800','Special events', NULL); SELECT account_save(NULL,'5810','Special events - non-gift revenue','I','9a&101', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'5820','Special events - gift revenue','I','1a&(9a)', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_heading_save(NULL,'6800','Unrealized gain (loss)', NULL); SELECT account_save(NULL,'6810','Unrealized gain (loss) - investments','I','PartIV-A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6820','Unrealized gain (loss) - other assets','I','PartIV-A', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'6900','Net assets released from restriction', NULL); SELECT account_save(NULL,'6910','Satisfaction of use restriction','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6920','LB&E acquisition satisfaction','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6930','Time restriction satisfaction','I','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'7000','Grantscts, & direct assistance', NULL); SELECT account_save(NULL,'7010','Contracts - program-related','E','22', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7020','Grants to other organizations','E','22', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7040','Awards & grants - individuals','E','22', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7050','Specific assistance - individuals','E','23', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7060','Benefits paid to or for members','E','24', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL,'7200','Salaries & related expenses', NULL); SELECT account_save(NULL,'7210','Officers & directors salaries','E','25', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7220','Salaries & wages - other','E','26', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7230','Pension plan contributions','E','27', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7240','Employee benefits - not pension','E','28', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7250','Payroll taxes, etc.','E','29', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'7500','Contract service expenses', NULL); SELECT account_save(NULL,'7510','Fundraising fees','E','30', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7520','Accounting fees','E','31', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7530','Legal fees','E','32', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7540','Professional fees - other','E','43', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7550','Temporary help - contract','E','43', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7580','Donated professional services - GAAP','E','PartIV-B,82b', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7590','Donated other services - non-GAAP','E','PartIV-B,82b', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL,'8100','Nonpersonnel expenses', NULL); SELECT account_save(NULL,'8110','Supplies','E','33', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8120','Donated materials & supplies','E','33', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8130','Telephone & telecommunications','E','34', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8140','Postage & shipping','E','35', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8150','Mailing services','E','35', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8170','Printing & copying','E','38', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8180','Books, subscriptions, references','E','38', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8190','In-house publications','E','38', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL,'8200','Facility & equipment expenses', NULL); SELECT account_save(NULL,'8210','Rent, parking, other occupancy','E','36', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8220','Utilities','E','36', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8230','Real estate taxes','E','36', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8240','Personal property taxes','E','36', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8250','Mortgage interest','E','36', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8260','Equipment rental & maintenance','E','37', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8270','Deprec & amort - allowable','E','42', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8280','Deprec & amort - not allowable','E','42', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8290','Donated facilities ','E','PartIV-B,82b', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'8300','Travel & meetings expenses', NULL); SELECT account_save(NULL,'8310','Travel','E','39', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8320','Conferences, conventions, meetings','E','40', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL,'8500','Other expenses', NULL); SELECT account_save(NULL,'8510','Interest-general','E','41', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8520','Insurance - non-employee related','E','43', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8530','Membership dues - organization','E','43', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8540','Staff development','E','43', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8550','List rental','E','43', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8560','Outside computer services','E','43', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8570','Advertising expenses','E','43', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8580','Contingency provisions','E','43', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8590','Other expenses','E','43', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL,'8600','Business expenses', NULL); SELECT account_save(NULL,'8610','Bad debt expense ','E','43', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8620','Sales taxes','E','43', NULL, false, false, string_to_array('AP_tax', ':')); SELECT account_save(NULL,'8630','UBITaxes ','E','43', NULL, false, false, string_to_array('AP_tax', ':')); SELECT account_save(NULL,'8650','Taxes - other','E','43', NULL, false, false, string_to_array('AP_tax', ':')); SELECT account_save(NULL,'8660','Fines, penalties, judgments','E','43', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8670','Organizational (corp) expenses','E','43', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'9800','Fixed asset purchases ', NULL); SELECT account_save(NULL,'9810','Capital purchases - land','A','capitalized', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9820','Capital purchases - building','A','capitalized', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9830','Capital purchases - equipment','A','capitalized', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9840','Capital purchases - vehicles','A','capitalized', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'9900','Other Allocations', NULL); SELECT account_save(NULL,'9910','Payments to affiliates','E','16', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9920','Additions to reserves','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9930','Program administration allocations','E','', NULL, false, false, string_to_array('', ':')); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '8620'),0); insert into tax (chart_id,rate) values ((select id from chart where accno = '8630'),0); insert into tax (chart_id,rate) values ((select id from chart where accno = '8650'),0); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '1410')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '4010')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '7510')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '5490')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '8590')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'USD'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'lbs'); commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/us/chart/Manufacturing.sql0000755000000000000000000002047711726631300020151 0ustar rootrootbegin; -- US_Manufacturing COA -- modify as needed -- SELECT account_heading_save(NULL,'1000','CURRENT ASSETS', NULL); SELECT account_save(NULL,'1060','Checking Account','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1065','Petty Cash','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno in ('1060', '1065'); SELECT account_save(NULL,'1200','Accounts Receivables','A','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1205','Allowance for doubtful accounts','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'1500','INVENTORY ASSETS', NULL); SELECT account_save(NULL,'1520','Inventory / General','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1530','Inventory / Raw Materials','A','1126', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1540','Inventory / Work in process','A','1125', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1550','Inventory / Finished Goods','A','1121', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL,'1800','CAPITAL ASSETS', NULL); SELECT account_save(NULL,'1820','Office Furniture & Equipment','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1825','Accum. Amort. -Furn. & Equip.','A','', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'1840','Vehicle','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1845','Accum. Amort. -Vehicle','A','', NULL, true, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'2000','CURRENT LIABILITIES', NULL); SELECT account_save(NULL,'2100','Accounts Payable','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_heading_save(NULL,'2600','LONG TERM LIABILITIES', NULL); SELECT account_save(NULL,'2620','Bank Loans','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2680','Loans from Shareholders','L','', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_heading_save(NULL,'3300','SHARE CAPITAL', NULL); SELECT account_save(NULL,'3350','Common Shares','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'3500','RETAINED EARNINGS', NULL); SELECT account_save(NULL,'3590','Retained Earnings - prior years','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'4000','SALES REVENUE', NULL); SELECT account_save(NULL,'4020','Sales / General','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'4030','Sales / Manufactured Goods','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'4040','Sales / Aftermarket Parts','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL,'4400','OTHER REVENUE', NULL); SELECT account_save(NULL,'4430','Shipping & Handling','I','', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'4440','Interest','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4450','Foreign Exchange Gain','I','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5000','COST OF GOODS SOLD', NULL); SELECT account_save(NULL,'5010','Purchases','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5020','COGS / General','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5030','COGS / Raw Materials','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5040','COGS / Direct Labor','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5050','COGS / Overhead','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5100','Freight','E','', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL,'5400','PAYROLL EXPENSES', NULL); SELECT account_save(NULL,'5410','Wages & Salaries','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5600','GENERAL & ADMINISTRATIVE EXPENSES', NULL); SELECT account_save(NULL,'5610','Accounting & Legal','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5615','Advertising & Promotions','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5620','Bad Debts','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5660','Amortization Expense','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5685','Insurance','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5690','Interest & Bank Charges','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5700','Office Supplies','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5760','Rent','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5765','Repair & Maintenance','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5780','Telephone','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5785','Travel & Entertainment','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5790','Utilities','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5795','Registrations','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5800','Licenses','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5810','Foreign Exchange Loss','E','', NULL, false, false, string_to_array('', ':')); -- SELECT account_save(NULL,'2110','Accrued Income Tax - Federal','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2120','Accrued Income Tax - State','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2130','Accrued Franchise Tax','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2140','Accrued Real & Personal Prop Tax','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2150','Sales Tax','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2210','Accrued Wages','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5510','Inc Tax Exp - Federal','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5520','Inc Tax Exp - State','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5530','Taxes - Real Estate','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5540','Taxes - Personal Property','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5550','Taxes - Franchise','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5560','Taxes - Foreign Withholding','E','', NULL, false, false, string_to_array('', ':')); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '2150'),0.05); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '1520')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '4020')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '5020')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '4450')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '5810')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'USD:CAD:EUR'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'lbs'); commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/us/chart/UCOA-Form990EZ.sql0000755000000000000000000006300611726631300017472 0ustar rootrootbegin; -- UCOA Form 990EZ -- SELECT account_heading_save(NULL,'1000','Cash', NULL); SELECT account_save(NULL,'1010','Cash in bank-operating','A','22', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1020','Cash in bank-payroll','A','22', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'1040','Petty cash','A','22', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1070','Savings & short-term investments','A','22', NULL, false, false, string_to_array('', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno in ('1010', '1020', '1040', '1070'); SELECT account_heading_save(NULL,'1100','Accounts receivable', NULL); SELECT account_save(NULL,'1110','Accounts receivable','A','24', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1115','Doubtful accounts allowance','A','24', NULL, true, false, string_to_array('AR_paid', ':')); SELECT account_heading_save(NULL,'1200','Contributions receivable', NULL); SELECT account_save(NULL,'1210','Pledges receivable','A','24', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1215','Doubtful pledges allowance','A','24', NULL, true, false, string_to_array('AR_paid', ':')); SELECT account_save(NULL,'1225','Discounts - long-term pledges','A','24', NULL, true, false, string_to_array('AR_paid', ':')); SELECT account_save(NULL,'1240','Grants receivable','A','24', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1245','Discounts - long-term grants','A','24', NULL, true, false, string_to_array('AR_paid', ':')); SELECT account_heading_save(NULL,'1300','Other receivables', NULL); SELECT account_save(NULL,'1310','Employee & trustee receivables','A','24', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1320','Notes/loans receivable','A','24', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1325','Doubtful notes/loans allowance','A','24', NULL, true, false, string_to_array('AR_paid', ':')); SELECT account_heading_save(NULL,'1400','Other assets', NULL); SELECT account_save(NULL,'1410','Inventories for sale','A','24', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1420','Inventories for use','A','24', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1450','Prepaid expenses','A','24', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1460','Accrued revenues','A','24', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'1500','Investments', NULL); SELECT account_save(NULL,'1510','Marketable securities ','A','22', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1530','Land held for investment','A','22', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1540','Buildings held for investment','A','22', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1545','Accum deprec - bldg investment','A','22', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'1580','Investments - other','A','22', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'1600','Fixed operating assets', NULL); SELECT account_save(NULL,'1610','Land - operating','A','23', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1620','Buildings - operating','A','23', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1630','Leasehold improvements','A','24', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1640','Furniture, fixtures, & equip','A','24', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1650','Vehicles','A','24', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1660','Construction in progress','A','24', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'1700','Accum deprec - fixed operating assets', NULL); SELECT account_save(NULL,'1725','Accum deprec - building','A','23', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'1735','Accum amort - leasehold improvements','A','24', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'1745','Accum deprec - furn,fix,equip','A','24', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'1755','Accum deprec - vehicles','A','24', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'1810','Other long-term assets','A','24', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1850','Split-interest agreements','A','24', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1910','Collections - art, etc','A','24', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1950','Funds held in trust by others','A','24', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'2000','Payables', NULL); SELECT account_save(NULL,'2010','Accounts payable','L','26', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'2020','Grants & allocations payable','L','26', NULL, false, false, string_to_array('AP', ':')); SELECT account_heading_save(NULL,'2100','Accrued liabilities', NULL); SELECT account_save(NULL,'2110','Accrued payroll','L','26', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2120','Accrued paid leave','L','26', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2130','Accrued payroll taxes','L','26', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2140','Accrued sales taxes','L','26', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2150','Accrued expenses - other','L','26', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'2300','Unearned/deferred revenue', NULL); SELECT account_save(NULL,'2310','Deferred contract revenue','L','26', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2350','Unearned/deferred revenue - other','L','26', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2410','Refundable advances','L','26', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'2500','Short-term notes & loans payable', NULL); SELECT account_save(NULL,'2510','Trustee & employee loans payable','L','26', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2550','Line of credit','L','26', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2560','Current portion - long-term loan','L','26', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2570','Short-term liabilities - other','L','26', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2610',' Split-interest liabilities','L','26', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'2700','Long-term notes & loans payable', NULL); SELECT account_save(NULL,'2710','Bonds payable','L','26', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2730','Mortgages payable','L','26', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2750','Capital leases','L','26', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2770','Long-term liabilities - other','L','26', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2810','Gov\'t-owned fixed assets liability','L','26', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2910','Custodial funds','L','26', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'3000','Unrestricted net assets', NULL); SELECT account_save(NULL,'3010','Unrestricted net assets','Q','21&27', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3020','Board-designated net assets','Q','21&27', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3030','Board designated quasi-endowment','Q','21&27', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3040','Fixed operating net assets','Q','21&27', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'3100','Temporarily restricted net assets', NULL); SELECT account_save(NULL,'3110','Use restricted net assets','Q','21&27', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3120','Time restricted net assets','Q','21&27', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'3200','Permanently restricted net assets', NULL); SELECT account_save(NULL,'3210','Endowment net assets','Q','21&27', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'4000','Revenue from direct contributions', NULL); SELECT account_save(NULL,'4010','Individual/small business contributions','I','1', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'4020','Corporate contributions','I','1', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'4070','Legacies & bequests','I','1', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4075','Uncollectible pledges - estimated','I','1', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'4085','Long-term pledges discount','I','1', NULL, true, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'4100','Donated goods & services revenue', NULL); SELECT account_save(NULL,'4110','Donated professional services-GAAP','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4120','Donated other services - non-GAAP','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4130','Donated use of facilities','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4140','Gifts in kind - goods','I','1', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'4150','Donated art, etc','I','1', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL,'4200','Revenue from non-government grants', NULL); SELECT account_save(NULL,'4210','Corporate/business grants','I','1', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4230','Foundation/trust grants','I','1', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4250','Nonprofit organization grants','I','1', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4255','Discounts - long-term grants','I','1', NULL, true, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'4300','Revenue from split-interest agreements', NULL); SELECT account_save(NULL,'4310','Split-interest agreement contributions','I','1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4350','Gain (loss) split-interest agreements','I','1', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'4400','Revenue from indirect contributions', NULL); SELECT account_save(NULL,'4410','United Way or CFC contributions','I','1', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4420','Affiliated organizations revenue','I','1', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4430','Fundraising agencies revenue','I','1', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_heading_save(NULL,'4500','Revenue from government grants', NULL); SELECT account_save(NULL,'4510','Agency (government) grants','I','1', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4520','Federal grants','I','1', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4530','State grants','I','1', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'4540','Local government grants','I','1', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_heading_save(NULL,'5000','Revenue from government agencies', NULL); SELECT account_save(NULL,'5010','Agency (government) contracts/fees','I','2', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'5020','Federal contracts/fees','I','2', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'5030','State contracts/fees','I','2', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'5040','Local government contracts/fees','I','2', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'5080','Medicare/Medicaid payments','I','2', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5100','Revenue from program-related sales & fees', NULL); SELECT account_save(NULL,'5180','Program service fees','I','2', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'5185','Bad debts, est - program fees','I','2', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5200','Revenue from dues', NULL); SELECT account_save(NULL,'5210','Membership dues-individuals','I','3', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'5220','Assessments and dues-organizations','I','3', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL,'5300','Revenue from investments', NULL); SELECT account_save(NULL,'5310','Interest-savings/short-term investments','I','4', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'5320','Dividends & interest - securities','I','4', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'5330','Real estate rent - debt-financed','I','8', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5335','Real estate rental cost - debt-financed','I','8', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5340','Real estate rent - not debt-financed','I','8', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5345','Real estate rental cost - not debt-financed','I','8', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5350','Personal property rent','I','8', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5355','Personal property rental cost','I','8', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'5360','Other investment income','I','4', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'5370','Securities sales - gross','I','5a', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5375','Securities sales cost ','I','5b', NULL, true, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5400','Revenue from other sources', NULL); SELECT account_save(NULL,'5410','Non-inventory sales - gross','I','5a', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'5415','Non-inventory sales cost ','I','5b', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'5440','Gross sales - inventory','I','8', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'5445','Cost of inventory sold ','I','8', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'5450','Advertising revenue','I','8', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'5460','Affiliate revenues from other entities','I','8', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'5490','Misc revenue','I','8', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_heading_save(NULL,'5800','Special events', NULL); SELECT account_save(NULL,'5810','Special events - non-gift revenue','I','6a', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'5820','Special events - gift revenue','I','1&(6a)', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_heading_save(NULL,'6800','Unrealized gain (loss)', NULL); SELECT account_save(NULL,'6810','Unrealized gain (loss) - investments','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6820','Unrealized gain (loss) - other assets','I','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'6900','Net assets released from restriction', NULL); SELECT account_save(NULL,'6910','Satisfaction of use restriction','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6920','LB&E acquisition satisfaction','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6930','Time restriction satisfaction','I','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'7000','Grantscts, & direct assistance', NULL); SELECT account_save(NULL,'7010','Contracts - program-related','E','10', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7020','Grants to other organizations','E','10', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7040','Awards & grants - individuals','E','10', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7050','Specific assistance - individuals','E','10', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7060','Benefits paid to or for members','E','11', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL,'7200','Salaries & related expenses', NULL); SELECT account_save(NULL,'7210','Officers & directors salaries','E','12', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7220','Salaries & wages - other','E','12', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7230','Pension plan contributions','E','12', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7240','Employee benefits - not pension','E','12', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7250','Payroll taxes, etc.','E','12', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'7500','Contract service expenses', NULL); SELECT account_save(NULL,'7510','Fundraising fees','E','13', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7520','Accounting fees','E','13', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7530','Legal fees','E','13', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7540','Professional fees - other','E','13', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7550','Temporary help - contract','E','13', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7580','Donated professional services - GAAP','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7590','Donated other services - non-GAAP','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL,'8100','Nonpersonnel expenses', NULL); SELECT account_save(NULL,'8110','Supplies','E','16', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8120','Donated materials & supplies','E','16', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8130','Telephone & telecommunications','E','16', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8140','Postage & shipping','E','15', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8150','Mailing services','E','15', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8170','Printing & copying','E','15', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8180','Books, subscriptions, references','E','15', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8190','In-house publications','E','15', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL,'8200','Facility & equipment expenses', NULL); SELECT account_save(NULL,'8210','Rent, parking, other occupancy','E','14', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8220','Utilities','E','14', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8230','Real estate taxes','E','14', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8240','Personal property taxes','E','14', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8250','Mortgage interest','E','14', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8260','Equipment rental & maintenance','E','14', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8270','Deprec & amort - allowable','E','16', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8280','Deprec & amort - not allowable','E','16', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8290','Donated facilities ','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'8300','Travel & meetings expenses', NULL); SELECT account_save(NULL,'8310','Travel','E','16', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8320','Conferences, conventions, meetings','E','16', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL,'8500','Other expenses', NULL); SELECT account_save(NULL,'8510','Interest-general','E','16', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8520','Insurance - non-employee related','E','16', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8530','Membership dues - organization','E','16', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8540','Staff development','E','16', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8550','List rental','E','16', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8560','Outside computer services','E','16', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8570','Advertising expenses','E','16', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8580','Contingency provisions','E','16', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8590','Other expenses','E','16', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL,'8600','Business expenses', NULL); SELECT account_save(NULL,'8610','Bad debt expense ','E','16', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8620','Sales taxes','E','16', NULL, false, false, string_to_array('AP_tax', ':')); SELECT account_save(NULL,'8630','UBITaxes ','E','16', NULL, false, false, string_to_array('AP_tax', ':')); SELECT account_save(NULL,'8650','Taxes - other','E','16', NULL, false, false, string_to_array('AP_tax', ':')); SELECT account_save(NULL,'8660','Fines, penalties, judgments','E','16', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8670','Organizational (corp) expenses','E','16', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'9800','Fixed asset purchases ', NULL); SELECT account_save(NULL,'9810','Capital purchases - land','A','capitalized', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9820','Capital purchases - building','A','capitalized', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9830','Capital purchases - equipment','A','capitalized', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9840','Capital purchases - vehicles','A','capitalized', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'9900','Other Allocations', NULL); SELECT account_save(NULL,'9910','Payments to affiliates','E','16', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9920','Additions to reserves','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9930','Program administration allocations','E','', NULL, false, false, string_to_array('', ':')); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '8620'),0); insert into tax (chart_id,rate) values ((select id from chart where accno = '8630'),0); insert into tax (chart_id,rate) values ((select id from chart where accno = '8650'),0); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '1410')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '4010')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '7510')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '5490')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '8590')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'USD'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'lbs'); commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/us/chart/General.sql0000755000000000000000000002227511726631300016721 0ustar rootrootbegin; -- US_General COA -- modify as needed -- SELECT account_heading_save(NULL,'1000','CURRENT ASSETS', NULL); SELECT account_save(NULL,'1060','Checking Account','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1065','Petty Cash','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno in ('1060', '1065'); SELECT account_save(NULL,'1200','Accounts Receivables','A','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1205','Allowance for doubtful accounts','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'1500','INVENTORY ASSETS', NULL); SELECT account_save(NULL,'1510','Inventory','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL,'1800','CAPITAL ASSETS', NULL); SELECT account_save(NULL,'1820','Office Furniture & Equipment','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1825','Accum. Amort. -Furn. & Equip.','A','', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'1840','Vehicle','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1845','Accum. Amort. -Vehicle','A','', NULL, true, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'2000','CURRENT LIABILITIES', NULL); SELECT account_save(NULL,'2100','Accounts Payable','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_heading_save(NULL,'2600','LONG TERM LIABILITIES', NULL); SELECT account_save(NULL,'2620','Bank Loans','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2680','Loans from Shareholders','L','', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_heading_save(NULL,'3300','SHARE CAPITAL', NULL); SELECT account_save(NULL,'3350','Common Shares','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'3500','RETAINED EARNINGS', NULL); SELECT account_save(NULL,'3590','Retained Earnings - prior years','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'4000','SALES REVENUE', NULL); SELECT account_save(NULL,'4010','Sales','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL,'4400','OTHER REVENUE', NULL); SELECT account_save(NULL,'4430','Shipping & Handling','I','', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'4440','Interest','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4450','Foreign Exchange Gain','I','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5000','COST OF GOODS SOLD', NULL); SELECT account_save(NULL,'5010','Purchases','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5100','Freight','E','', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL,'5400','PAYROLL EXPENSES', NULL); SELECT account_save(NULL,'5410','Wages & Salaries','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5600','GENERAL & ADMINISTRATIVE EXPENSES', NULL); SELECT account_save(NULL,'5610','Accounting & Legal','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5615','Advertising & Promotions','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5620','Bad Debts','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5660','Amortization Expense','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5685','Insurance','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5690','Interest & Bank Charges','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5700','Office Supplies','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5760','Rent','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5765','Repair & Maintenance','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5780','Telephone','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5785','Travel & Entertainment','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5790','Utilities','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5795','Registrations','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5800','Licenses','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5810','Foreign Exchange Loss','E','', NULL, false, false, string_to_array('', ':')); -- SELECT account_save(NULL,'2110','Accrued Income Tax - Federal','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2120','Accrued Income Tax - State','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2130','Accrued Franchise Tax','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2140','Accrued Real & Personal Prop Tax','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2150','Sales Tax','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2160','Accrued Use Tax Payable','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2210','Accrued Wages','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2220','Accrued Comp Time','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2230','Accrued Holiday Pay','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2240','Accrued Vacation Pay','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2310','Accr. Benefits - 401K','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2320','Accr. Benefits - Stock Purchase','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2330','Accr. Benefits - Med, Den','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2340','Accr. Benefits - Payroll Taxes','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2350','Accr. Benefits - Credit Union','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2360','Accr. Benefits - Savings Bond','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2370','Accr. Benefits - Garnish','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2380','Accr. Benefits - Charity Cont.','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5420','Wages - Overtime','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5430','Benefits - Comp Time','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5440','Benefits - Payroll Taxes','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5450','Benefits - Workers Comp','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5460','Benefits - Pension','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5470','Benefits - General Benefits','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5510','Inc Tax Exp - Federal','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5520','Inc Tax Exp - State','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5530','Taxes - Real Estate','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5540','Taxes - Personal Property','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5550','Taxes - Franchise','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5560','Taxes - Foreign Withholding','E','', NULL, false, false, string_to_array('', ':')); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '2150'),0.05); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '1510')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '4010')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '5010')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '4450')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '5810')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'USD:CAD:EUR'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'lbs'); -- commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/eg/0000755000000000000000000000000012060044550013450 5ustar rootrootledgersmb/sql/coa/eg/chart/0000755000000000000000000000000012060044550014551 5ustar rootrootledgersmb/sql/coa/eg/chart/General.sql0000755000000000000000000002256011726630426016672 0ustar rootrootbegin; -- SELECT account_heading_save(NULL, '1000', 'الاصول المتداولة', NULL); SELECT account_heading_save(NULL, '1500', 'المخزون كاصل', NULL); SELECT account_heading_save(NULL, '1800', 'الاصول الثابتة', NULL); SELECT account_heading_save(NULL, '2000', 'التزامات قصيرة الاجل', NULL); SELECT account_heading_save(NULL, '2600', 'التزامات طويلة الاجل', NULL); SELECT account_save(NULL,'2210','Workers Comp Payable','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2220','Vacation Pay Payable','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2250','Pension Plan Payable','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2260','Employment Insurance Payable','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5420','Employment Insurance Expense','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5430','Pension Plan Expense','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5440','Workers Comp Expense','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5470','Employee Benefits','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5650','Capital Cost Allowance Expense','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1060','نقدية بالبنك','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1065','نقديةبالصندوق','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno in ('1060', '1065'); SELECT account_save(NULL,'1520','مخزون - قطع غيار كمبيوتر','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1530','مخزون - برامج','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1540','مخزون - قطع اخرى','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1840','سيارات','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL, '1845','مخصص اهلاك سيارات','A','',NULL, true, false, '{}'); SELECT account_save(NULL,'1820','اثاث مكتبى و معدات','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL, '1825','مخصص اهلاك اثاث مكتبى و معدات','A','',NULL, true, false, '{}'); SELECT account_save(NULL,'2310','ضريبة مبيعات (10%)','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2320','ضريبة مبيعات (14%)','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2330','ضريبة مبيعات (30%)','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'1200','عملاء','A','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1205','مخصص ديون معدومة','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2100','موردين','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'2160','ضريبة شركات مستحقة','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2190','ضريبة دخل مستحقة','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2620','قروض من البنوك','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2680','قروض من حملة الاسهم','L','', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_heading_save(NULL, '3300', 'حقوق الملكية', NULL); SELECT account_save(NULL,'4020','مبيعات - قطع غيار','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'4030','مبيعات برامج','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'4040','مبيعات اخرى','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL, '4000', 'ايراد المبيعات', NULL); SELECT account_heading_save(NULL, '4300', 'ايراد استشارات', NULL); SELECT account_save(NULL,'4320','استشارات','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'4330','برمجة','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL, '4400', 'ايرادات اخرى', NULL); SELECT account_save(NULL,'4430','شحن و تعبئة','I','', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'4440','فائدة','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4450','ارباح تغيير عملة','I','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '5000', 'تكلفة البضاعة المباعة', NULL); SELECT account_save(NULL,'5010','مشتريات','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5020','تكلفة البضاعة المباعة - قطع غيار','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5030','تكلفة البضاعة المباعة - برامج','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5040','تكلفة البضاعة المباعة - اخرى','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5100','شحن','E','', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL, '5400', 'مصروفات الاجور', NULL); SELECT account_save(NULL,'5410','المرتبات','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3350','الاسهم','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '5600', 'مصروفات ادارية و عمومية', NULL); SELECT account_save(NULL,'5610','قانونية و محاسبية','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5615','دعاية و اعلان','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5765','اصلاح و صيانة','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5680','ضريبة دخل','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5685','تامين','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5620','ديون معدومة ','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5660','مصاريف اهلاك','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5690','قوائد و مصاريف بنكية','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5700','مهمات مكتبية','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5780','تلفون','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5760','ايجار','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5785','مصاريف سفر','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5795','رسوم','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5800','رخص','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5810','خسارة تحويل عملة','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5790','مرافق','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'2280','ضرائب مرتبات مستحقة','L','', NULL, false, false, string_to_array('', ':')); INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (SELECT id FROM chart WHERE accno = '1520')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (SELECT id FROM chart WHERE accno = '4020')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (SELECT id FROM chart WHERE accno = '5010')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (SELECT id FROM chart WHERE accno = '4450')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (SELECT id FROM chart WHERE accno = '5810')); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'USD:CAD:EUR'); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno = '2310'),'0.1',NULL); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno = '2320'),'0.14',NULL); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno = '2330'),'0.3',NULL); commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/py/0000755000000000000000000000000012060044550013505 5ustar rootrootledgersmb/sql/coa/py/gifi/0000755000000000000000000000000012060044550014423 5ustar rootrootledgersmb/sql/coa/py/gifi/General.sql0000755000000000000000000002103610573165441016540 0ustar rootrootbegin; -- Paraguay GIFI -- Plan de Cuentas Fiscal para Paraguay -- INSERT INTO gifi (accno,description) VALUES ('1','ACTIVOS'); INSERT INTO gifi (accno,description) VALUES ('1-01','ACTIVO CORRIENTE'); INSERT INTO gifi (accno,description) VALUES ('1-01-01','DISPONIBILIDADES'); INSERT INTO gifi (accno,description) VALUES ('1-01-01-01','Caja'); INSERT INTO gifi (accno,description) VALUES ('1-01-01-02','Recaudaciones a Depositar'); INSERT INTO gifi (accno,description) VALUES ('1-01-01-03','Bancos'); INSERT INTO gifi (accno,description) VALUES ('1-01-01-04','Otros valores'); INSERT INTO gifi (accno,description) VALUES ('1-01-02','INVERSIONES TEMPORARIAS'); INSERT INTO gifi (accno,description) VALUES ('1-01-02-01','Valores'); INSERT INTO gifi (accno,description) VALUES ('1-01-03','CRÉDITOS'); INSERT INTO gifi (accno,description) VALUES ('1-01-03-01','Clientes'); INSERT INTO gifi (accno,description) VALUES ('1-01-03-10','Menos: Previsión para incobrables'); INSERT INTO gifi (accno,description) VALUES ('1-01-03-11','Deudores varios'); INSERT INTO gifi (accno,description) VALUES ('1-01-03-12','Documentos / Cuentas a cobrar a Directores y Funcionarios'); INSERT INTO gifi (accno,description) VALUES ('1-01-03-13','Intereses a vencer'); INSERT INTO gifi (accno,description) VALUES ('1-01-03-14','Tarjetas de Créditos'); INSERT INTO gifi (accno,description) VALUES ('1-01-03-20','Menos: Previsión para Incobrables'); INSERT INTO gifi (accno,description) VALUES ('1-01-10','INVENTARIOS'); INSERT INTO gifi (accno,description) VALUES ('1-01-10-01','Mercaderías - Productos Terminados'); INSERT INTO gifi (accno,description) VALUES ('1-01-10-02','Productos en proceso'); INSERT INTO gifi (accno,description) VALUES ('1-01-10-03','Materias primas - Materiales'); INSERT INTO gifi (accno,description) VALUES ('1-01-10-04','Menos: Previsión por Obsolencia'); INSERT INTO gifi (accno,description) VALUES ('1-01-15','ANTICIPOS'); INSERT INTO gifi (accno,description) VALUES ('1-01-15-01','Importaciones en curso'); INSERT INTO gifi (accno,description) VALUES ('1-01-15-02','Proveedores'); INSERT INTO gifi (accno,description) VALUES ('1-01-20','OTROS ACTIVOS'); INSERT INTO gifi (accno,description) VALUES ('1-01-20-01','Gastos no devengados'); INSERT INTO gifi (accno,description) VALUES ('1-02','ACTIVO NO CORRIENTE'); INSERT INTO gifi (accno,description) VALUES ('1-02-01','CRÉDITOS'); INSERT INTO gifi (accno,description) VALUES ('1-02-01-01','Fondos con destino especial'); INSERT INTO gifi (accno,description) VALUES ('1-02-01-02','Documentos / Cuentas a cobrar a Directores y Funcionarios'); INSERT INTO gifi (accno,description) VALUES ('1-02-01-03','Documentos por cobrar'); INSERT INTO gifi (accno,description) VALUES ('1-02-01-04','Deudores varios'); INSERT INTO gifi (accno,description) VALUES ('1-02-01-05','Créditos en Gestión de Cobro'); INSERT INTO gifi (accno,description) VALUES ('1-02-01-06','Menos: Previsiones para incobrables'); INSERT INTO gifi (accno,description) VALUES ('1-02-10','PROPIEDAD, PLANTA Y EQUIPO'); INSERT INTO gifi (accno,description) VALUES ('1-02-10-01','Bienes en operación'); INSERT INTO gifi (accno,description) VALUES ('1-02-10-02','Depreciación acumulada'); INSERT INTO gifi (accno,description) VALUES ('1-02-10-03','Bienes fuera de operación'); INSERT INTO gifi (accno,description) VALUES ('1-02-20','ACTIVOS INTANGIBLES'); INSERT INTO gifi (accno,description) VALUES ('1-02-20-01','Licencia de manufactura'); INSERT INTO gifi (accno,description) VALUES ('1-02-20-02','Marcas'); INSERT INTO gifi (accno,description) VALUES ('1-02-20-03','Gastos de desarrollo'); INSERT INTO gifi (accno,description) VALUES ('1-02-20-04','Amortización Acumulada'); INSERT INTO gifi (accno,description) VALUES ('2','PASIVOS Y PATRIMONIO NETO'); INSERT INTO gifi (accno,description) VALUES ('2-01','PASIVO CORRIENTE'); INSERT INTO gifi (accno,description) VALUES ('2-01-01','CUENTAS A PAGAR'); INSERT INTO gifi (accno,description) VALUES ('2-01-01-01','Proveedores Locales'); INSERT INTO gifi (accno,description) VALUES ('2-01-01-02','Proveedores del Exterior'); INSERT INTO gifi (accno,description) VALUES ('2-01-01-03','Intereses a Vencer'); INSERT INTO gifi (accno,description) VALUES ('2-01-01-04','Acreedores varios'); INSERT INTO gifi (accno,description) VALUES ('2-01-05','PRÉSTAMOS FINANCIEROS'); INSERT INTO gifi (accno,description) VALUES ('2-01-05-01','Sobregiros en cuenta corriente'); INSERT INTO gifi (accno,description) VALUES ('2-01-05-02','Documentos a pagar'); INSERT INTO gifi (accno,description) VALUES ('2-01-05-03','Porción circulante de préstamos a largo plazo'); INSERT INTO gifi (accno,description) VALUES ('2-01-05-04','Intereses a devengar'); INSERT INTO gifi (accno,description) VALUES ('2-01-10','PROVISIONES'); INSERT INTO gifi (accno,description) VALUES ('2-01-10-01','Impuesto a la Renta a pagar'); INSERT INTO gifi (accno,description) VALUES ('2-01-10-02','IVA a pagar'); INSERT INTO gifi (accno,description) VALUES ('2-01-10-03','Retenciones de Impuestos'); INSERT INTO gifi (accno,description) VALUES ('2-01-10-04','Para pago de planes de beneficios para empleados'); INSERT INTO gifi (accno,description) VALUES ('2-01-10-05','Aportes y Retenciones a Pagar'); INSERT INTO gifi (accno,description) VALUES ('2-01-10-06','Gastos Acumulados a Pagar'); INSERT INTO gifi (accno,description) VALUES ('2-01-20','OTROS PASIVOS'); INSERT INTO gifi (accno,description) VALUES ('2-01-20-01','Préstamos de Terceros'); INSERT INTO gifi (accno,description) VALUES ('2-01-20-02','Anticipo de Clientes'); INSERT INTO gifi (accno,description) VALUES ('2-01-40','GANANCIAS DIFERIDAS'); INSERT INTO gifi (accno,description) VALUES ('2-01-40-01','Ingresos no realizados'); INSERT INTO gifi (accno,description) VALUES ('2-01-40-02','Costos y gastos aplicables a los ingresos no realizables'); INSERT INTO gifi (accno,description) VALUES ('2-02','PASIVOS NO CORRIENTES'); INSERT INTO gifi (accno,description) VALUES ('2-02-01','PRÉSTAMOS FINANCIEROS'); INSERT INTO gifi (accno,description) VALUES ('2-02-01-01','Préstamos en Bancos'); INSERT INTO gifi (accno,description) VALUES ('2-02-05','PREVISIONES'); INSERT INTO gifi (accno,description) VALUES ('2-02-05-01','Previsión para indemnización'); INSERT INTO gifi (accno,description) VALUES ('2-02-05-02','Otras Contingencias'); INSERT INTO gifi (accno,description) VALUES ('2-03','PATRIMONIO NETO'); INSERT INTO gifi (accno,description) VALUES ('2-03-01','CAPITAL'); INSERT INTO gifi (accno,description) VALUES ('2-03-01-01','Capital suscripto'); INSERT INTO gifi (accno,description) VALUES ('2-03-01-02','Capital a integrar'); INSERT INTO gifi (accno,description) VALUES ('2-03-01-03','Capital realizado'); INSERT INTO gifi (accno,description) VALUES ('2-03-02','RESERVAS'); INSERT INTO gifi (accno,description) VALUES ('2-03-02-01','Reserva Legal'); INSERT INTO gifi (accno,description) VALUES ('2-03-02-02','Reservas facultativas'); INSERT INTO gifi (accno,description) VALUES ('2-03-02-03','Reserva de revalúo'); INSERT INTO gifi (accno,description) VALUES ('2-03-03','RESULTADOS'); INSERT INTO gifi (accno,description) VALUES ('2-03-03-01','Resultados Acumulados'); INSERT INTO gifi (accno,description) VALUES ('2-03-03-02','Resultado del Ejercicio'); INSERT INTO gifi (accno,description) VALUES ('3-01','Ventas Netas. Sector Público'); INSERT INTO gifi (accno,description) VALUES ('3-02','Ventas Netas. Sector Privado'); INSERT INTO gifi (accno,description) VALUES ('3-10','Más otros ingresos'); INSERT INTO gifi (accno,description) VALUES ('3-10-01','Intereses ganados'); INSERT INTO gifi (accno,description) VALUES ('3-10-02','Otros (indicar naturaleza)'); INSERT INTO gifi (accno,description) VALUES ('3-20','Menos:'); INSERT INTO gifi (accno,description) VALUES ('3-20-01','Gastos financieros'); INSERT INTO gifi (accno,description) VALUES ('3-30-01','Ganancias'); INSERT INTO gifi (accno,description) VALUES ('4-01','Costo de Mercaderías (productos o servicios vendidos'); INSERT INTO gifi (accno,description) VALUES ('4-10','Menos:'); INSERT INTO gifi (accno,description) VALUES ('4-11','Gastos operacionales'); INSERT INTO gifi (accno,description) VALUES ('4-12','Gastos de ventas'); INSERT INTO gifi (accno,description) VALUES ('4-13','Gastos de administración'); INSERT INTO gifi (accno,description) VALUES ('4-20','Otros (indicar naturaleza)'); INSERT INTO gifi (accno,description) VALUES ('4-30','Pérdidas'); INSERT INTO gifi (accno,description) VALUES ('5-10','Más: (o menos) efectos de los precios cambiantes'); INSERT INTO gifi (accno,description) VALUES ('5-20','Más: (o menos) ajuste de ejercicios anteriores'); INSERT INTO gifi (accno,description) VALUES ('5-50','Impuesto a la Renta'); commit; ledgersmb/sql/coa/py/chart/0000755000000000000000000000000012060044550014606 5ustar rootrootledgersmb/sql/coa/py/chart/General.sql0000755000000000000000000010522311577441411016723 0ustar rootrootbegin; -- -- LedgerSMB Sample COA - Paraguay -- Version: 2.4.6 -- Submitted by: Mario L. Epp -- Date: 2005-01-03 -- -- INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.000','ACTIVO','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.100','ACTIVO CORRIENTE','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.110','DISPONIBLE','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.111','Caja','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.111.01','Recaudaciones a depositar','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.111.02','Fondo fijo','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.111.03','Valores a depositar','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.111.04','Monedas extranjeras','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.112','Bancos','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.112.01','Cuenta Corriente','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.112.02','Caja de Ahorro','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.120','VALORES NEGOCIABLES / INVERSIONES TRANSITORIAS','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.120.01','Títulos y acciones','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.120.02','Títulos públicos','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.120.03','Depósito a plazo fijo','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.120.04','Previsión fluctuaciones y desvalorizaciones (regularizadora)','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.130','CRÉDITOS','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.131','Créditos por ventas','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.132','Otros créditos','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.140','BIENES DE CAMBIO','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.141','Mercaderías de reventa','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.142','Mercaderías en proceso de producción','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.150','OTROS ACTIVOS CORRIENTES','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.151','Muestras y otros materiales de propaganda','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.152','Combustibles','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.153','Repuestos','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.154','Embalajes y envases','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.155','Materiales de oficina','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.156','Materiales diversos','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.200','REALIZABLE A LARGO PLAZO','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.210','INVERSIONES PERMANENTES','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.211','Títulos públicos','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.212','Debenturas','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.213','Inversiones en otras empresas','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.214','Previsión fluctuaciones y desvalorzaciones','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.220','CRÉDITOS','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.221','Créditos por ventas','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.222','Otros créditos','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.300','ACTIVO FIJO','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.310','MUEBLES, ÚTILES Y ENSERES','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.311','MUEBLES Y EQUIPOS','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.311.01','Muebles y equipos - Costo de origen','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.311.02','Muebles y equipos - Mejoras','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.311.03','Muebles y equipos - Revalúo','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.311.04','Muebles y equipos - (Depreciaciones acumuladas)','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.312','ÚTILES Y ENSERES','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.312.01','Útiles y enseres - Costo de origen','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.312.02','Útiles y enseres - Mejoras','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.312.03','Útiles y enseres - Revalúo','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.312.04','Útiles y enseres - (Depreciaciones acumuladas)','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.320','MAQUINARIAS, HERRAMIENTAS Y EQUIPOS','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.321','MAQUINARIAS','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.321.01','Maquinarias - Costo de origen','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.321.02','Maquinarias - Mejoras','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.321.03','Maquinarias - Revalúo','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.321.04','Maquinarias - (Depreciaciones acumuladas)','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.322','HERRAMIENTAS Y EQUIPOS','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.322.01','Herramientas y Equipos - Costo de origen','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.322.02','Herramientas y Equipos - Mejoras','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.322.03','Herramientas y Equipos - Revalúo','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.322.04','Herramientas y Equipos - (Depreciaciones acumuladas)','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.323','EQUIPOS INFORMÁTICOS','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.323.01','Equipos informáticos - Costo de origen','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.323.02','Equipos informáticos - Mejoras','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.323.03','Equipos informáticos - Revalúo','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.323.04','Equipos informáticos - (Depreciaciones acumuladas)','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.330','TRANSPORTE TERRESTRE','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.331','AUTOS, CAMIONETAS, CAMIONES O ACOPLADOS','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.331.01','Autos, camionetas, camiones o acoplados - Costo de origen','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.331.02','Autos, camionetas, camiones o acoplados - Mejoras','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.331.03','Autos, camionetas, camiones o acoplados - Revalúo','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.331.04','Autos, camionetas, camiones o acoplados - (Depreciaciones acumuladas)','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.332','MOTOCICLETAS, TRICICLOS Y BICICLETAS','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.332.01','Motocicletas, triciclos y bicicletas - Costo de origen','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.332.02','Motocicletas, triciclos y bicicletas - Mejoras','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.332.03','Motocicletas, triciclos y bicicletas - Revalúo','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.332.04','Motocicletas, triciclos y bicicletas - (Depreciaciones acumuladas)','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.333','BIENES PARA TRANSPORTE TERRESTRE','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.333.01','Bienes para transporte terrestre - Costo de origen','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.333.02','Bienes para transporte terrestre - Mejoras','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.333.03','Bienes para transporte terrestre - Revalúo','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.333.04','Bienes para transporte terrestre - (Depreciaciones acumuladas)','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.340','TRANSPORTE AÉREO','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.341','AVIONES Y MATERIAL DE VUELO','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.341.01','Aviones y material de vuelo - Costo de origen','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.341.02','Aviones y material de vuelo - Mejoras','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.341.03','Aviones y material de vuelo - Revalúo','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.341.04','Aviones y material de vuelo - (Depreciaciones acumuladas)','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.342','INSTALACIONES DE TIERRA','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.342.01','Instalaciones de tierra - Costo de origen','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.342.02','Instalaciones de tierra - Mejoras','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.342.03','Instalaciones de tierra - Revalúo','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.342.04','Instalaciones de tierra - (Depreciaciones acumuladas)','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.350','TRANSPORTE MARÍTIMO Y FLUVIAL','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.351','EMBARCACIONES EN GENERAL','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.351.01','Embarcaciones en general - Costo de origen','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.351.02','Embarcaciones en general - Mejoras','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.351.03','Embarcaciones en general - Revalúo','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.351.04','Embarcaciones en general - (Depreciaciones acumuladas)','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.352','CANOAS, BOTES Y DEMÁS BIENES','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.352.01','Canoas, botes y demás bienes - Costo de origen','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.352.02','Canoas, botes y demás bienes - Mejoras','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.352.03','Canoas, botes y demás bienes - Revalúo','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.352.04','Canoas, botes y demás bienes - (Depreciaciones acumuladas)','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.360','TRANSPORTE FERROVIARIO','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.361','MATERIALES RODANTES','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.361.01','Materiales rodantes - Costo de origen','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.361.02','Materiales rodantes - Mejoras','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.361.03','Materiales rodantes - Revalúo','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.361.04','Materiales rodantes - (Depreciaciones acumuladas)','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.362','VÍAS Y DEMÁS BIENES','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.362.01','Vías y demás bienes - Costo de origen','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.362.02','Vías y demás bienes - Mejoras','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.362.03','Vías y demás bienes - Revalúo','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.362.04','Vías y demás bienes - (Depreciaciones acumuladas)','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.370','INMUEBLES','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.371','CONSTRUCCIONES EN INMUEBLES URBANOS','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.371.01','Construcciones en inmuebles urbanos - Costo de origen','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.371.02','Construcciones en inmuebles urbanos - Mejoras','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.371.03','Construcciones en inmuebles urbanos - Revalúo','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.371.04','Construcciones en inmuebles urbanos - (Depreciaciones acumuladas)','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.372','CONSTRUCCIONES EN INMUEBLES RURALES','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.372.01','Construcciones en inmuebles rurales - Costo de origen','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.372.02','Construcciones en inmuebles rurales - Mejoras','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.372.03','Construcciones en inmuebles rurales - Revalúo','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.372.04','Construcciones en inmuebles rurales - (Depreciaciones acumuladas)','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.373','CONSTRUCCIONES EN INMUEBLES AJENOS','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.373.01','Construcciones en inmuebles ajenos - Costo de origen','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.373.02','Construcciones en inmuebles ajenos - Mejoras','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.373.03','Construcciones en inmuebles ajenos - Revalúo','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.373.04','Construcciones en inmuebles ajenos - (Depreciaciones acumuladas)','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.381','RESTANTES BIENES','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.381.01','Restantes bienes - Costo de origen','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.381.02','Restantes bienes - Mejoras','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.381.03','Restantes bienes - Revalúo','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.381.04','Restantes bienes - (Depreciaciones acumuladas)','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.390','BIENES INTANGIBLES','H','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.391','Llave de negocio','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.392','Marcas registradas','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.393','Concesiones','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.394','Patente de invención','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.395','Gastos de constitución y organización','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.396','Gastos de reorganización','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.397','Gastos de proyectos de inversión','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.398','Gastos de desarrollo e investigación','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('1.399','(Amortizaciones acumuladas)','A','A','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('2.000','PASIVO','H','L','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('2.100','CIRCULANTE','H','L','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('2.110','DEUDAS','H','L','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('2.111','Acreedores por compras','A','L','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('2.112','Deudas bancarias y financieras','A','L','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('2.113','Otras deudas','A','L','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('2.150','PROVISIONES','H','L','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('2.151','IVA a pagar','A','L','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('2.200','EXIGIBLE A LARGO PLAZO','H','L','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('2.210','DEUDAS','H','L','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('2.211','Acreedores por compras','A','L','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('2.212','Deudas bancarias y financieras','A','L','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('2.213','Otras deudas','A','L','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('2.220','PREVISIONES','H','L','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('2.221','Previsición para indemnización por despidos','A','L','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('2.222','Previsición para indemnización por accidente','A','L','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('3.000','PATRIMONIO NETO','H','Q','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('3.100','CAPITAL','A','Q','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('3.200','RESERVAS','H','Q','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('3.210','Reserva legal','A','Q','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('3.220','Reserva de revalúo','A','Q','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('3.230','Prima de emisión','A','Q','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('3.240','Reserva estatutaria','A','Q','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('3.300','RESULTADOS','H','Q','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('3.310','Resultados acumulados','A','Q','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('3.320','Resultados del ejercicio','A','Q','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('4.000','INGRESOS','H','I','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('4.100','INGRESOS OPERATIVOS','H','I','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('4.110','Venta de mercadrías','A','I','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('4.120','Venta de servicios','A','I','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('4.130','Otros ingresos operativos','H','I','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('4.130.01','Intereses ganados','A','I','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('4.130.02','Descuentos obtenidos','A','I','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('4.130.03','Comisiones obtenidas','A','I','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('4.200','INGRESOS NO OPERATIVOS','H','I','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('4.210','Utilidad en venta de bienes de uso','A','I','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('4.220','Alquileres ganados','A','I','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('4.230','Incobrables recuperados','A','I','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('4.240','Utilidad en venta de bienes intangibles','A','I','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('4.250','Utilidades varias','A','I','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('4.300','INGRESOS EXTRAORDINARIOS','H','I','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('4.310','Utilidad en venta de bienes de uso','A','I','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('4.320','Donaciones y premios','A','I','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('4.330','Premios','A','I','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('4.340','Diferencias de cambios positivos','A','I','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.000','EGRESOS','H','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.100','EGRESOS OPERATIVOS','H','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.110','COSTO DE MERCADERÍAS VENDIDAS','H','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.110.01','Costo de ventas sección 1','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.110.20','Costo de ventas producto 1','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.110.40','Costo de ventas diversas','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.110.60','Costo de ventas productos elaborados','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.120','COSTO DE SERVICIOS VENDIDOS','H','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.120.01','Costo de servicios','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.130','GASTOS DE VENTAS','H','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.130.01','Comisiones sobre ventas','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.130.02','Publicidad y propaganda','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.130.03','Gastos de viajes','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.130.04','Gastos de exportación','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.130.05','Otros gastos de ventas','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.140','GASTOS DE ADMINISTRACIÓN','H','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.140.01','Aguinaldos','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.140.02','Alquileres pagados','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.140.03','Depreciación bienes de uso','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.140.04','Depreciación bienes intangibles','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.140.05','Bonificación familiar','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.140.06','Créditos incobrables','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.140.07','Aporte patronal sobre salarios','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.140.08','Fletes y acarreos','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.140.09','Luz, teléfono y agua','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.140.10','Impuestos, tasas y contribuciones','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.140.11','Seguros','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.140.12','Gastos de útiles e impresos','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.140.13','Sueldos y jornales','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.140.14','Remuneración personal superior','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.140.15','Honorarios profesionales','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.140.16','Gastos de representación','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.140.17','Gastos de cobranza','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.140.18','Gastos judiciales','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.140.19','Otros gastos de administración','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.150','GASTOS FINANCIEROS','H','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.150.01','Intereses pagados','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.150.02','Gastos bancarios','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.150.03','Otros gastos financieros','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.200','EGRESOS NO OPERATIVOS','H','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.210','Bajas bienes de uso','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.220','Gastos inmuebles alquileres','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.230','Pérdidas en ventas bienes de uso','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.240','Otros resultados negativos no operativos','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.300','EGRESOS EXTRAORDINARIOS','H','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.310','Pérdidas en ventas bienes de uso','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.320','Donaciones y contribuciones negativas','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.330','Indemnizaciones a terceros','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.340','Diferencias de cambios negativos','A','E','',''); INSERT INTO chart (accno, description, charttype, category, link, gifi_accno) VALUES ('5.350','Otros resultados negativos extraordinarios','A','E','',''); -- INSERT INTO tax (chart_id,rate) VALUES ((select id from chart where accno = '2.151'),'0.1'); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '1.141')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '4.110')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '5.110.01')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '4.340')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '5.340')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'PYG:USD:EUR'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); -- commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/hu/0000755000000000000000000000000012060044550013471 5ustar rootrootledgersmb/sql/coa/hu/gifi/0000755000000000000000000000000012060044550014407 5ustar rootrootledgersmb/sql/coa/hu/gifi/General.sql0000755000000000000000000000322010573160304016510 0ustar rootrootbegin; --Hungarian GIFI / Magyar gyûjtõkódok -- amelyek csak példaként szolgálnak INSERT INTO gifi (accno,description) VALUES ('114','Tárgyi eszközök'); INSERT INTO gifi (accno,description) VALUES ('119','Tárgyi eszközök ÉCS'); INSERT INTO gifi (accno,description) VALUES ('261','Áruk'); INSERT INTO gifi (accno,description) VALUES ('311','Vevõk'); INSERT INTO gifi (accno,description) VALUES ('381','Pénztár'); INSERT INTO gifi (accno,description) VALUES ('384','Bank'); INSERT INTO gifi (accno,description) VALUES ('454','Szállítók'); INSERT INTO gifi (accno,description) VALUES ('466','Visszaigényelhetõ ÁFA'); INSERT INTO gifi (accno,description) VALUES ('467','Fizetendõ ÁFA'); INSERT INTO gifi (accno,description) VALUES ('520','Bérleti díj'); INSERT INTO gifi (accno,description) VALUES ('521','Telefon'); INSERT INTO gifi (accno,description) VALUES ('599','Egyéb költségek'); INSERT INTO gifi (accno,description) VALUES ('814','ELÁBÉ'); INSERT INTO gifi (accno,description) VALUES ('870','Árfolyamveszteség'); INSERT INTO gifi (accno,description) VALUES ('911','Árbevétel'); INSERT INTO gifi (accno,description) VALUES ('970','Árfolyamnyereség'); INSERT INTO gifi (accno,description) VALUES ('1','BEFEKTETETT ESZKÖZÖK'); INSERT INTO gifi (accno,description) VALUES ('2','KÉSZLETEK'); INSERT INTO gifi (accno,description) VALUES ('3','KÖVETELÉSEK'); INSERT INTO gifi (accno,description) VALUES ('4','KÖTELEZETTSÉGEK'); INSERT INTO gifi (accno,description) VALUES ('5','KÖLTSÉGEK'); INSERT INTO gifi (accno,description) VALUES ('8','RÁFORDÍTÁSOK'); INSERT INTO gifi (accno,description) VALUES ('9','BEVÉTELEK'); -- commit; ledgersmb/sql/coa/hu/chart/0000755000000000000000000000000012060044550014572 5ustar rootrootledgersmb/sql/coa/hu/chart/Complete.sql0000644000000000000000000013700111730345473017100 0ustar rootrootbegin; --Hungarian chart of accounts Complete -- Magyar fõkönyvi számlák, amely majdnem teljes -- SELECT account_heading_save(NULL, '1', 'BEFEKTETETT ESZKÖZÖK', NULL); SELECT account_heading_save(NULL, '3', 'KÖVETELÉSEK', NULL); SELECT account_heading_save(NULL, '8', 'RÁFORDÍTÁSOK', NULL); SELECT account_heading_save(NULL, '9', 'BEVÉTELEK', NULL); SELECT account_heading_save(NULL, '4', 'FORRÁSOK', NULL); SELECT account_heading_save(NULL, '5', 'KÖLTSÉGNEMEK', NULL); SELECT account_heading_save(NULL, '11', 'Immateriális javak', NULL); SELECT account_heading_save(NULL, '12', 'Ingatlanok', NULL); SELECT account_heading_save(NULL, '13', 'Műszaki gépek, berendezések, járművek', NULL); SELECT account_heading_save(NULL, '14', 'Egyéb gépek, berendezések, járművek', NULL); SELECT account_heading_save(NULL, '15', 'Beruházások', NULL); SELECT account_heading_save(NULL, '114', 'Szellemi termékek', NULL); SELECT account_heading_save(NULL, '117', 'Immateriális javak értékhelyesbítése', NULL); SELECT account_heading_save(NULL, '118', 'Immateriális javak terven felüli értékcsökkenése', NULL); SELECT account_heading_save(NULL, '119', 'Immateriális javak értékcsökkenése', NULL); SELECT account_heading_save(NULL, '131', 'Termelő gépek, berendezések', NULL); SELECT account_heading_save(NULL, '132', 'Járművek', NULL); SELECT account_heading_save(NULL, '139', 'Mászeki gépek, berendezések, járművek értékcsökkenése', NULL); SELECT account_heading_save(NULL, '137', 'Műszaki gépek, berendezések járművek értékhelyesbítése', NULL); SELECT account_heading_save(NULL, '138', 'Műszaki gépek, berendezések, járművek terven felüli értékcsökkenése', NULL); SELECT account_heading_save(NULL, '141', 'Egyéb gép, berendezés, szerszám', NULL); SELECT account_heading_save(NULL, '142', 'Egyéb járművek', NULL); SELECT account_heading_save(NULL, '143', 'Irodai, igazgatási berendezés, felszerelés', NULL); SELECT account_heading_save(NULL, '145', 'Kisértékű tárgyi eszköz', NULL); SELECT account_heading_save(NULL, '147', 'Egyéb gépek, berendezések, járművek értékhelyesbítése', NULL); SELECT account_heading_save(NULL, '149', 'Egyéb gépek, berendezések, járművek elszámolt értékcsökkenése', NULL); SELECT account_heading_save(NULL, '148', 'Egyéb gépek, berendezések, járművek terven felüli értékcsökkenése', NULL); SELECT account_heading_save(NULL, '161', 'Befejezetlen beruházások', NULL); SELECT account_heading_save(NULL, '21', 'Anyagok', NULL); SELECT account_heading_save(NULL, '26', 'Kereskedelmi áruk', NULL); SELECT account_heading_save(NULL, '31', 'Követelések áruszállításból, szolgáltatásból', NULL); SELECT account_heading_save(NULL, '32', 'Követelések kapcsolt vállakozással szemben', NULL); SELECT account_heading_save(NULL, '33', 'Követelések egyéb részesedési viszonyban lévő vállalkozással szemben', NULL); SELECT account_heading_save(NULL, '34', 'Váltókövetelések', NULL); SELECT account_heading_save(NULL, '35', 'Adott előlegek', NULL); SELECT account_heading_save(NULL, '36', 'Egyéb követelések', NULL); SELECT account_heading_save(NULL, '37', 'Értékpapirok', NULL); SELECT account_heading_save(NULL, '38', 'Pénzeszközök', NULL); SELECT account_heading_save(NULL, '39', 'Aktiv időbeli elhatárolások', NULL); SELECT account_heading_save(NULL, '321', 'Követelések', NULL); SELECT account_heading_save(NULL, '325', 'Jegyzett de be nem fizetett tőke', NULL); SELECT account_heading_save(NULL, '329', 'Követelések értékvesztése', NULL); SELECT account_heading_save(NULL, '331', 'Követelések egyéb részesedési viszonyban lévő vállalattal szemben', NULL); SELECT account_heading_save(NULL, '332', 'Jegyzett, de még be nem fizetett tőke egyéb részesedési viszonyban lévő vállalkozástól', NULL); SELECT account_heading_save(NULL, '339', 'Egyéb részesedési viszonyban lévő vállakozással szembeni követelés értékvesztése', NULL); SELECT account_heading_save(NULL, '366', 'Rövid lejáratra adott pénzkölcsönök', NULL); SELECT account_heading_save(NULL, '381', 'Pénztárak', NULL); SELECT account_heading_save(NULL, '382', 'Valutapénztárak', NULL); SELECT account_heading_save(NULL, '384', 'Elszámolási betétszámlák (Ft)', NULL); SELECT account_heading_save(NULL, '386', 'Deviza betétszámlák', NULL); SELECT account_heading_save(NULL, '389', 'Átvezetési számlák', NULL); SELECT account_heading_save(NULL, '311', 'Belföldi vevők', NULL); SELECT account_heading_save(NULL, '316', 'Külföldi vevők', NULL); SELECT account_heading_save(NULL, '41', 'Saját tőke', NULL); SELECT account_heading_save(NULL, '42', 'Céltartalékok', NULL); SELECT account_heading_save(NULL, '43', 'Hátrasorolt kötelezettségek', NULL); SELECT account_heading_save(NULL, '44', 'Hosszú lejáratú kötelezettségek', NULL); SELECT account_heading_save(NULL, '442', 'Hosszú lejáratra kapott kölcsönök', NULL); SELECT account_heading_save(NULL, '443', 'Beruházási fejlesztési hitelek', NULL); SELECT account_heading_save(NULL, '444', 'Egyéb hosszú lejáratú hitelek', NULL); SELECT account_heading_save(NULL, '447', 'Tartós kötelezettség egyéb vállalkozással szemben', NULL); SELECT account_heading_save(NULL, '446', 'Tartós kötelezettség kapcsolt vállalkozással szemben', NULL); SELECT account_heading_save(NULL, '449', 'Egyéb hosszú lejáratú kötelezettség', NULL); SELECT account_heading_save(NULL, '45', 'Rövid lejáratú kötelezettségek', NULL); SELECT account_heading_save(NULL, '451', 'Vevőktől kapott előlegek', NULL); SELECT account_heading_save(NULL, '452', 'Rövid lejáratú kölcsönök', NULL); SELECT account_heading_save(NULL, '453', 'Rövid lejáratú hitelek', NULL); SELECT account_heading_save(NULL, '455', 'Pénzügyi lízing miatti kötelezettség', NULL); SELECT account_heading_save(NULL, '456', 'Rövid lejáratú kötelezettség kapcsolt vállalkozással szemben', NULL); SELECT account_heading_save(NULL, '457', 'Rövid lejáratú kötelezettség egyéb vállakozással szemben', NULL); SELECT account_heading_save(NULL, '459', 'Egyéb rövid lejáratú kötelezettség', NULL); SELECT account_heading_save(NULL, '46', 'Adóhatósággal szembeni kötelezettségek', NULL); SELECT account_heading_save(NULL, '461', 'Társasági adó elszámolása', NULL); SELECT account_heading_save(NULL, '462', 'SZJA elszámolás', NULL); SELECT account_heading_save(NULL, '463', 'Költségvetési befizetési kötelezettség', NULL); SELECT account_heading_save(NULL, '464', 'Költségvetési befizetési kötelezettség teljesitése', NULL); SELECT account_heading_save(NULL, '465', 'VPOP elszámolási számla', NULL); SELECT account_heading_save(NULL, '466', 'Előzetesen felszámítottt ÁFA', NULL); SELECT account_heading_save(NULL, '467', 'Fizetendő ÁFA', NULL); SELECT account_heading_save(NULL, '469', 'Helyi adók elszámolási számla', NULL); SELECT account_heading_save(NULL, '47', 'Egyéb kötelezettségek', NULL); SELECT account_heading_save(NULL, '471', 'Jövedelem elszámolási számla', NULL); SELECT account_heading_save(NULL, '472', 'Fel nem vett járandóság', NULL); SELECT account_heading_save(NULL, '473', 'Nyugdíj- és egészségbiztosítás', NULL); SELECT account_heading_save(NULL, '4731', 'Nyugdíjbiztosítási Alap', NULL); SELECT account_heading_save(NULL, '4732', 'Egészségbiztosítási Alap', NULL); SELECT account_heading_save(NULL, '4733', 'Magánnyugdíjpénztár', NULL); SELECT account_heading_save(NULL, '478', 'Osztalékelszámolási számla', NULL); SELECT account_heading_save(NULL, '479', 'Egyéb rövid lejáratú kötelezettség', NULL); SELECT account_heading_save(NULL, '48', 'Passzív időbeli elhatárolások', NULL); SELECT account_heading_save(NULL, '49', 'Évi mérlegszámlák', NULL); SELECT account_heading_save(NULL, '51', 'Anyagjellegű költségek', NULL); SELECT account_heading_save(NULL, '52', 'Igénybevett szolgáltatások költségei', NULL); SELECT account_heading_save(NULL, '521', 'Szállítási, rakodási költség', NULL); SELECT account_heading_save(NULL, '524', 'Utazási és szállás költség', NULL); SELECT account_heading_save(NULL, '525', 'Hirdetés és reklám költség', NULL); SELECT account_heading_save(NULL, '526', 'Oktatás, továbbképzés költsége', NULL); SELECT account_heading_save(NULL, '527', 'Posta költség', NULL); SELECT account_heading_save(NULL, '528', 'Kommunikációs költségek', NULL); SELECT account_heading_save(NULL, '529', 'Egyéb igénybevett szolgáltatások', NULL); SELECT account_heading_save(NULL, '53', 'Egyéb szolgáltatások költségei', NULL); SELECT account_heading_save(NULL, '531', 'Hatósági, igazgatási, szolg. illeték', NULL); SELECT account_heading_save(NULL, '532', 'Bankköltség', NULL); SELECT account_heading_save(NULL, '533', 'Biztosítási díjak', NULL); SELECT account_heading_save(NULL, '539', 'Egyéb szolgáltatások ', NULL); SELECT account_heading_save(NULL, '54', 'Bérköltség', NULL); SELECT account_heading_save(NULL, '55', 'Személyi jellegű egyéb kifizetés', NULL); SELECT account_heading_save(NULL, '56', 'Bérjárulékok', NULL); SELECT account_heading_save(NULL, '561', 'Nyugdíj és egészségbiztosítás', NULL); SELECT account_heading_save(NULL, '562', 'EHO', NULL); SELECT account_heading_save(NULL, '57', 'Értékcsökkenési leirás', NULL); SELECT account_heading_save(NULL, '81', 'Anyagjellegű ráforditások', NULL); SELECT account_heading_save(NULL, '86', 'Egyéb ráforditások', NULL); SELECT account_heading_save(NULL, '861', 'Értékesitett eszközök nyilvántartási értéke', NULL); SELECT account_heading_save(NULL, '863', 'Egyéb eredményt csökkentő tételek', NULL); SELECT account_heading_save(NULL, '864', 'Céltartalék képzése', NULL); SELECT account_heading_save(NULL, '865', 'Értékvesztés, terven felüli értékcsökkenés', NULL); SELECT account_heading_save(NULL, '866', 'Önkormányzatokkal elszámolt adók, illetékek', NULL); SELECT account_heading_save(NULL, '868', 'Állami költségvetéssel elszámolt adók', NULL); SELECT account_heading_save(NULL, '869', 'Különféle egyéb ráforditások', NULL); SELECT account_heading_save(NULL, '87', 'Pénzügyi műveletek ráforditásai', NULL); SELECT account_heading_save(NULL, '874', 'Fizetendő kamatok és kamatjellegű ráforditások', NULL); SELECT account_heading_save(NULL, '876', 'Átváltáskori és értékesitéskori árfolyamveszteségek', NULL); SELECT account_heading_save(NULL, '879', 'Egyéb pénzügyi ráforditások', NULL); SELECT account_heading_save(NULL, '88', 'Rendkivüli ráforditások', NULL); SELECT account_heading_save(NULL, '881', 'Térités nélkül átadott eszközök nyilvántartási értéke', NULL); SELECT account_heading_save(NULL, '89', 'Nyereséget terhelő adók', NULL); SELECT account_heading_save(NULL, '91', 'Értékesités árbevétele', NULL); SELECT account_heading_save(NULL, '911', 'Belföldi értékesités árbevétele', NULL); SELECT account_heading_save(NULL, '93', 'Export értékesités árbevétele', NULL); SELECT account_heading_save(NULL, '96', 'Egyéb bevételek', NULL); SELECT account_heading_save(NULL, '961', 'Értékesitett eszközök bevétele', NULL); SELECT account_heading_save(NULL, '963', 'Egyéb eredményt növelő tételek', NULL); SELECT account_heading_save(NULL, '964', 'Céltartalék képzése', NULL); SELECT account_heading_save(NULL, '965', 'Értékvesztés, terven felüli érétkcsökkenés visszairása', NULL); SELECT account_heading_save(NULL, '969', 'Különféle egyéb bevételek', NULL); SELECT account_heading_save(NULL, '97', 'Pénzügyi bevételek', NULL); SELECT account_heading_save(NULL, '974', 'Kapott kamatok és kamatjellegű ráforditások', NULL); SELECT account_heading_save(NULL, '976', 'Átváltáskori és értékesitéskori árfolyamnyereség', NULL); SELECT account_heading_save(NULL, '979', 'Egyéb pénzügyi bevételek', NULL); SELECT account_heading_save(NULL, '98', 'Rendkivüli bevételek', NULL); SELECT account_heading_save(NULL, '454', 'Kötelezettségek áruszállításból és szolgáltatás nyújtásából', NULL); SELECT account_heading_save(NULL, '522', 'Bérleti díjak', NULL); SELECT account_heading_save(NULL, '931', 'Export értékesités árbevétele', NULL); SELECT account_save(NULL,'1111','Alapítás, átszervezés aktivált értéke','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1131','Vagyoni értékű jogok','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1141','Szellemi termékek','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1171','Immateriális javak értékhelyesbítése','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1181','Immateriális javak terven felüli értékcsökkenése','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1191','Alapitás, átszervezés elszámolt értékcsökkenése','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1193','Vagyoni értékű jogok elszámolt értékcsökkenése','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1194','Szellemi termékek elszámolt értékcsökkenése','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1311','Termelő gépek, berendezések','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1321','Járművek','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1371','Műszaki gépek, berendezések, járművek értékhelyesbítése','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1381','Műszaki gépek, berendezések, járművek tereven felüli értékcsökkenése','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1391','Termelő gépek, berendezések elszámolt értékcsökkenése','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1392','Járművek értékcsökkenése','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1411','Egyéb gép, berendezése, szerszám','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1421','Egyéb járművek','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1431','Irodai, igazgatási berendezés, felszerelés','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1451','Kisértékű gép, berendezés, felszerelés','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1452','Kisértékű irodai, igazgatási berendezés, felszerelés','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1471','Egyéb gép, berendezés, szerszám értékhelyesbítése','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1472','Egyéb járművek értékhelyesbítése','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1473','Irodai, igazgatási berendezés, felszerelés értékhelyesbítése','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1481','Egyéb gép, berendezés, felszerelés terven felüli értékcsökkenése','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1482','Egyéb járművek terven felüli értékcsökkenése','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1483','Irodai, igazgatási berendezések terven felüli értékcsökkenése','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1491','Egyéb gép, berendezés, szerszám elszámolt értékcsökkenése','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1492','Egyéb járművek elszámolt értékcsökkenése','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1493','Irodai, igazgatási berendezés, felszerelés elszámolt értékcsökkenése','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1495','Kisértékű tárgyi eszközök értékcsökkenése','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3920','Költségek ráforditások aktiv időbeli elhatárolása','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3910','Bevételek aktiv időbeli elhatárolása','','A', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '2', 'KÉSZLETEK', NULL); SELECT account_save(NULL,'3930','Halasztott ráforditások','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3211','Követelések anyavállalattal szemben','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3251','Jegyzett, de még be nem fizetett tőke','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3291','Követelések értékvesztése ','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3311','Követelések egyéb részesedési viszonyban lévő vállalattal szemben','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3321','Jegyzett, de még be nem fizetett tőke','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3391','Egyéb részesedési viszonyban lévő vállakozással szembeni követelés értékvesztése','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3410','Belföldi váltókövetelések','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3460','Külföldi váltókövetelések','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3510','Immateriális javakra adott előleg','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3520','Beruházásokra adott előleg','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3530','Készletekre adott előleg','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3540','Osztalék előleg','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3550','VPOP ÁFA elszámolási számla','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3560','Egyéb előlegek','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3610','Munkavállalókkal szembeni követelés','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3620','Költségvetési kiutálási igények','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3630','Költségvetési kiutalási igények teljesitése','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3640','Vevőtől kapott előleg ÁFÁ-ja','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3661','Rövid lejáratra adott pénzkölcsön','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3662','Rövid lejáratú betétek','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3710','Részesedés kapcsolt vállakozásban','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3720','Egyéb részesedés','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3680','Egyéb követelések','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3790','Értékpapirok értékvesztése és visszairása','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3690','Egyéb követelések értékvesztése és visszairása','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3811','Főpénztár','','A', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'3822','USD valutapénztár','','A', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'3821','EURO valutapénztár','','A', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'3841','Bankszámla (Ft)','','A', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'3861','Bankszámla (EUR)','','A', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'3893','Átvezetés Bank (HUF) - Bank (EUR)','','A', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'3891','Átvezetés Bank (HUF) - Pénztár (HUF)','','A', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'3892','Átvezetés Bank (EUR) - Pénztár (EUR)','','A', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'3894','Átvezetés Pénztár (HUF) - Pénztár (EUR)','','A', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'3111','Belföldi vevők','','A', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'3150','Belföldi követelések értékvesztése és visszairása','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3161','Külföldi vevők','','A', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'3190','Külföldi követelések értékvesztése és visszairása','','A', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4110','Jegyzett tőke','','Q', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4120','Tőketartalék','','Q', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4130','Eredménytartalék','','Q', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4140','Lekötött tartalék','','Q', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4170','Értékelési tartalék','','Q', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4190','Mérleg szerinti eredmény','','Q', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4210','Céltartalékok várható kötelezettségekre','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4220','Céltartalékok a jövőbeni költségekre','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4230','Egyéb céltartalékok','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4421','Hosszú lejáratra kapott kölcsönök','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4431','Beruházási és fejlesztési hitelek','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4441','Egyéb hosszú lejáratú hitel','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4461','Tartós kötelezettség','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4471','Tartós kötelezettség egyéb vállakozással szemben','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4491','Egyéb hosszú lejáratú kötelezettség','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4511','Vevőktől kapott előleg','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4541','Belföldi szállítók','','L', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'4542','Külföldi szállítók','','L', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'4551','Pénzügyi lízing (éven belüli)','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4561','Rövid lejáratú kötelezettség','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4571','Rövid lejáratú kötelezettség egyéb','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4591','Egyéb rövid lejáratú kötelezettség','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4611','Társasági adó','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4619','Társasági adó megfizetése','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4621','Munkaviszonyból származó SZJA','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4629','SZJA befizetés','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4631','Nyugdíjbiztosítás','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4632','Egészségbiztosítás','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4633','Munkaadói járulék','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4634','Munkavállalói járulék','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4635','Szakképzési hozzájárulás','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4636','Rehabilitációs hozzájárulás','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4637','EHO','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4638','Önellenörzési, késedelmi pótlék','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4641','Nyugdíjbiztosítás teljesitése','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4642','EEgészségbiztosítás teljesitése','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4643','Munkaadói járulék teljesitése','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4644','Munkavállalói járulék teljesitése','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4645','Szakképzési hozzájárulás teljesitése','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4646','Rehabilitációs hozzájárulás teljesitése','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4647','EHO teljesitése','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4648','Önellenörzési, késedelmi pótlék teljesitése','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4651','VPOP elszámolási számla','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4680','ÁFA elszámolási számla','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4691','Iparűzési adó','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4692','Gépjárműadó','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4693','Kommunális adó','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'47101','Jövedelem elszámolás január','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'47102','Jövedelem elszámolás február','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'47103','Jövedelem elszámolás március','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'47104','Jövedelem elszámolás április','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'47105','Jövedelem elszámolás május','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'47106','Jövedelem elszámolás június','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'47107','Jövedelem elszámolás július','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'47108','Jövedelem elszámolás augusztus','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'47109','Jövedelem elszámolás szeptember','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'47110','Jövedelem elszámolás október','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'47111','Jövedelem elszámolás november','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'47112','Jövedelem elszámolás december','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4721','Fel nem vett járandóság','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'47311','Nyugdíjbiztosítási Alap kötelezettség','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'47319','Nyugdíjbiztosítási Alap kötelezettség teljesitése','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'47321','Egészségbiztosítási Alap kötelezettség','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'47329','Egészségbiztosítási Alap kötelezettség teljesitése','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'47331','Magánnyugdíjpénztár','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4781','Osztalék','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4799','Technikai számla','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4810','Költségek, ráforditások passzív időbeli elhatárolása','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4820','Árbevételek passzív időbeli elhatárolása','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4830','Halasztott bevételek','','L', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4910','Nyitómérleg számla','','C', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4920','Záró mérleg számla','','C', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4930','Adózott eredmény elszámolási számla','','C', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5110','Anyagköltség','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5120','Energia, szemét, közüzemi díj','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5130','Üzemanyag','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5140','Nyomtatványok, irodaszerek','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5150','Tisztítószer','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5160','Szakkönyv, folyóirat','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5190','Egyéb anyagköltség','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5211','Belföldi szállítási költség','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5212','Külföldi szállítási költség','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5221','Irodabérleti díj','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5241','Belföldi utazási költség','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5242','Külföldi utazási költség','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5251','Reklám költség','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5252','Hirdetés költsége','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5261','Oktatás költsége','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5271','Posta költség','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5281','Telefonköltség','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5282','Internet költség','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'52901','Könyvvezetés költsége','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'52902','Ügyvédi költség','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5311','Illetékek, tagdíjak','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5321','Bankköltség','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5331','Vagyonbiztosítás','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5391','Faktordíj','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5410','Bérköltség (munkavállaló, tag)','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5420','Megbizási jogviszony költsége','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5450','Prémium','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5510','Étkezési jegy','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5520','Reprezentáció','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5590','Egyéb személyi jellegű kifizetés','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5611','Nyugdíjbiztosítási járulék','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5612','Egészségbiztosítási járulék','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5621','Tételes EHO','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5622','Százalékos EHO','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5630','Munkaadói járulék','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5640','Szakképzési hozzájárulás','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5650','Rehabilitációs hozzájárulás','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5690','Egyéb bérjárulékok','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5710','Terv szerinti értékcsökkenési leirás','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5720','Kisértékű eszközök értékcsökkenése','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8110','Anyagköltség','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8120','Igénybevett szolgáltatás','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8130','Eladott szolgáltatások értéke','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8150','Eladott (közvetitett) szolgáltatás értéke','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8611','Értékesitett immateriális javak nyilvántartási értéke','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8612','Értékesitett tárgyi eszközök nyilvántartási értéke','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8631','késedelmi kamatok','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8641','Céltartalék képzése','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8651','Követelések értékvesztése','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8652','Immateriális javak terven felüli értékcsökkenése','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8653','Tárgyi eszközök terven felüli értékcsökkenése','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8661','Iparűzési adó','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8662','Gépjárműadó','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8663','Kommunális adó','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8681','Le nem vonható ÁFA','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8682','Önellenörzési pótlék','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8691','Káresemények','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8694','Előző évet terhelő ráforditások','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8699','Egyéb ráforditások','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8698','Kerekitési különbözet','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8710','Fizetett osztalék, részesedés','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8720','Részesedések, értékpapirok, bankbetétek értékvesztése','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8730','Befektett pénzügyi eszközök árfolyam vesztesége','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8741','Fizetett kamatok kapcsolt vállakozásnak','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8742','Fizetett kamatok egyéb vállakozásoknak','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8743','Pénzintézetnek fizetett kamatok','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8744','Magénszemélyeknek fizetett kamatok','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8761','Deviza és valutakészletek átváltási árfolyamvesztesége','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8762','Követelések és kötelezettségek árfolyamvesztesége','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8791','Faktordíj','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8820','Társaságba bevitt vagyontárgyak nyilvántartás szerinti értéke','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8830','Véglegesen átadott pénzeszköz','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8840','Elengedett követelés','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8890','Egyéb rendkívüli ráforditások','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8910','Társasági adó','','E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8140','ELÁBÉ','','E', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'9611','Értékesitett immateriális javak bevétele','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9612','Értékesitett tárgyi eszközök bevétele','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9631','Kapott késedelmi kamatok','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9641','Céltartalék képzése','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9651','Követelések értékvesztésének visszairása','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9652','Immateriális javak terven felüli értékcsökkenésének visszairása','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9653','Tárgyi eszközök terven felüli érétkcsökkenésének visszairása','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9691','Káresemények bevételei','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9698','Kerekítési különbözet','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9699','Egyéb bevételek','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9710','Kapott osztalék, részesedés','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9720','Részesedések, értékpapirok, bankbetétek értékvesztésének visszairása','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9730','Befektetett pénzügyi eszközök árfolyam nyeresége','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9741','Kapott kamatok kapcsolt vállalkozástól','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9742','Kapott kamatok egyéb vállakozástól','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9743','Kapott kamatok pénzintézettől','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9744','Magánszemélytől kapott kamatok','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9761','Deviza és valutakészlet átváltási árfolyamnyeresége','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9762','Követelések és kötelezettségek árfolyamnyeresége','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9791','Egyéb pénzügyi bevételek','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9810','Ellenérték nélkül kapott eszközök értéke','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9820','Társaságba bevitt vagyontárgyak szerződés szerinti értéke','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9830','Véglegesen kapott pénzeszköz','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9840','Elengedett kötelezettség','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9890','Egyéb rendkívüli bevételek','','I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'52903','Tanácsadás','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'1611','Befejezetlen beruházás','','A', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'3862','Deviza betétszámla USD','','A', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'3895','Átvezetés Bank (HUF) - Bank (USD)','','A', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'9112','Belföldi szolgáltatás árbevétele','','I', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'9111','Belföldi termékértékesítés árbevétele','','I', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'9312','Export szolgáltatás árbevétele','','I', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'5299','Egyéb igénybevett szolgáltatás','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'2690','Uton levo keszlet','','A', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'2610','Áruk beszerzési áron','','A', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'52904','Vámügyintézés','','E', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'3896','Bankkártya átvezetés','','A', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'9311','Export termekértékesítés árbevétele','','I', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'4661','Előzetesen felszámítottt ÁFA 20%','','L', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4662','Előzetesen felszámítottt ÁFA 5%','','L', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4663','Előzetesen felszámítottt ÁFA 0%','','L', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4664','Előzetesen felszámítottt ÁFA adómentes','','L', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4671','Fizetendő ÁFA 20%','','L', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4672','Fizetendő ÁFA 5%','','L', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4673','Fizetendő ÁFA 0%','','L', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4674','Fizetendő ÁFA adómentes','','L', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE id IN (select account_id FROM account_link WHERE description = 'AP_paid'); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4661'),'0.20','VIS'); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4662'),'0.05','VIS'); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4663'),'0','VIS'); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4664'),'0','VIS'); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4671'),'0.20','FIZ'); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4672'),'0.05','FIZ'); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4673'),'0','FIZ'); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4674'),'0','FIZ'); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (SELECT id FROM chart WHERE accno = '2110')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (SELECT id FROM chart WHERE accno = '9111')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (SELECT id FROM chart WHERE accno = '8140')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (SELECT id FROM chart WHERE accno = '9761')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (SELECT id FROM chart WHERE accno = '8761')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'HUF:EUR:USD'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); UPDATE defaults SET value = 'VK00000' WHERE setting_key = 'glnumber'; UPDATE defaults SET value = 'VSZ10000' WHERE setting_key = 'sinumber'; UPDATE defaults SET value = 'SZSZ10000' WHERE setting_key = 'vinumber'; UPDATE defaults SET value = 'BR10000' WHERE setting_key = 'ponumber'; UPDATE defaults SET value = 'VR10000' WHERE setting_key = 'sonumber'; UPDATE defaults SET value = 'AA10000' WHERE setting_key = 'sqnumber'; UPDATE defaults SET value = 'AK10000' WHERE setting_key = 'rfqnumber'; UPDATE defaults SET value = 'ALK0000' WHERE setting_key = 'employeenumber'; UPDATE defaults SET value = 'VEVO10000' WHERE setting_key = 'customernumber'; UPDATE defaults SET value = 'SZALL10000' WHERE setting_key = 'vendornumber'; UPDATE defaults SET value = 'PROJ10000' WHERE setting_key = 'projectnumber'; commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/hu/chart/Minimal.sql0000644000000000000000000001507711730345473016726 0ustar rootrootbegin; --Hungarian chart of accounts -- Magyar fõkönyvi számlák, amelyek csak példaként szolgálnak -- SELECT account_heading_save(NULL, '1', 'BEFEKTETETT ESZKÖZÖK', NULL); SELECT account_heading_save(NULL, '2', 'KÉSZLETEK', NULL); SELECT account_heading_save(NULL, '3', 'KÖVETELÉSEK', NULL); SELECT account_heading_save(NULL, '4', 'KÖTELEZETTSÉGEK', NULL); SELECT account_heading_save(NULL, '5', 'KÖLTSÉGEK', NULL); SELECT account_heading_save(NULL, '8', 'RÁFORDÍTÁSOK', NULL); SELECT account_heading_save(NULL, '9', 'BEVÉTELEK', NULL); SELECT account_save(NULL,'1140','Irodai eszközök','A','114', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1199','Irodai eszközök ÉCS','A','119', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2610','Áruk ','A','261', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'3110','Vevõk','A','311', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'3111','Külföldi vevõk','A','311', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'3810','Pénztár 1','A','381', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'3811','Pénztár 2','A','381', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'3840','Bank 1','A','384', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'3841','Bank 2','A','384', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'4540','Belföldi Szállítók','L','454', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'4541','Külföldi szállítók','L','454', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'4660','Visszaigényelhetõ ÁFA 20%','L','466', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4661','Visszaigényelhetõ ÁFA 12%','L','466', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4662','Visszaigényelhetõ ÁFA 5%','L','466', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4663','Visszaigényelhetõ ÁFA adómentes','L','466', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4670','Fizetendõ ÁFA 20%','L','467', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4671','Fizetendõ ÁFA 15%','L','467', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4672','Fizetendõ ÁFA 5%','L','467', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4673','Fizetendõ ÁFA adómentes','L','467', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'5200','Bérleti díj','E','520', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5210','Telefon','E','521', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5990','Költségek','E','599', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'8140','Eladott áruk beszerzési értéke','E','814', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'8700','Árfolyamveszteség','E','870', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9110','Belföldi árbevétel','I','911', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'9111','Külföldi árbevétel','I','911', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'9700','Árfolyamnyereség','I','970', NULL, false, false, string_to_array('', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE id IN (select account_id FROM account_link WHERE description = 'AP_paid'); -- INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4660'),'0.20',''); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4661'),'0.15',''); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4662'),'0.05',''); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4663'),'0',''); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4670'),'0.20',''); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4671'),'0.15',''); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4672'),'0.05',''); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4673'),'0',''); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (SELECT id FROM chart WHERE accno = '2110')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (SELECT id FROM chart WHERE accno = '9110')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (SELECT id FROM chart WHERE accno = '8140')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (SELECT id FROM chart WHERE accno = '9700')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (SELECT id FROM chart WHERE accno = '8700')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'HUF:EUR:USD'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); UPDATE defaults SET value = 'VK00000' WHERE setting_key = 'glnumber'; UPDATE defaults SET value = 'VSZ10000' WHERE setting_key = 'sinumber'; UPDATE defaults SET value = 'SZSZ10000' WHERE setting_key = 'vinumber'; UPDATE defaults SET value = 'BR10000' WHERE setting_key = 'ponumber'; UPDATE defaults SET value = 'VR10000' WHERE setting_key = 'sonumber'; UPDATE defaults SET value = 'AA10000' WHERE setting_key = 'sqnumber'; UPDATE defaults SET value = 'AK10000' WHERE setting_key = 'rfqnumber'; UPDATE defaults SET value = 'ALK0000' WHERE setting_key = 'employeenumber'; UPDATE defaults SET value = 'VEVO10000' WHERE setting_key = 'customernumber'; UPDATE defaults SET value = 'SZALL10000' WHERE setting_key = 'vendornumber'; UPDATE defaults SET value = 'PROJ10000' WHERE setting_key = 'projectnumber'; commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/hu/chart/Old-general.sql0000755000000000000000000001335311730345473017467 0ustar rootrootbegin; --Hungarian chart of accounts -- Magyar fõkönyvi számlák, amelyek csak példaként szolgálnak -- SELECT account_heading_save(NULL, '1', 'BEFEKTETETT ESZKÖZÖK', NULL); SELECT account_heading_save(NULL, '2', 'KÉSZLETEK', NULL); SELECT account_heading_save(NULL, '3', 'KÖVETELÉSEK', NULL); SELECT account_heading_save(NULL, '4', 'KÖTELEZETTSÉGEK', NULL); SELECT account_heading_save(NULL, '5', 'KÖLTSÉGEK', NULL); SELECT account_heading_save(NULL, '8', 'RÁFORDÍTÁSOK', NULL); SELECT account_heading_save(NULL, '9', 'BEVÉTELEK', NULL); SELECT account_save(NULL,'1140','Irodai eszközök','A','114', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1199','Irodai eszközök ÉCS','A','119', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2610','Áruk ','A','261', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'3110','Vevõk','A','311', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'3111','Külföldi vevõk','A','311', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'3810','Pénztár 1','A','381', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'3811','Pénztár 2','A','381', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'3840','Bank 1','A','384', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'3841','Bank 2','A','384', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'4540','Belföldi Szállítók','L','454', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'4541','Külföldi szállítók','L','454', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'4660','Visszaigényelhetõ ÁFA 25%','L','466', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4661','Visszaigényelhetõ ÁFA 12%','L','466', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4662','Visszaigényelhetõ ÁFA 5%','L','466', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4663','Visszaigényelhetõ ÁFA adómentes','L','466', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4670','Fizetendõ ÁFA 25%','L','467', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4671','Fizetendõ ÁFA 15%','L','467', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4672','Fizetendõ ÁFA 5%','L','467', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4673','Fizetendõ ÁFA adómentes','L','467', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'5200','Bérleti díj','E','520', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5210','Telefon','E','521', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5990','Költségek','E','599', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'8140','Eladott áruk beszerzési értéke','E','814', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'8700','Árfolyamveszteség','E','870', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9110','Belföldi árbevétel','I','911', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'9111','Külföldi árbevétel','I','911', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'9700','Árfolyamnyereség','I','970', NULL, false, false, string_to_array('', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE id IN (select account_id FROM account_link WHERE description = 'AP_paid'); -- INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4660'),'0.25',''); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4661'),'0.15',''); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4662'),'0.05',''); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4663'),'0',''); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4670'),'0.25',''); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4671'),'0.15',''); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4672'),'0.05',''); INSERT INTO tax (chart_id,rate,taxnumber) VALUES ((SELECT id FROM chart WHERE accno='4673'),'0',''); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (SELECT id FROM chart WHERE accno = '2110')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (SELECT id FROM chart WHERE accno = '9110')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (SELECT id FROM chart WHERE accno = '8140')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (SELECT id FROM chart WHERE accno = '9700')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (SELECT id FROM chart WHERE accno = '8700')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'HUF:EUR:USD'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/Sample-chart.sql0000755000000000000000000001756711730316764016155 0ustar rootrootbegin; -- Default chart of accounts -- sample only SELECT account_heading_save(NULL, '1000', 'CURRENT ASSETS', NULL); SELECT account_save(NULL,'1060','Checking Account','A','', NULL, false,string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1065','Petty Cash','A','', NULL, false,string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1200','Accounts Receivables','A','', NULL, false,string_to_array('AR', ':')); SELECT account_save(NULL,'1205','Allowance for doubtful accounts','A','', NULL, false,string_to_array('', ':')); SELECT account_heading_save(NULL, '1500', 'INVENTORY ASSETS', NULL); SELECT account_save(NULL,'1520','Inventory / General','A','', NULL, false,string_to_array('IC', ':')); SELECT account_save(NULL,'1530','Inventory / Aftermarket Parts','A','', NULL, false,string_to_array('IC', ':')); SELECT account_heading_save(NULL, '1800', 'CAPITAL ASSETS', NULL); SELECT account_save(NULL,'1820','Office Furniture & Equipment','A','', NULL, false,string_to_array('', ':')); SELECT account_save(NULL,'1825','Accum. Amort. -Furn. & Equip.','A','', NULL, true,string_to_array('',':')); SELECT account_save(NULL,'1840','Vehicle','A','', NULL, false,string_to_array('', ':')); SELECT account_save(NULL,'1845','Accum. Amort. -Vehicle','A','', NULL, true,string_to_array('',':')); SELECT account_heading_save(NULL, '2000', 'CURRENT LIABILITIES', NULL); SELECT account_save(NULL,'2100','Accounts Payable','L','', NULL, false,string_to_array('AP', ':')); SELECT account_save(NULL,'2160','Corporate Taxes Payable','L','', NULL, false,string_to_array('', ':')); SELECT account_save(NULL,'2190','Federal Income Tax Payable','L','', NULL, false,string_to_array('', ':')); SELECT account_save(NULL,'2210','Workers Comp Payable','L','', NULL, false,string_to_array('', ':')); SELECT account_save(NULL,'2220','Vacation Pay Payable','L','', NULL, false,string_to_array('', ':')); SELECT account_save(NULL,'2250','Pension Plan Payable','L','', NULL, false,string_to_array('', ':')); SELECT account_save(NULL,'2260','Employment Insurance Payable','L','', NULL, false,string_to_array('', ':')); SELECT account_save(NULL,'2280','Payroll Taxes Payable','L','', NULL, false,string_to_array('', ':')); SELECT account_save(NULL,'2310','VAT (10%)','L','', NULL, false,string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2320','VAT (14%)','L','', NULL, false,string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2330','VAT (30%)','L','', NULL, false,string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_heading_save(NULL, '2600', 'LONG TERM LIABILITIES', NULL); SELECT account_save(NULL,'2620','Bank Loans','L','', NULL, false,string_to_array('', ':')); SELECT account_save(NULL,'2680','Loans from Shareholders','L','', NULL, false,string_to_array('AP_paid', ':')); SELECT account_heading_save(NULL, '3300', 'SHARE CAPITAL', NULL); SELECT account_save(NULL,'3350','Common Shares','Q','', NULL, false,string_to_array('', ':')); SELECT account_heading_save(NULL, '4000', 'SALES REVENUE', NULL); SELECT account_save(NULL,'4020','Sales / General','I','', NULL, false,string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'4030','Sales / Aftermarket Parts','I','', NULL, false,string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL, '4300', 'CONSULTING REVENUE', NULL); SELECT account_save(NULL,'4320','Consulting','I','', NULL, false,string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL, '4400', 'OTHER REVENUE', NULL); SELECT account_save(NULL,'4430','Shipping & Handling','I','', NULL, false,string_to_array('IC_income', ':')); SELECT account_save(NULL,'4440','Interest','I','', NULL, false,string_to_array('', ':')); SELECT account_save(NULL,'4450','Foreign Exchange Gain','I','', NULL, false,string_to_array('', ':')); SELECT account_heading_save(NULL, '5000', 'COST OF GOODS SOLD', NULL); SELECT account_save(NULL,'5010','Purchases','E','', NULL, false,string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'5020','COGS / General','E','', NULL, false,string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5030','COGS / Aftermarket Parts','E','', NULL, false,string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5100','Freight','E','', NULL, false,string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL, '5400', 'PAYROLL EXPENSES', NULL); SELECT account_save(NULL,'5410','Wages & Salaries','E','', NULL, false,string_to_array('', ':')); SELECT account_save(NULL,'5420','Employment Insurance Expense','E','', NULL, false,string_to_array('', ':')); SELECT account_save(NULL,'5430','Pension Plan Expense','E','', NULL, false,string_to_array('', ':')); SELECT account_save(NULL,'5440','Workers Comp Expense','E','', NULL, false,string_to_array('', ':')); SELECT account_save(NULL,'5470','Employee Benefits','E','', NULL, false,string_to_array('', ':')); SELECT account_heading_save(NULL, '5600', 'GENERAL & ADMINISTRATIVE EXPENSES', NULL); SELECT account_save(NULL,'5610','Accounting & Legal','E','', NULL, false,string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5615','Advertising & Promotions','E','', NULL, false,string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5620','Bad Debts','E','', NULL, false,string_to_array('', ':')); SELECT account_save(NULL,'5650','Capital Cost Allowance Expense','E','', NULL, false,string_to_array('', ':')); SELECT account_save(NULL,'5660','Amortization Expense','E','', NULL, false,string_to_array('', ':')); SELECT account_save(NULL,'5680','Income Taxes','E','', NULL, false,string_to_array('', ':')); SELECT account_save(NULL,'5685','Insurance','E','', NULL, false,string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5690','Interest & Bank Charges','E','', NULL, false,string_to_array('', ':')); SELECT account_save(NULL,'5700','Office Supplies','E','', NULL, false,string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5760','Rent','E','', NULL, false,string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5765','Repair & Maintenance','E','', NULL, false,string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5780','Telephone','E','', NULL, false,string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5785','Travel & Entertainment','E','', NULL, false,string_to_array('', ':')); SELECT account_save(NULL,'5790','Utilities','E','', NULL, false,string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5795','Registrations','E','', NULL, false,string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5800','Licenses','E','', NULL, false,string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5810','Foreign Exchange Loss','E','', NULL, false,string_to_array('', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE id IN (select account_id FROM account_link WHERE description = 'AP_paid'); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '2310'),0.1); insert into tax (chart_id,rate) values ((select id from chart where accno = '2320'),0.14); insert into tax (chart_id,rate) values ((select id from chart where accno = '2330'),0.3); -- insert into defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '1520')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '4020')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '5010')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '4450')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '5810')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'USD:CAD:EUR'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); commit; ledgersmb/sql/coa/cn/0000755000000000000000000000000012060044550013455 5ustar rootrootledgersmb/sql/coa/cn/chart/0000755000000000000000000000000012060044550014556 5ustar rootrootledgersmb/sql/coa/cn/chart/General.sql0000755000000000000000000002030311726630426016670 0ustar rootrootbegin; -- Default chart of accounts -- sample only SELECT account_heading_save(NULL, '1000', '流动资产', NULL); SELECT account_heading_save(NULL, '1800', '资本资产', NULL); SELECT account_heading_save(NULL, '2600', '长期负债', NULL); SELECT account_heading_save(NULL, '3300', '股份资本', NULL); SELECT account_heading_save(NULL, '2000', '流动负债', NULL); SELECT account_heading_save(NULL, '3500', '保留盈馀', NULL); SELECT account_heading_save(NULL, '4000', '销售盈馀', NULL); SELECT account_heading_save(NULL, '4300', '谘询盈馀', NULL); SELECT account_heading_save(NULL, '4400', '其它盈馀', NULL); SELECT account_heading_save(NULL, '5000', '货销成本', NULL); SELECT account_heading_save(NULL, '5400', '薪资支出', NULL); SELECT account_heading_save(NULL, '5600', '日常及管理支出', NULL); SELECT account_heading_save(NULL, '1500', '存货资产', NULL); SELECT account_save(NULL,'2190','应付所得税','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1205','呆帐备抵','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1825','累计分期付款 - 装璜及设备.','A','', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'1845','累计分期付款 - 运输工具','A','', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'2620','银行借款','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3600','流动盈馀','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2160','应付公司税','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3590','保留盈馀 - 去年度','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3350','普通股份','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5615','广告行销','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5790','工具','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5700','办公用品','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5800','权利金','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5610','会计法务','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5685','保险','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5660','分期支出','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5620','坏帐','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5680','所得税','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5690','利息及银行手续费','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5410','薪资','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5420','保险支出','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5430','退休金支出','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5440','补偿金支出','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5470','员工福利','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4030','销售 / 软体','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'4440','利息','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5100','运费','E','', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'5760','租金','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'1530','库存 / 软体','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1540','库存 / 二级市场零件','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'4040','销售 / 二级市场零件','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'5030','货销成本 / 软体','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5010','采购','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5040','货销成本 / 二级市场零件','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'1065','零用金','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1820','办公室装璜及设备','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5785','旅费及娱乐','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2680','股东贷款','L','', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'5795','注册费','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5780','电信费','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5781','网路连线费','E','', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'5765','维修管理费','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'2311','地方税','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'4430','运销费','I','', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'1520','库存 / 硬体','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'5020','货销成本 / 硬体','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'2100','应付帐款','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'1840','运输工具','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'4330','程式设计','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'4020','销售 / 硬体','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'4320','谘询','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'1200','应收帐款','A','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1061','支票户头','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno in ('1061', '1065'); SELECT account_save(NULL,'2310','商品服务税','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); -- -- exchange rate SELECT account_save(NULL,'4450','Foreign Exchange Gain','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5810','Foreign Exchange Loss','E','', NULL, false, false, string_to_array('', ':')); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '2310'),0.07); insert into tax (chart_id,rate) values ((select id from chart where accno = '2311'),0.08); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '1520')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '4020')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '5010')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '4450')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '5810')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'CAD'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); -- commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/it/0000755000000000000000000000000012060044550013471 5ustar rootrootledgersmb/sql/coa/it/gifi/0000755000000000000000000000000012060044550014407 5ustar rootrootledgersmb/sql/coa/it/gifi/General.sql0000755000000000000000000003046610573165441016533 0ustar rootrootbegin; -- Oct 8, 2003 -- verified D Simader -- Oct 13, 2003 -- updated Daniele Giacomini, daniele@swlibero.org (extended some descriptions, to avoid ambiguities) -- INSERT INTO gifi (accno,description) VALUES ('1', 'ATTIVO'); INSERT INTO gifi (accno,description) VALUES ('1.A', 'CREDITI VERSO I SOCI PER VERSAMENTI ANCORA DOVUTI'); INSERT INTO gifi (accno,description) VALUES ('1.B', 'IMMOBILIZZAZIONI'); INSERT INTO gifi (accno,description) VALUES ('1.B.I', 'Immobilizzazioni immateriali'); INSERT INTO gifi (accno,description) VALUES ('1.B.I.1', 'costi di impianto e di ampliamento'); INSERT INTO gifi (accno,description) VALUES ('1.B.I.2', 'costi di ricerca, di sviluppo e di pubblicita\''); INSERT INTO gifi (accno,description) VALUES ('1.B.I.3', 'diritti di brevetto industriale e diritti di utilizzazione delle opere dell\'ingegno'); INSERT INTO gifi (accno,description) VALUES ('1.B.I.4', 'concessioni, licenze, marchi e diritti simili'); INSERT INTO gifi (accno,description) VALUES ('1.B.I.5', 'avviamento'); INSERT INTO gifi (accno,description) VALUES ('1.B.I.6', 'immobilizzazioni immateriali in corso e acconti'); INSERT INTO gifi (accno,description) VALUES ('1.B.I.7', 'altre immobilizzazioni immateriali'); INSERT INTO gifi (accno,description) VALUES ('1.B.II', 'Immobilizzazioni materiali'); INSERT INTO gifi (accno,description) VALUES ('1.B.II.1', 'terreni e fabbricati'); INSERT INTO gifi (accno,description) VALUES ('1.B.II.2', 'impianti e macchinario'); INSERT INTO gifi (accno,description) VALUES ('1.B.II.3', 'attrezzature industriali e commerciali'); INSERT INTO gifi (accno,description) VALUES ('1.B.II.4', 'altri beni materiali'); INSERT INTO gifi (accno,description) VALUES ('1.B.II.5', 'immobilizzazioni in corso e acconti'); INSERT INTO gifi (accno,description) VALUES ('1.B.III', 'Immobilizzazioni finanziarie'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.1', 'partecipazioni'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.1.a', 'partecipazioni in imprese controllate'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.1.b', 'partecipazioni in imprese collegate'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.1.c', 'partecipazioni in imprese controllanti'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.1.d', 'partecipazioni in altre imprese'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.2', 'crediti'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.2.a', 'crediti verso imprese controllate'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.2.b', 'crediti verso imprese collegate'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.2.c', 'crediti verso controllanti'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.2.d', 'crediti verso altri'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.3', 'Altri titoli'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.4', 'Azioni proprie immobilizzate'); INSERT INTO gifi (accno,description) VALUES ('1.C', 'ATTIVO CIRCOLANTE'); INSERT INTO gifi (accno,description) VALUES ('1.C.I', 'Rimanenze'); INSERT INTO gifi (accno,description) VALUES ('1.C.I.1', 'rimanenze: materie prime, sussidiarie e di consumo'); INSERT INTO gifi (accno,description) VALUES ('1.C.I.2', 'rimanenze: prodotti in corso di lavorazione e semilavorati'); INSERT INTO gifi (accno,description) VALUES ('1.C.I.3', 'rimanenze: lavori in corso su ordinazione'); INSERT INTO gifi (accno,description) VALUES ('1.C.I.4', 'rimanenze: prodotti finiti e merci'); INSERT INTO gifi (accno,description) VALUES ('1.C.I.5', 'rimanenze: acconti'); INSERT INTO gifi (accno,description) VALUES ('1.C.II', 'Crediti'); INSERT INTO gifi (accno,description) VALUES ('1.C.II.1', 'crediti verso i clienti'); INSERT INTO gifi (accno,description) VALUES ('1.C.II.2', 'crediti verso imprese controllate'); INSERT INTO gifi (accno,description) VALUES ('1.C.II.3', 'crediti verso imprese collegate'); INSERT INTO gifi (accno,description) VALUES ('1.C.II.4', 'crediti verso imprese controllanti'); INSERT INTO gifi (accno,description) VALUES ('1.C.II.5', 'crediti verso altri'); INSERT INTO gifi (accno,description) VALUES ('1.C.III', 'Attivita\' finanziarie che non costituiscono immobilizzazioni'); INSERT INTO gifi (accno,description) VALUES ('1.C.III.1', 'partecipazioni in imprese controllate'); INSERT INTO gifi (accno,description) VALUES ('1.C.III.2', 'partecipazioni in imprese collegate'); INSERT INTO gifi (accno,description) VALUES ('1.C.III.3', 'partecipazioni in imprese controllanti'); INSERT INTO gifi (accno,description) VALUES ('1.C.III.4', 'altre partecipazioni'); INSERT INTO gifi (accno,description) VALUES ('1.C.III.5', 'azioni proprie per investimento temporaneo'); INSERT INTO gifi (accno,description) VALUES ('1.C.III.6', 'altri titoli'); INSERT INTO gifi (accno,description) VALUES ('1.C.IV', 'Disponibilita\' liquide'); INSERT INTO gifi (accno,description) VALUES ('1.C.IV.1', 'depositi bancari e postali'); INSERT INTO gifi (accno,description) VALUES ('1.C.IV.2', 'assegni'); INSERT INTO gifi (accno,description) VALUES ('1.C.IV.3', 'denaro e valori in cassa'); INSERT INTO gifi (accno,description) VALUES ('1.D', 'RATEI E RISCONTI ATTIVI'); INSERT INTO gifi (accno,description) VALUES ('2', 'PASSIVO'); INSERT INTO gifi (accno,description) VALUES ('2.A', 'PATRIMONIO NETTO'); INSERT INTO gifi (accno,description) VALUES ('2.A.I', 'Capitale'); INSERT INTO gifi (accno,description) VALUES ('2.A.II', 'Riserva da sovrapprezzo delle azioni'); INSERT INTO gifi (accno,description) VALUES ('2.A.III', 'Riserva di rivalutazione'); INSERT INTO gifi (accno,description) VALUES ('2.A.IV', 'Riserva legale'); INSERT INTO gifi (accno,description) VALUES ('2.A.V', 'Riserva per azioni proprie in portafoglio'); INSERT INTO gifi (accno,description) VALUES ('2.A.VI', 'Riserve statutarie'); INSERT INTO gifi (accno,description) VALUES ('2.A.VII', 'Altre riserve'); INSERT INTO gifi (accno,description) VALUES ('2.A.VIII', 'Utili (perdite) portati a nuovo'); INSERT INTO gifi (accno,description) VALUES ('2.A.IX', 'Utile (perdita) dell\'esercizio'); INSERT INTO gifi (accno,description) VALUES ('2.B', 'FONDI PER RISCHI E ONERI'); INSERT INTO gifi (accno,description) VALUES ('2.B.1', 'fondo per trattamento di quiescenza e obblighi simili'); INSERT INTO gifi (accno,description) VALUES ('2.B.2', 'fondo per imposte'); INSERT INTO gifi (accno,description) VALUES ('2.B.3', 'altri fondi per rischi e oneri futuri'); INSERT INTO gifi (accno,description) VALUES ('2.C', 'TRATTAMENTO DI FINE RAPPORTO DI LAVORO SUBORDINATO'); INSERT INTO gifi (accno,description) VALUES ('2.D', 'DEBITI'); INSERT INTO gifi (accno,description) VALUES ('2.D.1', 'obbligazioni non convertibili'); INSERT INTO gifi (accno,description) VALUES ('2.D.2', 'obbligazioni convertibili'); INSERT INTO gifi (accno,description) VALUES ('2.D.3', 'debiti verso banche'); INSERT INTO gifi (accno,description) VALUES ('2.D.4', 'debiti verso altri finanziatori'); INSERT INTO gifi (accno,description) VALUES ('2.D.5', 'debiti: acconti'); INSERT INTO gifi (accno,description) VALUES ('2.D.6', 'debiti verso fornitori'); INSERT INTO gifi (accno,description) VALUES ('2.D.7', 'debiti rappresentati da titoli di credito'); INSERT INTO gifi (accno,description) VALUES ('2.D.8', 'debiti verso imprese controllate'); INSERT INTO gifi (accno,description) VALUES ('2.D.9', 'debiti verso imprese collegate'); INSERT INTO gifi (accno,description) VALUES ('2.D.10', 'debiti verso controllanti'); INSERT INTO gifi (accno,description) VALUES ('2.D.11', 'debiti tributari'); INSERT INTO gifi (accno,description) VALUES ('2.D.12', 'debiti verso istituti di previdenza e di sicurezza sociale'); INSERT INTO gifi (accno,description) VALUES ('2.D.13', 'altri debiti'); INSERT INTO gifi (accno,description) VALUES ('2.E', 'RATEI E RISCONTI PASSIVI'); INSERT INTO gifi (accno,description) VALUES ('3', 'CONTO ECONOMICO'); INSERT INTO gifi (accno,description) VALUES ('3.A', 'VALORE DELLA PRODUZIONE'); INSERT INTO gifi (accno,description) VALUES ('3.A.1', 'ricavi delle vendite e delle prestazioni'); INSERT INTO gifi (accno,description) VALUES ('3.A.2', 'variazione rimanenze prodotti in lavorazione, semilavorati e finiti'); INSERT INTO gifi (accno,description) VALUES ('3.A.3', 'variazione dei lavori in corso su ordinazione'); INSERT INTO gifi (accno,description) VALUES ('3.A.4', 'incrementi di immobilizzazioni per lavori interni'); INSERT INTO gifi (accno,description) VALUES ('3.A.5', 'altri ricavi e proventi'); INSERT INTO gifi (accno,description) VALUES ('3.B', 'COSTI DELLA PRODUZIONE'); INSERT INTO gifi (accno,description) VALUES ('3.B.6', 'acquisti materie prime, sussidiarie, di consumo e di merci'); INSERT INTO gifi (accno,description) VALUES ('3.B.7', 'spese per prestazione di servizi'); INSERT INTO gifi (accno,description) VALUES ('3.B.8', 'spese per godimento di beni di terzi'); INSERT INTO gifi (accno,description) VALUES ('3.B.9', 'costi del personale'); INSERT INTO gifi (accno,description) VALUES ('3.B.9.a', 'salari e stipendi'); INSERT INTO gifi (accno,description) VALUES ('3.B.9.b', 'oneri sociali'); INSERT INTO gifi (accno,description) VALUES ('3.B.9.c', 'accantonamento al TFRL'); INSERT INTO gifi (accno,description) VALUES ('3.B.9.d', 'accantonamento per trattamento di quiescenza e simili'); INSERT INTO gifi (accno,description) VALUES ('3.B.9.e', 'altri costi del personale'); INSERT INTO gifi (accno,description) VALUES ('3.B.10', 'ammortamenti e svalutazioni'); INSERT INTO gifi (accno,description) VALUES ('3.B.10.a', 'ammortamento delle immobilizzazioni immateriali'); INSERT INTO gifi (accno,description) VALUES ('3.B.10.b', 'ammortamento delle immobilizzazioni materiali'); INSERT INTO gifi (accno,description) VALUES ('3.B.10.c', 'altre svalutazioni delle immobilizzazioni'); INSERT INTO gifi (accno,description) VALUES ('3.B.10.d', 'svalutazioni dell\'attivo circolante e delle disponibilita\' liquide'); INSERT INTO gifi (accno,description) VALUES ('3.B.11', 'variazioni rimanenze materie prime, sussidiarie, di consumo e merci'); INSERT INTO gifi (accno,description) VALUES ('3.B.12', 'accantonamento per rischi'); INSERT INTO gifi (accno,description) VALUES ('3.B.13', 'altri accantonamenti'); INSERT INTO gifi (accno,description) VALUES ('3.B.14', 'oneri diversi di gestione'); INSERT INTO gifi (accno,description) VALUES ('3.C', 'PROVENTI E ONERI FINANZIARI'); INSERT INTO gifi (accno,description) VALUES ('3.C.15', 'proventi da partecipazioni'); INSERT INTO gifi (accno,description) VALUES ('3.C.16', 'altri proventi finanziari'); INSERT INTO gifi (accno,description) VALUES ('3.C.16.a', 'proventi da crediti iscritti nelle immobilizzazioni'); INSERT INTO gifi (accno,description) VALUES ('3.C.16.b', 'proventi da titoli iscritti nelle immobilizzazioni che non costituiscono partecipazioni'); INSERT INTO gifi (accno,description) VALUES ('3.C.16.c', 'proventi da titoli iscritti all\'attivo circolante che non costituiscono partecipazioni'); INSERT INTO gifi (accno,description) VALUES ('3.C.16.d', 'proventi diversi dai precedenti'); INSERT INTO gifi (accno,description) VALUES ('3.C.17', 'Interessi e altri oneri finanziari'); INSERT INTO gifi (accno,description) VALUES ('3.D', 'RETTIFICHE DI VALORE DI ATTIVITA\' FINANZIARIE'); INSERT INTO gifi (accno,description) VALUES ('3.D.18', 'rivalutazioni'); INSERT INTO gifi (accno,description) VALUES ('3.D.18.a', 'rettifiche di partecipazioni'); INSERT INTO gifi (accno,description) VALUES ('3.D.18.b', 'rettifiche di immobilizzazioni finanziarie che non costituiscono partecipazioni'); INSERT INTO gifi (accno,description) VALUES ('3.D.18.c', 'rettifiche da titoli iscritti all\'attivo circolante che non costituiscono partecipazioni'); INSERT INTO gifi (accno,description) VALUES ('3.D.19', 'svalutazioni'); INSERT INTO gifi (accno,description) VALUES ('3.D.19.a', 'svalutazioni di partecipazioni'); INSERT INTO gifi (accno,description) VALUES ('3.D.19.b', 'svalutazioni di immobilizzazioni finanziarie che non costituiscono partecipazioni'); INSERT INTO gifi (accno,description) VALUES ('3.D.19.c', 'svalutazioni di titoli iscritti all\'attivo circolante che non costituiscono partecipazioni'); INSERT INTO gifi (accno,description) VALUES ('3.E', 'PROVENTI E ONERI STRAORDINARI'); INSERT INTO gifi (accno,description) VALUES ('3.E.20', 'proventi straordinari'); INSERT INTO gifi (accno,description) VALUES ('3.E.21', 'oneri straordinari'); INSERT INTO gifi (accno,description) VALUES ('3.E.22', 'Imposte sul reddito dell\'esercizio'); INSERT INTO gifi (accno,description) VALUES ('3.E.26', 'Utile o perdita di esercizio'); commit; ledgersmb/sql/coa/it/gifi/cc2424.sql0000755000000000000000000003046610573165441016057 0ustar rootrootbegin; -- Oct 8, 2003 -- verified D Simader -- Oct 13, 2003 -- updated Daniele Giacomini, daniele@swlibero.org (extended some descriptions, to avoid ambiguities) -- INSERT INTO gifi (accno,description) VALUES ('1', 'ATTIVO'); INSERT INTO gifi (accno,description) VALUES ('1.A', 'CREDITI VERSO I SOCI PER VERSAMENTI ANCORA DOVUTI'); INSERT INTO gifi (accno,description) VALUES ('1.B', 'IMMOBILIZZAZIONI'); INSERT INTO gifi (accno,description) VALUES ('1.B.I', 'Immobilizzazioni immateriali'); INSERT INTO gifi (accno,description) VALUES ('1.B.I.1', 'costi di impianto e di ampliamento'); INSERT INTO gifi (accno,description) VALUES ('1.B.I.2', 'costi di ricerca, di sviluppo e di pubblicita\''); INSERT INTO gifi (accno,description) VALUES ('1.B.I.3', 'diritti di brevetto industriale e diritti di utilizzazione delle opere dell\'ingegno'); INSERT INTO gifi (accno,description) VALUES ('1.B.I.4', 'concessioni, licenze, marchi e diritti simili'); INSERT INTO gifi (accno,description) VALUES ('1.B.I.5', 'avviamento'); INSERT INTO gifi (accno,description) VALUES ('1.B.I.6', 'immobilizzazioni immateriali in corso e acconti'); INSERT INTO gifi (accno,description) VALUES ('1.B.I.7', 'altre immobilizzazioni immateriali'); INSERT INTO gifi (accno,description) VALUES ('1.B.II', 'Immobilizzazioni materiali'); INSERT INTO gifi (accno,description) VALUES ('1.B.II.1', 'terreni e fabbricati'); INSERT INTO gifi (accno,description) VALUES ('1.B.II.2', 'impianti e macchinario'); INSERT INTO gifi (accno,description) VALUES ('1.B.II.3', 'attrezzature industriali e commerciali'); INSERT INTO gifi (accno,description) VALUES ('1.B.II.4', 'altri beni materiali'); INSERT INTO gifi (accno,description) VALUES ('1.B.II.5', 'immobilizzazioni in corso e acconti'); INSERT INTO gifi (accno,description) VALUES ('1.B.III', 'Immobilizzazioni finanziarie'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.1', 'partecipazioni'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.1.a', 'partecipazioni in imprese controllate'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.1.b', 'partecipazioni in imprese collegate'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.1.c', 'partecipazioni in imprese controllanti'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.1.d', 'partecipazioni in altre imprese'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.2', 'crediti'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.2.a', 'crediti verso imprese controllate'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.2.b', 'crediti verso imprese collegate'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.2.c', 'crediti verso controllanti'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.2.d', 'crediti verso altri'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.3', 'Altri titoli'); INSERT INTO gifi (accno,description) VALUES ('1.B.III.4', 'Azioni proprie immobilizzate'); INSERT INTO gifi (accno,description) VALUES ('1.C', 'ATTIVO CIRCOLANTE'); INSERT INTO gifi (accno,description) VALUES ('1.C.I', 'Rimanenze'); INSERT INTO gifi (accno,description) VALUES ('1.C.I.1', 'rimanenze: materie prime, sussidiarie e di consumo'); INSERT INTO gifi (accno,description) VALUES ('1.C.I.2', 'rimanenze: prodotti in corso di lavorazione e semilavorati'); INSERT INTO gifi (accno,description) VALUES ('1.C.I.3', 'rimanenze: lavori in corso su ordinazione'); INSERT INTO gifi (accno,description) VALUES ('1.C.I.4', 'rimanenze: prodotti finiti e merci'); INSERT INTO gifi (accno,description) VALUES ('1.C.I.5', 'rimanenze: acconti'); INSERT INTO gifi (accno,description) VALUES ('1.C.II', 'Crediti'); INSERT INTO gifi (accno,description) VALUES ('1.C.II.1', 'crediti verso i clienti'); INSERT INTO gifi (accno,description) VALUES ('1.C.II.2', 'crediti verso imprese controllate'); INSERT INTO gifi (accno,description) VALUES ('1.C.II.3', 'crediti verso imprese collegate'); INSERT INTO gifi (accno,description) VALUES ('1.C.II.4', 'crediti verso imprese controllanti'); INSERT INTO gifi (accno,description) VALUES ('1.C.II.5', 'crediti verso altri'); INSERT INTO gifi (accno,description) VALUES ('1.C.III', 'Attivita\' finanziarie che non costituiscono immobilizzazioni'); INSERT INTO gifi (accno,description) VALUES ('1.C.III.1', 'partecipazioni in imprese controllate'); INSERT INTO gifi (accno,description) VALUES ('1.C.III.2', 'partecipazioni in imprese collegate'); INSERT INTO gifi (accno,description) VALUES ('1.C.III.3', 'partecipazioni in imprese controllanti'); INSERT INTO gifi (accno,description) VALUES ('1.C.III.4', 'altre partecipazioni'); INSERT INTO gifi (accno,description) VALUES ('1.C.III.5', 'azioni proprie per investimento temporaneo'); INSERT INTO gifi (accno,description) VALUES ('1.C.III.6', 'altri titoli'); INSERT INTO gifi (accno,description) VALUES ('1.C.IV', 'Disponibilita\' liquide'); INSERT INTO gifi (accno,description) VALUES ('1.C.IV.1', 'depositi bancari e postali'); INSERT INTO gifi (accno,description) VALUES ('1.C.IV.2', 'assegni'); INSERT INTO gifi (accno,description) VALUES ('1.C.IV.3', 'denaro e valori in cassa'); INSERT INTO gifi (accno,description) VALUES ('1.D', 'RATEI E RISCONTI ATTIVI'); INSERT INTO gifi (accno,description) VALUES ('2', 'PASSIVO'); INSERT INTO gifi (accno,description) VALUES ('2.A', 'PATRIMONIO NETTO'); INSERT INTO gifi (accno,description) VALUES ('2.A.I', 'Capitale'); INSERT INTO gifi (accno,description) VALUES ('2.A.II', 'Riserva da sovrapprezzo delle azioni'); INSERT INTO gifi (accno,description) VALUES ('2.A.III', 'Riserva di rivalutazione'); INSERT INTO gifi (accno,description) VALUES ('2.A.IV', 'Riserva legale'); INSERT INTO gifi (accno,description) VALUES ('2.A.V', 'Riserva per azioni proprie in portafoglio'); INSERT INTO gifi (accno,description) VALUES ('2.A.VI', 'Riserve statutarie'); INSERT INTO gifi (accno,description) VALUES ('2.A.VII', 'Altre riserve'); INSERT INTO gifi (accno,description) VALUES ('2.A.VIII', 'Utili (perdite) portati a nuovo'); INSERT INTO gifi (accno,description) VALUES ('2.A.IX', 'Utile (perdita) dell\'esercizio'); INSERT INTO gifi (accno,description) VALUES ('2.B', 'FONDI PER RISCHI E ONERI'); INSERT INTO gifi (accno,description) VALUES ('2.B.1', 'fondo per trattamento di quiescenza e obblighi simili'); INSERT INTO gifi (accno,description) VALUES ('2.B.2', 'fondo per imposte'); INSERT INTO gifi (accno,description) VALUES ('2.B.3', 'altri fondi per rischi e oneri futuri'); INSERT INTO gifi (accno,description) VALUES ('2.C', 'TRATTAMENTO DI FINE RAPPORTO DI LAVORO SUBORDINATO'); INSERT INTO gifi (accno,description) VALUES ('2.D', 'DEBITI'); INSERT INTO gifi (accno,description) VALUES ('2.D.1', 'obbligazioni non convertibili'); INSERT INTO gifi (accno,description) VALUES ('2.D.2', 'obbligazioni convertibili'); INSERT INTO gifi (accno,description) VALUES ('2.D.3', 'debiti verso banche'); INSERT INTO gifi (accno,description) VALUES ('2.D.4', 'debiti verso altri finanziatori'); INSERT INTO gifi (accno,description) VALUES ('2.D.5', 'debiti: acconti'); INSERT INTO gifi (accno,description) VALUES ('2.D.6', 'debiti verso fornitori'); INSERT INTO gifi (accno,description) VALUES ('2.D.7', 'debiti rappresentati da titoli di credito'); INSERT INTO gifi (accno,description) VALUES ('2.D.8', 'debiti verso imprese controllate'); INSERT INTO gifi (accno,description) VALUES ('2.D.9', 'debiti verso imprese collegate'); INSERT INTO gifi (accno,description) VALUES ('2.D.10', 'debiti verso controllanti'); INSERT INTO gifi (accno,description) VALUES ('2.D.11', 'debiti tributari'); INSERT INTO gifi (accno,description) VALUES ('2.D.12', 'debiti verso istituti di previdenza e di sicurezza sociale'); INSERT INTO gifi (accno,description) VALUES ('2.D.13', 'altri debiti'); INSERT INTO gifi (accno,description) VALUES ('2.E', 'RATEI E RISCONTI PASSIVI'); INSERT INTO gifi (accno,description) VALUES ('3', 'CONTO ECONOMICO'); INSERT INTO gifi (accno,description) VALUES ('3.A', 'VALORE DELLA PRODUZIONE'); INSERT INTO gifi (accno,description) VALUES ('3.A.1', 'ricavi delle vendite e delle prestazioni'); INSERT INTO gifi (accno,description) VALUES ('3.A.2', 'variazione rimanenze prodotti in lavorazione, semilavorati e finiti'); INSERT INTO gifi (accno,description) VALUES ('3.A.3', 'variazione dei lavori in corso su ordinazione'); INSERT INTO gifi (accno,description) VALUES ('3.A.4', 'incrementi di immobilizzazioni per lavori interni'); INSERT INTO gifi (accno,description) VALUES ('3.A.5', 'altri ricavi e proventi'); INSERT INTO gifi (accno,description) VALUES ('3.B', 'COSTI DELLA PRODUZIONE'); INSERT INTO gifi (accno,description) VALUES ('3.B.6', 'acquisti materie prime, sussidiarie, di consumo e di merci'); INSERT INTO gifi (accno,description) VALUES ('3.B.7', 'spese per prestazione di servizi'); INSERT INTO gifi (accno,description) VALUES ('3.B.8', 'spese per godimento di beni di terzi'); INSERT INTO gifi (accno,description) VALUES ('3.B.9', 'costi del personale'); INSERT INTO gifi (accno,description) VALUES ('3.B.9.a', 'salari e stipendi'); INSERT INTO gifi (accno,description) VALUES ('3.B.9.b', 'oneri sociali'); INSERT INTO gifi (accno,description) VALUES ('3.B.9.c', 'accantonamento al TFRL'); INSERT INTO gifi (accno,description) VALUES ('3.B.9.d', 'accantonamento per trattamento di quiescenza e simili'); INSERT INTO gifi (accno,description) VALUES ('3.B.9.e', 'altri costi del personale'); INSERT INTO gifi (accno,description) VALUES ('3.B.10', 'ammortamenti e svalutazioni'); INSERT INTO gifi (accno,description) VALUES ('3.B.10.a', 'ammortamento delle immobilizzazioni immateriali'); INSERT INTO gifi (accno,description) VALUES ('3.B.10.b', 'ammortamento delle immobilizzazioni materiali'); INSERT INTO gifi (accno,description) VALUES ('3.B.10.c', 'altre svalutazioni delle immobilizzazioni'); INSERT INTO gifi (accno,description) VALUES ('3.B.10.d', 'svalutazioni dell\'attivo circolante e delle disponibilita\' liquide'); INSERT INTO gifi (accno,description) VALUES ('3.B.11', 'variazioni rimanenze materie prime, sussidiarie, di consumo e merci'); INSERT INTO gifi (accno,description) VALUES ('3.B.12', 'accantonamento per rischi'); INSERT INTO gifi (accno,description) VALUES ('3.B.13', 'altri accantonamenti'); INSERT INTO gifi (accno,description) VALUES ('3.B.14', 'oneri diversi di gestione'); INSERT INTO gifi (accno,description) VALUES ('3.C', 'PROVENTI E ONERI FINANZIARI'); INSERT INTO gifi (accno,description) VALUES ('3.C.15', 'proventi da partecipazioni'); INSERT INTO gifi (accno,description) VALUES ('3.C.16', 'altri proventi finanziari'); INSERT INTO gifi (accno,description) VALUES ('3.C.16.a', 'proventi da crediti iscritti nelle immobilizzazioni'); INSERT INTO gifi (accno,description) VALUES ('3.C.16.b', 'proventi da titoli iscritti nelle immobilizzazioni che non costituiscono partecipazioni'); INSERT INTO gifi (accno,description) VALUES ('3.C.16.c', 'proventi da titoli iscritti all\'attivo circolante che non costituiscono partecipazioni'); INSERT INTO gifi (accno,description) VALUES ('3.C.16.d', 'proventi diversi dai precedenti'); INSERT INTO gifi (accno,description) VALUES ('3.C.17', 'Interessi e altri oneri finanziari'); INSERT INTO gifi (accno,description) VALUES ('3.D', 'RETTIFICHE DI VALORE DI ATTIVITA\' FINANZIARIE'); INSERT INTO gifi (accno,description) VALUES ('3.D.18', 'rivalutazioni'); INSERT INTO gifi (accno,description) VALUES ('3.D.18.a', 'rettifiche di partecipazioni'); INSERT INTO gifi (accno,description) VALUES ('3.D.18.b', 'rettifiche di immobilizzazioni finanziarie che non costituiscono partecipazioni'); INSERT INTO gifi (accno,description) VALUES ('3.D.18.c', 'rettifiche da titoli iscritti all\'attivo circolante che non costituiscono partecipazioni'); INSERT INTO gifi (accno,description) VALUES ('3.D.19', 'svalutazioni'); INSERT INTO gifi (accno,description) VALUES ('3.D.19.a', 'svalutazioni di partecipazioni'); INSERT INTO gifi (accno,description) VALUES ('3.D.19.b', 'svalutazioni di immobilizzazioni finanziarie che non costituiscono partecipazioni'); INSERT INTO gifi (accno,description) VALUES ('3.D.19.c', 'svalutazioni di titoli iscritti all\'attivo circolante che non costituiscono partecipazioni'); INSERT INTO gifi (accno,description) VALUES ('3.E', 'PROVENTI E ONERI STRAORDINARI'); INSERT INTO gifi (accno,description) VALUES ('3.E.20', 'proventi straordinari'); INSERT INTO gifi (accno,description) VALUES ('3.E.21', 'oneri straordinari'); INSERT INTO gifi (accno,description) VALUES ('3.E.22', 'Imposte sul reddito dell\'esercizio'); INSERT INTO gifi (accno,description) VALUES ('3.E.26', 'Utile o perdita di esercizio'); commit; ledgersmb/sql/coa/it/chart/0000755000000000000000000000000012060044550014572 5ustar rootrootledgersmb/sql/coa/it/chart/General.sql0000755000000000000000000004415111726633756016724 0ustar rootrootbegin; -- -- Chart of Accounts for Italy -- -- From: Luca Venturini -- 9 Oct 2001 -- -- ('2001101'5 Conto ('6470005' diventa tassa (negativa) -- ('2001102'5 IVA su acquisti diventa Iva su acq. (20%) -- ('2001102'5 Introdotto un conto per ogni aliquota IVA -- ('2001102'7 Modificato numero di conto per la Ritenuta d'acconto -- ('2001103'1 Inseriti Fornitore-test e Consulente-test -- ('2001111'5 Invertito i ruoli di ('6470005' e ('6470010' (erano sbagliati) -- ('2001111'5 Eliminata l'applicabilita' della RA al cliente test -- ('2001112'0 Aggiunto IC_expense al conto ('7005005' (mancava un conto di default per i servizi) SELECT account_heading_save(NULL,'2010000','COSTI DI RICERCA, DI SVILUPPO E DI PUBBLICITA\'', NULL); SELECT account_save(NULL,'2010005','Spese di ricerca e di sviluppo','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2010010','Spese di pubblicita\'','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'2015000','DIRITTI DI BREV. IND. E DIRITTI DI UTILIZZ DELLE OPERE DELL\'INGEGNO', NULL); SELECT account_save(NULL,'2015005','Brevetti','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2020005','Concessioni, licenze e diritti simili','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2025005','Avviamento','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'2245000','TERRENI E FABBRICATI', NULL); SELECT account_save(NULL,'2245010','Fabbricati civili','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'2250000','IMPIANTI E MACCHINARI', NULL); SELECT account_save(NULL,'2250005','Impianti generici','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'2255000','ATTREZZATURE INDUSTRIALI E COMMERCIALI', NULL); SELECT account_save(NULL,'2255005','Attrezzature','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2255010','Mobili','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2255015','Macchine d\'ufficio','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2255025','Autovetture','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'3005000','RIMANENZE MATERIE PRIME, SUSSIDIARIE E DI CONSUMO', NULL); SELECT account_save(NULL,'3005005','Rimanenze materie prime','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'3020000','RIMANENZE PRODOTTI FINITI E MERCI', NULL); SELECT account_save(NULL,'3020005','Rimanenze prodotti finiti','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL,'4001000','CREDITI VERSO CL. PER FATT. EM. ESIGIBILI ENTRO L\'ESER. SUCC.', NULL); SELECT account_save(NULL,'4001001','Crediti verso clienti per fatture emesse','A','', NULL, false, false, string_to_array('AR', ':')); SELECT account_heading_save(NULL,'4064000','CREDITI VERSO ALTRI - CREDITI D\'IMPOSTA', NULL); SELECT account_save(NULL,'4064005','IRPEF acconto','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4064020','IRPEG acconto','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4064800','Credito verso erario per IVA','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'4400000','DISPONIBILITA\' LIQUIDE', NULL); SELECT account_save(NULL,'4480105','Banca ...c/c','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'4480400','Assegni','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'4480500','Cassa e valori','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_heading_save(NULL,'5005000','CAPITALE', NULL); SELECT account_save(NULL,'5005005','Capitale sociale','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5005010','Versamenti in conto capitale','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5020000','RISERVA LEGALE', NULL); SELECT account_save(NULL,'5020005','Riserva legale','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5080000','UTILI (PERDITE) PORTATI A NUOVO', NULL); SELECT account_save(NULL,'5080005','Utili esercizi precedenti','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5080010','Perdite esercizi precedenti','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5090000','UTILE (PERDITA) DELL\'ESERCIZIO', NULL); SELECT account_save(NULL,'5090005','Utile dell\'esercizio','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5090010','Perdita dell\'esercizio','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'6200000','TRATTAMENTO DI FINE RAPPORTO DI LAVORO SUBORDINATO', NULL); SELECT account_save(NULL,'6220005','Trattamento di fine rapporto di lavoro subordinato','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6220010','Anticipazioni erogate su trattamento di fine rapporto di lavoro subordinato','L','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'6435000','DEBITI VERSO BANCHE ESIGIBILI ENTRO ES. SUCC.', NULL); SELECT account_save(NULL,'6435005','Banca di ... c/c','L','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'6436000','DEBITI VERSO BANCHE ESIGIBILI OLTRE ES. SUCC.', NULL); SELECT account_save(NULL,'6436005','Mutuo banca di ...','L','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'6450000','DEBITI VERSO FORNITORI FATT. RICEVUTE ESIGIBILI ENTRO ES. SUCC.', NULL); SELECT account_save(NULL,'6450001','Debiti verso fornitori per fatture ricevute','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_heading_save(NULL,'6470000','DEBITI TRIBUTARI', NULL); SELECT account_save(NULL,'6470005','IRPEF dipendenti','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6470010','IRPEF terzi','L','', NULL, false, false, string_to_array('AP_tax:IC_taxservice', ':')); SELECT account_save(NULL,'6470015','IVA da versare','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'6470020','IVA in sospeso','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6470025','IRPEG sul reddito d\'esercizio','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6470030','ILOR sul reddito d\'esercizio','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6470050','Imposta patrimoniale','L','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'6475000','DEBITI VERSO ISTITUTI PREV. ESIGIBILI ENTRO ES. SUCC.', NULL); SELECT account_save(NULL,'6475005','INPS','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6475010','INAIL','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6475020','Servizio sanitario nazionale (S.S.N.)','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6475025','ENASARCO','L','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'6480000','ALTRI DEBITI - IVA C/ERARIO', NULL); SELECT account_save(NULL,'6480003','IVA su acquisti (4%)','L','', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'6480004','IVA su acquisti (10%)','L','', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'6480005','IVA su acquisti (20%)','L','', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'6480006','IVA a credito su acquisti U.E.','L','', NULL, false, false, string_to_array('AP_tax', ':')); SELECT account_save(NULL,'6480010','IVA su fatture emesse','L','', NULL, false, false, string_to_array('AR_tax', ':')); SELECT account_save(NULL,'6480011','IVA a debito su acquisti U.E.','L','', NULL, false, false, string_to_array('AR_tax', ':')); SELECT account_save(NULL,'6480015','IVA su corrispettivi','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6480020','IVA versata','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6480025','IVA acconto','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6480030','IVA a credito','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6480035','IVA ulteriore detrazione','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6480040','Crediti d\'imposta diversi','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6480045','IVA pro-rata indetraibile','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6480050','IVA da contabilità separata','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6480055','IVA c/riepilogativo','L','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'6600000','RATEI E RISCONTI PASSIVI', NULL); SELECT account_save(NULL,'6690005','Ratei passivi','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6692005','Risconti passivi','L','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'7005000','COSTI PER MATERIE PRIME, SUSSIDIARIE, DI CONSUMO E DI MERCI', NULL); SELECT account_save(NULL,'7005005','Materie prime','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'7005015','Merci destinate alla rivendita','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'7005020','Materiali di consumo destinati alla produzione','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7005030','Materiali di pulizia','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7005035','Combustibile per riscaldamento','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7005040','Cancelleria','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7005045','Materiale pubblicitario','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7005050','Carburanti e lubrificanti','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL,'7025000','SPESE DI GESTIONE', NULL); SELECT account_save(NULL,'7025005','Energia elettrica','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7025015','Spese telefoniche','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7025025','Spese pubblicità/propaganda','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7025030','Spese di assicurazione','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7025040','Pulizia locali','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7025055','Viaggi e soggiorni amministratori','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7025060','Spese di rappresentanza per servizi interamente detraibili','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7025065','Altre spese di rappresentanza','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7025100','Altri servizi','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL,'7028000','CARBURANTI E LUBRIFICANTI PER AUTOTRAZIONE', NULL); SELECT account_save(NULL,'7028005','Carburanti e lubrificanti autovetture','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7028010','Carburanti e lubrificanti autocarri etc.','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL,'7030000','COMPENSI PROFESSIONALI', NULL); SELECT account_save(NULL,'7030005','Consulenza fiscale e tributaria','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7030015','Consulenza legale','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7030030','Compenso amministratori','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL,'7035000','COSTI PER GODIMENTO BENI DI TERZI', NULL); SELECT account_save(NULL,'7035005','Fitti passivi','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7035050','Canoni di leasing','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL,'7040000','COSTI PER IL PERSONALE', NULL); SELECT account_save(NULL,'7040005','Salari e stipendi','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7040010','Oneri sociali INPS','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7040015','Oneri sociali INAIL','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7040020','Oneri sociali C.E.','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'7043000','AMMORTAMENTI E SVALUTAZIONI', NULL); SELECT account_save(NULL,'7043005','Ammortamenti immobilizzazioni immateriali','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7043100','Ammortamenti immobilizzazioni materiali','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'7056000','ONERI DIVERSI DI GESTIONE', NULL); SELECT account_save(NULL,'7056010','Imposta di registro, bolli ,CC.GG., etc.','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7056015','Imposta camerale','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'7056025','Tributi locali diversi','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7056040','Tassa possesso autoveicoli','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL,'7260000','INTERESSI E ONERI FINANZIARI', NULL); SELECT account_save(NULL,'7260020','Interessi passivi bancari','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7260025','Interessi passivi mutui','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'7875000','IMPOSTE SUL REDDITO DELL\'ESERCIZIO', NULL); SELECT account_save(NULL,'7875005','IRPEG corrente','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7875020','IRPEG differita','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'8005000','RICAVI DELLE VENDITE', NULL); SELECT account_save(NULL,'8005005','Ricavi cessione beni','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL,'8015000','RICAVI DELLE PRESTAZIONI', NULL); SELECT account_save(NULL,'8015005','Ricavi per prestazioni a terzi','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'8015015','Noleggio impianti e macchinari','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_heading_save(NULL,'8041000','INCREMENTI IMMOBILIZZAZIONI IMMATERIALI', NULL); SELECT account_save(NULL,'8041005','Brevetti','I','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8041010','Spese di costituzione società','I','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'8041020','Spese pubblicità e propaganda','I','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL,'8045000','ALTRI RICAVI E PROVENTI', NULL); SELECT account_save(NULL,'8045001','Cessione di materie prime, sussidiarie e semilavorati','I','', NULL, false, false, string_to_array('AR_amount', ':')); -- -- foreign exchange gain / loss SELECT account_save(NULL,'9990000','Foreign Exchange Gain','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9990010','Foreign Exchange Loss','E','', NULL, false, false, string_to_array('', ':')); -- -- insert taxes -- --Ritenuta d'acconto INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '6470010'), -0.2); --IVA Acquisti 4% INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '6480003'), 0.04); --IVA Acquisti 10% INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '6480004'), 0.1); --IVA Acquisti 20% INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '6480005'), 0.2); --IVA Fatture Emesse INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '6480010'), 0.2); --IVA su corrispettivi INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '6480015'), 0.2); -- -- update defaults -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '3020005')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '8005005')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '7005005')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '9990000')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '9990010')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'EUR'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); -- commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno = '4480105'; ledgersmb/sql/coa/it/chart/cc2424.sql0000755000000000000000000006621711726633756016257 0ustar rootrootbegin; -- -- Chart of Accounts for Italy -- -- From: Daniele Giacomini -- 13 ottobre 2003 -- 05 novembre 2003 -- -- Il codice GIFI viene usato per rappresentare il codice corrispondente -- al bilancio riclassificato, come da codice civile, art. 2424. -- Il codice in questione e' rappresentato separando i vari elementi -- con un punto, aggiungendo inizialmente un numero: 1 sta per attivo, -- 2 sta per passivo, 3 sta per conto economico. -- -- L'abbinamento tra il piano dei conti e il codice GIFI non e' perfetto -- e richiede un controllo ulteriore; inoltre, non sono stati risolti -- i problemi relativi alle sottoclassificazioni previste dal codice civile, -- che pero' non hanno un codice standard corrispondente. -- -- La codifica GIFI è contenuta in un file separato. -- -- Questo file e' scritto usando soltanto la codifica ASCII, per evitare -- problemi di qualunque genere nella scelta della codifica. Pertanto, -- le vocali accentate sono seguite da un apostrofo. -- -- E' disponibile un cliente, un fornitore e un articolo di prova. -- SELECT account_heading_save(NULL,'100000','ATTIVO', NULL); SELECT account_heading_save(NULL,'101000','IMMOBILIZZAZIONI IMMATERIALI', NULL); SELECT account_save(NULL,'101001','Costi di impianto e ampliamento','A','1.B.I.1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'101002','Avviamento','A','1.B.I.5', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'101008','Altre immobilizzazioni immateriali','A','1.B.I.7', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'102000','IMMOBILIZZAZIONI MATERIALI', NULL); SELECT account_save(NULL,'102001','Terreni','A','1.B.II.1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'102002','Fabbricati non strumentali','A','1.B.II.1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'102003','Fabbricati','A','1.B.II.1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'102004','Impianti e macchinari','A','1.B.II.2', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'102006','Attrezzature commerciali','A','1.B.II.3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'102007','Attrezzature d\'ufficio','A','1.B.II.3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'102008','Arredamento','A','1.B.II.3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'102009','Automezzi','A','1.B.II.3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'102021','Fondo ammortamento fabbricati','A','1.B.II.1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'102022','Fondo ammortamento impianti e macchinari','A','1.B.II.3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'102023','Fondo ammortamento attrezzature commerciali','A','1.B.II.3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'102024','Fondo ammortamento attrezzature d\'ufficio','A','1.B.II.3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'102025','Fondo ammortamento arredamento','A','1.B.II.3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'102026','Fondo ammortamento automezzi','A','1.B.II.3', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'103000','IMMOBILIZZAZIONI FINANZIARIE', NULL); SELECT account_save(NULL,'103001','Prestiti a terzi','A','1.B.III.2.d', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'105000','RIMANENZE', NULL); SELECT account_save(NULL,'105001','Rimanenze di merci','A','1.C.I.4', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'105002','Rimanenze di imballaggi','A','1.C.I.4', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'105003','Rimanenze di materiali di consumo','A','1.C.I.1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'105011','Fondo svalutazione magazzino','A','1.C.I.4', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'106000','CLIENTI', NULL); SELECT account_save(NULL,'106001','Crediti verso clienti','A','1.C.II.1', NULL, false, false, string_to_array('AR', ':')); SELECT account_heading_save(NULL,'111000','CREDITI COMMERCIALI', NULL); SELECT account_save(NULL,'111002','Cambiali attive','A','1.C.II.1', NULL, false, false, string_to_array('AR_paid', ':')); SELECT account_save(NULL,'111003','Cambiali allo sconto','A','1.C.II.1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'111005','Cambiali all\'incasso','A','1.C.II.1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'111006','Effetti insoluti e protestati','A','1.C.II.1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'111007','Crediti insoluti','A','1.C.II.1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'111011','Fatture da emettere','A','1.C.II.1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'111031','Fondo svalutazione crediti','A','1.C.II.1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'111032','Fondo rischi su crediti','A','1.C.II.1', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'112000','CREDITI DIVERSI', NULL); SELECT account_save(NULL,'112001','IVA nostro credito 4%','A','1.C.II.5', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'112002','IVA nostro credito 10%','A','1.C.II.5', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'112004','IVA nostro credito 20%','A','1.C.II.5', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'112062','Erario c/acconto IVA','A','1.C.II.5', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'112063','Credito per IVA','A','1.C.II.5', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'112071','Personale c/acconti','A','1.C.II.5', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'112072','Crediti v/istituti previdenziali','A','1.C.II.5', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'112073','Crediti per cauzioni','A','1.C.II.5', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'112074','Crediti diversi','A','1.C.II.5', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'113000','VALORI MOBILIARI', NULL); SELECT account_save(NULL,'113001','Titoli','A','1.C.III.6', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'114000','DISPONIBILITA\' LIQUIDE', NULL); SELECT account_save(NULL,'114001','Banca c/c','A','1.C.IV.1', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'114003','Poste c/c','A','1.C.IV.1', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'114004','Assegni','A','1.C.IV.2', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'114005','Denaro e valori in cassa','A','1.C.IV.3', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_heading_save(NULL,'115000','RATEI E RISCONTI ATTIVI', NULL); SELECT account_save(NULL,'115001','Ratei attivi','A','1.D', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'115002','Risconti attivi','A','1.D', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'200000','PASSIVO', NULL); SELECT account_heading_save(NULL,'216000','PATRIMONIO NETTO', NULL); SELECT account_save(NULL,'216001','Patrimonio netto','Q','2.A.I', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'216002','Utile d\'esercizio','Q','2.A.IX', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'216003','Perdita d\'esercizio','Q','2.A.IX', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'217000','FONDO ACCANTONAMENTO RISCHI E ONERI', NULL); SELECT account_save(NULL,'217002','Fondo per imposte','L','2.B.2', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'217003','Fondo manutenzioni e riparazioni','L','2.B.3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'217006','Altri fondi','L','2.B.3', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'218000','TFR LAVORO SUBORDINATO', NULL); SELECT account_save(NULL,'218001','Debito per TFRL','L','2.C', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'219000','DEBITI DI FINAZIAMENTO', NULL); SELECT account_save(NULL,'219001','Mutui ipotecari','L','2.D.3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'219002','Finanziamenti bancari','L','2.D.3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'219003','Sovvenzioni bancarie','L','2.D.3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'219004','Banche c/c passivi','L','2.D.3', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'219011','Finanziamenti non bancari','L','2.D.4', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'220000','FORNITORI', NULL); SELECT account_save(NULL,'220001','Debiti verso fornitori','L','2.D.6', NULL, false, false, string_to_array('AP', ':')); SELECT account_heading_save(NULL,'225000','DEBITI COMMERCIALI', NULL); SELECT account_save(NULL,'225002','Cambiali passive','L','2.D.6', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'225003','Fatture da ricevere','L','2.D.6', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'226000','DEBITI TRIBUTARI', NULL); SELECT account_save(NULL,'226001','IVA nostro debito 4%','L','2.D.13', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'226002','IVA nostro debito 10%','L','2.D.13', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'226004','IVA nostro debito 20%','L','2.D.13', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'226062','Debito per IVA','L','2.D.13', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'226065','Erario c/ritenute da versarare','L','2.D.13', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'226066','Altri debiti verso l\'erario','L','2.D.13', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'226067','Debiti per imposte','L','2.D.13', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'227000','DEBITI DIVERSI', NULL); SELECT account_save(NULL,'227001','Personale c/retribuzioni','L','2.D.13', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'227002','Personale c/liquidazioni','L','2.D.13', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'227003','Debiti v/istituti previdenziali','L','2.D.12', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'227004','Debiti per cauzioni','L','2.D.13', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'227005','Debiti diversi','L','2.D.13', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'228000','RATEI E RISCONTI PASSIVI', NULL); SELECT account_save(NULL,'228001','Ratei passivi','L','2.E', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'228002','Risconti passivi','L','2.E', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'300000','ALTRI CONTI PATRIMONIALI', NULL); SELECT account_heading_save(NULL,'329000','CONTI TRANSITORI E FINALALI', NULL); SELECT account_save(NULL,'329006','Istituti previdenziali','A','2.D.12', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'329011','Conto del patrimonio','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'329012','Bilancio di apertura','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'400000','CONTI D\'ORDINE', NULL); SELECT account_heading_save(NULL,'431000','IMPEGNI', NULL); SELECT account_save(NULL,'431001','Beni da ricevere','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'431002','Fornitori per beni da ricevere','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'431003','Beni da consegnare','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'431004','Clienti per beni da consegnare','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'431005','Beni in leasing','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'431006','Creditori per beni in leasing','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'432000','BENI DI TERZI', NULL); SELECT account_heading_save(NULL,'433000','BENI NOSTRI PRESSO TERZI', NULL); SELECT account_heading_save(NULL,'434000','RISCHI', NULL); SELECT account_heading_save(NULL,'500000','VALORE DELLA PRODUZIONE', NULL); SELECT account_heading_save(NULL,'541000','RICAVI VENDITE E PRESTAZIONI', NULL); SELECT account_save(NULL,'541001','Vendite di merci','I','3.A.1', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'541002','Vendite di imballaggi','I','3.A.1', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'541003','Ricavi per prestazione di servizi','I','3.A.1', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'541006','Resi su vendite','I','3.A.1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'541007','Ribassi e abbuoni passivi','I','3.A.1', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'541008','Premi a clienti','I','3.B.9.e', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'541010','Rimborso spese','I','3.A.5', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_heading_save(NULL,'542000','ALTRI RICAVI E PROVENTI', NULL); SELECT account_save(NULL,'542001','Ricavi e proventi vari','I','3.A.5', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'542002','Fitti attivi','I','3.A.5', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'542003','Arrotondamenti positivi','I','3.A.5', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_heading_save(NULL,'600000','COSTI DELLA PRODUZIONE', NULL); SELECT account_heading_save(NULL,'645000','COSTI ACQUISTO MERCI E MATERIALI DI CONSUMO', NULL); SELECT account_save(NULL,'645001','Acquisti di merci','E','3.B.6', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'645002','Acquisti di imballaggi','E','3.B.6', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'645003','Acquisti di materiali di consumo','E','3.B.6', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'645006','Resi su acquisti','E','3.B.6', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'645007','Ribassi e abbuoni attivi','E','3.B.6', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'645008','Premi da fornitori','E','3.A.5', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'646000','COSTI PER PRESTAZIONI E SERVIZI', NULL); SELECT account_save(NULL,'646001','Costi di trasporto','E','3.B.7', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'646002','Costi di energia','E','3.B.7', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'646003','Costi di pubblicita\'','E','3.B.7', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'646004','Assicurazioni','E','3.B.7', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'646005','Spese postali','E','3.B.7', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'646006','Spese telefoniche','E','3.B.7', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'646007','Spese legali e notarili','E','3.B.7', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'646008','Spese di banca','E','3.B.7', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'646009','Manutenzioni riparazioni','E','3.B.7', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'646010','Imponibile omaggi','E','3.B.9.e', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'646011','IVA c/omaggi','E','3.B.9.e', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'646021','Provvigioni passive','E','3.B.9.e', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'646022','Competenze a terzi','E','3.B.9.e', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'647000','COSTI PER GODIMENTO BENI DI TERZI', NULL); SELECT account_save(NULL,'647001','Fitti passivi','E','3.B.8', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'647002','Canoni leasing','E','3.B.8', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'648000','COSTI PER IL PERSONALE', NULL); SELECT account_save(NULL,'648001','Salari e stipendi','E','3.B.9.a', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'648002','Oneri sociali','E','3.B.9.b', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'648003','Trattamenti di fine rapporto di lavoro','E','3.B.9.c', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'648004','Trattamenti di quiescenza e simili','E','3.B.9.d', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'648005','Altri costi per il personale','E','3.B.9.e', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'649000','AMMORTAMENTO IMMOBILIZZAZIONI IMMATERIALI', NULL); SELECT account_save(NULL,'649001','Ammortamento impianto e ampliamento','E','3.B.10.a', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'649002','Ammortamento avviamento','E','3.B.10.a', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'649008','Ammortamento di altre immobilizzazioni immateriali','E','3.B.10.a', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'650000','AMMORTAMENTO IMMOBILIZZAZIONI MATERIALI', NULL); SELECT account_save(NULL,'650001','Ammortamento fabbricati','E','3.B.10.b', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'650002','Ammortamento impianti e macchinari','E','3.B.10.b', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'650003','Ammortamento attrezzature commerciali','E','3.B.10.b', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'650005','Ammortamento attrezzature d\'ufficio','E','3.B.10.b', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'650006','Ammortamento arredamento','E','3.B.10.b', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'650007','Ammortamento automezzi','E','3.B.10.b', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'651000','SVALUTAZIONI', NULL); SELECT account_save(NULL,'651003','Svalutazione magazzino','E','3.B.11', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'651004','Svalutazione crediti','E','3.B.12', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'652000','ESISTENZA INIZIALE E RIMANENZE FINALI', NULL); SELECT account_save(NULL,'652001','Esistenza iniziale merci','E','3.A.2', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'652002','Esistenza iniziale imballaggi','E','3.A.2', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'652003','Esistenza iniziale materie di consumo','E','3.A.2', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'652011','Rimanenze finali merci','E','3.A.2', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'652012','Rimanenze finali imballaggi','E','3.A.2', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'652013','Rimanenze finali materie di consumo','E','3.A.2', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'652021','Variazioni merci','E','3.A.2', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'652022','Variazioni imballaggi','E','3.A.2', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'652023','Variazioni materie di consumo','E','3.A.2', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'653000','ACCANTONAMENTI PER RISCHI', NULL); SELECT account_save(NULL,'653001','Accantonamenti per rischi su crediti','E','3.B.12', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'653002','Accantonamenti su imposte','E','3.B.13', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'653004','Altri accantonamenti rischi-oneri','E','3.B.12', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'654000','ALTRI ACCANTONAMENTI', NULL); SELECT account_save(NULL,'654001','Accantonamenti per spese future','E','3.B.13', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'654005','Accantonamenti per manutenzioni e riparazioni','E','3.B.13', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'654006','Altri accantonamenti','E','3.B.13', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'655000','ONERI DIVERSI', NULL); SELECT account_save(NULL,'655001','Imposta di bollo','E','3.B.14', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'655002','Tassa di concessione governativa','E','3.B.14', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'655003','Imposte comunali','E','3.B.14', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'655005','Imposte di esercizio','E','3.B.14', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'655006','Perdite su crediti','E','3.B.14', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'655011','Oneri e perdite varie','E','3.B.14', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'655012','Arrotondamenti negativi','E','3.B.14', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'700000','PROVENTI E ONERI FINANZIARI', NULL); SELECT account_save(NULL,'756000','PROVENTI FINANZIARI','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'756001','Interessi attivi da banche','I','3.C.16.d', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'756002','Interessi attivi da clienti','I','3.C.16.d', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'756003','Interessi attivi vari','I','3.C.16.d', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'756004','Interessi su titoli','I','3.C.16.d', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'756011','Proventi finanziari vari','I','3.C.16.d', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'756012','Utile su titoli','I','3.C.16.b', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'757000','ONERI FINANZIARI', NULL); SELECT account_save(NULL,'757001','Interessi passivi a banche','I','3.C.17', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'757002','Interessi passivi a fornitori','I','3.C.17', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'757003','Interessi passivi su finanziamenti','I','3.C.17', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'757004','Interessi passivi su mutui','I','3.C.17', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'757005','Interessi passivi vari','I','3.C.17', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'757011','Oneri finanziari vari','I','3.C.17', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'757012','Perdite su titoli','I','3.C.17', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'800000','PROVENTI E ONERI STRAORDINARI', NULL); SELECT account_heading_save(NULL,'860000','PROVENTI STRAORDINARI', NULL); SELECT account_save(NULL,'860001','Plusvalenze','I','3.E.20', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'860002','Sopravvenienze e insussistenze attive','I','3.E.20', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'861000','ONERI STRAORDINARI', NULL); SELECT account_save(NULL,'861001','Minusvalenze','I','3.E.21', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'861002','Sopravvenienze e insussistenze passive','I','3.E.21', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'900000','CONTI DI RIEPILOGO ECONOMICI', NULL); SELECT account_save(NULL,'970001','Conto del risultato economico','I','3.E.23', NULL, false, false, string_to_array('', ':')); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '112001'), 0.04); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '112002'), 0.1); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '112004'), 0.2); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '226001'), 0.04); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '226002'), 0.1); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '226004'), 0.2); -- -- update defaults -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '105001')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '541001')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '645001')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '756011')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '655011')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'EUR'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno = '114001'; SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno = '114003'; ledgersmb/sql/coa/nl/0000755000000000000000000000000012060044550013466 5ustar rootrootledgersmb/sql/coa/nl/chart/0000755000000000000000000000000012060044550014567 5ustar rootrootledgersmb/sql/coa/nl/chart/General.sql0000755000000000000000000006357311726633756016732 0ustar rootrootbegin; -- Nederlandstalig Rekeningschema conform het Decimaal Stelsel. -- Dutch Chart of Accounts following the Decimal Standards as set by the famous Philips Accounting Department -- PDF Tammes, Fri, 29 Mar 2002 ( remarks or questions to finance@bermuda-holding.com ) -- Just delete any accounts not needed after importing the scheme, beats entering all manually (or add -- at the beginning) -- Account groups (first number in accountnumber defines to which group it belongs) -- 0 : Vaste Activa, Eigen Vermogen, Voorzieningen en lang vreemd vermogen => Fixed Assets, Capital, Accruals and long term loans -- 1 : Financiele Rekeningen => Financial Accounts -- 2 : Tussenrekeningen => Intermediate Accounts -- 3 : Voorraad grond- en hulpstoffen => Stocks (minerals, parts not yet assembled etc) -- 4 : Kostenrekeningen => Costs Accounts -- 5 : Verdeling Directe kosten => Accounts to recharge several Direct Costs to separate departments -- 6 : Fabricagekosten => Assembly Costs -- 7 : Voorraad gereed produkt en product in bewerking => Stocks (Trade Articles, half-finished assemblies, projects under construction) -- 8 : Rekeningen voor vaststelling van het verkoopresultaat => Accounts for dediding Sales Result -- 9 : Rekeningen voor vaststelling van de resultatenrekening => Accounts for dediding Profit & Loss (P/L) -- The general idea is to allocate all costs to the 4/5/6 accounts, all stock transactions to 7 and sales related to 8. At the end of the -- year you clean out the seperate accounts via x999 and kick the result to the relevant 9xxx series. That way you have a specialized -- P/L in the seperate accounts and an overview/shirt version of the P/L in the 9 series, where also various results not related to normal -- operations is recorded (tax, donations, that kind of thing. Finally the 9999 account is used to kick the result to retained earnings and -- related accounts in the balance sheet, and we are ready for the next year -- SELECT account_heading_save(NULL,'0000','Vaste Activa & Eigen Vermogen', NULL); SELECT account_save(NULL,'0010','Terreinen','A','0010', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0015','Afschrijving Terreinen','A','0015', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0200','Gebouwen','A','0200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0205','Afschrijving Gebouwen','A','0205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0230','Inventaris','A','0230', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0235','Afschrijving Inventaris','A','0235', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0240','Computers','A','0240', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0245','Afschrijving Computers','A','0245', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0250','Auto','A','0250', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0255','Afschrijving Auto','A','0255', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0260','Machines','A','0260', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0265','Afschrijving Machines','A','0265', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0290','Goodwill','A','0290', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0295','Afschrijving Goodwill','A','0295', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0370','Overige Leningen u/g','A','0370', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0380','Aandelen & Effecten','A','0380', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0381','Beleggingen Spaarbeleg','A','0381', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0390','Beleggingen Legiolease','A','0390', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0400','Aandelenkapitaal','Q','0400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0410','Aandelen in portefeuille','Q','0410', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0420','Aandelen uit te reiken','Q','0420', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0430','Agioreserve','Q','0430', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0440','Winstreserve','Q','0440', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0450','Herwaarderingsreserve','Q','0450', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0470','Oprichtingskosten','Q','0470', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0480','Winst na belasting lopend jaar','Q','0480', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0500','Eigen Vermogen','Q','0500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0510','Prive','Q','0510', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0550','Onverdeeld Resultaat','Q','0550', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0600','Voorziening Onderhoud','Q','0600', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0610','Voorziening Garantie','Q','0610', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0620','Voorziening Assurantie','Q','0620', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0630','Voorziening Debiteuren','Q','0630', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0700','Obligatielening','Q','0700', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0710','Obligaties in portefeuille','Q','0710', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0720','Converteerbare Obligatielening','Q','0720', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0730','Agio op Obligaties','Q','0730', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0740','Disagio op Obligaties','Q','0740', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'0800','Hypothecaire lening o/g','L','0800', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'1000','Financiele Rekeningen', NULL); SELECT account_save(NULL,'1001','Kas','A','1001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1050','Contante Verkopen','A','1050', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1100','Interbank','A','1100', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1110','ABN-AMRO','A','1110', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1119','Postbank Plus','A','1119', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1120','Postbank Giro','A','1120', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1121','Postbank Kapitaal','A','1121', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1122','Postbank Leeuw','A','1122', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1139','Postbank Effectenrekening','A','1139', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1140','Rabobank','A','1140', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1141','Rabobank Rendementrekening','A','1141', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1160','van Lanschotbank','A','1160', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1170','Finansbank','A','1170', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1180','VISA Creditcard','A','1180', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1190','Kruisposten','A','1190', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1200','Debiteuren','A','1200', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1205','Dubieuze Debiteuren','A','1205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1321','Rekening Courant < A','A','1321', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1322','Rekening Courant < B','A','1322', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1340','Goederen ontvangen / GO','A','1340', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1500','Te betalen loonheffing','A','1500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1520','Te betalen Sociale Lasten','A','1520', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1530','Te betalen Pensioenpremies','A','1530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1600','Crediteuren','L','1600', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'1605','Nog te Ontvangen Facturen / NOF','A','1605', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1610','Te betalen tantiemes','A','1610', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1615','Te betalen Vennootschapsbelasting','A','1615', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1620','Interimdividend','A','1620', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1630','Te betalen dividend','A','1630', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1640','Te betalen dividendbelasting','A','1640', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1650','Aandeelhouders nog te storten','A','1650', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1700','Te betalen interest','A','1700', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1710','Te betalen coupons','A','1710', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1770','Uitgelote obligaties','A','1770', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1800','Te vorderen BTW hoog','L','1800', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'1801','Te vorderen BTW laag','L','1801', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'1810','Te betalen BTW hoog','L','1810', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'1811','Te betalen BTW laag','L','1811', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'1850','Saldo BTW','L','1850', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1941','Rekening Courant > A','A','1941', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1942','Rekening Courant > B','A','1942', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1960','Vooruitbetaalde bedragen','A','1960', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1970','Vooruitontvangen bedragen','A','1970', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1980','Nog te ontvangen bedragen','A','1980', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1990','Nog te betalen bedragen','A','1990', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'2000','Tussenrekeningen', NULL); SELECT account_save(NULL,'2100','Vraagposten','A','2100', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2400','Onbekende betalingen','A','2400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2800','Tussenrekening Lonen','A','2800', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2900','Tussenrekening Beginbalans','A','2900', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'3000','Voorraad Grond- en Hulpstoffen', NULL); SELECT account_save(NULL,'3010','Voorraad Grondstof A','A','3010', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL,'4000','Kostenrekeningen', NULL); SELECT account_save(NULL,'4001','Verbruik Grondstoffen','E','4001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4100','Directe Loonkosten','E','4100', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4110','Indirecte Loonkosten','E','4110', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4120','Sociale Lasten','E','4120', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4130','Kosten Pensioenen','E','4130', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4190','Overige Personeelskosten','E','4190', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4200','Kosten externe medewerkers','E','4200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4210','Kosten Personeelsuitjes','E','4210', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4220','Kantinekosten','E','4220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4240','Lief en Leedpot externe medewerkers','E','4240', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4300','Afschrijvingskosten Gebouwen','E','4300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4330','Afschrijvingskosten Inventaris','E','4330', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4340','Afschrijvingskosten Computers','E','4340', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4350','Afschrijvingskosten Autos','E','4350', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4360','Afschrijvingskosten Machines','E','4360', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4390','Afschrijvingskosten Goodwill','E','4390', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4400','Huurkosten','E','4400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4410','Asurantiekosten','E','4410', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4520','Gas, Licht & Water','E','4520', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4530','Vaste Lasten','E','4530', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4540','Reparatie- & Onderhoudskosten','E','4540', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4560','Verzekering en Beveiliging Pand','E','4560', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4600','Directe Verkoopkosten','E','4600', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4650','Indirecte Verkoopkosten','E','4650', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4730','Relatiegeschenken','E','4730', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4740','Reis en Verblijfkosten','E','4740', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4800','Kasverschillen','E','4800', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4810','Voorraadverschillen','E','4810', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4900','Telefoon & Faxkosten','E','4900', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4910','Contributies & Abonnementen','E','4910', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4920','Verzekeringen Algemeen','E','4920', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4930','Kantoorartikelen','E','4930', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4931','Kantoorbenodigdheden','E','4931', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4932','Vakliteratuur','E','4932', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4940','Licenties & Software','E','4940', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4941','Administratie & Acountantskosten','E','4941', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4943','Notaris & Advocaatkosten','E','4943', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4950','Drukwerk & Papier','E','4950', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4970','Porti','E','4970', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4980','Bankkosten','E','4980', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4981','Bankprovisie Effectenhandel','E','4981', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4990','Overige Algemene Kosten','E','4990', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4991','Bijzondere baten en lasten','E','4991', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4999','Overboekingsrekening Rubriek 4','E','4999', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5000','Verdeling Indirecte Kosten', NULL); SELECT account_save(NULL,'5400','Indirecte fabricagekosten','E','5400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5450','Opslag Indirecte fabricagekosten','I','5450', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5500','Indirecte verkoopkosten','E','5500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5550','Opslag Indirecte verkoopkosten','I','5550', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5999','Overboekingsrekening Rubriek 5','I','5999', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'6000','Fabricagerekeningen', NULL); SELECT account_save(NULL,'6001','Verbruik Grondstoffen','E','6001', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6010','Directe Lonen','E','6010', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6020','Toeslag Indirecte fabricagekosten','E','6020', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6101','Standaard Verbruik Grondstoffen','I','6101', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6110','Standaard Directe Lonen','I','6110', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6120','Standaard Toeslag Indirecte fabricagekosten','I','6120', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6999','Overboekingsrekening Rubriek 6','I','6999', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'7000','Voorraden gereed product', NULL); SELECT account_save(NULL,'7001','Voorraad A','A','7001', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'7002','Voorraad B','A','7002', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'7003','Voorraad C','A','7003', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'7010','Voorraad Incourante goederen','A','7010', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'7015','Afschrijving Incourante goederen','L','7015', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'7200','Voorraad Goederen in bewerking','A','7200', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'7300','Nog te Ontvangen Goederen / NOG','A','7300', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'7350','Nog af te leveren goederen','L','7350', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'7400','Prijsverschillen bij inkoop','I','7400', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'7999','Overboekingsrekening Rubriek 7','I','7999', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'8000','Rekeningen tbv Verkoopresultaat', NULL); SELECT account_save(NULL,'8010','Inkoopkosten algemeen','E','8010', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'8020','Kostprijs Verkopen A','E','8020', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'8030','Kostprijs Verkopen B','E','8030', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'8040','Kostprijs Verkopen C','E','8040', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'8100','Directe Verkoopkosten','E','8100', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'8150','Toeslag Indirecte Verkoopkosten','E','8150', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8300','Kortingen bij Verkoop','E','8300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8520','Opbrengst Verkopen A','I','8520', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'8530','Opbrengst Verkopen B','I','8530', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'8540','Opbrengst Verkopen C','I','8540', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'8999','Overboekingsrekening Rubriek 8','E','8999', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'9000','Rekeningen tbv Resultatenrekening', NULL); SELECT account_save(NULL,'9010','Resultaat Indirecte Kosten','E','9010', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9011','Resultaat Fabricage','I','9011', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9012','Resultaat Verkoop','I','9012', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9015','Resultaat Prijsverschillen','I','9015', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9030','Rente bate deposito','I','9030', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9040','Rente bate lening u/g','I','9040', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9050','Rente bate bank','I','9050', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9080','Rente bate Fiscus','I','9080', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9100','Rente last hypothecaire lening','E','9100', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9110','Rente last lening bank','E','9110', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9130','Rente last lening o/g','E','9130', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9150','Rente last bank','E','9150', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9180','Rente last Fiscus','E','9180', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9190','Rente last overig','E','9190', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9200','Ontvangen Dividend (bruto)','I','9200', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9205','Ingehouden Dividendbelasting','E','9205', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9210','Koersresultaat Effecten)','E','9210', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9220','Valutaresultaat','E','9220', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9300','Huuropbrengsten','I','9300', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9400','Resultaat tgv inhaalafschrijvingen','E','9400', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9500','Incidentele Resultaten','E','9500', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9600','Giften en Donaties','E','9600', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9700','Tantiemes','E','9700', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9800','Belasting Lopend Jaar','E','9800', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9810','Belasting Voorgaande Jaren','E','9810', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9900','Vennootschapsbelasting','E','9900', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'9999','Overboekingsrekening','I','9999', NULL, false, false, string_to_array('', ':')); -- -- insert into tax (chart_id,rate) values ((select id from chart where accno = '1800'),0.19); insert into tax (chart_id,rate) values ((select id from chart where accno = '1801'),0.06); insert into tax (chart_id,rate) values ((select id from chart where accno = '1810'),0.19); insert into tax (chart_id,rate) values ((select id from chart where accno = '1811'),0.06); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '7001')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '8520')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '8010')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '9220')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '9220')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'EUR:USD'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); -- commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno BETWEEN '1100' AND '1180'; ledgersmb/sql/coa/nl/chart/Simple.sql0000755000000000000000000002074511726633756016600 0ustar rootrootbegin; -- -- Dutch Chart of Accounts -- AJ Hettema, Mon, 20 Aug 2001 -- SELECT account_heading_save(NULL,'1000','HUIDIGE ACTIVA', NULL); SELECT account_save(NULL,'1061','Bank','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1065','Kas','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1200','Debiteuren','A','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1205','Toelage voor precaire rekeningen','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'1500','VOORRAAD ACTIVA', NULL); SELECT account_save(NULL,'1520','Voorraad / Hardware','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1530','Voorraad / Software','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1540','Voorraad / Aftermarket Parts','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL,'1800','LANGE TERMIJN ACTIVA', NULL); SELECT account_save(NULL,'1820','Inventaris','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'1825','Afschrijving inventaris','A','', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'1840','Auto','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'1845','Afschrijving auto','A','', NULL, true, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'2000','HUIDIGE PASSIVA', NULL); SELECT account_save(NULL,'2100','Crediteuren','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'2160','Niet-rijks Belastingen','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2170','Omzetbelasting','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2190','Vennootschapsbelasting','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2310','BTW hoog','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2311','BTW laag','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_heading_save(NULL,'2600','LANGE TERMIJN PASSIVA', NULL); SELECT account_save(NULL,'2620','Bank Leningen','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2680','Aandelenvermogen','L','', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_heading_save(NULL,'3300','AANDELEN KAPITAAL', NULL); SELECT account_save(NULL,'3350','Aandelen in portefeuille','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'3500','WINSTRESERVE', NULL); SELECT account_save(NULL,'3590','Winstreserve voorgaande jaren','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3600','Huidige winstreserve','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'4000','VERKOOP INKOMSTEN', NULL); SELECT account_save(NULL,'4020','Verkoop / Hardware','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'4030','Verkoop / Software','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'4040','Verkoop / Aftermarket Parts','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL,'4300','CONSULTANCY INKOMSTEN', NULL); SELECT account_save(NULL,'4320','Consultancy','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'4330','Programmeren','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL,'4400','ANDERE INKOMSTEN', NULL); SELECT account_save(NULL,'4430','Verzend & Administratie','I','', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'4440','Rente','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4450','Foreign Exchange Gain','I','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5000','INKOOPPRIJS VERKOPEN', NULL); SELECT account_save(NULL,'5010','Inkoopkosten algemeen','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5020','Inkoopkosten / Hardware','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5030','Inkoopkosten / Software','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5040','Inkoopkosten / Aftermarket Parts','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5100','Vrachtkosten','E','', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL,'5400','PERSONEELS KOSTEN', NULL); SELECT account_save(NULL,'5410','Salarissen','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5420','EI Expense','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5430','CPP Expense','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5440','WCB Expense','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5470','Employee Benefits','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5600','GENERAL & ADMINISTRATIVE EXPENSES', NULL); SELECT account_save(NULL,'5610','Boekhouding- & Rechtkosten','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5615','Reclame- & Promotiekosten','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5620','Slechte Schulden','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5660','Afschrijvingskosten','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5680','Inkomsten Belastingen','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5685','Verzekeringen','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5690','Rente & Bankkosten','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5700','Kantoorvoorzieningen','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5760','Huurkosten','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5765','Reparatie- & Onderhoudskosten','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5780','Telefoonkosten','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5781','Internetkosten','E','', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'5785','Reis- & Vermaakkosten','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5790','NUTS Kosten','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5795','Registratie''s','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5800','Licenties','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5810','Foreign Exchange Loss','E','', NULL, false, false, string_to_array('', ':')); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '2310'),0.19); insert into tax (chart_id,rate) values ((select id from chart where accno = '2311'),0.06); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '1520')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '4020')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '5010')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '4450')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '5810')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'EUR:USD'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); -- commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno = '1061'; ledgersmb/sql/coa/ar/0000755000000000000000000000000012060044550013457 5ustar rootrootledgersmb/sql/coa/ar/gifi/0000755000000000000000000000000012060044550014375 5ustar rootrootledgersmb/sql/coa/ar/sic/0000755000000000000000000000000012060044550014235 5ustar rootrootledgersmb/sql/coa/ar/sic/SIC_3.sql0000644000000000000000000004407311730272451015634 0ustar rootrootbegin; -- AFIP Argentina -- CODIGO ACTIVIDADES 3 DIGITOS (SIC) INSERT INTO sic (code, description) VALUES ('001', 'Cultivos agrícolas'); INSERT INTO sic (code, description) VALUES ('002', 'Cría de animales'); INSERT INTO sic (code, description) VALUES ('003', 'Servicios agrícolas y pecuarios, excepto los veterinarios'); INSERT INTO sic (code, description) VALUES ('004', 'Caza y captura de animales vivos, repoblación de animales de caza y servicios conexos'); INSERT INTO sic (code, description) VALUES ('005', 'Silvicultura, extracción de madera y servicios conexos'); INSERT INTO sic (code, description) VALUES ('006', 'Pesca y servicios conexos'); INSERT INTO sic (code, description) VALUES ('007', 'Extracción y aglomeración de carbón'); INSERT INTO sic (code, description) VALUES ('008', 'Extracción y aglomeración de lignito'); INSERT INTO sic (code, description) VALUES ('009', 'Extracción y aglomeración de turba'); INSERT INTO sic (code, description) VALUES ('010', 'Extracción de petróleo crudo y gas natural'); INSERT INTO sic (code, description) VALUES ('011', 'Actividades de servicios relacionadas con la extracción de petróleo y gas, excepto las actividades de prospección'); INSERT INTO sic (code, description) VALUES ('012', 'Extracción de minerales y concentrados de uranio y torio'); INSERT INTO sic (code, description) VALUES ('013', 'Extracción de minerales de hierro'); INSERT INTO sic (code, description) VALUES ('014', 'Extracción de minerales metalíferos no ferrosos, excepto minerales de uranio y torio'); INSERT INTO sic (code, description) VALUES ('015', 'Extracción de piedra, arena y arcillas'); INSERT INTO sic (code, description) VALUES ('016', 'Explotación de minas y canteras n.c.p.'); INSERT INTO sic (code, description) VALUES ('017', 'Producción y procesamiento de carne, pescado, frutas, legumbres, hortalizas, aceites y grasas'); INSERT INTO sic (code, description) VALUES ('018', 'Elaboración de productos lácteos'); INSERT INTO sic (code, description) VALUES ('019', 'Elaboración de productos de molinería, almidones y productos derivados del almidón y de alimentos preparados para animales'); INSERT INTO sic (code, description) VALUES ('020', 'Elaboración de productos alimenticios n.c.p.'); INSERT INTO sic (code, description) VALUES ('021', 'Elaboración de bebidas'); INSERT INTO sic (code, description) VALUES ('022', 'Elaboración de productos de tabaco'); INSERT INTO sic (code, description) VALUES ('023', 'Fabricación de hilados y tejidos, acabado de productos textiles'); INSERT INTO sic (code, description) VALUES ('024', 'Fabricación de productos textiles n.c.p.'); INSERT INTO sic (code, description) VALUES ('025', 'Fabricación de tejidos de punto y artículos de punto y ganchillo'); INSERT INTO sic (code, description) VALUES ('026', 'Confección de prendas de vestir, excepto prendas de piel'); INSERT INTO sic (code, description) VALUES ('027', 'Curtido y terminación de cueros; fabricación de artículos de marroquinería y talabartería'); INSERT INTO sic (code, description) VALUES ('028', 'Fabricación de calzado y de sus partes'); INSERT INTO sic (code, description) VALUES ('029', 'Aserrado y cepillado de madera'); INSERT INTO sic (code, description) VALUES ('030', 'Fabricación de productos de madera, corcho, paja y materiales trenzables'); INSERT INTO sic (code, description) VALUES ('031', 'Fabricación de papel y de productos de papel'); INSERT INTO sic (code, description) VALUES ('032', 'Edición'); INSERT INTO sic (code, description) VALUES ('033', 'Impresión y servicios conexos'); INSERT INTO sic (code, description) VALUES ('034', 'Reproducción de grabaciones'); INSERT INTO sic (code, description) VALUES ('035', 'Fabricación de productos de hornos de coque'); INSERT INTO sic (code, description) VALUES ('036', 'Fabricación de productos de la refinación del petróleo'); INSERT INTO sic (code, description) VALUES ('037', 'Elaboración de combustible nuclear'); INSERT INTO sic (code, description) VALUES ('038', 'Fabricación de sustancias químicas básicas'); INSERT INTO sic (code, description) VALUES ('039', 'Fabricación de productos químicos n.c.p.'); INSERT INTO sic (code, description) VALUES ('040', 'Fabricación de fibras manufacturadas'); INSERT INTO sic (code, description) VALUES ('041', 'Fabricación de productos de caucho'); INSERT INTO sic (code, description) VALUES ('042', 'Fabricación de productos de plástico'); INSERT INTO sic (code, description) VALUES ('043', 'Fabricación de vidrio y productos de vidrio'); INSERT INTO sic (code, description) VALUES ('044', 'Fabricación de productos minerales no metálicos n.c.p.'); INSERT INTO sic (code, description) VALUES ('045', 'Industrias básicas de hierro y acero'); INSERT INTO sic (code, description) VALUES ('046', 'Fabricación de productos primarios de metales preciosos y metales no ferrosos'); INSERT INTO sic (code, description) VALUES ('047', 'Fundición de metales'); INSERT INTO sic (code, description) VALUES ('048', 'Fabricación de productos metálicos para uso estructural, tanques, depósitos y generadores de vapor'); INSERT INTO sic (code, description) VALUES ('049', 'Fabricación de productos elaborados de metal n.c.p.; servicios de trabajo de metales'); INSERT INTO sic (code, description) VALUES ('050', 'Fabricación de maquinaria de uso general'); INSERT INTO sic (code, description) VALUES ('051', 'Fabricación de maquinaria de uso especial'); INSERT INTO sic (code, description) VALUES ('052', 'Fabricación de aparatos de uso doméstico n.c.p.'); INSERT INTO sic (code, description) VALUES ('053', 'Fabricación de maquinaria de oficina, contabilidad e informática'); INSERT INTO sic (code, description) VALUES ('054', 'Fabricación de motores, generadores y transformadores eléctricos'); INSERT INTO sic (code, description) VALUES ('055', 'Fabricación de aparatos de distribución y control de la energía eléctrica'); INSERT INTO sic (code, description) VALUES ('056', 'Fabricación de hilos y cables aislados'); INSERT INTO sic (code, description) VALUES ('057', 'Fabricación de acumuladores y de pilas y baterías primarias'); INSERT INTO sic (code, description) VALUES ('058', 'Fabricación de lámparas eléctricas y equipo de iluminación'); INSERT INTO sic (code, description) VALUES ('059', 'Fabricación de equipo eléctrico n.c.p.'); INSERT INTO sic (code, description) VALUES ('060', 'Fabricación de tubos, válvulas y otros componentes electrónicos'); INSERT INTO sic (code, description) VALUES ('061', 'Fabricación de transmisores de radio y televisión y de aparatos para telefonía y telegrafía con hilos'); INSERT INTO sic (code, description) VALUES ('062', 'Fabricación de receptores de radio y televisión, aparatos de grabación y reproducción de sonido y video, y productos conexos'); INSERT INTO sic (code, description) VALUES ('063', 'Fabricación de aparatos e instrumentos médicos y de aparatos para medir, verificar, ensayar, navegar y otros fines, excepto instrumentos de óptica'); INSERT INTO sic (code, description) VALUES ('064', 'Fabricación de instrumentos de óptica y equipo fotográfico'); INSERT INTO sic (code, description) VALUES ('065', 'Fabricación de relojes'); INSERT INTO sic (code, description) VALUES ('066', 'Fabricación de vehículos automotores'); INSERT INTO sic (code, description) VALUES ('067', 'Fabricación de carrocerías para vehículos automotores; fabricación de remolques y semirremolques'); INSERT INTO sic (code, description) VALUES ('068', 'Fabricación de partes; piezas y accesorios para vehículos automotores y sus motores'); INSERT INTO sic (code, description) VALUES ('069', 'Construcción y reparación de buques y embarcaciones n.c.p.'); INSERT INTO sic (code, description) VALUES ('070', 'Fabricación de locomotoras y de material rodante para ferrocarriles y tranvías'); INSERT INTO sic (code, description) VALUES ('071', 'Fabricación y reparación de aeronaves'); INSERT INTO sic (code, description) VALUES ('072', 'Fabricación de equipo de transporte n.c.p.'); INSERT INTO sic (code, description) VALUES ('073', 'Fabricación de muebles y colchones'); INSERT INTO sic (code, description) VALUES ('074', 'Industrias manufactureras n.c.p.'); INSERT INTO sic (code, description) VALUES ('075', 'Reciclamiento de desperdicios y desechos metálicos'); INSERT INTO sic (code, description) VALUES ('076', 'Reciclamiento de desperdicios y desechos no metálicos'); INSERT INTO sic (code, description) VALUES ('077', 'Generación, transporte y distribución de energía eléctrica'); INSERT INTO sic (code, description) VALUES ('078', 'Fabricación de gas y distribución de combustibles gaseosos por tuberías'); INSERT INTO sic (code, description) VALUES ('079', 'Suministro de vapor y agua caliente'); INSERT INTO sic (code, description) VALUES ('080', 'Captación, depuración y distribución de agua'); INSERT INTO sic (code, description) VALUES ('081', 'Preparación de terrenos para obras'); INSERT INTO sic (code, description) VALUES ('082', 'Construcción de edificios y sus partes y obras de ingeniería civil'); INSERT INTO sic (code, description) VALUES ('083', 'Instalaciones para edificios y obras de ingeniería civil'); INSERT INTO sic (code, description) VALUES ('084', 'Terminación de edificios y obras de ingeniería civil'); INSERT INTO sic (code, description) VALUES ('085', 'Alquiler de equipo de construcción o demolición dotado de operarios'); INSERT INTO sic (code, description) VALUES ('086', 'Venta de vehículos automotores, excepto motocicletas'); INSERT INTO sic (code, description) VALUES ('087', 'Mantenimiento y reparación de vehículos automotores, excepto motocicletas'); INSERT INTO sic (code, description) VALUES ('088', ' Venta de partes, piezas y accesorios de vehículos automotores'); INSERT INTO sic (code, description) VALUES ('089', 'Venta, mantenimiento y reparación de motocicletas y de sus partes, piezas y accesorios'); INSERT INTO sic (code, description) VALUES ('090', 'Venta al por menor de combustible para vehículos automotores y motocicletas'); INSERT INTO sic (code, description) VALUES ('091', 'Venta al por mayor en comisión o consignación'); INSERT INTO sic (code, description) VALUES ('092', 'Venta al por mayor de materias primas agropecuarias, de animales vivos, alimentos, bebidas y tabaco, excepto en comisión o consignación'); INSERT INTO sic (code, description) VALUES ('093', 'Venta al por mayor de artículos de uso doméstico y/o personal'); INSERT INTO sic (code, description) VALUES ('094', 'Venta al por mayor de productos intermedios, desperdicios y desechos no agropecuarios'); INSERT INTO sic (code, description) VALUES ('095', 'Venta al por mayor de máquinas, equipo y materiales conexos'); INSERT INTO sic (code, description) VALUES ('096', 'Venta al por mayor de mercancías n.c.p.'); INSERT INTO sic (code, description) VALUES ('097', 'Venta al por menor excepto la especializada'); INSERT INTO sic (code, description) VALUES ('098', 'Venta al por menor de productos alimentarios, bebidas y tabaco en comercios especializados'); INSERT INTO sic (code, description) VALUES ('099', 'Venta al por menor de productos n.c.p. excepto los usados, en comercios especializados'); INSERT INTO sic (code, description) VALUES ('100', 'Venta al por menor de artículos usados excluidos automotores y motocicletas'); INSERT INTO sic (code, description) VALUES ('101', 'Venta al por menor no realizada en establecimientos'); INSERT INTO sic (code, description) VALUES ('102', 'Reparación de efectos personales y enseres domésticos'); INSERT INTO sic (code, description) VALUES ('103', 'Servicios de alojamiento en hoteles, campamentos y otros tipos de hospedaje temporal'); INSERT INTO sic (code, description) VALUES ('104', 'Servicios de expendio de comidas y bebidas'); INSERT INTO sic (code, description) VALUES ('105', 'Servicio de transporte ferroviario'); INSERT INTO sic (code, description) VALUES ('106', 'Servicio de transporte automotor'); INSERT INTO sic (code, description) VALUES ('107', 'Servicio de transporte por tuberías'); INSERT INTO sic (code, description) VALUES ('108', 'Servicio de transporte marítimo'); INSERT INTO sic (code, description) VALUES ('109', 'Servicio de transporte fluvial'); INSERT INTO sic (code, description) VALUES ('110', 'Servicio de transporte aéreo de cargas'); INSERT INTO sic (code, description) VALUES ('111', 'Servicio de transporte aéreo de pasajeros'); INSERT INTO sic (code, description) VALUES ('112', 'Servicios de manipulación de carga'); INSERT INTO sic (code, description) VALUES ('113', 'Servicios de almacenamiento y depósito'); INSERT INTO sic (code, description) VALUES ('114', 'Servicios complementarios para el transporte'); INSERT INTO sic (code, description) VALUES ('115', 'Servicios de agencias de viaje y otras actividades complementarias de apoyo turístico'); INSERT INTO sic (code, description) VALUES ('116', 'Servicios de gestión y logística para el transporte de mercaderías'); INSERT INTO sic (code, description) VALUES ('117', 'Servicios de correos'); INSERT INTO sic (code, description) VALUES ('118', 'Servicios de telecomunicaciones'); INSERT INTO sic (code, description) VALUES ('119', 'Intermediación monetaria y financiera de la banca central'); INSERT INTO sic (code, description) VALUES ('120', 'Intermediación monetaria y financiera de las entidades financieras bancarias y no bancarias'); INSERT INTO sic (code, description) VALUES ('121', 'Servicios financieros excepto los de la banca central y las entidades financieras'); INSERT INTO sic (code, description) VALUES ('122', 'Servicios de seguros'); INSERT INTO sic (code, description) VALUES ('123', 'Servicios de administración de fondos de jubilaciones y pensiones'); INSERT INTO sic (code, description) VALUES ('124', 'Servicios auxiliares a la actividad financiera, excepto a los servicios de seguros y de administración de fondos de jubilaciones y pensiones'); INSERT INTO sic (code, description) VALUES ('125', 'Servicios auxiliares a los servicios de seguros y de administración de fondos de jubilaciones y pensiones'); INSERT INTO sic (code, description) VALUES ('126', 'Servicios inmobiliarios realizados por cuenta propia, con bienes propios o arrendados'); INSERT INTO sic (code, description) VALUES ('127', 'Servicios inmobiliarios realizados a cambio de una retribución o por contrata'); INSERT INTO sic (code, description) VALUES ('128', 'Alquiler de equipo de transporte'); INSERT INTO sic (code, description) VALUES ('129', 'Alquiler de maquinaria y equipo n.c.p.'); INSERT INTO sic (code, description) VALUES ('130', 'Alquiler de efectos personales y enseres domésticos n.c.p.'); INSERT INTO sic (code, description) VALUES ('131', 'Servicios de consultores en equipo de informática'); INSERT INTO sic (code, description) VALUES ('132', 'Servicios de consultores en informática y suministros de programas de informática'); INSERT INTO sic (code, description) VALUES ('133', 'Procesamiento de datos'); INSERT INTO sic (code, description) VALUES ('134', 'Servicios relacionados con bases de datos'); INSERT INTO sic (code, description) VALUES ('135', 'Mantenimiento y reparación de maquinaria de oficina, contabilidad e informática'); INSERT INTO sic (code, description) VALUES ('136', 'Actividades de informática n.c.p.'); INSERT INTO sic (code, description) VALUES ('137', 'Investigación y desarrollo experimental en el campo de la ingeniería y de las ciencias exactas y naturales'); INSERT INTO sic (code, description) VALUES ('138', 'Investigación y desarrollo experimental en el campo de las ciencias sociales y las humanidades'); INSERT INTO sic (code, description) VALUES ('139', 'Servicios jurídicos y de contabilidad, teneduría de libros y auditoría; asesoramiento en materia de impuestos; estudios de mercados y realización de encuestas de opinión pública; asesoramiento empresarial y en materia de gestión'); INSERT INTO sic (code, description) VALUES ('140', 'Servicios de arquitectura e ingeniería y servicios técnicos n.c.p.'); INSERT INTO sic (code, description) VALUES ('141', 'Servicios de publicidad'); INSERT INTO sic (code, description) VALUES ('142', 'Servicios empresariales n.c.p.'); INSERT INTO sic (code, description) VALUES ('143', 'Servicios de la administración pública'); INSERT INTO sic (code, description) VALUES ('144', 'Prestación pública de servicios a la comunidad en general'); INSERT INTO sic (code, description) VALUES ('145', 'Servicios de la seguridad social obligatoria'); INSERT INTO sic (code, description) VALUES ('146', 'Enseñanza inicial y primaria'); INSERT INTO sic (code, description) VALUES ('147', 'Enseñanza secundaria'); INSERT INTO sic (code, description) VALUES ('148', 'Enseñanza superior y formación de postgrado'); INSERT INTO sic (code, description) VALUES ('149', 'Enseñanza para adultos y servicios de enseñanza n.c.p.'); INSERT INTO sic (code, description) VALUES ('150', 'Servicios relacionados con la salud humana'); INSERT INTO sic (code, description) VALUES ('151', 'Servicios veterinarios'); INSERT INTO sic (code, description) VALUES ('152', 'Servicios sociales'); INSERT INTO sic (code, description) VALUES ('153', 'Eliminación de desperdicios y aguas residuales, saneamiento y servicios similares'); INSERT INTO sic (code, description) VALUES ('154', 'Servicios de organizaciones empresariales, profesionales y de empleadores'); INSERT INTO sic (code, description) VALUES ('155', 'Servicios de sindicatos'); INSERT INTO sic (code, description) VALUES ('156', 'Servicios de asociaciones n.c.p.'); INSERT INTO sic (code, description) VALUES ('157', 'Servicios de cinematografía, radio y televisión y servicios de espectáculos artísticos y de diversión n.c.p.'); INSERT INTO sic (code, description) VALUES ('158', 'Servicios de agencias de noticias'); INSERT INTO sic (code, description) VALUES ('159', 'Servicios de bibliotecas, archivos y museos y servicios culturales n.c.p.'); INSERT INTO sic (code, description) VALUES ('160', 'Servicios para la práctica deportiva y de entretenimiento n.c.p.'); INSERT INTO sic (code, description) VALUES ('161', 'Servicios n.c.p.'); INSERT INTO sic (code, description) VALUES ('162', 'Servicios de hogares privados que contratan servicio doméstico'); INSERT INTO sic (code, description) VALUES ('163', 'Servicios de organizaciones y órganos extraterritoriales'); commit; ledgersmb/sql/coa/ar/sic/SIC_6.sql0000644000000000000000000035034311730272451015637 0ustar rootrootbegin; -- AFIP Argentina -- CODIGO ACTIVIDADES 6 DIGITOS (SIC) INSERT INTO sic (code, description) VALUES ('171200', 'Acabado de productos textiles '); INSERT INTO sic (code, description) VALUES ('112000', 'Actividades de servicios relacionadas con la extracción de petróleo y gas, excepto las actividades de prospección '); INSERT INTO sic (code, description) VALUES ('659810', 'Actividades de crédito para financiar otras actividades económicas (Incluye las empresas de factoring y otras formas de adelanto, etc.)'); INSERT INTO sic (code, description) VALUES ('452520', 'Actividades de hincado de pilotes, cimentación y otros trabajos de hormigón armado '); INSERT INTO sic (code, description) VALUES ('729000', 'Actividades de informática n.c.p. '); INSERT INTO sic (code, description) VALUES ('452590', 'Actividades especializadas de construcción n.c.p. (Incluye el alquiler e instalación de andamios, la construcción de chimeneas y hornos industriales, el acorazamiento de cajas fuertes y cámaras frigoríficas, el armado e instalación de compuertas para diques, etc.)'); INSERT INTO sic (code, description) VALUES ('662000', 'Administración de fondos de jubilaciones y pensiones (A.F.J.P.) '); INSERT INTO sic (code, description) VALUES ('453200', 'Aislamiento térmico, acústico, hídrico y antivibratorio '); INSERT INTO sic (code, description) VALUES ('014292', 'Albergue y cuidado de animales de terceros '); INSERT INTO sic (code, description) VALUES ('713009', 'Alquiler de efectos personales y enseres domésticos n.c.p. (Incluye alquiler de artículos deportivos y de videos)'); INSERT INTO sic (code, description) VALUES ('455000', 'Alquiler de equipo de construcción o demolición dotado de operarios '); INSERT INTO sic (code, description) VALUES ('711200', 'Alquiler de equipo de transporte para vía acuática, sin operarios ni tripulación '); INSERT INTO sic (code, description) VALUES ('711300', 'Alquiler de equipo de transporte para vía aérea, sin operarios ni tripulación '); INSERT INTO sic (code, description) VALUES ('711100', 'Alquiler de equipo de transporte para vía terrestre, sin operarios ni tripulación '); INSERT INTO sic (code, description) VALUES ('712100', 'Alquiler de maquinaria y equipo agropecuario, sin operarios '); INSERT INTO sic (code, description) VALUES ('712200', 'Alquiler de maquinaria y equipo de construcción e ingeniería civil, sin operarios (Incluye el alquiler de andamios sin montaje ni desmantelamiento)'); INSERT INTO sic (code, description) VALUES ('712300', 'Alquiler de maquinaria y equipo de oficina, incluso computadoras '); INSERT INTO sic (code, description) VALUES ('713001', 'Alquiler de ropa '); INSERT INTO sic (code, description) VALUES ('712902', 'Alquiler de maquinaria y equipo minero y petrolero, sin personal '); INSERT INTO sic (code, description) VALUES ('712909', 'Alquiler de maquinaria y equipo n.c.p., sin personal '); INSERT INTO sic (code, description) VALUES ('712901', 'Alquiler de maquinaria y equipo para la industria manufacturera, sin personal '); INSERT INTO sic (code, description) VALUES ('012230', 'Apicultura (Incluye la producción de miel, jalea real, polen, propóleo, etc.)'); INSERT INTO sic (code, description) VALUES ('201000', 'Aserrado y cepillado de madera '); INSERT INTO sic (code, description) VALUES ('410010', 'Captación, depuración y distribución de agua de fuentes subterráneas '); INSERT INTO sic (code, description) VALUES ('410020', 'Captación, depuración y distribución de agua de fuentes superficiales '); INSERT INTO sic (code, description) VALUES ('151191', 'Fabricación de aceites y grasas de origen animal '); INSERT INTO sic (code, description) VALUES ('015010', 'Caza y captura de animales vivos y repoblación de animales de caza (Incluye la caza de animales para obtener carne, pieles y cueros y la captura de animales vivos para zoológicos, animales de compañía, para investigación, etc.)'); INSERT INTO sic (code, description) VALUES ('454300', 'Colocación de cristales en obra (Incluye la instalación y revestimiento de vidrio, espejos y otros artículos de vidrio, etc.)'); INSERT INTO sic (code, description) VALUES ('921420', 'Composición y representación de obras teatrales, musicales y artísticas (Incluye a compositores, actores, músicos, conferencistas, pintores, artistas plásticos etc.)'); INSERT INTO sic (code, description) VALUES ('181120', 'Confección de indumentaria de trabajo, uniformes, guardapolvos y sus accesorios '); INSERT INTO sic (code, description) VALUES ('181130', 'Confección de indumentaria para bebés y niños '); INSERT INTO sic (code, description) VALUES ('181191', 'Confección de pilotos e impermeables '); INSERT INTO sic (code, description) VALUES ('181202', 'Confección de prendas de vestir de cuero '); INSERT INTO sic (code, description) VALUES ('182001', 'Confección de prendas de vestir de piel y sucedáneos '); INSERT INTO sic (code, description) VALUES ('181199', 'Confección de prendas de vestir n.c.p., excepto las de piel, cuero y sucedáneos, pilotos e impermeables '); INSERT INTO sic (code, description) VALUES ('181110', 'Confección de ropa interior, prendas para dormir y para la playa '); INSERT INTO sic (code, description) VALUES ('351100', 'Construcción y reparación de buques (Incluye construcción de motores y piezas para navíos, etc.)'); INSERT INTO sic (code, description) VALUES ('351200', 'Construcción y reparación de embarcaciones de recreo y deporte '); INSERT INTO sic (code, description) VALUES ('452200', 'Construcción, reforma y reparación de edificios no residenciales (Incluye construcción, reforma y reparación de restaurantes, bares, campamentos, bancos, oficinas, galerías comerciales, estaciones de servicio, edificios para tráfico y comunicaciones, garajes, edificios industriales y depósitos, escuelas, etc.)'); INSERT INTO sic (code, description) VALUES ('452100', 'Construcción, reforma y reparación de edificios residenciales (Incluye la construcción, reforma y reparación de viviendas unifamiliares y multifamiliares; bungalows, cabañas, casas de campo, departamentos, albergues para ancianos, niños, estudiantes, etc.)'); INSERT INTO sic (code, description) VALUES ('452390', 'Construcción, reforma y reparación de obras de infraestructura del transporte n.c.p (Incluye la construcción, reforma y reparación de calles, autopistas, carreteras, puentes, túneles, vías férreas y pistas de aterrizaje, la señalización mediante pintura, etc.)'); INSERT INTO sic (code, description) VALUES ('452310', 'Construcción, reforma y reparación de obras hidráulicas (Incluye obras fluviales y canales, acueductos, diques, etc.)'); INSERT INTO sic (code, description) VALUES ('452400', 'Construcción, reforma y reparación de redes (Incluye la construcción, reforma y reparación de redes de electricidad, de gas, de agua, de telecomunicaciones, etc.)'); INSERT INTO sic (code, description) VALUES ('269600', 'Corte, tallado y acabado de la piedra (Incluye mármoles y granitos, etc.)'); INSERT INTO sic (code, description) VALUES ('012242', 'Cría de animales para la obtención de pelos '); INSERT INTO sic (code, description) VALUES ('012241', 'Cría de animales para la obtención de pieles y cueros '); INSERT INTO sic (code, description) VALUES ('012243', 'Cría de animales para la obtención de plumas '); INSERT INTO sic (code, description) VALUES ('012290', 'Cría de animales y obtención de productos de origen animal, n.c.p. (Incluye ciervo, conejo -excepto para pelos-, gato, gusano de seda, lombriz, pájaro, perro, rana, animales para experimentación, caracoles vivos, frescos, congelados y secos -excepto marinos-, cera de insectos excepto la de abeja, etc.)'); INSERT INTO sic (code, description) VALUES ('012211', 'Cría de aves para producción de carne '); INSERT INTO sic (code, description) VALUES ('012212', 'Cría de aves para producción de huevos (Incluye pollitos BB para postura)'); INSERT INTO sic (code, description) VALUES ('012161', 'Cría de ganado bovino en cabañas (Incluye la producción de semen)'); INSERT INTO sic (code, description) VALUES ('012111', 'Cría de ganado bovino -excepto en cabañas y para la producción de leche- '); INSERT INTO sic (code, description) VALUES ('012150', 'Cría de ganado caprino, excepto en cabañas y para producción de leche '); INSERT INTO sic (code, description) VALUES ('012163', 'Cría de ganado equino en haras (Incluye la producción de semen)'); INSERT INTO sic (code, description) VALUES ('012140', 'Cría de ganado equino, excepto en haras (Incluye equinos de trabajo)'); INSERT INTO sic (code, description) VALUES ('012190', 'Cría de ganado n.c.p. (Incluye la cría de alpaca, asno, búfalo, guanaco, llama, mula, vicuña, etc.)'); INSERT INTO sic (code, description) VALUES ('012169', 'Cría en cabañas de ganado n.c.p. '); INSERT INTO sic (code, description) VALUES ('012162', 'Cría de ganado ovino, porcino y caprino en cabañas (Incluye la producción de semen)'); INSERT INTO sic (code, description) VALUES ('012120', 'Cría de ganado ovino, excepto en cabañas y para la producción de lana '); INSERT INTO sic (code, description) VALUES ('012130', 'Cría de ganado porcino, excepto en cabañas '); INSERT INTO sic (code, description) VALUES ('011140', 'Cultivo de pastos forrajeros (Incluye alfalfa, moha, pastos consociados, sorgo azucarado y forrajero, etc.)'); INSERT INTO sic (code, description) VALUES ('011411', 'Cultivo de algodón '); INSERT INTO sic (code, description) VALUES ('011111', 'Cultivo de arroz '); INSERT INTO sic (code, description) VALUES ('011229', 'Cultivo de bulbos, brotes, raíces y hortalizas de frutos n.c.p. (Incluye ají, ajo, alcaparra, berenjena, cebolla, calabaza, espárrago, frutilla, melón, pepino, pimiento, sandía, zanahoria, zapallo, zapallito, etc.)'); INSERT INTO sic (code, description) VALUES ('011421', 'Cultivo de caña de azúcar '); INSERT INTO sic (code, description) VALUES ('011119', 'Cultivo de cereales excepto los forrajeros y las semillas n.c.p. (Incluye alforfón, cebada cervecera, etc.)'); INSERT INTO sic (code, description) VALUES ('011129', 'Cultivo de cereales forrajeros n.c.p. (Incluye alpiste, avena, cebada forrajera, centeno, mijo, etc.)'); INSERT INTO sic (code, description) VALUES ('011460', 'Cultivo de especias (de hoja, de semilla, de flor y de fruto) y de plantas aromáticas y medicinales '); INSERT INTO sic (code, description) VALUES ('011251', 'Cultivo de flores '); INSERT INTO sic (code, description) VALUES ('011330', 'Cultivo de frutas cítricas (Incluye bergamota, lima, limón, mandarina, naranja, pomelo, kinoto, etc.)'); INSERT INTO sic (code, description) VALUES ('011320', 'Cultivo de frutas de carozo (Incluye cereza, ciruela, damasco, durazno, pelón, etc.)'); INSERT INTO sic (code, description) VALUES ('011319', 'Cultivo de frutas de pepita n.c.p. (Incluye membrillo, níspero, etc.)'); INSERT INTO sic (code, description) VALUES ('011390', 'Cultivo de frutas n.c.p. (Incluye ananá, banana, higo, kiwi, mamón, palta, uva de mesa, etc.)'); INSERT INTO sic (code, description) VALUES ('011132', 'Cultivo de girasol '); INSERT INTO sic (code, description) VALUES ('011230', 'Cultivo de hortalizas de hoja y de otras hortalizas frescas (Incluye acelga, apio, cebolla de verdeo, choclo, coles, espinaca, lechuga, perejil, radicheta, repollo, etc.)'); INSERT INTO sic (code, description) VALUES ('011241', 'Cultivo de legumbres frescas (Incluye arveja, chaucha, haba, lupino, poroto, etc.)'); INSERT INTO sic (code, description) VALUES ('011242', 'Cultivo de legumbres secas (Incluye arveja, garbanzo, haba, lenteja, poroto, etc.)'); INSERT INTO sic (code, description) VALUES ('011121', 'Cultivo de maíz '); INSERT INTO sic (code, description) VALUES ('011311', 'Cultivo de manzana y pera '); INSERT INTO sic (code, description) VALUES ('011340', 'Cultivo de nueces y frutas secas (Incluye almendra, avellana, castaña, nuez, pistacho, etc.)'); INSERT INTO sic (code, description) VALUES ('011139', 'Cultivo de oleaginosas n.c.p. (Incluye los cultivos de oleaginosas para aceites comestibles y/o uso industrial: cártamo, colza, jojoba, lino oleaginoso, maní, olivo para aceite, ricino, sésamo, tung, etc.)'); INSERT INTO sic (code, description) VALUES ('011210', 'Cultivo de papa, batata y mandioca '); INSERT INTO sic (code, description) VALUES ('011252', 'Cultivo de plantas ornamentales '); INSERT INTO sic (code, description) VALUES ('011419', 'Cultivo de plantas para la obtención de fibras n.c.p. (Incluye abacá, cáñamo, formio, lino textil, maíz de Guinea, ramio, yute, etc.)'); INSERT INTO sic (code, description) VALUES ('011429', 'Cultivo de plantas sacaríferas n.c.p. (Incluye remolacha azucarera, etc.)'); INSERT INTO sic (code, description) VALUES ('011131', 'Cultivo de soja '); INSERT INTO sic (code, description) VALUES ('011122', 'Cultivo de sorgo granífero '); INSERT INTO sic (code, description) VALUES ('011450', 'Cultivo de tabaco '); INSERT INTO sic (code, description) VALUES ('011440', 'Cultivo de té, yerba mate y otras plantas cuyas hojas se utilizan para preparar bebidas (infusiones) '); INSERT INTO sic (code, description) VALUES ('011221', 'Cultivo de tomate '); INSERT INTO sic (code, description) VALUES ('011112', 'Cultivo de trigo '); INSERT INTO sic (code, description) VALUES ('011430', 'Cultivo de vid para vinificar '); INSERT INTO sic (code, description) VALUES ('011490', 'Cultivos industriales n.c.p. (Incluye olivo para conserva, palmitos, etc.)'); INSERT INTO sic (code, description) VALUES ('191100', 'Curtido y terminación de cueros '); INSERT INTO sic (code, description) VALUES ('451100', 'Demolición y voladura de edificios y de sus partes (Incluye los trabajos de limpieza de escombros asociados a la demolición y voladura, las perforaciones asociadas a la preparación del terreno para la construcción de obras, la limpieza del terreno de malezas y la estabilización del suelo, etc.)'); INSERT INTO sic (code, description) VALUES ('155110', 'Destilación de alcohol etílico '); INSERT INTO sic (code, description) VALUES ('155120', 'Destilación, rectificación y mezcla de bebidas espiritosas '); INSERT INTO sic (code, description) VALUES ('401300', 'Distribución de energía eléctrica '); INSERT INTO sic (code, description) VALUES ('921120', 'Distribución de filmes y videocintas '); INSERT INTO sic (code, description) VALUES ('221300', 'Edición de grabaciones '); INSERT INTO sic (code, description) VALUES ('221100', 'Edición de libros, folletos, partituras y otras publicaciones '); INSERT INTO sic (code, description) VALUES ('221200', 'Edición de periódicos, revistas y publicaciones periódicas '); INSERT INTO sic (code, description) VALUES ('221900', 'Edición n.c.p. '); INSERT INTO sic (code, description) VALUES ('453190', 'Ejecución y mantenimiento de instalaciones eléctricas y electrónicas n.c.p. (Incluye la instalación de antenas, pararrayos, sistemas de alarmas contra incendios y robos, sistemas de telecomunicación, etc.)'); INSERT INTO sic (code, description) VALUES ('269421', 'Elaboración de yeso '); INSERT INTO sic (code, description) VALUES ('151410', 'Elaboración de aceites y grasas vegetales sin refinar y sus subproductos; elaboración de aceite virgen '); INSERT INTO sic (code, description) VALUES ('151420', 'Elaboración de aceites y grasas vegetales refinadas (No incluye aceite de maíz)'); INSERT INTO sic (code, description) VALUES ('153131', 'Elaboración de alimentos a base de cereales '); INSERT INTO sic (code, description) VALUES ('153300', 'Elaboración de alimentos preparados para animales '); INSERT INTO sic (code, description) VALUES ('153200', 'Elaboración de almidones y productos derivados del almidón (Incluye la elaboración de glucosa, gluten, aceites de maíz)'); INSERT INTO sic (code, description) VALUES ('272010', 'Elaboración de aluminio primario y semielaborados de aluminio '); INSERT INTO sic (code, description) VALUES ('154200', 'Elaboración de azúcar '); INSERT INTO sic (code, description) VALUES ('155420', 'Elaboración de bebidas gaseosas, excepto soda '); INSERT INTO sic (code, description) VALUES ('154301', 'Elaboración de cacao, chocolate y productos a base de cacao '); INSERT INTO sic (code, description) VALUES ('269422', 'Elaboración de cal '); INSERT INTO sic (code, description) VALUES ('269410', 'Elaboración de cemento '); INSERT INTO sic (code, description) VALUES ('155300', 'Elaboración de cerveza, bebidas malteadas y de malta '); INSERT INTO sic (code, description) VALUES ('160091', 'Elaboración de cigarrillos '); INSERT INTO sic (code, description) VALUES ('154991', 'Elaboración de extractos, jarabes y concentrados '); INSERT INTO sic (code, description) VALUES ('151130', 'Elaboración de fiambres y embutidos '); INSERT INTO sic (code, description) VALUES ('151340', 'Elaboración de frutas, hortalizas y legumbres congeladas '); INSERT INTO sic (code, description) VALUES ('151390', 'Elaboración de frutas, hortalizas y legumbres deshidratadas o desecadas; preparación n.c.p. de frutas, hortalizas y legumbres (Incluye la elaboración de harina y escamas de papa, sémola de hortalizas y legumbres, frutas, hortalizas y legumbres deshidratadas, etc.)'); INSERT INTO sic (code, description) VALUES ('154110', 'Elaboración de galletitas y bizcochos '); INSERT INTO sic (code, description) VALUES ('155490', 'Elaboración de hielo, jugos envasados para diluir y otras bebidas no alcohólicas (Incluye los jugos para diluir o en polvo llamados "sintéticos" o de un contenido en jugos naturales inferior al 50%)'); INSERT INTO sic (code, description) VALUES ('151320', 'Elaboración de jugos naturales y sus concentrados, de frutas, hortalizas y legumbres '); INSERT INTO sic (code, description) VALUES ('152010', 'Elaboración de leches y productos lácteos deshidratados (Incluye la estandarización, homogeneización, pasteurización y esterilización de leche, la elaboración de leches chocolatadas y otras leches saborizadas, leches condensadas, leche en polvo, dulce de leche, etc.)'); INSERT INTO sic (code, description) VALUES ('151430', 'Elaboración de margarinas y grasas vegetales comestibles similares '); INSERT INTO sic (code, description) VALUES ('154410', 'Elaboración de pastas alimentarias frescas '); INSERT INTO sic (code, description) VALUES ('154420', 'Elaboración de pastas alimentarias secas '); INSERT INTO sic (code, description) VALUES ('151201', 'Elaboración de pescados de mar, crustáceos y productos marinos n.c.p. '); INSERT INTO sic (code, description) VALUES ('151202', 'Elaboración de pescados de ríos y lagunas y otros productos fluviales y lacustres '); INSERT INTO sic (code, description) VALUES ('154999', 'Elaboración de productos alimenticios n.c.p. (Incluye la elaboración de polvos para preparar postres y gelatinas, levadura, productos para copetín, sopas y concentrados, sal de mesa, mayonesa, mostaza, etc.)'); INSERT INTO sic (code, description) VALUES ('323000', 'Fabricación de receptores de radio y televisión, aparatos de grabación y reproducción de sonido y video, y productos conexos '); INSERT INTO sic (code, description) VALUES ('154309', 'Elaboración de productos de confitería n.c.p. (Incluye caramelos, frutas confitadas, pastillas, gomas de mascar, etc.)'); INSERT INTO sic (code, description) VALUES ('154199', 'Elaboración de productos de panadería n.c.p. (Incluye la elaboración de churros, prepizzas, masas fritas, de hojaldre, etc.en establecimientos de hasta 10 ocupados)'); INSERT INTO sic (code, description) VALUES ('160099', 'Elaboración de productos de tabaco n.c.p. '); INSERT INTO sic (code, description) VALUES ('152090', 'Elaboración de productos lácteos n.c.p. (Incluye la producción de caseínas, caseinatos lácteos, cremas, manteca, postres, etc.)'); INSERT INTO sic (code, description) VALUES ('152020', 'Elaboración de quesos (Incluye la producción de suero)'); INSERT INTO sic (code, description) VALUES ('155290', 'Elaboración de sidra y otras bebidas alcohólicas fermentadas a partir de frutas '); INSERT INTO sic (code, description) VALUES ('154992', 'Elaboración de vinagres '); INSERT INTO sic (code, description) VALUES ('155210', 'Elaboración de vinos (Incluye el fraccionamiento)'); INSERT INTO sic (code, description) VALUES ('154930', 'Elaboración de yerba mate '); INSERT INTO sic (code, description) VALUES ('152030', 'Elaboración industrial de helados (No incluye las heladerías artesanales)'); INSERT INTO sic (code, description) VALUES ('154120', 'Elaboración industrial de productos de panadería, excluido galletitas y bizcochos (Incluye la elaboración en establecimientos con más de 10 ocupados)'); INSERT INTO sic (code, description) VALUES ('269910', 'Elaboración primaria n.c.p. de minerales no metálicos '); INSERT INTO sic (code, description) VALUES ('151330', 'Elaboración y envasado de dulces, mermeladas y jaleas '); INSERT INTO sic (code, description) VALUES ('154912', 'Elaboración y molienda de hierbas aromáticas y especias '); INSERT INTO sic (code, description) VALUES ('155411', 'Embotellado de aguas naturales y minerales '); INSERT INTO sic (code, description) VALUES ('642091', 'Emisión de programas de televisión '); INSERT INTO sic (code, description) VALUES ('012113', 'Engorde en corrales (Fed-Lot) '); INSERT INTO sic (code, description) VALUES ('742200', 'Ensayos y análisis técnicos '); INSERT INTO sic (code, description) VALUES ('803100', 'Enseñanza terciaria '); INSERT INTO sic (code, description) VALUES ('801000', 'Enseñanza inicial y primaria '); INSERT INTO sic (code, description) VALUES ('809000', 'Enseñanza para adultos y servicios de enseñanza n.c.p. (Incluye instrucción impartida mediante programas de radio, televisión, correspondencia y otros medios de comunicación, escuelas de manejo, actividades de enseñanza a domicilio y/o particulares, etc.)'); INSERT INTO sic (code, description) VALUES ('802100', 'Enseñanza secundaria de formación general '); INSERT INTO sic (code, description) VALUES ('802200', 'Enseñanza secundaria de formación técnica y profesional '); INSERT INTO sic (code, description) VALUES ('803200', 'Enseñanza universitaria excepto formación de posgrado '); INSERT INTO sic (code, description) VALUES ('741300', 'Estudio de mercado, realización de encuestas de opinión pública '); INSERT INTO sic (code, description) VALUES ('921200', 'Exhibición de filmes y videocintas '); INSERT INTO sic (code, description) VALUES ('552120', 'Expendio de helados '); INSERT INTO sic (code, description) VALUES ('050200', 'Explotación de criaderos de peces, granjas piscícolas y otros frutos acuáticos (acuicultura) '); INSERT INTO sic (code, description) VALUES ('142900', 'Explotación de minas y canteras n.c.p. (Incluye amianto, baritina, cuarzo, diatomita, piedra pómez, ágata, agua marina, amatista, cristal de roca, rodocrosita, topacio, corindón, feldespato, mica, zeolita, perlita, granulado volcánico, puzolana, toba, talco, vermiculita, tosca, grafito, etc.)'); INSERT INTO sic (code, description) VALUES ('020130', 'Explotación de viveros forestales (Incluye propagación de especies forestales)'); INSERT INTO sic (code, description) VALUES ('141400', 'Extracción de arcilla y caolín (Incluye andalucita, arcillas, bentonita, caolín, pirofilita, silimanita, mullita, tierra de chamota o de dinas, etc.)'); INSERT INTO sic (code, description) VALUES ('141300', 'Extracción de arenas, canto rodado y triturados pétreos (Incluye arena para construcción, arena silícea, otras arenas naturales, canto rodado, dolomita triturada, granito triturado, piedra partida y otros triturados pétreos, etc.)'); INSERT INTO sic (code, description) VALUES ('131000', 'Extracción de minerales de hierro (Incluye hematitas, limonitas, magnetitas, siderita, etc.)'); INSERT INTO sic (code, description) VALUES ('132000', 'Extracción de minerales metalíferos no ferrosos, excepto minerales de uranio y torio (Incluye aluminio, cobre, estaño, manganeso, níquel, oro, plata, plomo, volframio, antimonio, bismuto, cinc, molibdeno, titanio, circonio, niobio, tántalo, vanadio, cromo, cobalto)'); INSERT INTO sic (code, description) VALUES ('142110', 'Extracción de minerales para la fabricación de abonos excepto turba. (Incluye guano, silvita, silvinita y otras sales de potasio naturales, etc.)'); INSERT INTO sic (code, description) VALUES ('142120', 'Extracción de minerales para la fabricación de productos químicos (Incluye azufre, boracita e hidroboracita, calcita, celestina, colemanita, fluorita, litio y sales de litio naturales, sulfato de aluminio, sulfato de hierro, sulfato de magnesio, sulfato de sodio, ocres, tinkal, ulexita, asfaltita, laterita, etc.)'); INSERT INTO sic (code, description) VALUES ('120000', 'Extracción de minerales y concentrados de uranio y torio '); INSERT INTO sic (code, description) VALUES ('111000', 'Extracción de petróleo crudo y gas natural (Incluye gas natural licuado y gaseoso, arenas alquitraníferas, esquistos bituminosos o lutitas, aceites de petróleo y de minerales bituminosos, petróleo, coque de petróleo, etc.)'); INSERT INTO sic (code, description) VALUES ('141200', 'Extracción de piedra caliza y yeso (Incluye caliza, castina, conchilla, riolita, yeso natural, anhidrita, etc.)'); INSERT INTO sic (code, description) VALUES ('020210', 'Extracción de productos forestales de bosques cultivados (Incluye tala de árboles, desbaste de troncos y producción de madera en bruto, rollizos, leña, postes, carbón, carbonilla y productos forestales n.c.p.)'); INSERT INTO sic (code, description) VALUES ('020220', 'Extracción de productos forestales de bosques nativos (Incluye tala de árboles, desbaste de troncos y producción de madera en bruto, leña, postes, carbón, carbonilla, la extracción de rodrigones, varas, varillas y la recolección de crines vegetales, gomas naturales, líquenes, musgos, resinas y de rosa mosqueta, etc.)'); INSERT INTO sic (code, description) VALUES ('141100', 'Extracción de rocas ornamentales (Incluye areniscas, cuarcita, dolomita, granito, mármol, piedra laja, pizarra, pórfido, serpentina , etc.)'); INSERT INTO sic (code, description) VALUES ('142200', 'Extracción de sal en salinas y de roca '); INSERT INTO sic (code, description) VALUES ('101000', 'Extracción y aglomeración de carbón (Incluye la producción de hulla no aglomerada, antracita, carbón bituminoso no aglomerado, briquetas, ovoides y combustibles sólidos análogos a base de hulla, etc.)'); INSERT INTO sic (code, description) VALUES ('102000', 'Extracción y aglomeración de lignito (Incluye la producción de lignito aglomerado y no aglomerado)'); INSERT INTO sic (code, description) VALUES ('103000', 'Extracción y aglomeración de turba (Incluye la producción de turba utilizada como corrector de suelos)'); INSERT INTO sic (code, description) VALUES ('319000', 'Fabricación de equipo eléctrico n.c.p. '); INSERT INTO sic (code, description) VALUES ('251909', 'Fabricación de productos de caucho n.c.p. '); INSERT INTO sic (code, description) VALUES ('251901', 'Fabricación de autopartes de caucho excepto cámaras y cubiertas '); INSERT INTO sic (code, description) VALUES ('291900', 'Fabricación de maquinaria de uso general n.c.p. '); INSERT INTO sic (code, description) VALUES ('202201', 'Fabricación de aberturas y estructuras de madera para la construcción '); INSERT INTO sic (code, description) VALUES ('241200', 'Fabricación de abonos y compuestos de nitrógeno '); INSERT INTO sic (code, description) VALUES ('181201', 'Fabricación de accesorios de vestir de cuero '); INSERT INTO sic (code, description) VALUES ('181192', 'Fabricación de accesorios de vestir excepto de cuero '); INSERT INTO sic (code, description) VALUES ('151203', 'Fabricación de aceites, grasas, harinas y productos a base de pescados n.c.p. '); INSERT INTO sic (code, description) VALUES ('314000', 'Fabricación de acumuladores y de pilas y baterías primarias '); INSERT INTO sic (code, description) VALUES ('312000', 'Fabricación de aparatos de distribución y control de la energía eléctrica '); INSERT INTO sic (code, description) VALUES ('293099', 'Fabricación de aparatos y accesorios eléctricos n.c.p. '); INSERT INTO sic (code, description) VALUES ('332001', 'Fabricación de aparatos y accesorios para fotografía excepto películas, placas y papeles sensibles '); INSERT INTO sic (code, description) VALUES ('292700', 'Fabricación de armas y municiones '); INSERT INTO sic (code, description) VALUES ('293095', 'Fabricación de artefactos para iluminación excepto los eléctricos '); INSERT INTO sic (code, description) VALUES ('172109', 'Fabricación de artículos confeccionados de materiales textiles excepto prendas de vestir n.c.p. '); INSERT INTO sic (code, description) VALUES ('269591', 'Fabricación de artículos de cemento y fibrocemento '); INSERT INTO sic (code, description) VALUES ('202901', 'Fabricación de artículos de cestería, caña y mimbre '); INSERT INTO sic (code, description) VALUES ('369300', 'Fabricación de artículos de deporte (Incluye equipos de deporte, para gimnasios y campos de juegos, equipos de pesca y camping, etc., excepto indumentaria deportiva)'); INSERT INTO sic (code, description) VALUES ('172103', 'Fabricación de artículos de lona y sucedáneos de lona '); INSERT INTO sic (code, description) VALUES ('202903', 'Fabricación de artículos de madera en tornerías '); INSERT INTO sic (code, description) VALUES ('210910', 'Fabricación de artículos de papel y cartón de uso doméstico e higiénico sanitario '); INSERT INTO sic (code, description) VALUES ('210990', 'Fabricación de artículos de papel y cartón n.c.p. '); INSERT INTO sic (code, description) VALUES ('269110', 'Fabricación de artículos sanitarios de cerámica '); INSERT INTO sic (code, description) VALUES ('202902', 'Fabricación de ataúdes '); INSERT INTO sic (code, description) VALUES ('359200', 'Fabricación de bicicletas y de sillones de ruedas para inválidos '); INSERT INTO sic (code, description) VALUES ('172104', 'Fabricación de bolsas de materiales textiles para productos a granel '); INSERT INTO sic (code, description) VALUES ('291200', 'Fabricación de bombas; compresores; grifos y válvulas '); INSERT INTO sic (code, description) VALUES ('289992', 'Fabricación de cajas de seguridad '); INSERT INTO sic (code, description) VALUES ('192010', 'Fabricación de calzado de cuero, excepto el ortopédico '); INSERT INTO sic (code, description) VALUES ('192020', 'Fabricación de calzado de tela, plástico, goma, caucho y otros materiales, excepto calzado ortopédico y de asbesto '); INSERT INTO sic (code, description) VALUES ('281101', 'Fabricación de carpintería metálica '); INSERT INTO sic (code, description) VALUES ('342000', 'Fabricación de carrocerías para vehículos automotores; fabricación de remolques y semirremolques '); INSERT INTO sic (code, description) VALUES ('369920', 'Fabricación de cepillos y pinceles '); INSERT INTO sic (code, description) VALUES ('289309', 'Fabricación de cerraduras, herrajes y artículos de ferretería n.c.p. (No incluye clavos, productos de bulonería, vajilla de mesa y de cocina, etc.)'); INSERT INTO sic (code, description) VALUES ('293010', 'Fabricación de cocinas, calefones, estufas y calefactores de uso doméstico no eléctricos '); INSERT INTO sic (code, description) VALUES ('291300', 'Fabricación de cojinetes; engranajes; trenes de engranaje y piezas de transmisión '); INSERT INTO sic (code, description) VALUES ('242903', 'Fabricación de colas, adhesivos, aprestos y cementos excepto los odontológicos obtenidos de sustancias minerales y vegetales '); INSERT INTO sic (code, description) VALUES ('233000', 'Fabricación de combustible nuclear '); INSERT INTO sic (code, description) VALUES ('242490', 'Fabricación de cosméticos, perfumes y productos de higiene y tocador '); INSERT INTO sic (code, description) VALUES ('251110', 'Fabricación de cubiertas y cámaras '); INSERT INTO sic (code, description) VALUES ('289302', 'Fabricación de artículos de cuchillería y utensillos de mesa y de cocina '); INSERT INTO sic (code, description) VALUES ('172300', 'Fabricación de cuerdas, cordeles, bramantes y redes '); INSERT INTO sic (code, description) VALUES ('241120', 'Fabricación de curtientes naturales y sintéticos. '); INSERT INTO sic (code, description) VALUES ('293093', 'Fabricación de enceradoras, pulidoras, batidoras, licuadoras y similares '); INSERT INTO sic (code, description) VALUES ('210202', 'Fabricación de envases de cartón '); INSERT INTO sic (code, description) VALUES ('289910', 'Fabricación de envases metálicos '); INSERT INTO sic (code, description) VALUES ('210201', 'Fabricación de envases de papel '); INSERT INTO sic (code, description) VALUES ('261010', 'Fabricación de envases de vidrio '); INSERT INTO sic (code, description) VALUES ('252010', 'Fabricación de envases plásticos '); INSERT INTO sic (code, description) VALUES ('331300', 'Fabricación de equipo de control de procesos industriales '); INSERT INTO sic (code, description) VALUES ('291500', 'Fabricación de equipo de elevación y manipulación (Incluye la fabricación de ascensores, escaleras mecánicas, montacargas, etc.)'); INSERT INTO sic (code, description) VALUES ('359900', 'Fabricación de equipo de transporte n.c.p. '); INSERT INTO sic (code, description) VALUES ('331100', 'Fabricación de equipo médico y quirúrgico y de aparatos ortopédicos '); INSERT INTO sic (code, description) VALUES ('261091', 'Fabricación de espejos y vitrales '); INSERT INTO sic (code, description) VALUES ('281102', 'Fabricación de estructuras metálicas para la construcción '); INSERT INTO sic (code, description) VALUES ('242902', 'Fabricación de explosivos, municiones y productos de pirotecnia '); INSERT INTO sic (code, description) VALUES ('243000', 'Fabricación de fibras manufacturadas '); INSERT INTO sic (code, description) VALUES ('369991', 'Fabricación de fósforos '); INSERT INTO sic (code, description) VALUES ('172101', 'Fabricación de frazadas, mantas, ponchos, colchas, cobertores, etc. '); INSERT INTO sic (code, description) VALUES ('241110', 'Fabricación de gases comprimidos y licuados. '); INSERT INTO sic (code, description) VALUES ('281300', 'Fabricación de generadores de vapor '); INSERT INTO sic (code, description) VALUES ('293020', 'Fabricación de heladeras, "freezers", lavarropas y secarropas '); INSERT INTO sic (code, description) VALUES ('289301', 'Fabricación de herramientas manuales y sus accesorios '); INSERT INTO sic (code, description) VALUES ('171132', 'Fabricación de hilados de algodón y sus mezclas '); INSERT INTO sic (code, description) VALUES ('171131', 'Fabricación de hilados de lana y sus mezclas '); INSERT INTO sic (code, description) VALUES ('171139', 'Fabricación de hilados textiles excepto de lana y de algodón '); INSERT INTO sic (code, description) VALUES ('313000', 'Fabricación de hilos y cables aislados '); INSERT INTO sic (code, description) VALUES ('202100', 'Fabricación de hojas de madera para enchapado; fabricación de tableros contrachapados; tableros laminados; tableros de partículas y tableros y paneles n.c.p. (Incluye la fabricación de madera terciada y machimbre)'); INSERT INTO sic (code, description) VALUES ('291400', 'Fabricación de hornos; hogares y quemadores '); INSERT INTO sic (code, description) VALUES ('369200', 'Fabricación de instrumentos de música '); INSERT INTO sic (code, description) VALUES ('332003', 'Fabricación de instrumentos de óptica '); INSERT INTO sic (code, description) VALUES ('331200', 'Fabricación de instrumentos y aparatos para medir, verificar, ensayar, navegar y otros fines, excepto el equipo de control de procesos industriales '); INSERT INTO sic (code, description) VALUES ('242412', 'Fabricación de jabones y detergentes '); INSERT INTO sic (code, description) VALUES ('369101', 'Fabricación de joyas y artículos conexos '); INSERT INTO sic (code, description) VALUES ('369400', 'Fabricación de juegos y juguetes '); INSERT INTO sic (code, description) VALUES ('269301', 'Fabricación de ladrillos '); INSERT INTO sic (code, description) VALUES ('269309', 'Fabricación de productos de arcilla y cerámica no refractaria para uso estructural n.c.p. '); INSERT INTO sic (code, description) VALUES ('315000', 'Fabricación de lámparas eléctricas y equipo de iluminación (Incluye la fabricación de letreros luminosos)'); INSERT INTO sic (code, description) VALUES ('369910', 'Fabricación de lápices, lapiceras, bolígrafos, sellos y artículos similares para oficinas y artistas '); INSERT INTO sic (code, description) VALUES ('332002', 'Fabricación de lentes y otros artículos oftálmicos '); INSERT INTO sic (code, description) VALUES ('352000', 'Fabricación de locomotoras y de material rodante para ferrocarriles y tranvías '); INSERT INTO sic (code, description) VALUES ('191200', 'Fabricación de maletas, bolsos de mano y similares, artículos de talabartería y artículos de cuero n.c.p. '); INSERT INTO sic (code, description) VALUES ('292190', 'Fabricación de maquinaria agropecuaria y forestal, excepto tractores '); INSERT INTO sic (code, description) VALUES ('300000', 'Fabricación de maquinaria de oficina, contabilidad e informática '); INSERT INTO sic (code, description) VALUES ('292909', 'Fabricación de maquinaria de uso especial n.c.p. '); INSERT INTO sic (code, description) VALUES ('292300', 'Fabricación de maquinaria metalúrgica '); INSERT INTO sic (code, description) VALUES ('292500', 'Fabricación de maquinaria para la elaboración de alimentos, bebidas y tabaco '); INSERT INTO sic (code, description) VALUES ('292600', 'Fabricación de maquinaria para la elaboración de productos textiles, prendas de vestir y cueros '); INSERT INTO sic (code, description) VALUES ('292400', 'Fabricación de maquinaria para la explotación de minas y canteras y para obras de construcción (Incluye la fabricación de máquinas y equipos viales)'); INSERT INTO sic (code, description) VALUES ('292901', 'Fabricación de maquinaria para la industria del papel y las artes gráficas '); INSERT INTO sic (code, description) VALUES ('293091', 'Fabricación de máquinas de coser y tejer '); INSERT INTO sic (code, description) VALUES ('292200', 'Fabricación de máquinas herramienta '); INSERT INTO sic (code, description) VALUES ('154191', 'Elaboración de masas y productos de pastelería '); INSERT INTO sic (code, description) VALUES ('241130', 'Fabricación de materias colorantes básicas, excepto pigmentos preparados. '); INSERT INTO sic (code, description) VALUES ('241309', 'Fabricación de materias plásticas en formas primarias n.c.p. '); INSERT INTO sic (code, description) VALUES ('241180', 'Fabricación de materias químicas inorgánicas básicas n.c.p. '); INSERT INTO sic (code, description) VALUES ('241190', 'Fabricación de materias químicas orgánicas básicas n.c.p. (Incluye la fabricación de alcoholes excepto el etílico, sustancias químicas para la elaboración de sustancias plásticas, etc.)'); INSERT INTO sic (code, description) VALUES ('173010', 'Fabricación de medias '); INSERT INTO sic (code, description) VALUES ('242310', 'Fabricación de medicamentos de uso humano y productos farmacéuticos '); INSERT INTO sic (code, description) VALUES ('242320', 'Fabricación de medicamentos de uso veterinario '); INSERT INTO sic (code, description) VALUES ('269510', 'Fabricación de mosaicos '); INSERT INTO sic (code, description) VALUES ('359100', 'Fabricación de motocicletas '); INSERT INTO sic (code, description) VALUES ('291100', 'Fabricación de motores y turbinas, excepto motores para aeronaves, vehículos automotores y motocicletas '); INSERT INTO sic (code, description) VALUES ('311000', 'Fabricación de motores, generadores y transformadores eléctricos '); INSERT INTO sic (code, description) VALUES ('361010', 'Fabricación de muebles y partes de muebles, principalmente de madera '); INSERT INTO sic (code, description) VALUES ('361020', 'Fabricación de muebles y partes de muebles, principalmente de otros materiales (metal, plástico, etc.) '); INSERT INTO sic (code, description) VALUES ('269193', 'Fabricación de objetos cerámicos excepto revestimientos de pisos y paredes n.c.p. '); INSERT INTO sic (code, description) VALUES ('269192', 'Fabricación de objetos cerámicos para uso doméstico excepto artefactos sanitarios '); INSERT INTO sic (code, description) VALUES ('269191', 'Fabricación de objetos cerámicos para uso industrial y de laboratorio '); INSERT INTO sic (code, description) VALUES ('369102', 'Fabricación de objetos de platería y artículos enchapados '); INSERT INTO sic (code, description) VALUES ('210102', 'Fabricación de papel y cartón excepto envases '); INSERT INTO sic (code, description) VALUES ('369992', 'Fabricación de paraguas '); INSERT INTO sic (code, description) VALUES ('192030', 'Fabricación de partes de calzado '); INSERT INTO sic (code, description) VALUES ('343000', 'Fabricación de partes; piezas y accesorios para vehículos automotores y sus motores '); INSERT INTO sic (code, description) VALUES ('242200', 'Fabricación de pinturas; barnices y productos de revestimiento similares; tintas de imprenta y masillas '); INSERT INTO sic (code, description) VALUES ('242100', 'Fabricación de plaguicidas y productos químicos de uso agropecuario '); INSERT INTO sic (code, description) VALUES ('293094', 'Fabricación de planchas, calefactores, hornos eléctricos, tostadoras y otros aparatos generadores de calor '); INSERT INTO sic (code, description) VALUES ('269592', 'Fabricación de premoldeadas para la construcción '); INSERT INTO sic (code, description) VALUES ('242411', 'Fabricación de preparados para limpieza, pulido y saneamiento '); INSERT INTO sic (code, description) VALUES ('269200', 'Fabricación de productos de cerámica refractaria '); INSERT INTO sic (code, description) VALUES ('202904', 'Fabricación de productos de corcho '); INSERT INTO sic (code, description) VALUES ('231000', 'Fabricación de productos de hornos de coque '); INSERT INTO sic (code, description) VALUES ('232000', 'Fabricación de productos de la refinación del petróleo '); INSERT INTO sic (code, description) VALUES ('242390', 'Fabricación de productos de laboratorio, sustancias químicas medicinales y productos botánicos n.c.p. '); INSERT INTO sic (code, description) VALUES ('202909', 'Fabricación de productos de madera n.c.p '); INSERT INTO sic (code, description) VALUES ('171149', 'Fabricación de productos de tejeduría n.c.p. '); INSERT INTO sic (code, description) VALUES ('261099', 'Fabricación de productos de vidrio n.c.p. '); INSERT INTO sic (code, description) VALUES ('289993', 'Fabricación de productos metálicos de tornería y/o matricería '); INSERT INTO sic (code, description) VALUES ('289999', 'Fabricación de productos metálicos n.c.p. (Incluye clavos, productos de bulonería, vajilla de mesa y de cocina, etc.)'); INSERT INTO sic (code, description) VALUES ('269990', 'Fabricación de productos minerales no metálicos n.c.p. '); INSERT INTO sic (code, description) VALUES ('252090', 'Fabricación de productos plásticos en formas básicas y artículos de plástico n.c.p., excepto muebles '); INSERT INTO sic (code, description) VALUES ('242909', 'Fabricación de productos químicos n.c.p. (Incluye la producción de aceites esenciales, etc.)'); INSERT INTO sic (code, description) VALUES ('172900', 'Fabricación de productos textiles n.c.p. '); INSERT INTO sic (code, description) VALUES ('210101', 'Fabricación de pulpa de madera '); INSERT INTO sic (code, description) VALUES ('202300', 'Fabricación de recipientes de madera '); INSERT INTO sic (code, description) VALUES ('333000', 'Fabricación de relojes '); INSERT INTO sic (code, description) VALUES ('241301', 'Fabricación de resinas y cauchos sintéticos '); INSERT INTO sic (code, description) VALUES ('269302', 'Fabricación de revestimientos cerámicos '); INSERT INTO sic (code, description) VALUES ('172102', 'Fabricación de ropa de cama y mantelería '); INSERT INTO sic (code, description) VALUES ('155412', 'Fabricación de sodas '); INSERT INTO sic (code, description) VALUES ('361030', 'Fabricación de somieres y colchones '); INSERT INTO sic (code, description) VALUES ('173020', 'Fabricación de suéteres y artículos similares de punto '); INSERT INTO sic (code, description) VALUES ('281200', 'Fabricación de tanques, depósitos y recipientes de metal '); INSERT INTO sic (code, description) VALUES ('172200', 'Fabricación de tapices y alfombras '); INSERT INTO sic (code, description) VALUES ('171142', 'Fabricación de tejidos (telas) planos de algodón y sus mezclas '); INSERT INTO sic (code, description) VALUES ('171143', 'Fabricación de tejidos (telas) planos de fibras manufacturadas y seda '); INSERT INTO sic (code, description) VALUES ('171148', 'Fabricación de tejidos (telas) planos de fibras textiles n.c.p. (Incluye hilanderías y tejedurías integradas)'); INSERT INTO sic (code, description) VALUES ('171141', 'Fabricación de tejidos (telas) planos de lana y sus mezclas '); INSERT INTO sic (code, description) VALUES ('289991', 'Fabricación de tejidos de alambre '); INSERT INTO sic (code, description) VALUES ('173090', 'Fabricación de tejidos y artículos de punto n.c.p. '); INSERT INTO sic (code, description) VALUES ('242901', 'Fabricación de tintas '); INSERT INTO sic (code, description) VALUES ('292110', 'Fabricación de tractores '); INSERT INTO sic (code, description) VALUES ('322000', 'Fabricación de transmisores de radio y televisión y de aparatos para telefonía y telegrafía con hilos '); INSERT INTO sic (code, description) VALUES ('321000', 'Fabricación de tubos, válvulas y otros componentes electrónicos '); INSERT INTO sic (code, description) VALUES ('341000', 'Fabricación de vehículos automotores (Incluye la fabricación de motores para automotores)'); INSERT INTO sic (code, description) VALUES ('293092', 'Fabricación de ventiladores, extractores y acondicionadores de aire, aspiradoras y similares '); INSERT INTO sic (code, description) VALUES ('202202', 'Fabricación de viviendas prefabricadas de madera '); INSERT INTO sic (code, description) VALUES ('271009', 'Fabricación en industrias básicas de productos de hierro y acero n.c.p. '); INSERT INTO sic (code, description) VALUES ('402009', 'Fabricación y distribución de combustibles gaseosos n.c.p. '); INSERT INTO sic (code, description) VALUES ('402001', 'Fabricación y distribución de gas (No incluye el transporte por gasoductos)'); INSERT INTO sic (code, description) VALUES ('261020', 'Fabricación y elaboración de vidrio plano '); INSERT INTO sic (code, description) VALUES ('353000', 'Fabricación y reparación de aeronaves '); INSERT INTO sic (code, description) VALUES ('289100', 'Forjado, prensado, estampado y laminado de metales; pulvimetalurgia '); INSERT INTO sic (code, description) VALUES ('803300', 'Formación de posgrado '); INSERT INTO sic (code, description) VALUES ('514191', 'Fraccionamiento y distribución de gas licuado '); INSERT INTO sic (code, description) VALUES ('273100', 'Fundición de hierro y acero '); INSERT INTO sic (code, description) VALUES ('273200', 'Fundición de metales no ferrosos '); INSERT INTO sic (code, description) VALUES ('271001', 'Fundición en altos hornos y acerías. Producción de lingotes, planchas o barras '); INSERT INTO sic (code, description) VALUES ('401130', 'Generación de energía hidráulica (Incluye la producción de energía eléctrica mediante centrales de bombeo)'); INSERT INTO sic (code, description) VALUES ('401190', 'Generación de energía n.c.p. (Incluye la producción de energía eléctrica mediante fuentes de energía solar, biomasa, eólica, geotérmica, mareomotriz, etc.)'); INSERT INTO sic (code, description) VALUES ('401110', 'Generación de energía térmica convencional (Incluye la producción de energía eléctrica mediante máquinas turbo-gas, turbo vapor, ciclo combinado y turbo diesel)'); INSERT INTO sic (code, description) VALUES ('401120', 'Generación de energía térmica nuclear (Incluye la producción de energía eléctrica mediante combustible nuclear)'); INSERT INTO sic (code, description) VALUES ('222101', 'Impresión de diarios y revistas '); INSERT INTO sic (code, description) VALUES ('222109', 'Impresión excepto de diarios y revistas '); INSERT INTO sic (code, description) VALUES ('369999', 'Industrias manufactureras n.c.p. (Incluye fabricación de cochecitos de bebé, termos, velas, pelucas, etc.)'); INSERT INTO sic (code, description) VALUES ('014210', 'Inseminación artificial y servicios n.c.p. para mejorar la reproducción de los animales y el rendimiento de sus productos '); INSERT INTO sic (code, description) VALUES ('453120', 'Instalación de sistemas de iluminación, control y señalización eléctrica para el transporte '); INSERT INTO sic (code, description) VALUES ('502910', 'Instalación y reparación de caños de escape '); INSERT INTO sic (code, description) VALUES ('502300', 'Instalación y reparación de lunetas y ventanillas, alarmas, cerraduras, radios, sistemas de climatización automotor y grabado de cristales (Incluye instalación y reparación de parabrisas, aletas, burletes, colisas, levantavidrios, parlantes y autoestereos, aire acondicionado, alarmas y sirenas, etc.)'); INSERT INTO sic (code, description) VALUES ('453110', 'Instalaciones de ascensores, montacargas y escaleras mecánicas '); INSERT INTO sic (code, description) VALUES ('454100', 'Instalaciones de carpintería, herrería de obra y artística (Incluye instalación de puertas y ventanas, carpintería metálica y no metálica, etc.)'); INSERT INTO sic (code, description) VALUES ('453300', 'Instalaciones de gas, agua, sanitarios y de climatización, con sus artefactos conexos (Incluye la instalación de compactadores, calderas, sistemas de calefacción central, etc.)'); INSERT INTO sic (code, description) VALUES ('453900', 'Instalaciones para edificios y obras de ingeniería civil n.c.p. '); INSERT INTO sic (code, description) VALUES ('012112', 'Invernada de ganado bovino excepto el engorde en corrales (Fed-Lot) '); INSERT INTO sic (code, description) VALUES ('731100', 'Investigación y desarrollo experimental en el campo de la ingeniería y la tecnología '); INSERT INTO sic (code, description) VALUES ('731300', 'Investigación y desarrollo experimental en el campo de las ciencias agropecuarias '); INSERT INTO sic (code, description) VALUES ('732200', 'Investigación y desarrollo experimental en el campo de las ciencias humanas '); INSERT INTO sic (code, description) VALUES ('731200', 'Investigación y desarrollo experimental en el campo de las ciencias médicas '); INSERT INTO sic (code, description) VALUES ('732100', 'Investigación y desarrollo experimental en el campo de las ciencias sociales '); INSERT INTO sic (code, description) VALUES ('731900', 'Investigación y desarrollo experimental en el campo de las ciencias exactas y naturales n.c.p. '); INSERT INTO sic (code, description) VALUES ('271002', 'Laminación y estirado '); INSERT INTO sic (code, description) VALUES ('502100', 'Lavado automático y manual '); INSERT INTO sic (code, description) VALUES ('171120', 'Preparación de fibras animales de uso textil, incluso lavado de lana '); INSERT INTO sic (code, description) VALUES ('930100', 'Lavado y limpieza de artículos de tela, cuero y/o de piel, incluso la limpieza en seco '); INSERT INTO sic (code, description) VALUES ('502920', 'Mantenimiento y reparación de frenos '); INSERT INTO sic (code, description) VALUES ('725000', 'Mantenimiento y reparación de maquinaria de oficina, contabilidad e informática '); INSERT INTO sic (code, description) VALUES ('504020', 'Mantenimiento y reparación de motocicletas '); INSERT INTO sic (code, description) VALUES ('502990', 'Mantenimiento y reparación del motor n.c.p.; mecánica integral (Incluye auxilio y servicios de grúa para automotores; instalación y reparación de equipos de GNC)'); INSERT INTO sic (code, description) VALUES ('151111', 'Matanza de ganado bovino '); INSERT INTO sic (code, description) VALUES ('151140', 'Matanza de ganado excepto el bovino y procesamiento de su carne (Incluye ganado ovino, porcino, equino, búfalo, etc.)'); INSERT INTO sic (code, description) VALUES ('151199', 'Matanza de animales n.c.p. y procesamiento de su carne; elaboración de subproductos cárnicos n.c.p. '); INSERT INTO sic (code, description) VALUES ('151120', 'Matanza y procesamiento de carne de aves '); INSERT INTO sic (code, description) VALUES ('153110', 'Molienda de trigo '); INSERT INTO sic (code, description) VALUES ('451900', 'Movimiento de suelos y preparación de terrenos para obras n.c.p. (Incluye el drenaje, remoción de rocas, excavación de zanjas para servicios públicos, alcantarillado urbano y para construcciones diversas, movimientos de tierras para hacer terraplenes o desmontes previos a la construcción de vías, autopistas, FFCC, etc.)'); INSERT INTO sic (code, description) VALUES ('452900', 'Obras de ingeniería civil n.c.p. (Incluye los trabajos generales de construcción para la minería y la industria, de centrales eléctricas y nucleares, excavaciones de sepulturas, etc.)'); INSERT INTO sic (code, description) VALUES ('749100', 'Obtención y dotación de personal '); INSERT INTO sic (code, description) VALUES ('511912', 'Operaciones de intermediación de carne excepto consignatario directo (Incluye consignatarios y abastecedores de carnes, etc.)'); INSERT INTO sic (code, description) VALUES ('511121', 'Operaciones de intermediación de ganado en pie (Incluye consignatarios de hacienda y ferieros)'); INSERT INTO sic (code, description) VALUES ('511122', 'Operaciones de intermediación de lanas, cueros y productos afines de terceros '); INSERT INTO sic (code, description) VALUES ('511911', 'Operaciones de intermediación de carne - consignatario directo - '); INSERT INTO sic (code, description) VALUES ('452510', 'Perforación de pozos de agua '); INSERT INTO sic (code, description) VALUES ('451200', 'Perforación y sondeo excepto: perforación de pozos de petróleo, de gas, de minas e hidráulicos y prospección de yacimientos de petróleo (Incluye los trabajos de perforación, sondeo y muestreo con fines de construcción o para estudios geofísicos, geológicos u otros similares, las perforaciones horizontales para el paso de cables o cañerías de drenaje, etc.. No incluye los servicios de perforación relacionados con la extracción de petróleo y gas, actividad 112000, ni los trabajos de perforación de pozos hidraúlicos, actividad 452510)'); INSERT INTO sic (code, description) VALUES ('050120', 'Pesca continental, fluvial y lacustre '); INSERT INTO sic (code, description) VALUES ('050110', 'Pesca marítima, costera y de altura (Incluye peces, crustáceos, moluscos y otros animales acuáticos)'); INSERT INTO sic (code, description) VALUES ('454400', 'Pintura y trabajos de decoración '); INSERT INTO sic (code, description) VALUES ('020110', 'Plantación de bosques '); INSERT INTO sic (code, description) VALUES ('930300', 'Pompas fúnebres y servicios conexos '); INSERT INTO sic (code, description) VALUES ('153120', 'Preparación de arroz '); INSERT INTO sic (code, description) VALUES ('151310', 'Preparación de conservas de frutas, hortalizas y legumbres '); INSERT INTO sic (code, description) VALUES ('171111', 'Desmotado de algodón; preparación de fibras de algodón '); INSERT INTO sic (code, description) VALUES ('171112', 'Preparación de fibras textiles vegetales excepto de algodón (Incluye la preparación de fibras de yute, ramio, cáñamo y lino)'); INSERT INTO sic (code, description) VALUES ('160010', 'Preparación de hojas de tabaco '); INSERT INTO sic (code, description) VALUES ('154920', 'Preparación de hojas de té '); INSERT INTO sic (code, description) VALUES ('153139', 'Preparación y molienda de legumbres y cereales n.c.p. (excepto trigo) '); INSERT INTO sic (code, description) VALUES ('552290', 'Preparación y venta de comidas para llevar n.c.p. (Incluye casas de comidas, rotiserías y demás lugares que no poseen espacio para el consumo in situ)'); INSERT INTO sic (code, description) VALUES ('151112', 'Procesamiento de carne de ganado bovino (Incluye los mataderos y frigoríficos que sacrifican principalmente ganado bovino)'); INSERT INTO sic (code, description) VALUES ('723000', 'Procesamiento de datos '); INSERT INTO sic (code, description) VALUES ('921410', 'Producción de espectáculos teatrales y musicales '); INSERT INTO sic (code, description) VALUES ('921110', 'Producción de filmes y videocintas '); INSERT INTO sic (code, description) VALUES ('012220', 'Producción de huevos '); INSERT INTO sic (code, description) VALUES ('012181', 'Producción de lana '); INSERT INTO sic (code, description) VALUES ('012171', 'Producción de leche de ganado bovino '); INSERT INTO sic (code, description) VALUES ('012179', 'Producción de leche de ganado n.c.p. (Incluye la cría de ganado de búfala, cabra, etc. para la producción de leche)'); INSERT INTO sic (code, description) VALUES ('272090', 'Producción de metales no ferrosos n.c.p. y sus semielaborados '); INSERT INTO sic (code, description) VALUES ('011520', 'Producción de otras formas de propagación de cultivos agrícolas (Incluye gajos, bulbos, estacas enraizadas o no, esquejes, plantines, etc.)'); INSERT INTO sic (code, description) VALUES ('012182', 'Producción de pelos (Incluye la cría de caprinos, camélidos, etc., para la obtención de pelos)'); INSERT INTO sic (code, description) VALUES ('011519', 'Producción de semillas de cultivos agrícolas n.c.p. '); INSERT INTO sic (code, description) VALUES ('011513', 'Producción de semillas de hortalizas y legumbres, flores y plantas ornamentales y árboles frutales '); INSERT INTO sic (code, description) VALUES ('011511', 'Producción de semillas híbridas de cereales y oleaginosas '); INSERT INTO sic (code, description) VALUES ('011512', 'Producción de semillas varietales o autofecundadas de cereales, oleaginosas, y forrajeras '); INSERT INTO sic (code, description) VALUES ('921302', 'Producción y distribución por televisión (No incluye la transmisión, actividad 642010)'); INSERT INTO sic (code, description) VALUES ('924120', 'Promoción y producción de espectáculos deportivos '); INSERT INTO sic (code, description) VALUES ('552210', 'Provisión de comidas preparadas para empresas (Incluye el servicio de catering, el suministro de comidas para banquetes, bodas, fiestas y otras celebraciones, etc.)'); INSERT INTO sic (code, description) VALUES ('661300', 'Reaseguros '); INSERT INTO sic (code, description) VALUES ('251120', 'Recauchutado y renovación de cubiertas '); INSERT INTO sic (code, description) VALUES ('371000', 'Reciclamiento de desperdicios y desechos metálicos '); INSERT INTO sic (code, description) VALUES ('372000', 'Reciclamiento de desperdicios y desechos no metálicos '); INSERT INTO sic (code, description) VALUES ('050130', 'Recolección de productos marinos (Incluye la recolección de algas marinas y otras plantas acuáticas, corales, esponjas)'); INSERT INTO sic (code, description) VALUES ('900010', 'Recolección, reducción y eliminación de desperdicios '); INSERT INTO sic (code, description) VALUES ('526909', 'Reparación de artículos n.c.p. '); INSERT INTO sic (code, description) VALUES ('502220', 'Reparación de amortiguadores, alineación de dirección y balanceo de ruedas '); INSERT INTO sic (code, description) VALUES ('526200', 'Reparación de artículos eléctricos de uso doméstico '); INSERT INTO sic (code, description) VALUES ('526100', 'Reparación de calzado y artículos de marroquinería '); INSERT INTO sic (code, description) VALUES ('502210', 'Reparación de cámaras y cubiertas (Incluye reparación de llantas)'); INSERT INTO sic (code, description) VALUES ('526901', 'Reparación de relojes y joyas '); INSERT INTO sic (code, description) VALUES ('502600', 'Reparación y pintura de carrocerías; colocación de guardabarros y protecciones exteriores '); INSERT INTO sic (code, description) VALUES ('502500', 'Reparaciones eléctricas, del tablero e instrumental; reparación y recarga de baterías '); INSERT INTO sic (code, description) VALUES ('020120', 'Repoblación y conservación de bosques nativos y zonas forestadas '); INSERT INTO sic (code, description) VALUES ('223000', 'Reproducción de grabaciones '); INSERT INTO sic (code, description) VALUES ('151113', 'Saladero y peladero de cueros de ganado bovino '); INSERT INTO sic (code, description) VALUES ('621000', 'Servicio de transporte aéreo de cargas '); INSERT INTO sic (code, description) VALUES ('622000', 'Servicio de transporte aéreo de pasajeros '); INSERT INTO sic (code, description) VALUES ('602290', 'Servicio de transporte automotor de pasajeros n.c.p. '); INSERT INTO sic (code, description) VALUES ('602260', 'Servicio de transporte automotor de pasajeros para el turismo '); INSERT INTO sic (code, description) VALUES ('602250', 'Servicio de transporte automotor interurbano de pasajeros (Incluye los servicios de transporte regular de más de 50 km., los llamados servicios de larga distancia)'); INSERT INTO sic (code, description) VALUES ('602240', 'Servicio de transporte automotor urbano de oferta libre de pasajeros excepto mediante taxis y remises, alquiler de autos con chofer y transporte escolar (Incluye servicios urbanos especiales como charters, servicios contratados, servicios para ámbito portuario o aeroportuario, servicio de hipódromos y espectáculos deportivos y culturales)'); INSERT INTO sic (code, description) VALUES ('602210', 'Servicio de transporte automotor urbano regular de pasajeros (Incluye los servicios de transporte regular de menos de 50 km.)'); INSERT INTO sic (code, description) VALUES ('602230', 'Servicio de transporte escolar (Incluye el sevicio de transporte para colonias de vacaciones y clubes)'); INSERT INTO sic (code, description) VALUES ('601100', 'Servicio de transporte ferroviario de cargas '); INSERT INTO sic (code, description) VALUES ('601220', 'Servicio de transporte ferroviario interurbano de pasajeros '); INSERT INTO sic (code, description) VALUES ('601210', 'Servicio de transporte ferroviario urbano y suburbano de pasajeros (Incluye el servicio de subterráneo y de premetro)'); INSERT INTO sic (code, description) VALUES ('612100', 'Servicio de transporte fluvial de cargas '); INSERT INTO sic (code, description) VALUES ('612200', 'Servicio de transporte fluvial de pasajeros '); INSERT INTO sic (code, description) VALUES ('611100', 'Servicio de transporte marítimo de carga '); INSERT INTO sic (code, description) VALUES ('611200', 'Servicio de transporte marítimo de pasajeros '); INSERT INTO sic (code, description) VALUES ('603200', 'Servicio de transporte por gasoductos '); INSERT INTO sic (code, description) VALUES ('603100', 'Servicio de transporte por oleoductos y poliductos '); INSERT INTO sic (code, description) VALUES ('602180', 'Servicio de transporte urbano de carga n.c.p. (Incluye el transporte realizado por fleteros y distribuidores dentro del égido urbano)'); INSERT INTO sic (code, description) VALUES ('741102', 'Servicios notariales '); INSERT INTO sic (code, description) VALUES ('633120', 'Servicios prestados por playas de estacionamiento y garajes '); INSERT INTO sic (code, description) VALUES ('014190', 'Servicios agrícolas n.c.p (Incluye planificación y diseño paisajista, plantación y mantenimiento de jardines, parques y cementerios, riego, polinización o alquiler de colmenas, control acústico de plagas, etc.)'); INSERT INTO sic (code, description) VALUES ('672200', 'Servicios auxiliares a la administración de fondos de jubilaciones y pensiones '); INSERT INTO sic (code, description) VALUES ('671990', 'Servicios auxiliares a la intermediación financiera n.c.p., excepto a los servicios de seguros y de administración de fondos de jubilaciones y pensiones '); INSERT INTO sic (code, description) VALUES ('672190', 'Servicios auxiliares a los servicios de seguros n.c.p. '); INSERT INTO sic (code, description) VALUES ('751900', 'Servicios auxiliares para los servicios generales de la Administración Pública n.c.p. (Incluye las actividades de servicios generales y de personal; la administración, dirección y apoyo de servicios generales, compras y suministros, etc. )'); INSERT INTO sic (code, description) VALUES ('671200', 'Servicios bursátiles de mediación o por cuenta de terceros (Incluye la actividad de agentes y sociedades de bolsa)'); INSERT INTO sic (code, description) VALUES ('634300', 'Servicios complementarios de apoyo turístico '); INSERT INTO sic (code, description) VALUES ('633390', 'Servicios complementarios para el transporte aéreo n.c.p. (Incluye servicios de prevención y extinción de incendios)'); INSERT INTO sic (code, description) VALUES ('633290', 'Servicios complementarios para el transporte por agua n.c.p. (Incluye explotación de servicios de terminales como puertos y muelles)'); INSERT INTO sic (code, description) VALUES ('633190', 'Servicios complementarios para el transporte terrestre n.c.p. (Incluye servicios de mantenimiento de material ferroviario, terminales y estaciones)'); INSERT INTO sic (code, description) VALUES ('921430', 'Servicios conexos a la producción de espectáculos teatrales y musicales (Incluye diseño y manejo de escenografía, montaje de iluminación y sonido, funcionamiento de agencias de venta de billetes de teatro, conciertos, etc.)'); INSERT INTO sic (code, description) VALUES ('851210', 'Servicios de atención ambulatoria (Incluye las actividades de consultorios médicos de establecimientos sin internación, consultorios de guardia para resolver urgencias médicas, vacunatorios, centros del primer nivel de atención, etc. Los servicios de cirugía ambulatoria, tales como cirugía plástica, oftalmológica, artroscopía, electrocoagulación, lipoaspiración, etc.)'); INSERT INTO sic (code, description) VALUES ('922000', 'Servicios de agencias de noticias y servicios de información (Incluye el suministro de material informativo, fotográfico y periodístico a medios de difusión)'); INSERT INTO sic (code, description) VALUES ('659910', 'Servicios de agentes de mercado abierto "puros" (Incluye las transacciones extrabursátiles - por cuenta propia -)'); INSERT INTO sic (code, description) VALUES ('632000', 'Servicios de almacenamiento y depósito (Incluye silos de granos, depósitos con cámaras frigoríficas, almacenes para mercancías diversas, incluso productos de zona franca, etc.)'); INSERT INTO sic (code, description) VALUES ('551100', 'Servicios de alojamiento en camping (Incluye refugios de montaña)'); INSERT INTO sic (code, description) VALUES ('551222', 'Servicios de alojamiento en hoteles, hosterías y residenciales similares, excepto por hora, que incluyen servicio de restaurante al público '); INSERT INTO sic (code, description) VALUES ('551223', 'Servicios de alojamiento en hoteles, hosterías y residenciales similares, excepto por hora, que no incluyen servicio de restaurante al público '); INSERT INTO sic (code, description) VALUES ('551221', 'Servicios de alojamiento en pensiones '); INSERT INTO sic (code, description) VALUES ('551210', 'Servicios de alojamiento por hora '); INSERT INTO sic (code, description) VALUES ('701010', 'Servicios de alquiler y explotación de inmuebles para fiestas, convenciones y otros eventos similares '); INSERT INTO sic (code, description) VALUES ('742101', 'Servicios relacionados con la construcción. (Incluye los servicios prestados por ingenieros, arquitectos y técnicos)'); INSERT INTO sic (code, description) VALUES ('661210', 'Servicios de aseguradoras de riesgo de trabajo (A.R.T.) '); INSERT INTO sic (code, description) VALUES ('741409', 'Servicios de asesoramiento, dirección y gestión empresarial n.c.p. '); INSERT INTO sic (code, description) VALUES ('741402', 'Servicios de asesoramiento, dirección y gestión empresarial realizados por integrantes de cuerpos de dirección en sociedades excepto las anónimas '); INSERT INTO sic (code, description) VALUES ('741401', 'Servicios de asesoramiento, dirección y gestión empresarial realizados por integrantes de los órganos de administración y/o fiscalización en sociedades anónimas '); INSERT INTO sic (code, description) VALUES ('911200', 'Servicios de asociaciones de especialistas en disciplinas científicas, prácticas profesionales y esferas técnicas '); INSERT INTO sic (code, description) VALUES ('919900', 'Servicios de asociaciones n.c.p. '); INSERT INTO sic (code, description) VALUES ('752100', 'Servicios de asuntos exteriores '); INSERT INTO sic (code, description) VALUES ('853110', 'Servicios de atención a ancianos con alojamiento '); INSERT INTO sic (code, description) VALUES ('853130', 'Servicios de atención a menores con alojamiento '); INSERT INTO sic (code, description) VALUES ('853140', 'Servicios de atención a mujeres con alojamiento '); INSERT INTO sic (code, description) VALUES ('853120', 'Servicios de atención a personas minusválidas con alojamiento '); INSERT INTO sic (code, description) VALUES ('851220', 'Servicios de atención domiciliaria programada (Incluye las actividades llevadas a cabo en establecimientos que ofrecen atención por módulos a domicilio y actividades de agentes sanitarios relacionados con la prevención y educación para la salud)'); INSERT INTO sic (code, description) VALUES ('552114', 'Servicios de bares y confiterías (Incluye locales de expendio de bebidas con servicio de mesa y/o de mostrador para consumo en el lugar, salones de té, servicios de comedores escolares, cantinas deportivas, fábricas etc.)'); INSERT INTO sic (code, description) VALUES ('923100', 'Servicios de bibliotecas y archivos '); INSERT INTO sic (code, description) VALUES ('671130', 'Servicios de bolsas de Comercio '); INSERT INTO sic (code, description) VALUES ('671910', 'Servicios de casas y agencias de cambio '); INSERT INTO sic (code, description) VALUES ('642020', 'Servicios de comunicación por medio de teléfono, telégrafo y télex '); INSERT INTO sic (code, description) VALUES ('721000', 'Servicios de consultores en equipo de informática '); INSERT INTO sic (code, description) VALUES ('722000', 'Servicios de consultores en informática y suministros de programas de informática '); INSERT INTO sic (code, description) VALUES ('741200', 'Servicios de contabilidad y teneduría de libros, auditoría y asesoría fiscal '); INSERT INTO sic (code, description) VALUES ('014130', 'Servicios de contratistas de mano de obra agrícola (Incluye la poda de árboles, transplante, fumigación y desinfección manual, cosecha manual de citrus, algodón, etc.)'); INSERT INTO sic (code, description) VALUES ('014220', 'Servicios de contratistas de mano de obra pecuaria (Incluye arreo, castración de aves, esquila de ovejas, recolección de estiércol, etc. )'); INSERT INTO sic (code, description) VALUES ('641000', 'Servicios de correos '); INSERT INTO sic (code, description) VALUES ('014120', 'Servicios de cosecha mecánica (Incluye la cosecha mecánica de granos, caña de azúcar, algodón, forrajes, el enfardado, enrrollado, etc.)'); INSERT INTO sic (code, description) VALUES ('659890', 'Servicios de crédito n.c.p. (Incluye el otorgamiento de préstamos por entidades que no reciben depósitos y que están fuera del sistema bancario, y cuyo destino es financiar el consumo, la vivienda u otros bienes)'); INSERT INTO sic (code, description) VALUES ('752200', 'Servicios de defensa '); INSERT INTO sic (code, description) VALUES ('900020', 'Servicios de depuración de aguas residuales, alcantarillado y cloacas '); INSERT INTO sic (code, description) VALUES ('851400', 'Servicios de diagnóstico (Incluye las actividades de laboratorios de análisis clínicos y patológicos, centros de diagnóstico por imágenes, centros de endoscopía, de electrodiagnóstico, consultorios de hemodinamia, etc.)'); INSERT INTO sic (code, description) VALUES ('851600', 'Servicios de emergencias y traslados '); INSERT INTO sic (code, description) VALUES ('659920', 'Servicios de entidades de tarjeta de compra y/o crédito '); INSERT INTO sic (code, description) VALUES ('924990', 'Servicios de entretenimiento n.c.p. '); INSERT INTO sic (code, description) VALUES ('749500', 'Servicios de envase y empaque '); INSERT INTO sic (code, description) VALUES ('924910', 'Servicios de esparcimiento relacionados con juegos de azar y apuestas '); INSERT INTO sic (code, description) VALUES ('921990', 'Servicios de espectáculos artísticos y de diversión n.c.p. (Incluye parques de diversión y centros similares, circenses, de títeres, mimos etc.)'); INSERT INTO sic (code, description) VALUES ('552119', 'Servicios de expendio de comidas y bebidas en establecimientos con servicio de mesa y/o en mostrador - excepto en heladerías - n.c.p. '); INSERT INTO sic (code, description) VALUES ('633210', 'Servicios de explotación de infraestructura para el transporte por agua; derechos de puerto '); INSERT INTO sic (code, description) VALUES ('633110', 'Servicios de explotación de infraestructura para el transporte terrestre; peajes y otros derechos '); INSERT INTO sic (code, description) VALUES ('911100', 'Servicios de federaciones de asociaciones, cámaras, gremios y organizaciones similares '); INSERT INTO sic (code, description) VALUES ('659990', 'Servicios de financiación y actividades financieras n.c.p. (Incluye actividades de inversión en acciones, títulos, fondos comunes de inversión, la actividad de corredores de bolsa, las sociedades de inversión inmobiliaria y sociedades de cartera, arrendamiento financiero o leasing, securitización, etc..No incluye actividades financieras relacionadas con el otorgamiento de créditos)'); INSERT INTO sic (code, description) VALUES ('749400', 'Servicios de fotografía '); INSERT INTO sic (code, description) VALUES ('635000', 'Servicios de gestión y logística para el transporte de mercaderías (Incluye las actividades de los agentes aduaneros, actividades de empresas empaquetadoras, etc.)'); INSERT INTO sic (code, description) VALUES ('633220', 'Servicios de guarderías náuticas '); INSERT INTO sic (code, description) VALUES ('633310', 'Servicios de hangares, estacionamiento y remolque de aeronaves '); INSERT INTO sic (code, description) VALUES ('950000', 'Servicios de hogares privados que contratan servicio doméstico '); INSERT INTO sic (code, description) VALUES ('551229', 'Servicios de hospedaje temporal n.c.p. (Incluye hospedaje en estancias, residencias para estudiantes y albergues juveniles, apartamentos turísticos, etc.)'); INSERT INTO sic (code, description) VALUES ('851120', 'Servicios de hospital de día (Incluye las actividades de tratamiento que no necesitan hospitalización a tiempo completo, tales como tratamientos oncológicos; infectológicos; dialíticos; atención de la salud mental; atención pediátrica; atención gerontológica; etc.)'); INSERT INTO sic (code, description) VALUES ('749600', 'Servicios de impresión heliográfica, fotocopia y otras formas de reproducciones '); INSERT INTO sic (code, description) VALUES ('742109', 'Servicios de arquitectura e ingeniería y servicios conexos de asesoramiento técnico n.c.p. '); INSERT INTO sic (code, description) VALUES ('652203', 'Servicios de intermediación financiera realizada por cajas de crédito '); INSERT INTO sic (code, description) VALUES ('652201', 'Servicios de intermediación financiera realizada por las compañías financieras '); INSERT INTO sic (code, description) VALUES ('652202', 'Servicios de intermediación financiera realizada por sociedades de ahorro y préstamo para la vivienda y otros inmuebles '); INSERT INTO sic (code, description) VALUES ('851110', 'Servicios de internación '); INSERT INTO sic (code, description) VALUES ('749290', 'Servicios de investigación y seguridad n.c.p. '); INSERT INTO sic (code, description) VALUES ('923300', 'Servicios de jardines botánicos, zoológicos y de parques nacionales '); INSERT INTO sic (code, description) VALUES ('752300', 'Servicios de justicia '); INSERT INTO sic (code, description) VALUES ('651100', 'Servicios de la banca central (Incluye las actividades del Banco Central de la República Argentina)'); INSERT INTO sic (code, description) VALUES ('652120', 'Servicios de la banca de inversión '); INSERT INTO sic (code, description) VALUES ('652110', 'Servicios de la banca mayorista '); INSERT INTO sic (code, description) VALUES ('652130', 'Servicios de la banca minorista '); INSERT INTO sic (code, description) VALUES ('753000', 'Servicios de la seguridad social obligatoria '); INSERT INTO sic (code, description) VALUES ('014111', 'Servicios de labranza, siembra, transplante y cuidados culturales '); INSERT INTO sic (code, description) VALUES ('749300', 'Servicios de limpieza de edificios '); INSERT INTO sic (code, description) VALUES ('631000', 'Servicios de manipulación de carga (Incluye los servicios de carga y descarga de mercancías o equipajes de pasajeros, sin discriminar medios de transporte, la estiba y desestiba, etc.)'); INSERT INTO sic (code, description) VALUES ('014119', 'Servicios de maquinaria agrícola n.c.p., excepto los de cosecha mecánica (Incluye enfardado, enrollado, envasado - silo-pack -, clasificación y secado, etc.)'); INSERT INTO sic (code, description) VALUES ('671120', 'Servicios de mercados a término '); INSERT INTO sic (code, description) VALUES ('671110', 'Servicios de mercados y cajas de valores '); INSERT INTO sic (code, description) VALUES ('602110', 'Servicios de mudanza (Incluye servicios de guardamuebles)'); INSERT INTO sic (code, description) VALUES ('923200', 'Servicios de museos y preservación de lugares y edificios históricos '); INSERT INTO sic (code, description) VALUES ('924110', 'Servicios de organización, dirección y gestión de prácticas deportivas y explotación de las instalaciones (Incluye clubes, gimnasios y otras instalaciones para practicar deportes)'); INSERT INTO sic (code, description) VALUES ('919200', 'Servicios de organizaciones políticas '); INSERT INTO sic (code, description) VALUES ('919100', 'Servicios de organizaciones religiosas '); INSERT INTO sic (code, description) VALUES ('990000', 'Servicios de organizaciones y órganos extraterritoriales '); INSERT INTO sic (code, description) VALUES ('930201', 'Servicios de peluquería '); INSERT INTO sic (code, description) VALUES ('552113', 'Servicios de pizzerías, "fast food" y locales de venta de comidas y bebidas al paso (Incluye el expendio de pizza, empanadas, hamburguesas, productos lácteos excepto helados, etc.)'); INSERT INTO sic (code, description) VALUES ('672110', 'Servicios de productores y asesores de seguros '); INSERT INTO sic (code, description) VALUES ('752500', 'Servicios de protección civil '); INSERT INTO sic (code, description) VALUES ('743000', 'Servicios de publicidad '); INSERT INTO sic (code, description) VALUES ('014112', 'Servicios de pulverización, desinfección y fumigación aérea y terrestre, excepto la manual '); INSERT INTO sic (code, description) VALUES ('921301', 'Servicios de radio (No incluye la transmisión, actividad 642010)'); INSERT INTO sic (code, description) VALUES ('552112', 'Servicios de restaurantes y cantinas con espectáculo '); INSERT INTO sic (code, description) VALUES ('552111', 'Servicios de restaurantes y cantinas sin espectáculo '); INSERT INTO sic (code, description) VALUES ('921910', 'Servicios de salones de baile, discotecas y similares '); INSERT INTO sic (code, description) VALUES ('924920', 'Servicios de salones de juegos (Incluye salones de billar, pool, bowling, juegos electrónicos, etc.)'); INSERT INTO sic (code, description) VALUES ('900090', 'Servicios de saneamiento público n.c.p. '); INSERT INTO sic (code, description) VALUES ('661130', 'Servicios de seguros a las personas excepto los de salud y de vida (Incluye los seguros de accidentes)'); INSERT INTO sic (code, description) VALUES ('661110', 'Servicios de seguros de salud (Incluye medicina prepaga)'); INSERT INTO sic (code, description) VALUES ('661120', 'Servicios de seguros de vida (Incluye los seguros de vida, retiro y sepelio)'); INSERT INTO sic (code, description) VALUES ('661220', 'Servicios de seguros patrimoniales excepto los de las aseguradoras de riesgo de trabajo '); INSERT INTO sic (code, description) VALUES ('912000', 'Servicios de sindicatos '); INSERT INTO sic (code, description) VALUES ('671920', 'Servicios de sociedades calificadoras de riesgos '); INSERT INTO sic (code, description) VALUES ('642010', 'Servicios de transmisión de radio y televisión '); INSERT INTO sic (code, description) VALUES ('642099', 'Servicios de transmisión n.c.p. de sonido, imágenes, datos u otra información '); INSERT INTO sic (code, description) VALUES ('602220', 'Servicios de transporte automotor de pasajeros mediante taxis y remises; alquiler de autos con chofer '); INSERT INTO sic (code, description) VALUES ('602130', 'Servicios de transporte de animales '); INSERT INTO sic (code, description) VALUES ('749210', 'Servicios de transporte de caudales y objetos de valor '); INSERT INTO sic (code, description) VALUES ('602120', 'Servicios de transporte de mercaderías a granel, incluido el transporte por camión cisterna '); INSERT INTO sic (code, description) VALUES ('851500', 'Servicios de tratamiento (Incluye las actividades de centros de cobaltoterapia, de radiología convencional, de acelerador lineal de rehabilitación física, de psicoterapia, de hemoterapia, de rehabilitación psíquica, unidades de hemodiálisis, centros de medicina nuclear, etc.)'); INSERT INTO sic (code, description) VALUES ('930202', 'Servicios de tratamiento de belleza, excepto los de peluquería '); INSERT INTO sic (code, description) VALUES ('749900', 'Servicios empresariales n.c.p. '); INSERT INTO sic (code, description) VALUES ('020310', 'Servicios forestales de extracción de madera (Incluye tala de árboles, acarreo y transporte en el interior del bosque, servicios realizados de terceros, etc.)'); INSERT INTO sic (code, description) VALUES ('020390', 'Servicios forestales excepto los relacionados con la extracción de madera (Incluye protección contra incendios, evaluación de masas forestales en pie, estimación del valor de la madera, etc.)'); INSERT INTO sic (code, description) VALUES ('751100', 'Servicios generales de la administración pública (Incluye el desempeño de funciones ejecutivas y legislativas de administración por parte de las entidades de la administración central, regional y local; la administración y supervisión de asuntos fiscales; la aplicación del presupuesto y la gestión de los fondos públicos y de la deuda pública; la gestión administrativa de servicios estadísticos y sociológicos y de planificación social y económica global a distintos niveles de la administración)'); INSERT INTO sic (code, description) VALUES ('742102', 'Servicios geológicos y de prospección '); INSERT INTO sic (code, description) VALUES ('851190', 'Servicios hospitalarios n.c.p. '); INSERT INTO sic (code, description) VALUES ('702000', 'Servicios inmobiliarios realizados a cambio de una retribución o por contrata (Incluye compra, venta, alquiler, remate, tasación, administración de bienes, etc., realizados a cambio de una retribución o por contrata, y la actividad de administradores, martilleros, rematadores, comisionistas, etc.)'); INSERT INTO sic (code, description) VALUES ('701090', 'Servicios inmobiliarios realizados por cuenta propia, con bienes propios o arrendados n.c.p. '); INSERT INTO sic (code, description) VALUES ('741101', 'Servicios jurídicos '); INSERT INTO sic (code, description) VALUES ('634100', 'Servicios mayoristas de agencias de viajes '); INSERT INTO sic (code, description) VALUES ('634200', 'Servicios minoristas de agencias de viajes '); INSERT INTO sic (code, description) VALUES ('930990', 'Servicios n.c.p. (Incluye actividades de astrología y espiritismo, las realizadas con fines sociales como agencias matrimoniales, de investigaciones genealógicas, de contratación de acompañantes, la actividad de lustrabotas, acomodadores de autos, etc.)'); INSERT INTO sic (code, description) VALUES ('851300', 'Servicios odontológicos '); INSERT INTO sic (code, description) VALUES ('014291', 'Servicios para el control de plagas, baños parasiticidas, etc. '); INSERT INTO sic (code, description) VALUES ('930910', 'Servicios para el mantenimiento físico-corporal (Incluye baños turcos, saunas, solarios, centros de masajes y adelgazamiento, etc.)'); INSERT INTO sic (code, description) VALUES ('752400', 'Servicios para el orden público y la seguridad '); INSERT INTO sic (code, description) VALUES ('633320', 'Servicios para la aeronavegación (Incluye servicios de terminales como aeropuertos, actividades de control de tráfico aéreo, etc.)'); INSERT INTO sic (code, description) VALUES ('015020', 'Servicios para la caza '); INSERT INTO sic (code, description) VALUES ('633230', 'Servicios para la navegación (Incluye servicios de practicaje y pilotaje, atraque y salvamento)'); INSERT INTO sic (code, description) VALUES ('050300', 'Servicios para la pesca '); INSERT INTO sic (code, description) VALUES ('751300', 'Servicios para la regulación de la actividad económica (Incluye la administración pública y la regulación de varios sectores económicos; la gestión administrativa de actividades de carácter laboral; la aplicación de políticas de desarrollo regional)'); INSERT INTO sic (code, description) VALUES ('751200', 'Servicios para la regulación de las actividades sanitarias, educativas, culturales, y restantes servicios sociales, excepto seguridad social obligatoria (Incluye la gestión administrativa de programas destinados a mejorar el bienestar de los ciudadanos)'); INSERT INTO sic (code, description) VALUES ('014299', 'Servicios pecuarios n.c.p., excepto los veterinarios '); INSERT INTO sic (code, description) VALUES ('924130', 'Servicios prestados por profesionales y técnicos, para la realización de prácticas deportivas (Incluye la actividad realizada por deportistas, atletas, entrenadores, instructores, jueces árbitros, escuelas de deporte, etc.)'); INSERT INTO sic (code, description) VALUES ('724000', 'Servicios relacionados con bases de datos '); INSERT INTO sic (code, description) VALUES ('742103', 'Servicios relacionados con la electrónica y las comunicaciones '); INSERT INTO sic (code, description) VALUES ('222200', 'Servicios relacionados con la impresión '); INSERT INTO sic (code, description) VALUES ('851900', 'Servicios relacionados con la salud humana n.c.p. '); INSERT INTO sic (code, description) VALUES ('853190', 'Servicios sociales con alojamiento n.c.p. '); INSERT INTO sic (code, description) VALUES ('853200', 'Servicios sociales sin alojamiento '); INSERT INTO sic (code, description) VALUES ('852000', 'Servicios veterinarios '); INSERT INTO sic (code, description) VALUES ('403000', 'Suministro de vapor y agua caliente '); INSERT INTO sic (code, description) VALUES ('502400', 'Tapizado y retapizado '); INSERT INTO sic (code, description) VALUES ('454900', 'Terminación de edificios y obras de ingeniería civil n.c.p. (Incluye trabajos de ornamentación, limpieza exterior de edificios con vapor, chorro de arena u otros métodos, etc.)'); INSERT INTO sic (code, description) VALUES ('454200', 'Terminación y revestimiento de paredes y pisos (Incluye yesería, salpicré, el pulido de pisos y la colocación de revestimientos de cerámicas, de piedra tallada, de suelos flexibles, parqué , baldosas, empapelados, etc.)'); INSERT INTO sic (code, description) VALUES ('182009', 'Terminación y teñido de pieles; fabricación de artículos de piel n.c.p. '); INSERT INTO sic (code, description) VALUES ('154911', 'Tostado, torrado y molienda de café '); INSERT INTO sic (code, description) VALUES ('602190', 'Transporte automotor de cargas n.c.p. (Incluye servicios de transporte de carga refrigerada, automotores, transporte pesado y de mercaderías peligrosas)'); INSERT INTO sic (code, description) VALUES ('401200', 'Transporte de energía eléctrica '); INSERT INTO sic (code, description) VALUES ('289200', 'Tratamiento y revestimiento de metales; obras de ingeniería mecánica en general realizadas a cambio de una retribución o por contrata '); INSERT INTO sic (code, description) VALUES ('513999', 'Venta al por mayor de artículos de uso doméstico y/o personal n.c.p (Incluye artículos de platería excepto los incluidos en talabartería, cuadros y marcos que no sean obra de arte o de colección, sahumerios y artículos de santería, parrillas y hogares, etc.)'); INSERT INTO sic (code, description) VALUES ('514310', 'Venta al por mayor de aberturas (Incluye puertas, ventanas, cortinas de enrollar de PVC, madera, aluminio, puertas corredizas, frentes de placards, etc.)'); INSERT INTO sic (code, description) VALUES ('514931', 'Venta al por mayor de abonos, fertilizantes y plaguicidas '); INSERT INTO sic (code, description) VALUES ('512292', 'Venta al por mayor de alimentos para animales '); INSERT INTO sic (code, description) VALUES ('513540', 'Venta al por mayor de artefactos para el hogar, eléctricos, a gas, kerosene u otros combustibles (Incluye electrodomésticos, cocinas, estufas y salamandras, hornos, etc., excepto equipos de sonido, televisión y video)'); INSERT INTO sic (code, description) VALUES ('513532', 'Venta al por mayor de artículos de bazar y menaje excepto de vidrio '); INSERT INTO sic (code, description) VALUES ('513940', 'Venta al por mayor de artículos de esparcimiento y deportes (Incluye embarcaciones deportivas, armas y municiones, equipos de pesca, piletas de natación de lona o plástico, etc.)'); INSERT INTO sic (code, description) VALUES ('514330', 'Venta al por mayor de artículos de ferretería '); INSERT INTO sic (code, description) VALUES ('513520', 'Venta al por mayor de artículos de iluminación '); INSERT INTO sic (code, description) VALUES ('513223', 'Venta al por mayor de artículos de librería y papelería '); INSERT INTO sic (code, description) VALUES ('514392', 'Venta al por mayor de artículos de loza, cerámica y porcelana de uso en construcción '); INSERT INTO sic (code, description) VALUES ('513149', 'Venta al por mayor de artículos de marroquinería, paraguas y productos similares n.c.p. '); INSERT INTO sic (code, description) VALUES ('513113', 'Venta al por mayor de artículos de mercería (Incluye la venta de puntillas, galones, hombreras, agujas, botones, etc.)'); INSERT INTO sic (code, description) VALUES ('513410', 'Venta al por mayor de artículos de óptica y de fotografía (Incluye venta de lentes de contacto, líquidos oftalmológicos, armazones, cristales ópticos, películas fotográficas, cámaras y accesorios para fotografía, etc.)'); INSERT INTO sic (code, description) VALUES ('514933', 'Venta al por mayor de artículos de plástico '); INSERT INTO sic (code, description) VALUES ('514391', 'Venta al por mayor de artículos de plomería, electricidad, calefacción, obras sanitarias, etc. '); INSERT INTO sic (code, description) VALUES ('513420', 'Venta al por mayor de artículos de relojería, joyería y fantasías '); INSERT INTO sic (code, description) VALUES ('513115', 'Venta al por mayor de tapices y alfombras de materiales textiles '); INSERT INTO sic (code, description) VALUES ('513531', 'Venta al por mayor de artículos de vidrio '); INSERT INTO sic (code, description) VALUES ('512229', 'Venta al por mayor de aves, huevos y productos de granja y de la caza n.c.p. '); INSERT INTO sic (code, description) VALUES ('512319', 'Venta al por mayor de bebidas alcohólicas n.c.p. (Incluye la venta de aperitivos con alcohol, cerveza, sidra, el fraccionamiento de alcohol, etc.)'); INSERT INTO sic (code, description) VALUES ('512312', 'Venta al por mayor de bebidas espiritosas '); INSERT INTO sic (code, description) VALUES ('512320', 'Venta al por mayor de bebidas no alcohólicas (Incluye la venta de aguas, sodas, bebidas refrescantes, jarabes, extractos, concentrados, gaseosas, jugos, etc.)'); INSERT INTO sic (code, description) VALUES ('513930', 'Venta al por mayor de bicicletas y rodados similares (Incluye cochecitos y sillas de paseo para bebés, andadores, triciclos, etc.)'); INSERT INTO sic (code, description) VALUES ('512273', 'Venta al por mayor de café, té, yerba mate y otras infusiones y especias y condimentos (Incluye la venta de sal, etc.)'); INSERT INTO sic (code, description) VALUES ('513130', 'Venta al por mayor de calzado excepto el ortopédico (Incluye venta de calzado de cuero, tela, plástico, goma, etc.)'); INSERT INTO sic (code, description) VALUES ('512221', 'Venta al por mayor de carnes y derivados excepto las de aves. '); INSERT INTO sic (code, description) VALUES ('514932', 'Venta al por mayor de caucho y productos de caucho excepto calzado y autopartes '); INSERT INTO sic (code, description) VALUES ('512111', 'Venta al por mayor de cereales (incluye arroz), oleaginosas y forrajeras excepto semillas '); INSERT INTO sic (code, description) VALUES ('512260', 'Venta al por mayor de chocolates, golosinas y productos para kioscos y polirrubros n.c.p., excepto cigarrillos '); INSERT INTO sic (code, description) VALUES ('512400', 'Venta al por mayor de cigarrillos y productos de tabaco '); INSERT INTO sic (code, description) VALUES ('514110', 'Venta al por mayor de combustibles y lubricantes para automotores '); INSERT INTO sic (code, description) VALUES ('514199', 'Venta al por mayor de combustibles y lubricantes, excepto para automotores, leña y carbón '); INSERT INTO sic (code, description) VALUES ('513212', 'Venta al por mayor de diarios y revistas '); INSERT INTO sic (code, description) VALUES ('513222', 'Venta al por mayor de envases de papel y cartón '); INSERT INTO sic (code, description) VALUES ('515910', 'Venta al por mayor de equipo profesional y científico e instrumentos de medida y de control '); INSERT INTO sic (code, description) VALUES ('513552', 'Venta al por mayor de equipos de sonido, radio y televisión, comunicaciones y sus componentes, repuestos y accesorios '); INSERT INTO sic (code, description) VALUES ('515921', 'Venta al por mayor de equipos informáticos y máquinas electrónicas de escribir y calcular (Incluye la venta de computadoras incluso las portátiles y sus periféricos, impresoras, suministros para computación, software, máquinas de escribir y calcular electrónicas, incluso las de bolsillo, cajas registradoras y de contabilidad electrónicas, etc.)'); INSERT INTO sic (code, description) VALUES ('512212', 'Venta al por mayor de fiambres y quesos '); INSERT INTO sic (code, description) VALUES ('513111', 'Venta al por mayor de productos textiles excepto telas, tejidos, prendas y accesorios de vestir (Incluye fibras vegetales, animales, minerales y manufacturadas)'); INSERT INTO sic (code, description) VALUES ('513991', 'Venta al por mayor de flores y plantas naturales y artificiales '); INSERT INTO sic (code, description) VALUES ('513330', 'Venta al por mayor de instrumental médico y odontológico y artículos ortopédicos (Incluye venta de vaporizadores, nebulizadores, masajeadores, termómetros, prótesis, muletas, plantillas, calzado ortopédico y otros artículos similares de uso personal o doméstico)'); INSERT INTO sic (code, description) VALUES ('513551', 'Venta al por mayor de instrumentos musicales, discos y casetes de audio y video, etc. '); INSERT INTO sic (code, description) VALUES ('513920', 'Venta al por mayor de juguetes (Incluye artículos de cotillón)'); INSERT INTO sic (code, description) VALUES ('514399', 'Venta al por mayor de ladrillos, cemento, cal, arena, piedra, mármol y materiales para la construcción n.c.p. '); INSERT INTO sic (code, description) VALUES ('513211', 'Venta al por mayor de libros y publicaciones '); INSERT INTO sic (code, description) VALUES ('513114', 'Venta al por mayor de mantelería, ropa de cama y artículos textiles para el hogar '); INSERT INTO sic (code, description) VALUES ('515200', 'Venta al por mayor de máquinas - herramienta de uso general '); INSERT INTO sic (code, description) VALUES ('515922', 'Venta al por mayor de máquinas y equipos de comunicaciones, control y seguridad (Incluye venta de productos de telefonía, equipos de circuito cerrado, sistemas de alarmas y sirenas contra incendios, robos y otros sistemas de seguridad, equipos de facsímil, etc.)'); INSERT INTO sic (code, description) VALUES ('515990', 'Venta al por mayor de máquinas, equipo y materiales conexos n.c.p. (Incluye máquinas registradoras de escribir y de calcular mecánicas, equipos para destruir documentos, etc.)'); INSERT INTO sic (code, description) VALUES ('515140', 'Venta al por mayor de máquinas, equipos e implementos de uso en imprentas, artes gráficas y actividades conexas (Incluye venta de máquinas fotocopiadoras - excepto las de uso personal- copiadoras de planos, máquinas para imprimir, guillotinar, troquelar, encuadernar, etc.)'); INSERT INTO sic (code, description) VALUES ('515120', 'Venta al por mayor de máquinas, equipos e implementos de uso en la elaboración de alimentos, bebidas y tabacos (Incluye máquinas para moler, picar y cocer alimentos, fabricadora de pastas, bateas, enfriadoras y envasadoras de bebidas, etc.)'); INSERT INTO sic (code, description) VALUES ('515130', 'Venta al por mayor de máquinas, equipos e implementos de uso en la fabricación de textiles, prendas y accesorios de vestir, calzado, artículos de cuero y marroquin (Incluye venta de máquinas de coser, de cortar tejidos, de tejer, extender telas, robots de corte y otros equipos dirigidos por computadora para la industria textil y confeccionista, etc.)'); INSERT INTO sic (code, description) VALUES ('515160', 'Venta al por mayor de máquinas, equipos e implementos de uso en la industria del plástico y del caucho (Incluye sopladora de envases, laminadora de plásticos, máquinas extrusoras y moldeadoras, etc.)'); INSERT INTO sic (code, description) VALUES ('515110', 'Venta al por mayor de máquinas, equipos e implementos de uso en los sectores agropecuario, jardinería, silvicultura, pesca y caza (Incluye venta de tractores, cosechadoras, enfardadoras, remolques de carga y descarga automática, motosierras, cortadoras de césped autopropulsadas, etc.)'); INSERT INTO sic (code, description) VALUES ('515190', 'Venta al por mayor de máquinas, equipos e implementos de uso especial n.c.p. (Incluye motoniveladoras, excavadoras, palas mecánicas, perforadoras-percutoras, etc.)'); INSERT INTO sic (code, description) VALUES ('515150', 'Venta al por mayor de máquinas, equipos e implementos de uso médico y paramédico (Incluye venta de equipos de diagnóstico y tratamiento, camillas, cajas de cirugía, jeringas y otros implementos de material descartable, etc.)'); INSERT INTO sic (code, description) VALUES ('513910', 'Venta al por mayor de materiales y productos de limpieza '); INSERT INTO sic (code, description) VALUES ('512119', 'Venta al por mayor de materias primas agrícolas y de la silvicultura n.c.p. (Incluye el acopio y venta al por mayor de frutas, flores y plantas, etc.)'); INSERT INTO sic (code, description) VALUES ('512129', 'Venta al por mayor de materias primas pecuarias incluso animales vivos n.c.p. '); INSERT INTO sic (code, description) VALUES ('513122', 'Venta al por mayor de medias y prendas de punto '); INSERT INTO sic (code, description) VALUES ('519000', 'Venta al por mayor de mercancías n.c.p. '); INSERT INTO sic (code, description) VALUES ('514200', 'Venta al por mayor de metales y minerales metalíferos '); INSERT INTO sic (code, description) VALUES ('515420', 'Venta al por mayor de muebles e instalaciones para la industria, el comercio y los servicios n.c.p. '); INSERT INTO sic (code, description) VALUES ('515410', 'Venta al por mayor de muebles e instalaciones para oficinas '); INSERT INTO sic (code, description) VALUES ('513511', 'Venta al por mayor de muebles metálicos excepto de oficina '); INSERT INTO sic (code, description) VALUES ('513519', 'Venta al por mayor de muebles n.c.p. excepto de oficina; artículos de mimbre y corcho; colchones y somieres '); INSERT INTO sic (code, description) VALUES ('512250', 'Venta al por mayor de pan, productos de confitería y pastas frescas '); INSERT INTO sic (code, description) VALUES ('513221', 'Venta al por mayor de papel y productos de papel y cartón excepto envases '); INSERT INTO sic (code, description) VALUES ('513950', 'Venta al por mayor de papeles para pared, revestimiento para pisos de goma, plástico y textiles, y artículos similares para la decoración '); INSERT INTO sic (code, description) VALUES ('503100', 'Venta al por mayor de partes, piezas y accesorios de vehículos automotores '); INSERT INTO sic (code, description) VALUES ('512230', 'Venta al por mayor de pescado '); INSERT INTO sic (code, description) VALUES ('513141', 'Venta al por mayor de pieles y cueros curtidos y salados '); INSERT INTO sic (code, description) VALUES ('514340', 'Venta al por mayor de pinturas y productos conexos '); INSERT INTO sic (code, description) VALUES ('513121', 'Venta al por mayor de prendas de vestir de cuero '); INSERT INTO sic (code, description) VALUES ('513129', 'Venta al por mayor de prendas de vestir n.c.p. '); INSERT INTO sic (code, description) VALUES ('512299', 'Venta al por mayor de productos alimenticios n.c.p. (Incluye la venta de miel y derivados, productos congelados, etc.)'); INSERT INTO sic (code, description) VALUES ('513320', 'Venta al por mayor de productos cosméticos, de tocador y de perfumería '); INSERT INTO sic (code, description) VALUES ('514320', 'Venta al por mayor de productos de madera excepto muebles (Incluye placas, varillas, parqué, machimbre, etc.)'); INSERT INTO sic (code, description) VALUES ('513992', 'Venta al por mayor de productos en general en almacenes y supermercados mayoristas, con predominio de alimentos y bebidas '); INSERT INTO sic (code, description) VALUES ('513310', 'Venta al por mayor de productos farmacéuticos y veterinarios (Incluye venta de medicamentos y kits de diagnóstico como test de embarazo, hemoglucotest, vacunas, etc.)'); INSERT INTO sic (code, description) VALUES ('514920', 'Venta al por mayor de productos intermedios n.c.p., desperdicios y desechos de papel y cartón '); INSERT INTO sic (code, description) VALUES ('514940', 'Venta al por mayor de productos intermedios n.c.p., desperdicios y desechos metálicos (Incluye chatarra, viruta de metales diversos, etc.)'); INSERT INTO sic (code, description) VALUES ('514910', 'Venta al por mayor de productos intermedios n.c.p., desperdicios y desechos textiles '); INSERT INTO sic (code, description) VALUES ('514990', 'Venta al por mayor de productos intermedios, desperdicios y desechos n.c.p. (Incluye venta al por mayor de petróleo, minerales no metalíferos, etc.)'); INSERT INTO sic (code, description) VALUES ('512211', 'Venta al por mayor de productos lácteos '); INSERT INTO sic (code, description) VALUES ('512112', 'Venta al por mayor de semillas '); INSERT INTO sic (code, description) VALUES ('513142', 'Venta al por mayor de suelas y afines (Incluye talabarterías, artículos regionales de cuero, almacenes de suelas, etc.)'); INSERT INTO sic (code, description) VALUES ('513112', 'Venta al por mayor de tejidos (telas) '); INSERT INTO sic (code, description) VALUES ('515300', 'Venta al por mayor de vehículos, equipos y máquinas para el transporte ferroviario, aéreo y de navegación '); INSERT INTO sic (code, description) VALUES ('514350', 'Venta al por mayor de vidrios planos y templados '); INSERT INTO sic (code, description) VALUES ('512311', 'Venta al por mayor de vino '); INSERT INTO sic (code, description) VALUES ('511930', 'Venta al por mayor en comisión o consignación de madera y materiales para la construcción '); INSERT INTO sic (code, description) VALUES ('511960', 'Venta al por mayor en comisión o consignación de maquinaria, equipo profesional industrial y comercial, embarcaciones y aeronaves '); INSERT INTO sic (code, description) VALUES ('511990', 'Venta al por mayor en comisión o consignación de mercaderías n.c.p. (Incluye galerías de arte)'); INSERT INTO sic (code, description) VALUES ('511919', 'Venta al por mayor en comisión o consignación de alimentos, bebidas y tabaco n.c.p. '); INSERT INTO sic (code, description) VALUES ('511111', 'Venta al por mayor en comisión o consignación de cereales (incluye arroz), oleaginosas y forrajeras excepto semillas '); INSERT INTO sic (code, description) VALUES ('511940', 'Venta al por mayor en comisión o consignación de energía eléctrica, gas y combustibles '); INSERT INTO sic (code, description) VALUES ('511950', 'Venta al por mayor en comisión o consignación de minerales, metales y productos químicos industriales '); INSERT INTO sic (code, description) VALUES ('511970', 'Venta al por mayor en comisión o consignación de papel, cartón, libros, revistas, diarios, materiales de embalaje y artículos de librería '); INSERT INTO sic (code, description) VALUES ('511119', 'Venta al por mayor en comisión o consignación de productos agrícolas n.c.p. '); INSERT INTO sic (code, description) VALUES ('511920', 'Venta al por mayor en comisión o consignación de productos textiles, prendas de vestir, calzado excepto el ortopédico, artículos de marroquinería, paraguas y simi '); INSERT INTO sic (code, description) VALUES ('511112', 'Venta al por mayor en comisión o consignación de semillas '); INSERT INTO sic (code, description) VALUES ('512240', 'Venta al por mayor y empaque de frutas, de legumbres y hortalizas frescas (Incluye la conservación en cámaras frigoríficas por parte de los empaquetadores)'); INSERT INTO sic (code, description) VALUES ('523610', 'Venta al por menor de aberturas (Incluye puertas, ventanas, cortinas de enrollar de PVC, madera, aluminio, puertas corredizas, frentes de placards, etc.)'); INSERT INTO sic (code, description) VALUES ('524910', 'Venta al por menor de antigüedades (Incluye venta de antigüedades en remates)'); INSERT INTO sic (code, description) VALUES ('523942', 'Venta al por menor de armas y artículos de cuchillería, artículos para la caza y pesca '); INSERT INTO sic (code, description) VALUES ('523550', 'Venta al por menor de artefactos para el hogar, eléctricos, a gas, a kerosene u otros combustibles (Incluye electrodomésticos -excepto equipos de sonido-, televisión y video, cocinas, estufas, hornos, etc.)'); INSERT INTO sic (code, description) VALUES ('523540', 'Venta al por menor de artículos de bazar y menaje '); INSERT INTO sic (code, description) VALUES ('523991', 'Venta al por menor de artículos de caucho excepto cámaras y cubiertas '); INSERT INTO sic (code, description) VALUES ('523994', 'Venta al por menor de artículos de colección y objetos de arte '); INSERT INTO sic (code, description) VALUES ('523941', 'Venta al por menor de artículos de deporte, equipos e indumentaria deportiva '); INSERT INTO sic (code, description) VALUES ('523630', 'Venta al por menor de artículos de ferretería '); INSERT INTO sic (code, description) VALUES ('523530', 'Venta al por menor de artículos de iluminación '); INSERT INTO sic (code, description) VALUES ('523490', 'Venta al por menor de artículos de marroquinería, paraguas y similares n.c.p. '); INSERT INTO sic (code, description) VALUES ('523710', 'Venta al por menor de artículos de óptica y fotografía '); INSERT INTO sic (code, description) VALUES ('523720', 'Venta al por menor de artículos de relojería, joyería y fantasía '); INSERT INTO sic (code, description) VALUES ('523999', 'Venta al por menor de artículos nuevos n.c.p. (Incluye casas de regalos, de artesanías y artículos regionales excepto de talabartería, de artículos religiosos, de monedas y sellos, etc.)'); INSERT INTO sic (code, description) VALUES ('523590', 'Venta al por menor de artículos para el hogar n.c.p. '); INSERT INTO sic (code, description) VALUES ('523650', 'Venta al por menor de artículos para plomería e instalación de gas '); INSERT INTO sic (code, description) VALUES ('523410', 'Venta al por menor de artículos regionales y de talabartería (Incluye venta de artículos de talabartería y regionales de cuero, plata, alpaca y similares)'); INSERT INTO sic (code, description) VALUES ('523290', 'Venta al por menor de artículos textiles n.c.p. excepto prendas de vestir (Incluye la venta al por menor de tapices, alfombras, etc.)'); INSERT INTO sic (code, description) VALUES ('524990', 'Venta al por menor de artículos usados n.c.p. excluidos automotores y motocicletas '); INSERT INTO sic (code, description) VALUES ('503220', 'Venta al por menor de baterías '); INSERT INTO sic (code, description) VALUES ('522500', 'Venta al por menor de bebidas '); INSERT INTO sic (code, description) VALUES ('522420', 'Venta al por menor de bombones, golosinas y demás productos de confitería '); INSERT INTO sic (code, description) VALUES ('523420', 'Venta al por menor de calzado excepto el ortopédico '); INSERT INTO sic (code, description) VALUES ('503210', 'Venta al por menor de cámaras y cubiertas '); INSERT INTO sic (code, description) VALUES ('522210', 'Venta al por menor de carnes rojas, menudencias y chacinados frescos '); INSERT INTO sic (code, description) VALUES ('523520', 'Venta al por menor de colchones y somieres '); INSERT INTO sic (code, description) VALUES ('505000', 'Venta al por menor de combustible para vehículos automotores y motocicletas (Incluye estaciones de servicios y la venta al por menor de productos lubricantes y refrigerantes para automotores y motocicletas)'); INSERT INTO sic (code, description) VALUES ('523220', 'Venta al por menor de confecciones para el hogar (Incluye la venta al por menor de sábanas, toallas, mantelería, cortinas confeccionadas, colchas, cubrecamas, etc.)'); INSERT INTO sic (code, description) VALUES ('523660', 'Venta al por menor de cristales, espejos, mamparas y cerramientos '); INSERT INTO sic (code, description) VALUES ('523820', 'Venta al por menor de diarios y revistas '); INSERT INTO sic (code, description) VALUES ('523993', 'Venta al por menor de equipo profesional y científico e instrumentos de medida y de control '); INSERT INTO sic (code, description) VALUES ('522112', 'Venta al por menor de fiambres y embutidos '); INSERT INTO sic (code, description) VALUES ('523911', 'Venta al por menor de flores y plantas naturales y artificiales '); INSERT INTO sic (code, description) VALUES ('522300', 'Venta al por menor de frutas, legumbres y hortalizas frescas '); INSERT INTO sic (code, description) VALUES ('523960', 'Venta al por menor de fuel oil, gas en garrafas, carbón y leña (No incluye las estaciones de servicios que se clasifican en 505000)'); INSERT INTO sic (code, description) VALUES ('523210', 'Venta al por menor de hilados, tejidos y artículos de mercería (Incluye mercerías, sederías, comercios de venta de lanas y otros hilados, etc.)'); INSERT INTO sic (code, description) VALUES ('522220', 'Venta al por menor de huevos, carne de aves y productos de granja y de la caza n.c.p. '); INSERT INTO sic (code, description) VALUES ('523320', 'Venta al por menor de indumentaria de trabajo, uniformes y guardapolvos '); INSERT INTO sic (code, description) VALUES ('523330', 'Venta al por menor de indumentaria para bebés y niños '); INSERT INTO sic (code, description) VALUES ('523130', 'Venta al por menor de instrumental médico y odontológico y artículos ortopédicos (Incluye venta de vaporizadores, nebulizadores, masajeadores, termómetros, prótesis, muletas, plantillas, calzado ortopédico y otros artículos similares de uso personal o doméstico)'); INSERT INTO sic (code, description) VALUES ('523560', 'Venta al por menor de instrumentos musicales, equipos de sonido, casetes de audio y video, discos de audio y video '); INSERT INTO sic (code, description) VALUES ('523930', 'Venta al por menor de juguetes y artículos de cotillón '); INSERT INTO sic (code, description) VALUES ('523810', 'Venta al por menor de libros y publicaciones '); INSERT INTO sic (code, description) VALUES ('524200', 'Venta al por menor de libros, revistas y similares usados '); INSERT INTO sic (code, description) VALUES ('523620', 'Venta al por menor de maderas y artículos de madera y corcho excepto muebles '); INSERT INTO sic (code, description) VALUES ('523950', 'Venta al por menor de máquinas y equipos para oficina y sus componentes y repuestos '); INSERT INTO sic (code, description) VALUES ('523992', 'Venta al por menor de máquinas y motores y sus repuestos '); INSERT INTO sic (code, description) VALUES ('523690', 'Venta al por menor de materiales de construcción n.c.p. '); INSERT INTO sic (code, description) VALUES ('523920', 'Venta al por menor de materiales y productos de limpieza '); INSERT INTO sic (code, description) VALUES ('523510', 'Venta al por menor de muebles excepto de oficina, la industria, el comercio y los servicios; artículos de mimbre y corcho '); INSERT INTO sic (code, description) VALUES ('524100', 'Venta al por menor de muebles usados '); INSERT INTO sic (code, description) VALUES ('522410', 'Venta al por menor de pan y productos de panadería '); INSERT INTO sic (code, description) VALUES ('523830', 'Venta al por menor de papel, cartón, materiales de embalaje y artículos de librería '); INSERT INTO sic (code, description) VALUES ('523670', 'Venta al por menor de papeles para pared, revestimientos para pisos y artículos similares para la decoración '); INSERT INTO sic (code, description) VALUES ('503290', 'Venta al por menor de partes, piezas y accesorios excepto cámaras, cubiertas y baterías '); INSERT INTO sic (code, description) VALUES ('522910', 'Venta al por menor de pescados y productos de la pesca '); INSERT INTO sic (code, description) VALUES ('523640', 'Venta al por menor de pinturas y productos conexos '); INSERT INTO sic (code, description) VALUES ('523391', 'Venta al por menor de prendas de vestir de cuero y sucedáneos excepto calzado '); INSERT INTO sic (code, description) VALUES ('523399', 'Venta al por menor de prendas y accesorios de vestir n.c.p. excepto calzado, artículos de marroquinería, paraguas y similares '); INSERT INTO sic (code, description) VALUES ('522999', 'Venta al por menor de productos alimentarios n.c.p., en comercios especializados '); INSERT INTO sic (code, description) VALUES ('523120', 'Venta al por menor de productos cosméticos, de tocador y de perfumería '); INSERT INTO sic (code, description) VALUES ('522120', 'Venta al por menor de productos de almacén y dietética '); INSERT INTO sic (code, description) VALUES ('523110', 'Venta al por menor de productos farmacéuticos y de herboristería '); INSERT INTO sic (code, description) VALUES ('522111', 'Venta al por menor de productos lácteos '); INSERT INTO sic (code, description) VALUES ('523970', 'Venta al por menor de productos veterinarios y animales domésticos '); INSERT INTO sic (code, description) VALUES ('523310', 'Venta al por menor de ropa interior, medias, prendas para dormir y para la playa (Incluye corsetería, lencería, camisetas, medias excepto ortopédicas, pijamas, camisones y saltos de cama, salidas de baño, trajes de baño, etc.)'); INSERT INTO sic (code, description) VALUES ('523912', 'Venta al por menor de semillas, abonos, fertilizantes y otros productos de vivero '); INSERT INTO sic (code, description) VALUES ('522991', 'Venta al por menor de tabaco y sus productos '); INSERT INTO sic (code, description) VALUES ('521110', 'Venta al por menor en hipermercados con predominio de productos alimentarios y bebidas '); INSERT INTO sic (code, description) VALUES ('521190', 'Venta al por menor en kioscos, polirrubros y comercios no especializados n.c.p. '); INSERT INTO sic (code, description) VALUES ('521130', 'Venta al por menor en minimercados con predominio de productos alimentarios y bebidas '); INSERT INTO sic (code, description) VALUES ('525200', 'Venta al por menor en puestos móviles '); INSERT INTO sic (code, description) VALUES ('521120', 'Venta al por menor en supermercados con predominio de productos alimentarios y bebidas '); INSERT INTO sic (code, description) VALUES ('521200', 'Venta al por menor excepto la especializada, sin predominio de productos alimentarios y bebidas '); INSERT INTO sic (code, description) VALUES ('525900', 'Venta al por menor no realizada en establecimientos n.c.p. (Incluye venta mediante máquinas expendedoras, vendedores ambulantes y vendedores a domicilio)'); INSERT INTO sic (code, description) VALUES ('525100', 'Venta al por menor por correo, televisión, internet y otros medios de comunicación '); INSERT INTO sic (code, description) VALUES ('512272', 'Venta al por mayor de aceites y grasas '); INSERT INTO sic (code, description) VALUES ('501210', 'Venta de autos, camionetas y utilitarios, usados (Incluye taxis, jeeps, 4x4 y vehículos similares)'); INSERT INTO sic (code, description) VALUES ('501110', 'Venta de autos, camionetas y utilitarios, nuevos (Incluye taxis, jeeps, 4x4 y vehículos similares)'); INSERT INTO sic (code, description) VALUES ('512271', 'Venta al por mayor de azúcar '); INSERT INTO sic (code, description) VALUES ('512291', 'Venta al por mayor de frutas, legumbres y cereales secos y en conserva '); INSERT INTO sic (code, description) VALUES ('512121', 'Venta al por mayor de lanas, cueros en bruto y productos afines '); INSERT INTO sic (code, description) VALUES ('504010', 'Venta de motocicletas y de sus partes, piezas y accesorios '); INSERT INTO sic (code, description) VALUES ('512279', 'Venta al por mayor de productos y subproductos de molinería n.c.p. '); INSERT INTO sic (code, description) VALUES ('501290', 'Venta de vehículos automotores, usados n.c.p. (Incluye, casas rodantes, trailers, camiones, remolques, ambulancias, ómnibus, microbuses y similares, cabezas tractoras, etc..)'); INSERT INTO sic (code, description) VALUES ('501190', 'Venta de vehículos automotores, nuevos n.c.p. (Incluye casas rodantes, trailers, camiones, remolques, ambulancias, ómnibus, microbuses y similares, cabezas tractoras, etc.)'); commit; ledgersmb/sql/coa/ar/chart/0000755000000000000000000000000012060044550014560 5ustar rootrootledgersmb/sql/coa/ar/chart/General.sql0000755000000000000000000004656311730273023016701 0ustar rootrootbegin; -- Plan de Cuenta para SRL Argentina -- Sumario SELECT account_heading_save(NULL, '0.','SUMARIO',NULL); SELECT account_save(NULL, '0.01','A Cobrar','A','', (SELECT id FROM account WHERE accno LIKE '0.'), false, false, string_to_array('AR', ':')); SELECT account_save(NULL, '0.02','A Pagar','A','', (SELECT id FROM account WHERE accno LIKE '0.'), false, false, string_to_array('AP', ':')); SELECT account_save(NULL, '0.03','Inventario','A','', (SELECT id FROM account WHERE accno LIKE '0.'), false, false, string_to_array('IC', ':')); -- Activo SELECT account_heading_save(NULL, '1.','ACTIVO',NULL); SELECT account_heading_save(NULL, '1.1.','CORRIENTE',(SELECT id FROM account_heading WHERE accno LIKE '1.')); SELECT account_heading_save(NULL, '1.1.1.','CAJAS - BANCOS',(SELECT id FROM account_heading WHERE accno LIKE '1.1.')); SELECT account_save(NULL, '1.1.1.01','Caja Chica Suc1','A','', (SELECT id FROM account WHERE accno LIKE '1.1.1.'), false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL, '1.1.1.02','Caja Chica Suc2','A','', (SELECT id FROM account WHERE accno LIKE '1.1.1.'), false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL, '1.1.1.10','Tesoreria','A','', (SELECT id FROM account WHERE accno LIKE '1.1.1.'), false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL, '1.1.1.20','Caja Ahorro Banco1','A','', (SELECT id FROM account WHERE accno LIKE '1.1.1.'), false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL, '1.1.1.21','Caja Ahorro Banco2','A','', (SELECT id FROM account WHERE accno LIKE '1.1.1.'), false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL, '1.1.1.30','Cuenta Corriente Banco1','A','', (SELECT id FROM account WHERE accno LIKE '1.1.1.'), false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL, '1.1.1.31','Cuenta Corriente Banco2','A','', (SELECT id FROM account WHERE accno LIKE '1.1.1.'), false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_heading_save(NULL, '1.1.2.','CREDITO A CLIENTES',(SELECT id FROM account_heading WHERE accno LIKE '1.1.')); SELECT account_save(NULL, '1.1.2.01','Cliente1','A','', (SELECT id FROM account WHERE accno LIKE '1.1.2.'), false, false, string_to_array('AR_overpayment:AR_amount', ':')); SELECT account_save(NULL, '1.1.2.02','Cliente2','A','', (SELECT id FROM account WHERE accno LIKE '1.1.2.'), false, false, string_to_array('AR_overpayment:AR_amount', ':')); SELECT account_save(NULL, '1.1.2.03','Cliente3','A','', (SELECT id FROM account WHERE accno LIKE '1.1.2.'), false, false, string_to_array('AR_overpayment:AR_amount', ':')); SELECT account_save(NULL, '1.1.2.04','Cliente4','A','', (SELECT id FROM account WHERE accno LIKE '1.1.2.'), false, false, string_to_array('AR_overpayment:AR_amount', ':')); SELECT account_heading_save(NULL, '1.1.3.','RIESGO DE CREDITO',(SELECT id FROM account_heading WHERE accno LIKE '1.1.')); SELECT account_save(NULL, '1.1.3.01','Incobrables','A','', (SELECT id FROM account WHERE accno LIKE '1.1.3.'), false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '1.1.4.','OTROS A COBRAR ',(SELECT id FROM account_heading WHERE accno LIKE '1.1.')); SELECT account_save(NULL, '1.1.4.01','Anticipos a empleados','A','', (SELECT id FROM account WHERE accno LIKE '1.1.4.'), false, false, string_to_array('', ':')); SELECT account_save(NULL, '1.1.4.02','Anticipos a proveedores','A','', (SELECT id FROM account WHERE accno LIKE '1.1.4.'), false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '1.1.5.','IMPUESTOS A FAVOR',(SELECT id FROM account_heading WHERE accno LIKE '1.1.')); SELECT account_save(NULL, '1.1.5.01','IVA','A','', (SELECT id FROM account WHERE accno LIKE '1.1.5.'), false, true, string_to_array('AP_tax', ':')); SELECT account_heading_save(NULL, '1.1.6.','INVENTARIO',(SELECT id FROM account_heading WHERE accno LIKE '1.1.')); SELECT account_save(NULL, '1.1.6.01','Articulos','A','', (SELECT id FROM account WHERE accno LIKE '1.1.6.'), false, false, string_to_array('IC_sale:AR_amount', ':')); SELECT account_save(NULL, '1.1.6.02','Manufacturas','A','', (SELECT id FROM account WHERE accno LIKE '1.1.6.'), false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '1.2.','FIJO',(SELECT id FROM account_heading WHERE accno LIKE '1.')); SELECT account_heading_save(NULL, '1.2.1.','PROPIEDADES INMOBILIARIAS',(SELECT id FROM account_heading WHERE accno LIKE '1.2.')); SELECT account_save(NULL, '1.2.1.01','Oficina Comercial','A','', (SELECT id FROM account WHERE accno LIKE '1.2.1.'), false, false, string_to_array('Fixed_Asset', ':')); SELECT account_heading_save(NULL, '1.2.2.','FLOTA DE VEHICULOS',(SELECT id FROM account_heading WHERE accno LIKE '1.2.')); SELECT account_save(NULL, '1.2.2.01','Camion','A','', (SELECT id FROM account WHERE accno LIKE '1.2.2.'), false, false, string_to_array('Fixed_Asset', ':')); SELECT account_save(NULL, '1.2.2.02','Camioneta','A','', (SELECT id FROM account WHERE accno LIKE '1.2.2.'), false, false, string_to_array('Fixed_Asset', ':')); SELECT account_save(NULL, '1.2.2.03','Auto','A','', (SELECT id FROM account WHERE accno LIKE '1.2.2.'), false, false, string_to_array('Fixed_Asset', ':')); SELECT account_save(NULL, '1.2.2.04','Moto','A','', (SELECT id FROM account WHERE accno LIKE '1.2.2.'), false, false, string_to_array('Fixed_Asset', ':')); SELECT account_heading_save(NULL, '1.2.3.','MAQUINARIA Y MUEBLES',(SELECT id FROM account_heading WHERE accno LIKE '1.2.')); SELECT account_save(NULL, '1.2.3.01','Herramientas','A','', (SELECT id FROM account WHERE accno LIKE '1.2.3.'), false, false, string_to_array('Fixed_Asset', ':')); SELECT account_save(NULL, '1.2.3.02','Muebles Oficina','A','', (SELECT id FROM account WHERE accno LIKE '1.2.3.'), false, false, string_to_array('Fixed_Asset', ':')); SELECT account_heading_save(NULL, '1.2.4.','DEPRECIACION ACUMULADA',(SELECT id FROM account_heading WHERE accno LIKE '1.2.')); SELECT account_save(NULL, '1.2.4.01','(-)Vehiculos','A','', (SELECT id FROM account WHERE accno LIKE '1.2.4.'), false, false, string_to_array('Asset_Dep', ':')); SELECT account_save(NULL, '1.2.4.02','(-)Herramientas','A','', (SELECT id FROM account WHERE accno LIKE '1.2.4.'), false, false, string_to_array('Asset_Dep', ':')); SELECT account_save(NULL, '1.2.4.03','(-)Muebles Oficina','A','', (SELECT id FROM account WHERE accno LIKE '1.2.4.'), false, false, string_to_array('Asset_Dep', ':')); SELECT account_heading_save(NULL, '1.3.','OTROS ACTIVOS',(SELECT id FROM account_heading WHERE accno LIKE '1.')); SELECT account_heading_save(NULL, '1.3.1.','PROMOCION',(SELECT id FROM account_heading WHERE accno LIKE '1.3.')); SELECT account_save(NULL, '1.3.1.01','Folleteria','A','', (SELECT id FROM account WHERE accno LIKE '1.3.1.'), false, false, string_to_array('', ':')); SELECT account_save(NULL, '1.3.1.02','Anuncios','A','', (SELECT id FROM account WHERE accno LIKE '1.3.1.'), false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '1.3.2.','INVESTIGACION',(SELECT id FROM account_heading WHERE accno LIKE '1.3.')); SELECT account_save(NULL, '1.3.2.01','Mercadeo','A','', (SELECT id FROM account WHERE accno LIKE '1.3.2.'), false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '1.3.3.','DEPOSITOS EN GARANTIA',(SELECT id FROM account_heading WHERE accno LIKE '1.3.')); SELECT account_save(NULL, '1.3.3.01','Alquiler de propiedades','A','', (SELECT id FROM account WHERE accno LIKE '1.3.3.'), false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '1.3.4.','AMORTIZACION ACUMULADA',(SELECT id FROM account_heading WHERE accno LIKE '1.3.')); SELECT account_save(NULL, '1.3.4.01','(-)Amortizacion','A','', (SELECT id FROM account WHERE accno LIKE '1.3.4.'), false, false, string_to_array('', ':')); -- Pasivo SELECT account_heading_save(NULL, '2.','PASIVO',NULL); SELECT account_heading_save(NULL, '2.1.','CORRIENTE',(SELECT id FROM account_heading WHERE accno LIKE '2.')); SELECT account_heading_save(NULL, '2.1.1.','CUENTAS POR PAGAR',(SELECT id FROM account_heading WHERE accno LIKE '2.1.')); SELECT account_save(NULL, '2.1.1.01','Proveedores','L','', (SELECT id FROM account WHERE accno LIKE '2.1.1.'), false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL, '2.1.1.02','Sueldos','L','', (SELECT id FROM account WHERE accno LIKE '2.1.1.'), false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL, '2.1.1.03','Servicios','L','', (SELECT id FROM account WHERE accno LIKE '2.1.1.'), false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL, '2.1.2.','IMPUESTOS',(SELECT id FROM account_heading WHERE accno LIKE '2.1.')); SELECT account_save(NULL, '2.1.2.01','Ganancias (9% - 35%)','L','', (SELECT id FROM account WHERE accno LIKE '2.1.2.'), false, true, string_to_array('IC_taxservice:IC_taxpart:AR_tax', ':')); SELECT account_save(NULL, '2.1.2.02','Bienes Personales (0,5% - 1,25%)','L','', (SELECT id FROM account WHERE accno LIKE '2.1.2.'), false, true, string_to_array('IC_taxservice:IC_taxpart:AR_tax', ':')); SELECT account_save(NULL, '2.1.2.03','Ganancia Mi­nima Presunta (1%)','L','', (SELECT id FROM account WHERE accno LIKE '2.1.2.'), false, true, string_to_array('IC_taxservice:IC_taxpart:AR_tax', ':')); SELECT account_save(NULL, '2.1.2.04','Valor Agregado (IVA 10,5% - 27%)','L','', (SELECT id FROM account WHERE accno LIKE '2.1.2.'), false, true, string_to_array('IC_taxservice:IC_taxpart:AR_tax', ':')); SELECT account_heading_save(NULL, '2.2.','LARGO PLAZO',(SELECT id FROM account_heading WHERE accno LIKE '2.')); SELECT account_heading_save(NULL, '2.2.1.','CREDITOS',(SELECT id FROM account_heading WHERE accno LIKE '2.2.')); SELECT account_save(NULL, '2.2.1.01','Hipotecario Banco Nacion','L','', (SELECT id FROM account WHERE accno LIKE '2.2.1.'), false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL, '2.2.2.','OTROS PASIVOS',(SELECT id FROM account_heading WHERE accno LIKE '2.2.')); -- Patrimonio SELECT account_heading_save(NULL, '3.','PATRIMONIO',NULL); SELECT account_heading_save(NULL, '3.1.','PATRIMONIO NETO',(SELECT id FROM account_heading WHERE accno LIKE '3.')); SELECT account_heading_save(NULL, '3.1.1.','CAPITAL SUSCRITO',(SELECT id FROM account_heading WHERE accno LIKE '3.1.')); SELECT account_save(NULL, '3.1.1.01','Capital Social','Q','', (SELECT id FROM account WHERE accno LIKE '3.1.1.'), false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '3.1.2.','RESERVAS',(SELECT id FROM account_heading WHERE accno LIKE '3.1.')); SELECT account_save(NULL, '3.1.2.01','Reserva Legal','Q','', (SELECT id FROM account WHERE accno LIKE '3.1.2.'), false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '3.1.3.','UTILIDADES',(SELECT id FROM account_heading WHERE accno LIKE '3.1.')); -- Ingresos SELECT account_heading_save(NULL, '4.','INGRESOS',NULL); SELECT account_heading_save(NULL, '4.1.','OPERACIONALES',(SELECT id FROM account_heading WHERE accno LIKE '4.')); SELECT account_heading_save(NULL, '4.1.1.','VENTAS',(SELECT id FROM account_heading WHERE accno LIKE '4.1.')); SELECT account_save(NULL, '4.1.1.01','Servicio','I','', (SELECT id FROM account WHERE accno LIKE '4.1.1.'), false, false, string_to_array('IC_income:AR_amount', ':')); SELECT account_save(NULL, '4.1.1.02','Articulo','I','', (SELECT id FROM account WHERE accno LIKE '4.1.1.'), false, false, string_to_array('IC_income:AR_amount', ':')); SELECT account_save(NULL, '4.1.1.03','Manufactura','I','', (SELECT id FROM account WHERE accno LIKE '4.1.1.'), false, false, string_to_array('IC_income:AR_amount', ':')); SELECT account_heading_save(NULL, '4.1.2.','VENTAS EXCENTAS',(SELECT id FROM account_heading WHERE accno LIKE '4.1.')); SELECT account_save(NULL, '4.1.2.01','Exportaciones','I','', (SELECT id FROM account WHERE accno LIKE '4.1.2.'), false, false, string_to_array('IC_income:AR_amount', ':')); SELECT account_save(NULL, '4.1.2.02','Sin IVA','I','', (SELECT id FROM account WHERE accno LIKE '4.1.2.'), false, false, string_to_array('IC_income:AR_amount', ':')); SELECT account_heading_save(NULL, '4.1.3.','DEVOLUCIONES',(SELECT id FROM account_heading WHERE accno LIKE '4.1.')); SELECT account_heading_save(NULL, '4.2.','NO OPERACIONALES',(SELECT id FROM account_heading WHERE accno LIKE '4.')); SELECT account_heading_save(NULL, '4.2.1.','OTROS INGRESOS ',(SELECT id FROM account_heading WHERE accno LIKE '4.2.')); SELECT account_save(NULL, '4.2.1.01','Intereses ganados','I','', (SELECT id FROM account WHERE accno LIKE '4.2.1.'), false, false, string_to_array('asset_gain', ':')); SELECT account_save(NULL, '4.2.1.02','Venta de activo fijo','I','', (SELECT id FROM account WHERE accno LIKE '4.2.1.'), false, false, string_to_array('asset_gain', ':')); SELECT account_save(NULL, '4.2.1.03','Rentas','I','', (SELECT id FROM account WHERE accno LIKE '4.2.1.'), false, false, string_to_array('asset_gain', ':')); SELECT account_save(NULL, '4.2.1.04','Cambio de moneda ganado','I','', (SELECT id FROM account WHERE accno LIKE '4.2.1.'), false, false, string_to_array('', ':')); -- Gastos SELECT account_heading_save(NULL, '5.','GASTOS ',NULL); SELECT account_heading_save(NULL, '5.1.','COSTO',(SELECT id FROM account_heading WHERE accno LIKE '5.')); SELECT account_heading_save(NULL, '5.1.1.','VENTAS',(SELECT id FROM account_heading WHERE accno LIKE '5.1.')); SELECT account_save(NULL, '5.1.1.01','Servicio','E','', (SELECT id FROM account WHERE accno LIKE '5.1.1.'), false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL, '5.1.1.02','Articulo','E','', (SELECT id FROM account WHERE accno LIKE '5.1.1.'), false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL, '5.1.1.03','Manufactura','E','', (SELECT id FROM account WHERE accno LIKE '5.1.1.'), false, false, string_to_array('AP_amount:asset_loss', ':')); SELECT account_heading_save(NULL, '5.2.','ADMINISTRACION',(SELECT id FROM account_heading WHERE accno LIKE '5.')); SELECT account_heading_save(NULL, '5.2.1.','RECURSOS HUMANOS',(SELECT id FROM account_heading WHERE accno LIKE '5.2.')); SELECT account_save(NULL, '5.2.1.01','Sueldos','E','', (SELECT id FROM account WHERE accno LIKE '5.2.1.'), false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL, '5.2.1.02','Salarios','E','', (SELECT id FROM account WHERE accno LIKE '5.2.1.'), false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL, '5.2.1.03','Vacaciones','E','', (SELECT id FROM account WHERE accno LIKE '5.2.1.'), false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL, '5.2.1.04','Aportes','E','', (SELECT id FROM account WHERE accno LIKE '5.2.1.'), false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL, '5.2.1.05','Adelantos','E','', (SELECT id FROM account WHERE accno LIKE '5.2.1.'), false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL, '5.2.2.','COMISIONES',(SELECT id FROM account_heading WHERE accno LIKE '5.2.')); SELECT account_save(NULL, '5.2.2.01','Ventas','E','', (SELECT id FROM account WHERE accno LIKE '5.2.2.'), false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL, '5.2.2.02','Publicidad','E','', (SELECT id FROM account WHERE accno LIKE '5.2.2.'), false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL, '5.2.3.','SERVICIOS',(SELECT id FROM account_heading WHERE accno LIKE '5.2.')); SELECT account_save(NULL, '5.2.3.01','Alquiler inmobiliario','E','', (SELECT id FROM account WHERE accno LIKE '5.2.3.'), false, false, string_to_array('AP_amount:asset_expense', ':')); SELECT account_save(NULL, '5.2.3.02','Electricidad','E','', (SELECT id FROM account WHERE accno LIKE '5.2.3.'), false, false, string_to_array('AP_amount:asset_expense', ':')); SELECT account_save(NULL, '5.2.3.03','Gas','E','', (SELECT id FROM account WHERE accno LIKE '5.2.3.'), false, false, string_to_array('AP_amount:asset_expense', ':')); SELECT account_save(NULL, '5.2.3.04','Municipal','E','', (SELECT id FROM account WHERE accno LIKE '5.2.3.'), false, false, string_to_array('AP_amount:asset_expense', ':')); SELECT account_save(NULL, '5.2.3.05','Telefonia','E','', (SELECT id FROM account WHERE accno LIKE '5.2.3.'), false, false, string_to_array('AP_amount:asset_expense', ':')); SELECT account_save(NULL, '5.2.3.06','Internet','E','', (SELECT id FROM account WHERE accno LIKE '5.2.3.'), false, false, string_to_array('AP_amount:asset_expense', ':')); SELECT account_heading_save(NULL, '5.2.4.','MANTENIMIENTO',(SELECT id FROM account_heading WHERE accno LIKE '5.2.')); SELECT account_save(NULL, '5.2.4.01','Inmobiliario','E','', (SELECT id FROM account WHERE accno LIKE '5.2.4.'), false, false, string_to_array('AP_amount:asset_expense', ':')); SELECT account_save(NULL, '5.2.4.02','Flota de vehiculos','E','', (SELECT id FROM account WHERE accno LIKE '5.2.4.'), false, false, string_to_array('AP_amount:asset_expense', ':')); SELECT account_save(NULL, '5.2.4.03','Combustible vehiculos','E','', (SELECT id FROM account WHERE accno LIKE '5.2.4.'), false, false, string_to_array('AP_amount:asset_expense', ':')); SELECT account_save(NULL, '5.2.4.04','Varios','E','', (SELECT id FROM account WHERE accno LIKE '5.2.4.'), false, false, string_to_array('AP_amount:asset_expense', ':')); SELECT account_heading_save(NULL, '5.2.5.','OTROS GASTOS',(SELECT id FROM account_heading WHERE accno LIKE '5.2.')); SELECT account_save(NULL, '5.2.5.01','Contribucion Escuela regional','E','', (SELECT id FROM account WHERE accno LIKE '5.2.5.'), false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL, '5.2.5.02','Cambio de moneda perdido','E','', (SELECT id FROM account WHERE accno LIKE '5.2.5.'), false, false, string_to_array('', ':')); commit; -- Impuestos -- Ganancias INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '2.1.2.01'), 0.09); -- Bienes Personales INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '2.1.2.02'), 0.05); -- Ganancia Minima Presunta INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '2.1.2.03'), 0.01); -- IVA INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '2.1.2.04'), 0.21); -- IVA Favor INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '1.1.5.01'), 0.21); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE id IN (select account_id FROM account_link WHERE description = 'AP_paid'); -- Sistema -- Predeterminados INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '0.03')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '4.1.1.03')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '5.1.1.03')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '4.2.1.04')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '5.2.5.02')); INSERT INTO defaults (setting_key, value) VALUES ('default_country', '12'); INSERT INTO defaults (setting_key, value) VALUES ('default_language', 'es_AR'); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'ARS:USD:EUR'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit' , 'Kg'); -- -- Hardcode -- INSERT INTO language (code, description) VALUES ('es_AR', 'Spanish (Argentina)'); commit; ledgersmb/sql/coa/ar/chart/Personal.sql0000755000000000000000000003200111730273023017065 0ustar rootrootbegin; -- Plan de Cuentas para uso personal en Argentina -- Sumario SELECT account_heading_save(NULL, '0.','SUMARIO',NULL); SELECT account_save(NULL, '0.00','A Cobrar','A','', (SELECT id FROM account WHERE accno LIKE '0.'), false, false, string_to_array('AR', ':')); SELECT account_save(NULL, '0.10','A Pagar','A','', (SELECT id FROM account WHERE accno LIKE '0.'), false, false, string_to_array('AP', ':')); SELECT account_save(NULL, '0.20','Inventario','A','', (SELECT id FROM account WHERE accno LIKE '0.'), false, false, string_to_array('IC', ':')); -- Activo SELECT account_heading_save(NULL, '1.','ACTIVO',NULL); SELECT account_heading_save(NULL, '1.1.','CORRIENTE',(SELECT id FROM account_heading WHERE accno LIKE '1.')); SELECT account_save(NULL, '1.1.00','Efectivo','A','', (SELECT id FROM account WHERE accno LIKE '1.1.'), false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL, '1.1.10','Caja Seguridad','A','', (SELECT id FROM account WHERE accno LIKE '1.1.'), false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL, '1.1.20','Caja Ahorro Banco1','A','', (SELECT id FROM account WHERE accno LIKE '1.1.'), false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL, '1.1.21','Caja Ahorro Banco2','A','', (SELECT id FROM account WHERE accno LIKE '1.1.'), false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL, '1.1.30','TC Banco1','A','', (SELECT id FROM account WHERE accno LIKE '1.1.'), false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL, '1.1.31','TC Banco2','A','', (SELECT id FROM account WHERE accno LIKE '1.1.'), false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL, '1.1.40','Credito a Terceros','A','', (SELECT id FROM account WHERE accno LIKE '1.1.'), false, false, string_to_array('AR_overpayment:AR_amount', ':')); SELECT account_heading_save(NULL, '1.2.','INVENTARIO',(SELECT id FROM account_heading WHERE accno LIKE '1.')); SELECT account_save(NULL, '1.2.00','Articulos','A','', (SELECT id FROM account WHERE accno LIKE '1.2.'), false, false, string_to_array('IC_sale:AR_amount', ':')); SELECT account_save(NULL, '1.2.10','Manufacturas','A','', (SELECT id FROM account WHERE accno LIKE '1.2.'), false, false, string_to_array('IC_sale:AR_amount', ':')); SELECT account_heading_save(NULL, '1.3.','NO CORRIENTE',(SELECT id FROM account_heading WHERE accno LIKE '1.')); SELECT account_save(NULL, '1.3.00','Propiedades','A','', (SELECT id FROM account WHERE accno LIKE '1.3.'), false, false, string_to_array('Fixed_Asset', ':')); SELECT account_save(NULL, '1.3.10','Vehiculos','A','', (SELECT id FROM account WHERE accno LIKE '1.3.'), false, false, string_to_array('Fixed_Asset', ':')); SELECT account_save(NULL, '1.3.20','Muebles','A','', (SELECT id FROM account WHERE accno LIKE '1.3.'), false, false, string_to_array('Fixed_Asset', ':')); SELECT account_save(NULL, '1.3.30','Electrodomesticos','A','', (SELECT id FROM account WHERE accno LIKE '1.3.'), false, false, string_to_array('Fixed_Asset', ':')); SELECT account_save(NULL, '1.3.40','Herramientas','A','', (SELECT id FROM account WHERE accno LIKE '1.3.'), false, false, string_to_array('Fixed_Asset', ':')); SELECT account_save(NULL, '1.3.100','(-)Depresiacion','A','', (SELECT id FROM account WHERE accno LIKE '1.3.'), false, false, string_to_array('Asset_Dep', ':')); SELECT account_heading_save(NULL, '1.4.','OTROS',(SELECT id FROM account_heading WHERE accno LIKE '1.')); SELECT account_save(NULL, '1.4.00','(-)Amortizacion','A','', (SELECT id FROM account WHERE accno LIKE '1.4.'), false, false, string_to_array('', ':')); SELECT account_save(NULL, '1.4.10','IVA a Favor','A','', (SELECT id FROM account WHERE accno LIKE '1.4.'), false, true, string_to_array('AP_tax', ':')); SELECT account_save(NULL, '1.4.20','Depositos de Alquiler','A','', (SELECT id FROM account WHERE accno LIKE '1.4.'), false, false, string_to_array('', ':')); -- Pasivo SELECT account_heading_save(NULL, '2.','PASIVO',NULL); SELECT account_heading_save(NULL, '2.1.','CORRIENTE',(SELECT id FROM account_heading WHERE accno LIKE '2.')); SELECT account_save(NULL, '2.1.00','Servicios','L','', (SELECT id FROM account WHERE accno LIKE '2.1.'), false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL, '2.1.10','Proveedores','L','', (SELECT id FROM account WHERE accno LIKE '2.1.'), false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL, '2.1.20','Ganancias (9% - 35%)','L','', (SELECT id FROM account WHERE accno LIKE '2.1.'), false, true, string_to_array('IC_taxservice:IC_taxpart:AR_tax', ':')); SELECT account_save(NULL, '2.1.21','Jubilacion (11%)','L','', (SELECT id FROM account WHERE accno LIKE '2.1.'), false, true, string_to_array('IC_taxservice:IC_taxpart:AR_tax', ':')); SELECT account_save(NULL, '2.1.22','Jubilacion INSSJP (3%)','L','', (SELECT id FROM account WHERE accno LIKE '2.1.'), false, true, string_to_array('IC_taxservice:IC_taxpart:AR_tax', ':')); SELECT account_save(NULL, '2.1.23','Servicio Social (3%)','L','', (SELECT id FROM account WHERE accno LIKE '2.1.'), false, true, string_to_array('IC_taxservice:IC_taxpart:AR_tax', ':')); SELECT account_save(NULL, '2.1.24','Bienes Personales (0,5% - 1,25%)','L','', (SELECT id FROM account WHERE accno LIKE '2.1.'), false, true, string_to_array('IC_taxservice:IC_taxpart:AR_tax', ':')); SELECT account_save(NULL, '2.1.25','Valor Agregado (IVA 10,5% - 27%)','L','', (SELECT id FROM account WHERE accno LIKE '2.1.'), false, true, string_to_array('IC_taxservice:IC_taxpart:AR_tax', ':')); SELECT account_save(NULL, '2.1.26','Ingresos Brutos (3%)','L','', (SELECT id FROM account WHERE accno LIKE '2.1.'), false, true, string_to_array('IC_taxservice:IC_taxpart:AR_tax', ':')); SELECT account_heading_save(NULL, '2.2.','LARGO PLAZO',(SELECT id FROM account_heading WHERE accno LIKE '2.')); SELECT account_save(NULL, '2.2.00','Hipotecario Banco X','L','', (SELECT id FROM account WHERE accno LIKE '2.2.'), false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL, '2.3.','OTROS PASIVOS',(SELECT id FROM account_heading WHERE accno LIKE '2.')); -- Patrimonio SELECT account_heading_save(NULL, '3.','PATRIMONIO',NULL); SELECT account_heading_save(NULL, '3.1.','PATRIMONIO NETO',(SELECT id FROM account_heading WHERE accno LIKE '3.')); SELECT account_save(NULL, '3.1.00','Capital Social','Q','', (SELECT id FROM account WHERE accno LIKE '3.1.'), false, false, string_to_array('', ':')); -- Ingresos SELECT account_heading_save(NULL, '4.','INGRESOS',NULL); SELECT account_heading_save(NULL, '4.1.','OPERACIONALES',(SELECT id FROM account_heading WHERE accno LIKE '4.')); SELECT account_save(NULL, '4.1.00','Acreditacion de Haberes','I','', (SELECT id FROM account WHERE accno LIKE '4.1.'), false, false, string_to_array('IC_income:AR_amount', ':')); SELECT account_save(NULL, '4.1.10','Servicios Prestados','I','', (SELECT id FROM account WHERE accno LIKE '4.1.'), false, false, string_to_array('IC_income:AR_amount', ':')); SELECT account_save(NULL, '4.1.20','Articulos Vendidos','I','', (SELECT id FROM account WHERE accno LIKE '4.1.'), false, false, string_to_array('IC_income:AR_amount', ':')); SELECT account_save(NULL, '4.1.30','Manufacturas Vendidas','I','', (SELECT id FROM account WHERE accno LIKE '4.1.'), false, false, string_to_array('IC_income:AR_amount', ':')); SELECT account_heading_save(NULL, '4.2.','NO OPERACIONALES',(SELECT id FROM account_heading WHERE accno LIKE '4.')); SELECT account_save(NULL, '4.2.00','Intereses Ganados','I','', (SELECT id FROM account WHERE accno LIKE '4.2.'), false, false, string_to_array('asset_gain', ':')); SELECT account_save(NULL, '4.2.10','Venta de Activo Fijo','I','', (SELECT id FROM account WHERE accno LIKE '4.2.'), false, false, string_to_array('asset_gain', ':')); SELECT account_save(NULL, '4.2.20','Rentas','I','', (SELECT id FROM account WHERE accno LIKE '4.2.'), false, false, string_to_array('asset_gain', ':')); SELECT account_save(NULL, '4.2.30','Cambio de Moneda Ganado','I','', (SELECT id FROM account WHERE accno LIKE '4.2.'), false, false, string_to_array('asset_gain', ':')); -- Gastos SELECT account_heading_save(NULL, '5.','GASTOS ',NULL); SELECT account_heading_save(NULL, '5.1.','COSTO',(SELECT id FROM account_heading WHERE accno LIKE '5.')); SELECT account_save(NULL, '5.1.00','Servicios','E','', (SELECT id FROM account WHERE accno LIKE '5.1.'), false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL, '5.1.10','Articulos','E','', (SELECT id FROM account WHERE accno LIKE '5.1.'), false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL, '5.1.20','Manufacturas','E','', (SELECT id FROM account WHERE accno LIKE '5.1.'), false, false, string_to_array('AP_amount:asset_loss', ':')); SELECT account_heading_save(NULL, '5.2.','SERVICIOS',(SELECT id FROM account_heading WHERE accno LIKE '5.')); SELECT account_save(NULL, '5.2.00','Alquiler inmobiliario','E','', (SELECT id FROM account WHERE accno LIKE '5.2.'), false, false, string_to_array('AP_amount:asset_expense', ':')); SELECT account_save(NULL, '5.2.01','Electricidad','E','', (SELECT id FROM account WHERE accno LIKE '5.2.'), false, false, string_to_array('AP_amount:asset_expense', ':')); SELECT account_save(NULL, '5.2.02','Gas','E','', (SELECT id FROM account WHERE accno LIKE '5.2.'), false, false, string_to_array('AP_amount:asset_expense', ':')); SELECT account_save(NULL, '5.2.03','Municipal','E','', (SELECT id FROM account WHERE accno LIKE '5.2.'), false, false, string_to_array('AP_amount:asset_expense', ':')); SELECT account_save(NULL, '5.2.04','Telefonia','E','', (SELECT id FROM account WHERE accno LIKE '5.2.'), false, false, string_to_array('AP_amount:asset_expense', ':')); SELECT account_save(NULL, '5.2.05','Internet','E','', (SELECT id FROM account WHERE accno LIKE '5.2.'), false, false, string_to_array('AP_amount:asset_expense', ':')); SELECT account_heading_save(NULL, '5.3.','MANTENIMIENTO',(SELECT id FROM account_heading WHERE accno LIKE '5.')); SELECT account_save(NULL, '5.3.00','Propiedades','E','', (SELECT id FROM account WHERE accno LIKE '5.3.'), false, false, string_to_array('AP_amount:asset_expense', ':')); SELECT account_save(NULL, '5.3.10','Vehiculos','E','', (SELECT id FROM account WHERE accno LIKE '5.3.'), false, false, string_to_array('AP_amount:asset_expense', ':')); SELECT account_save(NULL, '5.3.20','Varios','E','', (SELECT id FROM account WHERE accno LIKE '5.3.'), false, false, string_to_array('AP_amount:asset_expense', ':')); SELECT account_heading_save(NULL, '5.4.','OTROS GASTOS',(SELECT id FROM account_heading WHERE accno LIKE '5.')); SELECT account_save(NULL, '5.4.00','Vacaciones','E','', (SELECT id FROM account WHERE accno LIKE '5.4.'), false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL, '5.4.10','Cooperadora Escuela','E','', (SELECT id FROM account WHERE accno LIKE '5.4.'), false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL, '5.4.20','Cambio de Moneda Perdido','E','', (SELECT id FROM account WHERE accno LIKE '5.4.'), false, false, string_to_array('AP_amount', ':')); commit; -- Impuestos -- Ganancias (9% - 35%) INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '2.1.20'), 0.09); -- Jubilacion (11%) INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '2.1.21'), 0.11); -- Jubilacion INSSJP (3%) INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '2.1.22'), 0.03); -- Servicio Social (3%) INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '2.1.23'), 0.03); -- Bienes Personales (0,5% - 1,25%) INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '2.1.24'), 0.01); -- Valor Agregado (IVA 10,5% - 27%) INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '2.1.25'), 0.21); -- Ingresos Brutos (3%) INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '2.1.26'), 0.03); -- IVA Favor INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '1.4.10'), 0.21); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE id IN (select account_id FROM account_link WHERE description = 'AP_paid'); -- Sistema -- Predeterminados INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '0.20')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '4.1.00')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '5.1.00')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '4.2.30')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '5.4.20')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'ARS:USD:EUR'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit' , 'Kg'); -- -- Hardcode -- INSERT INTO language (code, description) VALUES ('es_AR', 'Spanish (Argentina)'); commit; ledgersmb/sql/coa/pl/0000755000000000000000000000000012060044550013470 5ustar rootrootledgersmb/sql/coa/pl/chart/0000755000000000000000000000000012060044550014571 5ustar rootrootledgersmb/sql/coa/pl/chart/General.sql0000755000000000000000000013031611730345473016711 0ustar rootrootbegin; -- Chart of Account for Poland -- From: Peter Dabrowski -- Sun, 23 March 2003 SELECT account_heading_save(NULL,'000000000','Aktywa Trwa³e', NULL); SELECT account_save(NULL,'001000000','¦rodki Trwa³e','A','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'001010000','Grunty w³asne i prawa wieczystego u¿ytkowania gruntów','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'001020000','Budynki, locale i obiekty in¿ynierii l±dowej i wodnej','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'001030000','Urz±dzenia techniczne i maszyny','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'001040000','¦rodki transportu','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'001050000','Inne ¶rodki trwa³e','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'002000000','Warto¶ci niematerialne i prawne','A','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'002010000','Koszty zakoñczonych prac rozwojowych','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'002020000','Nabyta warto¶æ firmy','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'002080000','Inne warto¶ci niematerialne i prawne','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'002090000','Zaliczki na warto¶ci niematerialne i prawne','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'003000000','D³ugoterminowe aktywa finansowe','A','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'003010000','W jednostkach powi±zanych','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'003010100','Udzia³y lub akcje','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'003010200','Inne papiery warto¶ciowe','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'003010300','Udzielone porzyczki','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'003010400','Inne d³ugoterminowe aktywa finansowe','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'003020000','W pozosta³ych jednostkach','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'003020100','Udzia³y lub akcje','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'003020200','Inne papiery warto¶ciowe','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'003020300','Udzielone po¿yczki','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'003020400','Inne d³ugoterminowe aktywa finansowe','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'003090000','Inne investycje d³ugoterminowe','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'003090100','Inne rodzaje d³ugoterminowych aktywów finansowych','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'004000000','Investycje w nieruchomo¶ci i prawa','A','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'004010000','Nieruchomo¶ci','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'004020000','Warto¶ci niematerialne i prawne','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'005000000','D³ugoterminowe rozliczenia miêdzyokresowe','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'005010000','Aktywa z tytu³u odroczonego podatku dochodowego','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'005020000','Inne rozliczenia miêdzyokresowe','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'006000000','Nale¿no¶ci d³ugoterminowe','A','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'006010000','Od jednostek powi±zanych','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'006020000','Od pozosta³ych jednostek','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'007000000','Odpisy umorzeniowe ¶rodków trwa³ych oraz warto¶ci niematerialnych i prawnych','A','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'007010000','Odpisy umorzeniowe warto¶ci gruntów i prawa wieczystego u¿ytkowania gruntów','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'007020000','Odpisy umorzeniowe budynków, lokali i obiektów in¿ynierii l±dowej i wodnej','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'007030000','Odpisy umorzeniowe urz±dzeñ technicznych i maszyn','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'007040000','Odpisy umorzeniowe ¶rodków transportu','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'007050000','Odpisy umorzeniowe ulepszeñ obcych ¶rodków trwa³ych','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'007090000','Odpisy umorzeniowe innych ¶rodków trwa³ych','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'008000000','¦rodki trwa³e w budowie','A','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'008010000','Inwestycje budowy ¶rodka trwa³ego','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'008020000','Ulepszenia ¶rodka trwa³ego','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'008030000','Nak³ady na budowê ¶rodka trwa³ego','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'008040000','Zaliczki na ¶rodki trwa³e w budowie','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'008050000','Ulepszenia obcych ¶rodków trwa³ych','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'009000000','Odpisy aktualizuj±ce d³ugoterminowe aktywa finansowe','A','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'009010000','Odpisy aktualizuj±ce udzia³y i akcje w obcych jednostkach','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'009020000','Odpisy aktualizuj±ce lokaty','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'009030000','Odpisy aktualizuj±ce udzielone porzyczki d³ugoterminowe','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'009090000','Odpisy aktualizuj±ce inne rodzaje d³ugoterminowych aktywów finansowych','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'100000000','¦rodki pieniê¿ne, rachunki bankowe oraz inne krótkoterminowe aktywa finansowe', NULL); SELECT account_save(NULL,'110000000','¦rodki pieniê¿ne w kasie','A','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'110010000','Kasa krajowych ¶rodków pieniê¿nych','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'110020000','Kasa zagranicznych ¶rodków pieniê¿nych','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'113000000','Rachunki i kredyty bankowe','A','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'113010000','Rachunek bie¿±cy','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'113020000','Rachunek ¶rodków wyodrêbnionych i zablokowanych','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'113030000','Rachunki kredytów bankowych','A','', NULL, false, false, string_to_array('AR_paid:AP_amount:AP_paid', ':')); SELECT account_save(NULL,'113040000','Rachunek ¶rodków walutowych','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'114000000','Krótkoterminowe aktywa finansowe','A','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'114010000','Krótkoterminowe aktywa finansowe w jednostkach powi±zanych','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'114010100','Udzia³y lub akcje','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'114010200','Inne papiery warto¶ciowe','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'114010300','Udzielone po¿yczki','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'114010400','Inne krótkoterminowe aktywa finansowe','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'114020000','Krótkoterminowe aktywa finansowe w pozosta³ych jednostkach','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'114020100','Udzia³y lub akcje','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'114020200','Inne papiery warto¶ciowe','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'114020400','Inne krótkoterminowe aktywa finansowe','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'115000000','Inne ¶rodki pieniê¿ne','A','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'116000000','Inne aktywa pieniê¿ne','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'117000000','Inne inwestycje krótkoterminowe','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'118000000','Krótkoterminowe rozliczenia miêdzyokresowe','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'200000000','Rozrachunki i roszczenia', NULL); SELECT account_save(NULL,'220000000','Nale¿no¶ci krótkoterminowe','L','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'220010000','Nale¿no¶ci od jednostek powi±zanych','L','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'220010100','Nale¿no¶ci z tytu³u dostaw i us³ug','L','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'220010110','Nale¿no¶ci z tytu³u dostaw i us³ug, o okresie sp³aty do 12 miesiêcy','L','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'220010120','Nale¿no¶ci z tytu³u dostaw i us³ug, o okresie sp³aty powy¿ej 12 miesiêcy','L','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'220010200','Inne nale¿no¶ci','L','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'220010210','Zobowi±zania z tytu³u pokrycia kosztów ogólnego zarz±du','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'220010220','Zobowi±zania z tytu³u rozliczeñ VAT','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'221010000','Nale¿no¶ci od pozosta³ych jednostek','L','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'221020100','Nale¿no¶ci z tytu³u dostaw i us³ug','L','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'221020110','Nale¿no¶ci z tytu³u dostaw i us³ug, o okresie sp³aty do 12 miesiêcy','L','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'221020120','Nale¿no¶ci z tytu³u dostaw i us³ug, o okresie sp³aty powy¿ej 12 miesiêcy','L','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'221020200','Nale¿no¶ci z tytu³u podatków, dotacji, ce³, ubezpieczeñ spo³ecznych i zdrowotnych oraz innych ¶wiadczeñ','L','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'221020300','Zaliczki przekazane dostawcom','L','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'221020400','Nale¿no¶ci dochodzone na drodze s±dowej','L','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'221020500','Inne nale¿no¶ci','L','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'222000000','Zobowi±zania krótkoterminowe','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'222010000','Zobowi±zania wobec jednostek powiazanych','L','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'222010100','Zobowi±zania z tytu³u dostaw i us³ug','L','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'222010200','Zobowi±zania o okresie wymagalno¶ci do 12 miesiêcy','L','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'222010300','Zobowi±zania o okresie wymagalno¶ci powy¿ej 12 miesiêcy','L','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'222010400','Inne zobowi±zania','L','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'222020000','Zobowi±zania wobec pozosta³ych jednostek','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'222020100','Kredyty i po¿yczki','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'222020200','Zobowi±zania z tytu³u emisji d³u¿nych papierów warto¶ciowych','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'222020300','Inne zobowi±zania finasowe','L','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'222020400','Zobowiazania z tytu³u dostaw i us³ug','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'222020500','Zobowi±zania o okresie wymagalno¶ci do 12 miesiêcy ','L','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'222020600','Zobowi±zania o okresie wymagalno¶ci powy¿ej 12 miesiêy','L','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'222020700','Zaliczki otrzmane na dostawy','L','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'222020800','Zobowi±zania wekslowe','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'222020900','Zobowi±zania z tytu³u podatków, ce³, ubezpieczeñ i innych ¶wiadczeñ','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'222021000','Zobowi±zania z tytu³u wynagrodzeñ','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'222021100','Inne zobowi±zania','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'223000000','Rozrachunki publicznoprawne','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'223010000','Rozrachunki z urzêdem skarbowym z tytu³u VAT','L','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'223020000','Rozliczenie nale¿nego VAT','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'223020100','Rozliczenie nale¿nego VAT-22%','L','', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'223020200','Rozliczenie nale¿nego VAT-7%','L','', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'223020300','Rozliczenie nale¿nego VAT-0%','L','', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'223030000','Rozliczenie naliczonego VAT','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'223030100','Rozliczenie naliczonego VAT-22%','L','', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'223030200','Rozliczenie naliczonego VAT-7%','L','', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'223030300','Rozliczenie naliczonego VAT-0%','L','', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'223040000','Korekty naliczonego VAT','L','', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'223050000','Rozrachunki z Urzêdem Celnym','L','', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'223060000','Rozrachunki z Urzêdem Skarbowym z tytu³u znaków akcyzy','L','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'223070000','Rozrachunki z Urzêdem Skarbowym z tytu³u podatku akcyzowego','L','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'223080000','Rozliczenie znaków akcyzy','L','', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'223090000','Rozrachunki z ZUS','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'223100000','Rozrachunki z Urzêdem Skarbowym z tytu³u podatku dochodowego od osób prawnych','L','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'224000000','Rozrachunki z pracownikami','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'224010000','Rozrachunki z tytu³u wynagrodzeñ','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'224020000','Rozrachunki z tytu³u po¿yczek udzielonych pracownikom','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'224090000','Inne rozrachunki z pracownikami','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'225000000','Zobowi±zania d³ugoterminowe','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'225010000','Zobowi±zania wobec jednostek powi±zanych','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'225010100','Zobowi±zania z tytu³u wyodrêbnienia sk³adników maj±tkowych','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'225010200','Zobowi±zania z tytu³u podzia³u zysku','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'225020000','Zobowi±zania wobec pozosta³ych jednostek','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'225020100','Kredyty i po¿yczki otrzymane','L','', NULL, false, false, string_to_array('AR_amount:AP_amount', ':')); SELECT account_save(NULL,'225020200','Kredyty i po¿yczki udzielone','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'225020300','Zobowi±zania z tytu³u emisji d³u¿nych papierów warto¶ciowych','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'225020400','Inne zobowi±zania kredytowe','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'225020500','Inne zobowi±zania','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'225030000','Rozrachunki z tytu³u wp³at na kapita³ zak³adowy','L','', NULL, false, false, string_to_array('AR_amount:AP_amount', ':')); SELECT account_save(NULL,'225040000','Rozrachunki z tytu³u wk³adów niepieniê¿nych na kapita³ zak³adowy','L','', NULL, false, false, string_to_array('AR_amount:AP_amount', ':')); SELECT account_save(NULL,'225050000','Rozrachunki z tytu³u podwy¿szenia kapita³u ze ¶rodków w³asnych spó³ki','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'225060000','Rozrachunki z tytu³u umorzenia udzia³ów w³asnych','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'225070000','Rozrachunki z tytu³u dywident','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'225080000','Rozrachunki z tytu³u dop³at i zwrotu dop³at','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'225090000','Pozosta³e rozrachunki ze wspólnikami','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'229000000','Odpisy aktualizuj±ce rozrachunki','L','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'300000000','Materia³y i towary', NULL); SELECT account_save(NULL,'330000000','Rozliczenie zakupu','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'330010000','Rozliczenie warto¶ci materia³ów i towarów w drodze','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'330020000','Warto¶ci dostaw niefakturowanych','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'330030000','Przychody wszelkich dostaw i us³ug i ich rozliczanie','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'330040000','Odhylenia cen ewidencyjnych od rzeczywistych cen nabycia lub zakupu','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'330050000','Koszty zakupu zawarte w fakturach dostawców','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'330060000','Op³aty manipulacyjne policzone przez Urz±d Celny','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'330070000','Niedobory, szkody i nadwy¿ki w transporcie','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'330080000','Znaki akcyzy wed³ug dokumentu SAD','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'330090000','Reklamacje faktur dostawców','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'331000000','Materia³y','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'331010000','Materia³y w magazynach w³asnych','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'331020000','Materia³y w magazynach obcych','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'331030000','Materia³y w przerobie','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'333000000','Towary','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'333010000','Towary w magazynach w³asnych','A','', NULL, false, false, string_to_array('IC_sale', ':')); SELECT account_save(NULL,'333020000','Towary w magazynach obcych','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'333030000','Towary w detalu','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'334000000','Odchylenia od cen ewidencyjnych materia³ów i towarów','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'334010000','Odpisy aktualizuj±ce warto¶æ materia³ów','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'334020000','Odpisy aktualizuj±ce warto¶æ towarów','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'400000000','Koszty wed³ug rodzajów i ich rozliczeñ', NULL); SELECT account_save(NULL,'440000000','Koszty wed³ug rodzajów','E','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'440010000','Zu¿ycie materia³ów i energii','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'440010100','Zu¿ycie materia³ów biurowych','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'440020000','Us³ugi obce','E','', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'440020100','Us³ugi celne','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'440020200','Us³ugi telekomunikacyjne','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'440020300','Us³ugi pocztowe','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'440020400','Us³ugi kurierskie i transportowe','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'440020500','Analizy sanitarne','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'440020600','Us³ugi graficzne i drukarskie','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'440030000','Podatki i op³aty','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'440030100','Op³aty i prowizje bankowe','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'440030200','Op³aty s±dowe, prawnicze i notarialne','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'440030300','Op³aty skarbowe','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'440030400','Koncesje','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'440040000','Wynagrodzenia za pracê','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'441000000','¦wiadczenia na rzecz pracowników','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'442000000','Amortyzacja','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'443000000','Pozosta³e','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'449000000','Rozliczenie kosztów','E','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'449010000','Nie podlegaj±ce rozliczeniu w czasie','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'449020000','Przypadaj±ce na przysz³e okresy','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'449030000','Koszty zgromadzone','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'449040000','Koszty nie wliczane do warto¶ci sprzeda¿y','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'500000000','Koszty wed³ug typów dzia³alno¶ci i ich rozliczenie', NULL); SELECT account_save(NULL,'550000000','Koszty dzia³alno¶ci podstawowej-produkcyjnej','E','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'550010000','Rozliczone koszta dzia³alno¶ci','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'550020000','Koszty nie zakoñczonych d³ugotrwa³ych us³ug','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'550030000','Straty zwi±zane z wykonaniem d³ugotrwa³ych us³ug','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'552000000','Koszty dzia³alno¶ci podstawowej-handlowej','E','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'552010000','Koszty utrzymania punktów sprzeda¼y detalicznej','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'550200000','Koszty utrzymania hurtowni','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'552030000','Koszty sprzeda¿y wyrobów','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'552040000','Podatek akcyzowy','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'552050000','Op³aty celne','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'553000000','Koszty dzia³alno¶ci pomocniczej','E','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'553010000','¦wiadczenia us³ug transportowych','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'555000000','Koszty zarz±du','E','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'555010000','Koszty zarz±dzania jednostk±','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'555020000','¦wiadczenia us³ug na potrzeby reprezentacji i reklamy','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'558000000','Rozliczenie kosztów dzia³alno¶ci','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL,'600000000','Produkty i rozliczenia miêdzyokresowe', NULL); SELECT account_save(NULL,'660000000','Pó³produkty i produkty w toku','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'661000000','Produkty gotowe','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'661010000','Wyroby gotowe','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'661020000','Wyroby poza jednostk±','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'662000000','Odchylenia od cen ewidencyjnych produktów','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'662010000','Odchylenia od cen evidencyjnych wyrobów gotowych','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'662020000','Odhylenia od cen evidencyjnych pó³fabrykatów','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'664000000','Rozliczenia miêdzyokresowe kosztów','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'664010000','Czynne rozliczenia miêdzyokresowe kosztów','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'664020000','Bierne rozliczenia miêdzyokresowe kosztów','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'665000000','Pozosta³e rozliczenia miêdzyokresowe','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'665010000','Czynne rozliczenia przysz³ych okresów','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'665020000','Bierne rozliczenia przysz³ych okresów','L','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'700000000','Przychody i koszty zwi±zane z ich osi±gniêciem', NULL); SELECT account_save(NULL,'770000000','Sprzeda¿ produktów','I','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'770010000','Sprzeda¿ produktów na kraj','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'770020000','Sprzeda¿ produktów na eksport','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'770030000','Sprzeda¿ us³ug na kraj','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'770040000','Sprzeda¿ us³ug na eksport','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'770100000','Koszty sprzedanych produktów','E','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'770110000','Koszt w³asny sprzeda¿y produktów na kraj','E','', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'770120000','Koszt w³asny sprzeda¿y produktów na eksport','E','', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'770130000','Koszt w³asny sprzeda¿y us³ug na kraj','E','', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'770140000','Koszt w³asny sprzeda¿y us³ug na export','E','', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'773000000','Sprzeda¿ towarów','I','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'773010000','Sprzeda¿ hurtowa towarów','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'773020000','Sprzeda¿ detaliczna towarów','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'773030000','Sprzeda¿ wysy³kowa towarów','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'773040000','Prowizja komisowa','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'773100000','Warto¶æ sprzedanych towarów w cenach zakupu','E','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'773110000','Warto¶æ sprzedanych towarów w sprzeda¿y hurtowej','E','', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'773120000','Warto¶æ sprzedanych towarów w sprzeda¿y detalicznej','E','', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'773130000','Warto¶æ sprzedanych towarów w sprzeda¿y wysy³kowej','E','', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'773140000','Prowizja komisowa','E','', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'774000000','Sprzeda¿ materia³ów','I','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'774010000','Materia³y','I','', NULL, false, false, string_to_array('AP_amount:IC_sale', ':')); SELECT account_save(NULL,'774020000','Opakowania','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'774030000','Odpady','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'774100000','Warto¶æ sprzedanych materia³ów','E','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'774110000','Warto¶æ w cenach zakupu sprzedanych materia³ów','E','', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'774120000','Warto¶æ w cenach zakupu sprzedanych opakowañ','E','', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'774130000','Warto¶æ w cenach zakupu sprzedanych odpadów','E','', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'775000000','Przychody finansowe','I','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'775010000','Kwoty nale¿ne ze sprzeda¿y aktywów finansowych','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'775020000','Kwoty nale¿ne z tytu³u dywident','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'775030000','Otrzymane odsetki','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'775040000','Przychody ze zbycia investycji','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'775050000','Aktualizacja warto¶ci investycji-przychody','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'775060000','Dodatnie ró¿nice kursu walut','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'775070000','Pozosta³e przychody finansowe','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'775100000','Koszty finansowe','E','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'775110000','Warto¶æ sprzedanych investycji','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'775120000','Odpisy z tytu³u utraty warto¶ci investycji-koszty','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'775130000','Odsetki zap³acone','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'775140000','Ujemne ró¿nice kursu walut','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'775190000','Pozosta³e koszty finansowe','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'776000000','Pozosta³e przychody operacyjne','I','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'776010000','Przychody ze zbycia niefinansowych aktywów trwa³ych','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'776020000','Otrzymane dotacje','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'776030000','Przychody z us³ug socjalnych','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'776040000','Przychody ze wzrostu warto¶ci niefinansowych aktywów trwa³ych','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'776090000','Inne pozosta³e przychody operacyjne','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'776100000','Pozosta³e koszty operacyjne','E','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'776110000','Warto¶æ sprzedanych niefinansowych aktywów trwa³ych','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'776120000','Dotacje przekazane','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'776130000','Odpisy z tytu³u utraty warto¶ci aktywów niefinansowych','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'776140000','Inne pozosta³e koszty operacyjne','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'777000000','Zyski nadzwyczajne','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'777100000','Straty nadzwyczajne','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'779000000','Obroty wewnêtrzne','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'779010000','Koszt wyrobów w³asnej produkcji wydanych do w³asnych sklepów','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'779020000','¦wiadczenia na rzecz ¶rodków trwa³ych w budowie','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'779040000','Koszt niedoborów produktów','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'779050000','Koszt zaniechania okre¶lonego rodzaju dzia³alno¶ci','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'779100000','Koszt obrotów wewnêtrznych','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'779110000','Koszt wytworzenia wyrobów gotowych wydanych do w³asnych sklepów','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'779120000','Koszt wytworzenia ¶wiadczeñ na rzecz ¶rodków trwa³ych w budowie','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'779130000','Koszt wytworzenia zakoñczonych prac rozwojowych','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'779140000','Koszt wytworzenia produktów uznanych za niedobory','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'779150000','Koszt zaniechania okre¶lonego rodzaju dzia³alno¶ci','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'800000000','Kapita³y w³asne i wynik finansowy', NULL); SELECT account_save(NULL,'880000000','Kapita³ podstawowy','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'880010000','Kapita³ zak³adowy','Q','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'881000000','Fundusze wydzielone jednostkom zale¿nym','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'882000000','Nale¿ne wp³aty na kapita³ podstawowy','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'883000000','Fundusze wydzielone jednostkom zale¿nym','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'884000000','Kapita³ zapasowy','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'885000000','Kapita³ rezerwowy','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'886000000','Kapita³ z aktualizacji wyceny','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'887000000','Rozliczenia wyniku finansowego','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'888000000','Rezerwy','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'888010000','Rezerwa z tytu³u odroczonego podatku dochodowego','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'888020000','Rezerwa na ¶wiadczenia','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'888020100','Rezerwa d³ugoterminowa na ¶wiadczenia emerytalne i podobne','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'888020200','Rezerwa krótkoterminowa na ¶wiadczenia emerytalne i podobne','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'889090000','Pozosta³e rezerwy','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'889090100','Pozosta³e rezerwy d³ugoterminowe','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'889090200','Pozosta³e rezerwy krótkoterminowe','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'890000000','Rozliczenia miêdzyokresowe','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'890010000','Ujemna warto¶æ firmy','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'890020000','Inne rozliczenia miêdzyokresowe','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'890020100','Inne rozliczenia miêdzyokresowe d³ugoterminowe','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'890020200','Inne rozliczenia miêdzyokresowe krótkoterminowe','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'891000000','Fundusze specjalne','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'892000000','Wynik finansowy','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'893000000','Odpisy z zysku netto w ci±gu roku obrotowego','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'893010000','Podatek dochodowy','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'893020000','Inne obowi±zkowe obci±¿enia wyniku finansowego','Q','', NULL, false, false, string_to_array('', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE id IN (select account_id FROM account_link WHERE description = 'AP_paid'); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '223020100'),0.22); insert into tax (chart_id,rate) values ((select id from chart where accno = '223020200'),0.07); insert into tax (chart_id,rate) values ((select id from chart where accno = '223020300'),0); insert into tax (chart_id,rate) values ((select id from chart where accno = '223030100'),0.22); insert into tax (chart_id,rate) values ((select id from chart where accno = '223030200'),0.07); insert into tax (chart_id,rate) values ((select id from chart where accno = '223030300'),0); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '333000000')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '773010000')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '773110000')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '775060000')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '775140000')); INSERT INTO defaults (setting_key, value) VALUES ('invnumber', '1000'); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'PLN:USD:EUR'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); UPDATE defaults SET value = '1000' WHERE setting_key = 'sonumber'; UPDATE defaults SET value = '1000' WHERE setting_key = 'ponumber'; -- commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/dk/0000755000000000000000000000000012060044550013453 5ustar rootrootledgersmb/sql/coa/dk/chart/0000755000000000000000000000000012060044550014554 5ustar rootrootledgersmb/sql/coa/dk/chart/General.sql0000755000000000000000000002030611726630426016671 0ustar rootrootbegin; -- Default chart of accounts -- sample only SELECT account_heading_save(NULL,'1000','KORTFRISTEDE AKTIVER', NULL); SELECT account_save(NULL,'1061','Bank','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1065','Kasse','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno in ('1061', '1065'); SELECT account_save(NULL,'1200','Indbetalinger','A','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1205','Hensættelser til formodet gæld','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1210','Moms indgående','A','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_heading_save(NULL,'1500','LAGER-AKTIVER', NULL); SELECT account_save(NULL,'1520','Lager / udstyr','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1530','Lager / programmel','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1540','Lager / tillægssalg','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1550','Lager / arrangementer','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL,'1800','AKTIVER', NULL); SELECT account_save(NULL,'1820','Kontorinventar og -udstyr','A','', NULL, false, false, string_to_array('AP_amount', ':')); insert into chart (accno,description,charttype,gifi_accno,category,link,contra) values ('1825','Samlede afskrivninger, inventar, udstyr','A','','A','','1'); SELECT account_save(NULL,'1840','Køretøjer','A','', NULL, false, false, string_to_array('AP_amount', ':')); insert into chart (accno,description,charttype,gifi_accno,category,link,contra) values ('1845','Samlede afskrivninger, køretøjer','A','','A','','1'); SELECT account_heading_save(NULL,'2000','KORTFRISTET GÆLD', NULL); SELECT account_save(NULL,'2100','Udbetalinger','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'2160','Selskabsskat','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2190','Afgifter','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2311','Moms udgående','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_heading_save(NULL,'2600','LANGFRISTET GÆLD', NULL); SELECT account_save(NULL,'2620','Banklån','L','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'3300','AKTIEKAPITAL', NULL); SELECT account_save(NULL,'3350','Almindelige aktier','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'3500','EGENKAPITAL', NULL); SELECT account_save(NULL,'3510','Egenkapital primo','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3600','Årets resultat','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'4000','SALGSINDTÆGT', NULL); SELECT account_save(NULL,'4020','Salg / udstyr','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'4030','Salg / programmel','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'4040','Salg / tillægssalg','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'4050','Salg / arrangementer','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL,'4300','KONSULENTINDTÆGT', NULL); SELECT account_save(NULL,'4320','Konsulentbistand','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'4330','Programmering','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL,'4400','ANDEN INDTÆGT', NULL); SELECT account_save(NULL,'4440','Renter','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4450','Foreign Exchange Gain','I','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5000','SALGSOMKOSTNINGER', NULL); SELECT account_save(NULL,'5020','Omkostninger / udstyr','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5010','Anskaffelser under 8.000','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5011','Anskaffelser over 8.000','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5030','Omkostninger / programmel','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5040','Omkostninger / tillægssalg','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5050','Omkostninger / arrangementer','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5100','Fragt, post','E','', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL,'5400','LØNUDGIFTER', NULL); SELECT account_save(NULL,'5410','Lønninger og honorarer','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5420','ATP','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5470','Personalegoder','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5600','GENERELLE & ADMINISTRATIVE UDGIFTER', NULL); SELECT account_save(NULL,'5610','Bogføring, revision, advokat','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5615','Marketing','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5620','Dårlige skyldnere','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5660','Afdrag på lån','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5680','A-skat','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5685','Forsikringer','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5690','Renter og bankgebyrer','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5700','Kontorudgifter','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5760','Husleje','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5765','Vedligeholdelse og reparation','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5780','Telefon','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5785','Rejser & repræsentation','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5790','El, vand, varme','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5800','Licenser','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5810','Foreign Exchange Loss','E','', NULL, false, false, string_to_array('', ':')); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '1210'),0.25); insert into tax (chart_id,rate) values ((select id from chart where accno = '2311'),0.25); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '1520')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '4020')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '5010')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '4450')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '5810')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'DKK'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); -- commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/no/0000755000000000000000000000000012060044550013471 5ustar rootrootledgersmb/sql/coa/no/chart/0000755000000000000000000000000012060044550014572 5ustar rootrootledgersmb/sql/coa/no/chart/General.sql0000755000000000000000000010121411730320620016670 0ustar rootrootbegin; -- Default chart of accounts -- charset: ISO-8859-1, see: -- http://www.idrett.no/TEMA/KLUBBGUIDEN/%C3%98KONOMI/Sider/regnskap.aspx -- http://www.idrett.no/tema/klubbguiden/%C3%B8konomi/Documents/Norskstandardkontoplan_ny.pdf -- -- http://web.archive.org/web/20041227034757/http://www.legemiddelverket.no/rundskriv/frahtil/1999/ik-1499.htm -- -- sample only SELECT account_heading_save(NULL,'10','Immaterielle eiendeler', NULL); SELECT account_save(NULL,'1000','Forskning og utvikling','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1030','Patenter','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1040','Lisenser','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1050','Varemerker','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1060','Andre rettigheter','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1070','Utsatt skattefordel','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1080','Goodwill','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'11','Varige driftsmidler', NULL); SELECT account_save(NULL,'1100','Bygninger','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1120','Bygningsmessige anlegg','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1140','Jord- og skogbrukseiendommer','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1150','Tomter og andre grunnarealer','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'12','Transportmidler, inventar, maskiner o.l.', NULL); SELECT account_save(NULL,'1200','Maskiner og anlegg','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1210','Maskiner og anlegg under utførelse','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1230','Biler','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1240','Andre transportmidler','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1250','Inventar','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1260','Fast bygningsinventar med annen avskrivning','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1270','Verktøy mv.','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1280','Kontormaskiner','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'13','Finansielle anleggsmidler', NULL); SELECT account_save(NULL,'1300','Investeringer i datterselskaper','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1350','Investeringer i aksjer og andeler','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1360','Obligasjoner','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1370','Fordringer på eiere, styremedlemmer mv.','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1380','Fordringer på ansatte','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1390','Andre langsiktige fordringer','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '14', 'Varer', NULL); SELECT account_save(NULL,'1400','Råvarer og innkjøpte halvfabrikata','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1420','Varer under tilvirkning','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1440','Ferdige egentilvirkede varer','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1460','Innkjøpte varer for videresalg','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1480','Forskuddsbetaling til leverandører','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'15','Fordringer', NULL); SELECT account_save(NULL,'1500','Kundefordringer','A','', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1520','Andre kortsiktige fordringer','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1530','Opptjente, ikke fakturerte driftsinntekter','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1570','Andre kortsiktige fordringer','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1580','Avsetning tap på fordringer','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'17','Andre fordringer', NULL); SELECT account_save(NULL,'1700','Forskuddsbetalt leie','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1710','Forskuddsbetalt rente','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1720','Forskuddsbetalt lønn','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1750','Påløpte leieinntekter','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1760','Påløpte renteinntekter','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1780','Krav på innbetaling av selskapskapital','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'18','Investeringer', NULL); SELECT account_save(NULL,'1800','Aksjer & andeler i foretak i samme kons.','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1810','Markesdbaserte aksjer','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1820','Andre aksjer','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1830','Markedsbaserte obligasjoner','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1840','Andre obligasjoner','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1850','Markedsbaserte sertifikater','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1860','Andre sertifikater','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1880','Andre finansielle instrumenter','A','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'19','Bankinnskudd, kontanter o.l.', NULL); SELECT account_save(NULL,'1900','Kontanter','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1910','Kasse','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1920','Bankinnskudd','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1950','Bankinnskudd for skattetrekk','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_heading_save(NULL,'20','Egenkapital', NULL); SELECT account_heading_save(NULL,'200','Innskutt egenkapital', NULL); SELECT account_save(NULL,'2000','Aksjekapital','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2010','Egne aksjer','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2020','Overkursfond','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'204','Opptj. egenkapital', NULL); SELECT account_save(NULL,'2040','Fond for vurderingsforskjeller','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2050','Annen egenkapital','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2080','Udisponert overskudd','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2090','Udekket tap','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'210','Avsetninger for forpliktelser', NULL); SELECT account_save(NULL,'2100','Pensjonsforpliktelser','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2120','Utsatt skatt','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2140','Avsetn. for garanti- & serviceforpl.','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2180','Andre avsetninger for forpiktelser','L','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'220','Annen langsiktig gjeld', NULL); SELECT account_save(NULL,'2200','Konvertible lån','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2210','Obligsjonslån','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2220','Gjeld til kredittinstitusjoner','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2240','Pantelån','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2260','Gjeld til selskap i samme konsern','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2270','Andre valutalån','L','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'230','Kortsiktig gjeld', NULL); SELECT account_save(NULL,'2300','Konvertible lån','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2320','Sertifikatlån','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2340','Andre valutalån','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2360','Byggelån','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2380','Kassakreditt','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2400','Leverandørgjeld','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'2500','Avsatt betalbar skatt','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2510','Skattebetaling','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2600','Skattetrekk','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2620','Påleggstrekk','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2630','Bidragstrekk','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2640','Trygdetrekk','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2650','Forsikringstrekk','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2660','Fagforeningstrekk','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2690','Andre trekk','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2710','Utgående 25% mva','L','', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2720','Utgående 14% mva','L','', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2730','Utgående 8% mva','L','', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2717','Beregnet avgift utlandet','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2715','Inngående 25% mva','L','', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2725','Inngående 14% mva','L','', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2735','Inngående 25% mva','L','', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2745','Grunnlag 1 tjenester utlandet','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2746','Grunnlag 2 tjenester utlandet','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2750','Oppgjørskonto merverdiavgift','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2770','Påløpt arbeidsgiveravgift','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2780','Skyldig arbeidsgiveravgift','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2781','Arb.giv.avg. pål. feriep.','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2800','Avsatt utbytte','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2900','Forskudd fra kunder','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2910','Skyldig lønn','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2920','Skyldig feriepenger','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2930','Gjeld til ansatte og aksjonærer','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2950','Påløpte renter','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2960','Påløpte kostn. og forskuddsbet. inskudd','L','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'3','Salgs- og driftsinntekter', NULL); SELECT account_save(NULL,'3010','Salgsinntekter, 24% mva','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3019','Frakt','I','', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'3020','Salgsinntekter, 12% mva','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3060','Uttak av varer','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3080','Rabatter og andre salgsinntektsreduksjon','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3099','Miljøavgift','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3110','Salgsinntekter, avgiftsfrie','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'3160','Uttak av varer','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3180','Rabatter og andre salgsinntektsreduksjon','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3300','Spes. offent. avg. tilvirk./solgte varer','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3400','Spes. offent. avg. tilvirk./solgte varer','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3440','Spes. offentlige tilskudd for tjenester','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3500','Uopptjente inntekter garanti','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3510','Uopptjente inntekter service','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3600','Leieinntekter fast eiendom','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3610','Leieinntekter andre varige driftsmidler','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3620','Andre leieinntekter','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3700','Provisjonsinntekter','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3800','Gevinst ved avgang av anleggsmidler','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'3900','Andre driftsrelaterte inntekter','I','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'4','Varekostnad', NULL); SELECT account_heading_save(NULL,'40','Råvarer og halvfabrikata', NULL); SELECT account_save(NULL,'4010','Innkjøp varer, avgiftspliktig 24% mva','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4020','Innkjøp varer, avgiftspliktig 12% mva','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4060','Innkjøpsprisreduksjoner','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4070','Frakt, toll og spedisjon','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4090','Beholdningsendring','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4110','Innkjøp varer, avgiftsfritt','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4160','Frakt, toll og spedisjon','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4170','Frakt, toll og spedisjon, avgiftsfritt','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4180','Innkjøpsprisreduksjoner','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4190','Beholdningsendring','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'43','Varer for videresalg', NULL); SELECT account_save(NULL,'4310','Innkjøp av varer for videresalg, 24% mva','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4320','Innkjøp av varer for videresalg, 12% mva','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'4360','Frakt, toll m.m. vedr. innkjøp av varer for videresalg','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4370','Rabatter m.m. vedr. innkjøp av varer for videresalg','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4380','Varekostnad','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4390','Beholdningsendring varer for videresalg','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5','Lønnskostnader', NULL); SELECT account_save(NULL,'5010','Faste lønninger','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5090','Periodiseringskonto lønn','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5190','Påløpne feriepenger','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5210','Fri bil','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5220','Fri telefon','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5230','Fri avis','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5240','Fri losji og bolig','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5250','Rentefordel','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5260','Smusstillegg','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5280','Andre fordeler i arbeidsforhold','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5291','Motkonto for gruppe 52','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5330','Godtgj. til styre- og bedriftsforsamling','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5410','Arbeidsgiveravgift','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5411','Arb.giv.avg. pål. feriep.','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5420','Innberetningspliktige pensjonskostnader','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5430','Premie pensjonsordning','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5500','Andre kostnadsgodtgjørelser','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5510','Overtidsmat etter regning','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5520','Kantinekostnader','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5800','Refusjon av sykepenger','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5820','Refusjon av arbeidsgiveravgift','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5920','Yrkesskadeforsikring','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5930','Andre ikke arb.giv.avg.pliktige forsikr.','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5950','Personalforsikring','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5960','Gaver til ansatte','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'6','Andre driftskostnader, av- og nedskrivninger', NULL); SELECT account_save(NULL,'6000','Avskrivning på bygn. & annen fast eiend.','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6010','Avskrivning på transportmidler, maskiner','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6020','Avskrivning på immaterielle eiendeler','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6050','Nedskr. varige driftsmidl. & imat. eiend','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6100','Frakter, transportkostnader og forsikring','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6110','Toll og spedisjonskostnader ved forsend','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'62','Energi, brensel o.l. vedr. produksjon', NULL); SELECT account_save(NULL,'6200','Elektrisitet','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'6260','Vann','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL,'63','Kostnader. vedr. lokaler', NULL); SELECT account_save(NULL,'6300','Leie lokaler','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'6320','Renovasjon, vann, avløp mv.','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'6340','Lys, varme','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'6360','Renhold','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'64','Leie av maskiner, inventar o.l.', NULL); SELECT account_save(NULL,'6400','Leie av driftsmidler','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6430','Leie andre kontormaskiner','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6540','Inventar','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6550','Driftsmaterialer','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6560','Rekvisita','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'6570','Arbeidsklær og verneutstyr','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'6600','Reparasjoner og vedlikehold bygninger','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6620','Reparasjoner og vedlikehold utstyr','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6700','Revisjonshonorar','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6720','Honorar for økonomisk & juridisk bistand','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6750','Honorar regnskapsfører','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6800','Kontorrekvisita','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'6820','Trykksaker','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6840','Aviser, tidsskrifter, bøker mv.','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6860','Møter, kurs, oppdatering mv.','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6900','Telefon','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'6940','Porto','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7000','Drivstoff','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7020','Vedlikehold','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7040','Forsikringer','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7100','Bilgodtgjørelse, oppgavepliktig','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7105','Øreavrunding','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7130','Reisekostnader, oppgavepliktige','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7140','Reisekostnader, ikke oppgavepliktig','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7150','Diettkostnader, oppgaveplikig','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7160','Diettkostnader, ikke oppgavepliktig','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7200','Provisjonskostnader, oppgavepliktige','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7210','Provisjonskostnader, ikke oppgavepliktig','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7300','Salgskostnader','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7320','Reklamekostnader','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7350','Representasjon, fradragsberettiget','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7360','Representasjon, ikke fradragsberettiget','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7400','Kontingenter og gaver','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7500','Forsikringspremier','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7550','Garanti- og servicekostnader','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7600','Lisenesavgifter og royalties','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7700','Styre- og bedriftsforsamlingsmøter','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7710','Generalforsamling','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7730','Kostnader ved egne aksjer','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7750','Eiendoms- og festeavgift','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7770','Bank og kortgebyrer','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7800','Tap ved avgang anleggsmidler','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7820','Innkommet på tidligere nedskrevne fordri','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7830','Tap på fordringer','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7850','Tap pga. brannskade','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7860','Tap på kontrakter','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7900','Beholdningsendring anlegg under utførels','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'7990','Andre driftskostnader','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'8','Finansinntekter og -kostnader, skatter, m.m.', NULL); SELECT account_save(NULL,'8000','Inntekter på investeringer i datterselskap','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8040','Renteinntekter, skattefrie','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8050','Annen renteinntekt','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8060','Purregebyr, kunder','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8070','Renteinntekter, kunder','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8080','Agio gevinst','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8090','Andre finansinntekter','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8100','Verdired. av markedsbas.finans. omløps.','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8110','Nedskrivn. av andre finansielle omløps.','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8120','Nedskrivning av finansielle anleggsmidl.','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8140','Rentekostnader, ikke fradragsberettigede','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8150','Annen rentekostnad','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8160','Purregebyr. leverandør','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8180','Agio tap','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8300','Betalbar skatt','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8320','Utsatt skatt','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8350','Skattekostnad','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8600','Betalbar skatt','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8620','Utsatt skatt','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'880','Fond for vurderingsforskjeller', NULL); SELECT account_save(NULL,'8800','Årsresultat','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8900','Overføringer fond for vurderingsforskjel','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'892','Utbytte', NULL); SELECT account_save(NULL,'8920','Avsatt utbytte/renter på grunnfondsbevis','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'893','Konsernbidrag', NULL); SELECT account_save(NULL,'8930','Konsernbidrag','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'891','Annen egenkapital', NULL); SELECT account_save(NULL,'8910','Overføringer felleseid andelskapital for','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8940','Aksjonærbidrag','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8950','Fondsemisjon','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8960','Overføringer annen egenkapital','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8980','Avsatt til fri egenkapital','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'8990','Udekket tap','E','', NULL, false, false, string_to_array('', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE id IN (select account_id FROM account_link WHERE description = 'AP_paid'); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '2710'),0.25); insert into tax (chart_id,rate) values ((select id from chart where accno = '2720'),0.14); insert into tax (chart_id,rate) values ((select id from chart where accno = '2730'),0.08); insert into tax (chart_id,rate) values ((select id from chart where accno = '2715'),0.25); insert into tax (chart_id,rate) values ((select id from chart where accno = '2725'),0.14); insert into tax (chart_id,rate) values ((select id from chart where accno = '2735'),0.08); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '1250')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '3010')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '4010')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '8080')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '8180')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'NOK:EUR:USD'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); -- commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/id/0000755000000000000000000000000012060044550013451 5ustar rootrootledgersmb/sql/coa/id/chart/0000755000000000000000000000000012060044550014552 5ustar rootrootledgersmb/sql/coa/id/chart/General.sql0000755000000000000000000001763311726630426016700 0ustar rootrootbegin; -- Default chart of accounts -- sample only SELECT account_heading_save(NULL,'1000','AKTIVA LANCAR', NULL); SELECT account_save(NULL,'1060','Bank','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1065','Kas Kecil','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno in ('1060', '1065'); SELECT account_save(NULL,'1200','Piutang','A','', NULL, false, false, string_to_array('AR', ':')); SELECT account_heading_save(NULL,'1500','INVENTORY', NULL); SELECT account_save(NULL,'1520','Inventory / Umum','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1530','Inventory / Aftermarket Parts','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL,'1800','AKTIVA TETAP', NULL); SELECT account_save(NULL,'1820','Perabot Kantor & Peralatan','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1825','Akumulasi Amort. Perabot & Peralatan','A','', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'1840','Kendaraan','A','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1845','Akumulasi Amort. Kendaraan','A','', NULL, true, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'2000','HUTANG LANCAR', NULL); SELECT account_save(NULL,'2100','Hutang Dagang','L','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'2160','Hutang Pajak','L','', NULL, false, false, string_to_array('', ':')); --SELECT account_save(NULL,'2190','Federal Income Tax Payable','L','', NULL, false, false, string_to_array('', ':')); --SELECT account_save(NULL,'2210','Workers Comp Payable','L','', NULL, false, false, string_to_array('', ':')); --SELECT account_save(NULL,'2220','Vacation Pay Payable','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2250','Hutang Rencana Pensiun','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2260','Hutang Asuransi Karyawan','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2280','Hutang Pajak Gaji','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2310','PPn (10%)','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); --SELECT account_save(NULL,'2320','VAT (14%)','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); --SELECT account_save(NULL,'2330','VAT (30%)','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_heading_save(NULL,'2600','HUTANG JANGKA PANJANG', NULL); SELECT account_save(NULL,'2620','Hutang Bank','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2680','Hutang ke Pemegang Saham','L','', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_heading_save(NULL,'3300','MODAL', NULL); SELECT account_save(NULL,'3350','Modal Umum','Q','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'4000','PENDAPATAN PENJUALAN', NULL); SELECT account_save(NULL,'4020','Penjualan / General','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'4030','Penjualan / Aftermarket Parts','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL,'4300','PENDAPATAN KONSULTASI', NULL); SELECT account_save(NULL,'4320','Jasa Konsultasi','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL,'4400','PENDAPATAN LAIN', NULL); SELECT account_save(NULL,'4430','Jasa Pengiriman dan Pengepakan','I','', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'4440','Bunga','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'4450','Keuntungan Selisih Kurs','I','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5000','BIAYA PENJUALAN', NULL); SELECT account_save(NULL,'5010','Pembelian','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5020','COGS / General','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5030','COGS / Aftermarket Parts','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5100','Ongkos Kirim','E','', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL,'5400','BIAYA GAJI', NULL); SELECT account_save(NULL,'5410','Biaya Gaji','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5420','Biaya Asuransi Karyawan','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5430','Biaya Rencana Pensiun','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL,'5600','BIAYA UMUM DAN ADMINISTRASI', NULL); SELECT account_save(NULL,'5610','Akunting dan Legalitas','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5615','Iklan dan Promosi','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5650','Capital Cost Allowance Expense','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5660','Biaya Amortisasi','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5680','Biaya Pajak Pendapatan','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5685','Asuransi','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5690','Biaya Bank dan Bunga','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5700','Biaya Keperluan Kantor','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5760','Biaya Sewa','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5765','Reparasi & Maintenance','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5780','Telephone','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5785','Perjalanan dan Entertainment','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5790','Utilitas','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5795','Registrasi','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5800','Licensi','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5810','Rugi Selisih Kurs','E','', NULL, false, false, string_to_array('', ':')); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '2310'),0.1); --insert into tax (chart_id,rate) values ((select id from chart where accno = '2320'),0.14); --insert into tax (chart_id,rate) values ((select id from chart where accno = '2330'),0.3); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '1520')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '4020')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '5010')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '4450')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '5810')); UPDATE defaults SET value = 'IDR:USD:CAD:EUR' where setting_key = 'curr'; UPDATE defaults SET value = 'kg' WHERE setting_key = 'weightunit'; -- commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/be/0000755000000000000000000000000012060044550013443 5ustar rootrootledgersmb/sql/coa/be/gifi/0000755000000000000000000000000012060044550014361 5ustar rootrootledgersmb/sql/coa/be/gifi/General.sql0000755000000000000000000001302410573160304016465 0ustar rootrootbegin; -- contribué par Jens-Ingo Brodesser, jens-ingo@all2all.org, Moving Art Studio ASBL, ALL2ALL The Independent Network -- le 15/07/2003 INSERT INTO gifi (accno,description) VALUES ('10','Capital'); INSERT INTO gifi (accno,description) VALUES ('30','Approvisionnements - Matières premières'); INSERT INTO gifi (accno,description) VALUES ('11','Primes d''émission'); INSERT INTO gifi (accno,description) VALUES ('12','Plus-values de réévaluation'); INSERT INTO gifi (accno,description) VALUES ('13','Réserves'); INSERT INTO gifi (accno,description) VALUES ('14','Bénéfice reporté [ou Perte reportée (-)]'); INSERT INTO gifi (accno,description) VALUES ('15','Subsides en capital'); INSERT INTO gifi (accno,description) VALUES ('16','Provisions pour risques et charges et impôts différés'); INSERT INTO gifi (accno,description) VALUES ('17','Dettes à plus d''un an'); INSERT INTO gifi (accno,description) VALUES ('40','Créances commerciales'); INSERT INTO gifi (accno,description) VALUES ('20','Frais d''établissement'); INSERT INTO gifi (accno,description) VALUES ('21','Immobilisations incorporelles'); INSERT INTO gifi (accno,description) VALUES ('22','Terrains et constructions'); INSERT INTO gifi (accno,description) VALUES ('23','Installations, machines et outillage'); INSERT INTO gifi (accno,description) VALUES ('24','Mobilier et matériel roulant'); INSERT INTO gifi (accno,description) VALUES ('25','Immobilisations détenues en location-finac. et droits similaires'); INSERT INTO gifi (accno,description) VALUES ('31','Approvis. - Fournitures'); INSERT INTO gifi (accno,description) VALUES ('27','Autres immobilisations corporelles en cours et acompts versés'); INSERT INTO gifi (accno,description) VALUES ('26','Autres immobilisations corporelles'); INSERT INTO gifi (accno,description) VALUES ('28','Immobilisations financières'); INSERT INTO gifi (accno,description) VALUES ('29','Créances à plus d''un an'); INSERT INTO gifi (accno,description) VALUES ('4115','TVA DUE TOTAL'); INSERT INTO gifi (accno,description) VALUES ('33','Produits finis'); INSERT INTO gifi (accno,description) VALUES ('32','Encours fabrication'); INSERT INTO gifi (accno,description) VALUES ('34','Marchandises'); INSERT INTO gifi (accno,description) VALUES ('35','Immeubles déstinés à la vente'); INSERT INTO gifi (accno,description) VALUES ('36','Acomptes s/achats stocks'); INSERT INTO gifi (accno,description) VALUES ('37','Commandes en cours d''exécution'); INSERT INTO gifi (accno,description) VALUES ('41','Autres créances'); INSERT INTO gifi (accno,description) VALUES ('42','Dettes à plus d''un an échéant dans l''année'); INSERT INTO gifi (accno,description) VALUES ('43','Dettes financières'); INSERT INTO gifi (accno,description) VALUES ('44','Dettes commerciales'); INSERT INTO gifi (accno,description) VALUES ('45','Dettes fiscales, salariales et sociales'); INSERT INTO gifi (accno,description) VALUES ('46','Acomptes réçus s/commandes'); INSERT INTO gifi (accno,description) VALUES ('48','Dettes diverses'); INSERT INTO gifi (accno,description) VALUES ('47','Dettes découlants de l''affectation du résultat'); INSERT INTO gifi (accno,description) VALUES ('49','Comptes de régularisation et comptes d''attente'); INSERT INTO gifi (accno,description) VALUES ('50','Actions propres'); INSERT INTO gifi (accno,description) VALUES ('51','Actions et parts'); INSERT INTO gifi (accno,description) VALUES ('52','Titres à revenu fixe'); INSERT INTO gifi (accno,description) VALUES ('53','Dépôts à terme'); INSERT INTO gifi (accno,description) VALUES ('54','Valeurs échues à l''encaissement'); INSERT INTO gifi (accno,description) VALUES ('55','Etablissements de crédit'); INSERT INTO gifi (accno,description) VALUES ('56','Office des chèques postaux'); INSERT INTO gifi (accno,description) VALUES ('57','Caisses'); INSERT INTO gifi (accno,description) VALUES ('58','Virements internes'); INSERT INTO gifi (accno,description) VALUES ('60','Approvis. et marchandises'); INSERT INTO gifi (accno,description) VALUES ('61','Services et biens divers'); INSERT INTO gifi (accno,description) VALUES ('62','Rémunérations, charges sociales, pensions'); INSERT INTO gifi (accno,description) VALUES ('63','Amortissements, réductions valeur, provisions risques et charges'); INSERT INTO gifi (accno,description) VALUES ('64','Autres charges d''exploitation'); INSERT INTO gifi (accno,description) VALUES ('65','Charges financières'); INSERT INTO gifi (accno,description) VALUES ('66','Charges exceptionnelles'); INSERT INTO gifi (accno,description) VALUES ('67','Impôts sur le résultat'); INSERT INTO gifi (accno,description) VALUES ('68','Transferts aux réserves immunisées et aux impôts différés'); INSERT INTO gifi (accno,description) VALUES ('69','Affectations et prélèvements'); INSERT INTO gifi (accno,description) VALUES ('70','Chiffre d''affaires'); INSERT INTO gifi (accno,description) VALUES ('71','Variation de stock et des commandes en cours d''éxécution'); INSERT INTO gifi (accno,description) VALUES ('72','Production immobilisée'); INSERT INTO gifi (accno,description) VALUES ('74','Autres produits d''exploitation'); INSERT INTO gifi (accno,description) VALUES ('75','Produits financiers'); INSERT INTO gifi (accno,description) VALUES ('76','Produits exceptionnels'); INSERT INTO gifi (accno,description) VALUES ('77','Régularisations d''impôts et reprises provisions fiscales'); INSERT INTO gifi (accno,description) VALUES ('78','Prélèvements s/réserves immunisées et impôts différés'); INSERT INTO gifi (accno,description) VALUES ('79','Affectations et prélèvements'); commit; ledgersmb/sql/coa/be/chart/0000755000000000000000000000000012060044550014544 5ustar rootrootledgersmb/sql/coa/be/chart/General.sql0000755000000000000000000016357211726633756016707 0ustar rootrootbegin; -- selon PLAN COMPTABLE MINIMUM NORMALISE BELGE -- contribu. par Jens-Ingo Brodesser, jens-ingo@all2all.org -- verified May 19, 2006 -- SELECT account_heading_save(NULL, '000', '', NULL); SELECT account_save(NULL,'756000','Produits financiers divers','I','75', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'555000','DEX02','A','55', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'499200','Compte de repartition NDC - Verdelingsrekening CN','L','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'460','Acomptes reçus sur commandes','L','46', NULL, false, false, string_to_array('AR_paid', ':')); SELECT account_save(NULL,'4168','Rabais, ristournes, remises à obtenir et autres avoirs non encore reçus','A','416', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_heading_save(NULL, '43', 'Dettes financières - Financiële schulden', NULL); SELECT account_save(NULL,'2400','Mobilier - Meubilair','A','24', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'240190','Matériel bureau amort. anterieurs - Afschr. op bureaumaterieel vorig boekj.','A','24', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'221900','Constructions amort. anterieurs - Afschr. op gebouwen vorig boekj.','A','22', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'221910','Constructions amort. de l''exercice - Afschr. op gebouwen dit boekj.','A','22', NULL, true, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '75', 'Produits financiers - Financiële opbrengsten', NULL); SELECT account_save(NULL,'230900','Inst. techniques amort. anterieurs - Afschr. op installaties vorig boekj.','A','23', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'240090','Mobilier amort. anter. - Afschr. op meubilair vorig boekj.','A','24', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'240091','Mobilier amort. exercice - Afschr. op meubilair dit boekj.','A','24', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'240191','Matériel bureau amort. exercice - Afschr. op bureaumaterieel dit boekj.','A','24', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'240290','Materiel Informatique amort. anter. - Afschr. op hardware vorig boekj.','A','24', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'240291','Mat. informat. amort. exercice - Afschr. op hardware dit boekj.','A','24', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'241900','Voiture amort. anter. - Afschr. op wagen vorig boekj.','A','24', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'241910','Voiture amort. exercice - Afschr. op wagen dit boekj. ','A','24', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'260900','Amen. loc. loués amort. anter. - Inrichtingskost. vorig boekj.','A','26', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'230910','Inst. techniques amort. exercice - Afschr. op installaties dit boekj.','A','23', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'231900','Mach. et gros mat. amort. anterieurs - Afschr. op machines vorig boekj.','A','23', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'231910','Mach. et gros mat. amort. exercice - Afschr. op machines dit boekj.','A','23', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'237900','Outillage amort. anterieurs - Afschr. op uitrusting vorig boekj.','A','23', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'237910','Outillage amort. exercice - Afschr. op uitrusting dit boekj.','A','23', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'260910','Amen. loc. loués amort. exercice - Inrichtingskost. dit boekj.','A','26', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'451541','TVA DUE VENTES 21%','L','451', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'612200','Carburants voitures','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'630','Dotations amort., réduction valeur s/immo. - Afschr., waardeverm. op v. a., toevoeging','E','63', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'613210','Honoraires avocats','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'712','Des encours de fabrication - In de vooraad goederen in bewerking','I','71', NULL, false, false, string_to_array('IC_sale', ':')); SELECT account_save(NULL,'600','Achats matières premières - Aankopen van grondstoffen','E','60', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'614400','Entrée aux foires','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'742','Plus-values créances com. - Meerwaarden realis. handelsvorderingen','I','74', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'613304','Traiteurs-réception clientèle','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL, '64', 'Autres charges exploitation - Andere bedrijfskosten', NULL); SELECT account_heading_save(NULL, '76', 'Produits exceptionnels - Uitzonderlijke opbrengsten', NULL); SELECT account_save(NULL,'743000','Ventes diverses - Diverse bedrijfsopbrengsten','I','74', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'760100','sur immobilisations corp. - op materiële vaste activa','I','760', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'611150','Charges locatives voitures','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'771200','Reprises de provisions fiscales - Terugn. fiscale voorz.','I','771', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'794','Intervention associé perte - Tussenkomst vennoten verlies','I','79', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'404','Produits à recevoir - Te innen opbrengsten','A','40', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'500','Action propres - Eigen aandelen','A','50', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '41', 'Autres créances - Overige vorderingen', NULL); SELECT account_save(NULL,'407','Créances douteuses - Dubieuze debiteuren','A','40', NULL, false, false, string_to_array('AR_paid', ':')); SELECT account_save(NULL,'442001','Fournisseurs essence','L','44', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'608','Remises ristournes rabais obtenus - Ontvangen kortingen ristorno''s en rabatten (-)','E','60', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'612140','Internet','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL, '50', 'Actions propres - Eigen aandelen', NULL); SELECT account_heading_save(NULL, '6', 'CLASSE 6 -- CHARGES - KOSTEN', NULL); SELECT account_save(NULL,'611350','Entr. & Repar. Voitures & Veh. Mixtes','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'655000','Ecarts de conversion de devises','E','65', NULL, false, false, string_to_array('AR_paid:IC_sale:IC_expense', ':')); SELECT account_save(NULL,'451560','TVA DUE CO-CONTRACTANT','L','451', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'609000','de matières premières - van grondstofen','E','60', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'411590','TVA ACHATS 6%','A','411', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'411591','TVA ACHATS 21%','A','411', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'411620','TVA à régulariser (case 62)','A','411', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '411', 'TVA A RECUPERER - TERUG TE VORDEREN BTW', NULL); SELECT account_heading_save(NULL, '44', 'Dettes commerciales - Handelsschulden', NULL); SELECT account_save(NULL,'409','Réductions de valeur actées (-) - Geboekte waardevermindering','A','40', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'451540','TVA DUE VENTES 6%','L','451', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'640','Charges fiscales de l''exploitation - Bedrijfsbelastingen','E','64', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'713','Des Produits finis - In de voorraad gereed product','I','71', NULL, false, false, string_to_array('IC_sale', ':')); SELECT account_save(NULL,'750','Produits immo. financières - Opbrengsten financiële vaste activa','I','75', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'656500','Intérêts retards sociaux - Sociale achterst. interest','E','65', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'755000','Ecarts de convers. devises - Resultats omrekening vreemde valuta','I','75', NULL, false, false, string_to_array('IC_sale:IC_income', ':')); SELECT account_save(NULL,'754000','Différence de change - Wisselresultaten','I','75', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'761','Reprises réduct. valeur immo. fin. - Terugneming waardeverm. fin. v. a.','I','76', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'773','Impôts étrangers s/résultat - Buitenl. belasting op resultaat','I','77', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '77', 'Régularisation d''impôts, reprises provisions fiscales - Regul. belastingen en terugneming fiscale voorz.', NULL); SELECT account_heading_save(NULL, '7', 'CLASSE 7 -- PRODUITS - OPBRENGSTEN', NULL); SELECT account_save(NULL,'411640','TVA à recupérer s/NDC émises (case 64)','A','411', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'612300','Abonnements & Documentations','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'410','Capital appelé, non versé - Opgevraagd, niet-gestort kapitaal','A','41', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'417','Créances douteuses - Dubieuze debiteuren','A','416', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '451', 'TVA A PAYER - TE BETALEN BTW', NULL); SELECT account_save(NULL,'499000','Compte d''attente - Wachtrekening','L','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'455','Rémunerations - Bezoldigingen','L','45', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'601','Achat des fournitures - Aankoop van hulpstoffen','E','60', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_heading_save(NULL, '49', 'Comptes de régularisation - Overlopende- en wachtrekeningen', NULL); SELECT account_save(NULL,'613220','Honoraires notaires','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'414100','Indeminités s/sinistres à recevoir - Te ontvang. schadevergoed.','A','41', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '42', 'Dettes à plus d''un an écheant dans l''année - Schulden op meer dan één jaar die binnen het jaar verfallen', NULL); SELECT account_save(NULL,'613311','Deplacements étranger train, taxi, etc','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'611151','Charges locatives camions/camionnettes','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'432','Etabli. crédit, crédits d''acceptation - Acceptkrediten','L','43', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'433','Etabl. crédit, dettes cpt. courant - Schulden rekening courant','L','43', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'705100','DNS REGISTRY','I','70', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'609100','de fourniture - van hulpstoffen','E','60', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'656100','Frais de banque','E','65', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'620000','Administrateurs ou gérants - Bestuurders of zaakvoerders','E','62', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'618','Divers','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL, '65', 'Charges financières', NULL); SELECT account_save(NULL,'442004','VISA - décompte mensuel','L','44', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'620100','Personnel de direction - Directiepersoneel','E','62', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'617','Personnel intérimaire - Uitzendkrachten','E','61', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'440','Fournisseurs - Leveranciers','L','44', NULL, false, false, string_to_array('AP', ':')); SELECT account_heading_save(NULL, '52', 'Titres à revenu fixe - Vastrentende Effecten', NULL); SELECT account_heading_save(NULL, '4529', '453 - 459 Dettes salariales et sociales - Bezoldigingen en sociale schulden', NULL); SELECT account_save(NULL,'620','Rémunerations et avant. sociaux directs - Bezolgingen en rechts. sociale voordelen','E','62', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'602','Achats services, travaux, études - Aankopen diensten, werk, studies','E','60', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'612000','Eau','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'611351','Pneus Voitures & Vehic. Mixtes','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'641','Moins-values s/réalis. cour. d''immo. corp. - Minderwa. courante realis. vaste activa','E','64', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'715','Des immeubles constr. dest. à la vente - In de voorr. onroe. goederen best. v. verkoop','I','71', NULL, false, false, string_to_array('IC_sale', ':')); SELECT account_save(NULL,'612400','Imprimés & fournitures de bureau','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'414200','Subsides en capital à recevoir - Te ontv. kapitaalsubsidies','A','41', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '66', 'Charges exceptionnelles', NULL); SELECT account_save(NULL,'613230','Honoraires huissiers de justice','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'613313','Restaurants étranger','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL, '74', 'Autres produits exploitation - Andere bedrijfsopbrengsten', NULL); SELECT account_save(NULL,'610','Loyers et charges locatives','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL, '70', 'Chiffre d''affaires - Omzet', NULL); SELECT account_save(NULL,'751','Produits actifs circulants - Opbrengsten uit vlottende activa','I','75', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'705200','WEB HOSTING','I','70', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'442005','AMERICAN EXPRESS - décompte mensuel','L','44', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'762','Reprises provisions risq. charg. except. - Terugn. voorz. uitz. risico en kosten','I','76', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'780','Prélèvements s/impôts différés - Onttrekking a. uitgesteld. belast.','I','78', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '78', 'Prélèvements réserves immunisées et impôts différés - Onttrek. belast.vrije reserves en de uitgestelde belastingen', NULL); SELECT account_heading_save(NULL, '53', 'Dépôts à terme - Termijndeposito''s', NULL); SELECT account_save(NULL,'614100','Catalogues et imprimées','I','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'451500','TVA DUE ACHATS INCO','L','451', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'613110','Assurance vol','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'451543','TVA due 2e trimestre','L','451', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'609400','de marchandises - van handelsgoederen','E','60', NULL, false, false, string_to_array('AP_amount:IC_sale', ':')); SELECT account_save(NULL,'613305','Collations','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'612010','Chauffage','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'612410','Fournitures informatiques','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'613250','Honoraires sécretariat social','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'611362','Control technique voitures','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'482200','ASSOCIES - MEMBRES','L','48', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'612530','Petit outillage & petit matériel','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'613400','Seminaires & Recyclages','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'612540','Petit matériel informatique','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'603','Sous-traitances générales - Algemene onderaanemingen','E','60', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'743200','COTISATION DE MEMBRE','I','74', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'601000','Emballages perdus','E','60', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'230010','Inst. techniques acquis. exercice - Installaties m.b.t. dit boekj.','A','23', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'570000','CAISSE ESPECES - CONTANTEN','A','57', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'451544','TVA due 3e trimestre','L','451', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'411000','Cpt. curr. TVA à récuperer - Terug te vord. BTW: saldo BTW r/c','A','411', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'611152','Locations machines et outils','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL, '56', 'Office des chèques postaux - Postchèque en girodienst', NULL); SELECT account_save(NULL,'411593','TVA RECUP. 1ER TRIMESTRE TOTAL (case 59)','A','411', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '51', 'Actions et parts - Aandelen', NULL); SELECT account_save(NULL,'510010','Montants non-appelés (-) - Niet opgevraagde bedragen aan. (-)','A','51', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'609500','d''immeubles achétés destinés à vente - van gek. onroer. goederen best. v. verkoop','E','60', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '58', 'Virements interns - Interne overboekingen', NULL); SELECT account_heading_save(NULL, '416', 'Créances diverses - Diverse vorderingen ', NULL); SELECT account_save(NULL,'416200','Cpt. courant associés - Rekening-courant vennoten','A','416', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'418','Cautionnements versés en numéraire - Borgtochten betaald in contanten','A','416', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '67', 'Impôt sur le résultat', NULL); SELECT account_save(NULL,'654','Différence de change','E','65', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'642','Moins-values s/réalis. créances com. - Minderwa. realis. handelsvorderingen','E','64', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'717','Des commandes en cours exécution - In de bestelling in uitvoering','I','71', NULL, false, false, string_to_array('IC_sale', ':')); SELECT account_save(NULL,'752','Plus-values réalis. d''actifs circulants - Meerwaar. realis. v. vlottende activa','I','75', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'763','Plus-values s/réalis. actifs immo. - Meerwaar. realis. vaste a.','I','76', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'789','Prélèvements s/réserves immunisées - Onttrekking a. belast.vrije reserves','I','78', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '79', 'Affectations et prélèvements - Resultaatverwerking', NULL); SELECT account_save(NULL,'412','Impôts, précomptes à récupérer - Terug te vorderen belast. en voorheffingen','A','41', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'120','Plus-values de réévaluation sur immo. incorp. - Herwaarderingsmeerwaarde','L','12', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'121','Plus-values de réévaluation sur immo. corp. - Herwaarderingsmeerwaarde','L','12', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'122','Plus-values de réévaluation sur immo. financiers - Herwaarderingsmeerwaarde','L','12', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'123','Plus-values de réévaluation sur stocks - Herwaarderingsmeerwaarde','L','12', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'124','Reprises de réduction de valeur sur placements trésorerie - Herwaarderingsmeerwaarde','L','12', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '12', 'Plus-values de réévaluation - Herwaarderingsmeerwaarde', NULL); SELECT account_save(NULL,'110','Primes d''émission - Uitgiftepremies','L','11', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '11', 'Primes d''émission - Uitgiftepremies', NULL); SELECT account_heading_save(NULL, '643', '643-648 Charges d''exploitation diverses - Diverse berijfskosten', NULL); SELECT account_save(NULL,'612100','Telephone','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL, '10', 'Capital - Kapitaal', NULL); SELECT account_heading_save(NULL, '1', 'CLASSE 1 -- CAPITAL PROPRE, ... - EIGEN VERMOGEN, ...', NULL); SELECT account_heading_save(NULL, '60', 'Approv. et marchandises', NULL); SELECT account_save(NULL,'717000','Valeur d''acquisition - Aanschaffingswaarde','I','717', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '68', 'Transferts comptes immunisées et impôts différés', NULL); SELECT account_save(NULL,'130','Réserve légale - Wettelijke reserve','L','13', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'131100','Autres réserves indisponibles - Andere onbeschikbare reserves','L','13', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'132','Réserves immunisées - Belastingvrije reserves','L','13', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'131000','Réserves pour actions propres - Reserve voor eigen aandelen','L','13', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'133','Réserves disponibles - Beschikbare reserves','L','13', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'101','Capital non appelé (-) - Niet opgevraagd kapitaal (-)','L','10', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '14', 'Bénéfice/perte reporté(e) - Overgedragen winst/verlies', NULL); SELECT account_save(NULL,'100','Capital souscrit - Geplaatst kapitaal','L','10', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'601010','Emballages recuperables','E','60', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'140','Bénéfice/perte reporté(e) - Overgedragen winst/verlies','Q','14', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '15', 'Subsides en capital - Kapitaalsubsidies', NULL); SELECT account_save(NULL,'419','Réductions de valeur actées (-) - Geboekte waardevermindering (-)','A','416', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'612450','Photocopies-Photographies','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'131','Réserves indisponibles - Onbeschikbare reserves','L','13', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '16', 'Provisions et impôts différés - Voorz. en uitgestelde belastingen', NULL); SELECT account_save(NULL,'160','Provisions pensions et obligations - Voorz. pensioenen en soortg. verplichtingen','L','16', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'161','Provisions charges fiscales - Voorz. belastingen','L','16', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'162','Provisions gros entretiens et réparations - Voorz. grote herstel/onderh.','L','16', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'163','Provisions autres risques-charges - Voorzieningen voor Lijfrente','L','16', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'753','Subsides en capital et intérêts - Kapitaal- en interestsubsidies','I','75', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'705000','Prestations de services - Verkopen en dienstprestaties','I','70', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '764', '764-769 Autres produits execptionnels - Andere uitz. opbrengsten', NULL); SELECT account_save(NULL,'790','Bénéfice reporté exercice précéd. - Overgedragen winst vorige boekj.','I','79', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'168200','Impôts diff. s/+value immo. corp. - Uitg. belast./meerwa./mat. v.a.','L','16', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'604','Achats marchandises - Aankopen van handelsgoederen','E','60', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_save(NULL,'168000','Impôts diff. s/subsides en capital - Uitgest. belast./Kapitaalsubsidie','L','16', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'613265','Honoraires d''autres','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'620800','Assurance revenus garantis','E','62', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'168800','Impôts différés étrangers - Uitg. belast. buitenland','L','16', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '17', 'Dettes à plus d''un an - Schulden op meer dan een jaar', NULL); SELECT account_save(NULL,'150','Montants obtenus - Kapitaalsubsidies','L','15', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'172000','Dettes location fin. et assimilées - Leasingschuld. van vaste activa','L','17', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'231010','Mach. et gros mat. acquis. exercice - Machines m.b.t. dit boekj.','A','23', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'451610','TVA à régulariser (case 61)','L','45', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'456','Pécules de vacances - Vakantiegeld','L','45', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'176','Acomptes reçus sur commandes','L','17', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '47', 'Dettes affectation résultat - Schulden besteming resultaat', NULL); SELECT account_save(NULL,'620200','Employés - Bedienden','E','62', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'178','Cautionnements reçu en numéraire - Borgtocht. ontvang. in contanten','L','17', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'179','Dettes diverses - Overige schulden','L','17', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'174','Autres emprunts - Overige schulden','L','17', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '2', 'CLASSE 2 -- FRAIS D''ETABLISSEMENT, ACTIFS IMMOBILISES, ... - OPRICHTINGSKOSTEN, VASTE ACTIVA, ...', NULL); SELECT account_heading_save(NULL, '20', 'Frais d''établissement - Oprichtingskosten', NULL); SELECT account_save(NULL,'200','Frais de constitution - Kosten van oprichting','A','20', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'200000','Fr. const. acquis. anterieurs - Kost. opricht./kapitaalverhoging','A','20', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'605','Achats d''immeubles destinés vente - Aankopen onroer. goederen bestemd v. verkoop','E','60', NULL, false, false, string_to_array('IC_cogs', ':')); SELECT account_heading_save(NULL, '61', 'Services et biens divers', NULL); SELECT account_heading_save(NULL, '69', 'Affectations et prélèvements', NULL); SELECT account_save(NULL,'200900','Fr. const. amort. anterieur - Afschr. kost. opricht./kap.verh. vorig','A','20', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'200910','Fr. const. amort. de l''exercice - Afschr. kost. opricht./kap.verh. dit','A','20', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'612020','Electricité','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'202','Autres frais d''établissement - Overige oprichtingskosten','A','20', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'204','Frais de restructuration - Herstructureringskosten','A','20', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'201','Frais d''émission d''emprunts - Kosten bij uitgifte van leningen','A','20', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '21', 'Immobilisations incorporelles - Immateriele vaste activa', NULL); SELECT account_save(NULL,'211','Concessions, brevets, licences, ... - Consessies, octrooien, licenties, ...','A','21', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'210','Frais de recherches et developpement - Kosten van onderzoek en ontwikkeling','A','21', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'212','Goodwill','A','21', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'213','Acomptes versés - Vooruitbetalingen','A','21', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'214','Surprix afférents acquisition d''une participation','A','21', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '22', 'Terrains et constructions - Terreinen en gebouwen', NULL); SELECT account_heading_save(NULL, '743', '743-749 Produits d''exploitation divers - Diverse bedrijfsopbrengsten', NULL); SELECT account_save(NULL,'580000','TRANSFERTS INTERNES DES FONDS - TRANSFERTEN','A','58', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'221','Constructions - Gebouwen','A','22', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'717100','Bénéfice pris en compte - Toegerekende winst','I','717', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '756', '756-759 Produits financiers divers - Diverse financiële opbrengsten', NULL); SELECT account_save(NULL,'222','Terrains bâtis - Bebouwde terreinen','A','22', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '13', 'Réserves - Reserves', NULL); SELECT account_save(NULL,'223','Autres droits réels sur immeubles - Overige zakelijke rechten op onroe.','A','22', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'221000','Constructions acquis. anterieurs - Geb. aanschaffingsprijs vorig. boekj.','A','22', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'411594','TVA RECUP. 2E TRIMESTRE TOTAL','A','411', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'771','Impôts belges sur le résultat - Belgische belasting op het resultaat','I','77', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '23', 'Installations, machines et outillage - Installaties, machines en uitrusting', NULL); SELECT account_save(NULL,'230','Installations - Installaties','A','23', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'230000','Inst. techniques acquis. anterieurs - Installaties m.b.t. vorig boekj.','A','23', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'620300','Ouvriers - Arbeiders','E','62', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'231','Machines','A','23', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'791','Prélèvement s/capital et primes émissions - Onttrek. kapitaal e. uitgiftepre.','I','79', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'220','Terrains - Terreinen','A','22', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'237','Outillage - Uitrusting','A','23', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'231000','Mach. et gros mat. acquis anterieurs - Machines m.b.t. vorig boekj.','A','23', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'613100','Assurance incendie','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'613275','Publications légales','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'237000','Outillage acquis. anterieurs - Uitrusting m.b.t. vorig boekj.','A','23', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '24', 'Mobilier et matériel roulant - Meubilair en rollend materieel', NULL); SELECT account_save(NULL,'2401','Matériel de bureau - Bureaumaterieel','A','24', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2402','Matériel informatique - Hardware','A','24', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'241','Voiture - Rollend materieel (wagen)','A','24', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '62', 'Rémunérations, charges sociales et pensions', NULL); SELECT account_heading_save(NULL, '25', 'Immobilis. en loc-financement - Vaste activa in leasing of op grond', NULL); SELECT account_save(NULL,'612120','GSM','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'242','Camions - Rollend materieel (vrachtwagen)','A','24', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'250','Terreins loc-fin - Terreinen in leasing','A','25', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'251','Install., machines loc-fin - Installaties, machines in leasing','A','25', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'309','Réduction val. act. mat. premières (-) - Geboekte waardev. grondst. (-)','A','30', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'253','Matériel en loc-fin - Uitrusting in leasing','A','25', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'254','Mat. inform. en loc-fin- Hardware in leasing','A','25', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'255','Mat. roulant en loc-fin - Rollend materieel leasing','A','25', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '26', 'Autres immobilisations corp. - Andere materiele vaste activa', NULL); SELECT account_save(NULL,'260','Amenagement locaux loués - Inrichtingskost. gehuurde gebouw','A','26', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'613130','Assurance crédit','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'300','Approv. matière première - Grondstoffen','A','30', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'411595','TVA RECUP. 3E TRIMESTRE TOTAL','A','411', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '48', 'Dettes diverses - Diverse schulden', NULL); SELECT account_save(NULL,'270','Immo. corp. en cours et acomptes versés - V. activa in aanbouw en vooruit','A','27', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'613300','Deplacements Belg. train, taxi, etc','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL, '27', 'Immo. corp. en cours et acomptes versés - V. activa in aanbouw en vooruit ', NULL); SELECT account_save(NULL,'252','Mobilier en loc-fin - Meubilair in leasing','A','25', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'168100','Impôts diff. s/+value immo. incorp. - Uitg. belast./meerwa./immat. v.a.','L','16', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'168700','Impôts diff. s/+value fonds publ. belges - Uitg. bel./meerwa./belg. effecten','L','16', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '28', 'Immobilisations financiers - Financiele vaste activa', NULL); SELECT account_save(NULL,'620400','Autres membres du personnel - Andere personeelsleden','E','62', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'649','Ch. exploit. portées actif c. frais de restruct. (-) - Als herstruct.kost. geactiv. bedrijfsk. (-)','E','64', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '71', 'Variation stocks et commandes en cours - Wijzigingen vorraden en in de bestellingen in uitvoering', NULL); SELECT account_save(NULL,'740','Subsides et montants compensat. - Subsidies en compens. bedragen','I','74', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'760','Reprises amort. et réduct. valeur - Terugneming afschr. en waardeverm.','E','76', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'280','Participations entreprises liées - Aanschaffingsw. deeln. verb. ond.','A','28', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'771000','Régularisations impôts dus versés - Regularisiering versch. of betaal. belast.','I','771', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'281','Créances s/entreprises liées - Vorderingen op rekening','A','28', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'283','Créances s/entr. avec lien de part.','A','28', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'284','Autres actions et parts - Aanschaffingsw. and. aand.','A','28', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'285','Autres créances - Overige vorderingen','A','28', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'288','Cautions versés en numeraire - Borgtocht. betaald in contanten','A','28', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'792','Prélèvements réserves - Onttrekking reserves','I','79', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'173100','Promesses banque - Promessen bank','L','17', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'290','Créances commerciales - Commerciele vorderingen','A','29', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'441','Effets à payer - Te betalen wissels','L','44', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'430','Emprunts en compte à terme fixe - Leningen op rekeningen vaste termijn','L','43', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'451630','TVA sur NDC reçues (case 63)','L','45', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '29', 'Créances à plus d''un an - Vorderingen op meer dan een jaar', NULL); SELECT account_heading_save(NULL, '45', 'Dettes fiscales, salariales, sociales - Schulden m. betrekking tot belastingen, bezoldingen en sociale lasten', NULL); SELECT account_save(NULL,'452','Impôts et taxes à payer','L','45', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'290000','Clients > 1 an - Handelsdebiteuren > 1 jaar','A','29', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'290100','Effects à recevoir >1 an - Te innen wissels > 1 jaar','A','29', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'290600','Acptes versés s/immo. financ. > 1 an - Vooruitbetalingen > 1 jaar','A','29', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'290700','Créances douteuses - Dubieuze debiteuren >1 jaar','A','29', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'290900','Réduction valeur actée cr.dout. - Geboekte waardevermindering (-)','A','29', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'291','Autres Créances > 1 an - Over. vorderingen op rekening > 1 j.','A','29', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '30', 'Approv. matières premières - Grondstoffen', NULL); SELECT account_heading_save(NULL, '3', 'CLASSE 3 -- STOCK ET COMMANDES EN COURS - GRONDSTOFFEN', NULL); SELECT account_save(NULL,'453','Précompte retenus - Ingehouden voorheffingen','L','45', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'459','Autres dettes sociales - Andere sociale schulden','L','45', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '31', 'Approv. et fournitures - Hulpstoffen', NULL); SELECT account_save(NULL,'431','Etabli. crédit, promesses - Kreditinstellingen, promessen','L','43', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'400','Clients - Handelsdebiteuren','A','40', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'319','Réduction valeur actées (-) - Geboekte waardev. hulpstoffen (-)','A','31', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '32', 'Encours de fabrication - Goederen in bewerking', NULL); SELECT account_save(NULL,'708','Remis. rabais ristourn. accordés (-) - Toegek. korting. ristorno''s rabat. (-) ','I','70', NULL, false, false, string_to_array('AR_amount:IC_expense', ':')); SELECT account_save(NULL,'741','Plus-values réalis. cour. immo. corp. - Meerwaar. cour. realis. materiële v.a.','I','74', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '33', 'Produits finis - Gereed Product', NULL); SELECT account_heading_save(NULL, '72', 'Production immobilisée - Geproduceerde vaste activa', NULL); SELECT account_save(NULL,'656600','Intérêts rétards com. - Com. achterst. interest','E','65', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL, '34', 'Marchandises - Handelsgoederen', NULL); SELECT account_save(NULL,'221010','Construction acquis. de l''exercice - Geb. aanschaffingsprijs dit boekj.','A','22', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'760000','sur immobilisations incorp. - op immateriële vaste activa','I','760', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '35', 'Immeubles destinés vente - Onroerende goederen bestemd. v. verk.', NULL); SELECT account_save(NULL,'771100','Régul. d''impôts estimés - Regul. geraamde belasting','I','771', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'793','Perte à reporter - Over te dragen verlies','I','79', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '4', 'CLASSE 4 -- CREANCES ET DETTES A UN AN AU PLUS - VORDERINGEN EN SCHULDEN OP TEN HOOGTE EEN JAAR', NULL); SELECT account_save(NULL,'552000','KBC56','A','55', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'411596','TVA RECUP. 4E TRIMESTRE TOTAL','A','411', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'444','Factures à recevoir - Te ontvangen facturen','L','44', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_heading_save(NULL, '40', 'Créances commerciales - Handelsvorderingen', NULL); SELECT account_save(NULL,'329','Réduction valuer actée (-) - Geboekte waardeverminderingen (-) ','A','32', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'339','Réductions de valeur actées (-) - Geboekte waardeverminderingen (-) ','A','33', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'340','Marchandises - Handelsgoederen','A','34', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'451000','COMPTE COURANT TVA DUE','L','451', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'349','Réduct. valeur actées (-) - Geboekte waardeverminderingen (-) ','A','34', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'359','Réductions valeur actées (-) - Geboekte waardeverminderingen (-) ','A','35', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'613150','Assurance tous risques matériel élec.','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL, '63', 'Amortissements, réd. val., provi. risques et charges - Afschrijvingen waardevermin. en voorzieningen v. risico''s kost.', NULL); SELECT account_save(NULL,'510000','Titres cotés - Aandelen op beurs','A','51', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '5', 'CLASSE 5 - PLACEMENTS DE TRESORIERIE - LIQUIDE MIDDELEN / GELDBELEGGINGEN', NULL); SELECT account_heading_save(NULL, '54', 'Valeurs échues à encaissement - Te incasseren verfallen waarden', NULL); SELECT account_heading_save(NULL, '55', 'Banque - Rekening-courant', NULL); SELECT account_save(NULL,'613303','Restaurants','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'310','Valeur d''acquisition - Aanschaffingswaarde hulpstoffen','A','31', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'320','Valeur d''acquisition - Aanschaffingsw. goed. bewerking','A','32', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'330','Produits finis - Gereed product','A','33', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'350','Immeubles - Aanschaffingsw. onr. goed. verkoop','A','35', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'609','Variation de stock - Voorraadwijzigingen','E','60', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'621','Cotisation patronales d''assur. sociales - Werkgeversbijdragen soc. verzekeringen','E','62', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'451640','TVA à recupérer s/NDC émises','L','45', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'454','O.N.S.S. - R.S.Z.','L','45', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'640700','TVA non-deductible','E','64', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'401','Effets à recevoir - Te innen wissels','A','40', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'414','Produits à recevoir - Te innen opbrengsten','A','41', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'450','Dettes fiscales estimées - Geramd bedrag der belastingschulden','L','45', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '46', 'Acomptes reçus sur commandes', NULL); SELECT account_save(NULL,'499100','Compte de repartition - Verdelingsrekening','L','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'553000','KBC40','A','55', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'613180','Assurance RC professionnelle','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'452500','Précompte immobilier - Onroerende voorhoeffing','L','45', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'554000','KBC83','A','55', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'612150','Frais postaux','E','61', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'451545','TVA due 4e trimestre','L','451', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'200010','Fr. const. acquis. de l''exercice - Kost. opricht./kap.verh. dit boekjaar','A','20', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'451542','TVA due 1er trimestre (case 54)','L','451', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'451570','TVA DUE SUR IMPORTATIONS','L','451', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'540','Chèques à encaisser - Te incasseren chèques','A','54', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'611340','Entretiens & réparations locaux','E','61', NULL, false, false, string_to_array('AR_amount:AP_amount:IC_expense', ':')); SELECT account_save(NULL,'665000','Pertes et charges diverses','E','66', NULL, false, false, string_to_array('AR_paid:AP_amount', ':')); SELECT account_save(NULL,'665200','Perte définitive créance douteuse','E','66', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'237010','Outillage acquisition exercice - Uitrusting m.b.t. dit boekj.','A','23', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'623600','Vêtements de travail employés','E','62', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'612520','Emballages perdus','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'240200','Mat. informatique acquis anterieurs - Hardware m.b.t. vorig boekj.','A','24', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'240210','Matériel informatique acquis. exercice - Hardware m.b.t. dit boekj.','A','24', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'260000','Amenagement locaux loués acquis anterieurs - Inrichtingskost. m.b.t. vorig boekj.','A','26', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'240000','Mobilier acquis. anterieurs - Meubilair m.b.t. vorig boekj.','A','24', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'240010','Mobilier acquis. exercice - Meubilair m.b.t. dit boekj.','A','24', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'240110','Mat. bureau acquis. exercice - Bureaumaterieel m.b.t. dit boekj.','A','24', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'240100','Mat. bureau acquis. anterieurs - Bureaumaterieel m.b.t. vorig boekj.','A','24', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'241000','Voiture acquis. anterieurs - Wagen m.b.t. vorig boekj.','A','24', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'241010','Voiture acquis. exercice - Wagen m.b.t. dit boekj. ','A','24', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL, '57', 'Caisses - Kassen', NULL); SELECT account_save(NULL,'510200','Titrés non-cotés - Aandelen niet op beurs','A','51', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'510090','Réduct. valeur actées (-) - Geb. waardev. aandelen (-)','A','51', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'510210',' Montants non-appelés (-) - Niet opgevraagde bedragen aan. (-)','A','51', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'510290','Réduct. valeur actées (-) - Geb. waardev. aandelen (-) ','A','51', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'614700','Frais de bonne politique','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'615000','Sous-traitants','E','61', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'630000','Amort.s/frais.constit.&aug.capi - Afschr.o.opricht./kapitaalverhoging','E','63', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'630210','Amort.s/constructions - Afschr. op gebouwen','E','63', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'630200','Amort.s/installations - Afschr. op installaties','E','63', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'630220','Amort.s/machines - Afschr. op machines','E','63', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'630221','Amort.s/outillage - Afschr. op uitrusting','E','63', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'630222','Amort.s/mobilier - Afschr. op meubilair','E','63', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'630223','Amort.s/mat.bureau - Afschr. op bureaumaterieel','E','63', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'630224','Amort.s/mat.informatique - Afschr. op hardware','E','63', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'630230','Amort.s/voitures - Afschr. op wagens','E','63', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'640000','Taxes circl. voitures - Belasting wagens','E','64', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'652000','Moins-value sur réalisation d''actifs circulants','E','65', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'640020','Précompte immoblier - Onroerende voorhoeffing','E','64', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'640100','Timbres fiscaux','E','64', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'640230','Raccordement aux egouts','E','64', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'640310','Cotisation dépannage','E','64', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'630225','Amort.s/amén. locaux - Afschr. op inrichtingskost','E','63', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'650000','Intérêts comm. & frais s/decouvert','E','65', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'656300','Intérêts de retards fiscaux - Fiscale achterst. interest','E','65', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'693000','Bénéfice à reporter','E','69', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'663750','-Val.s/materiel informatique','E','66', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'743300','Intervention assurance salaires garant.','I','74', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'763750','+Val.s/mat.informatique','I','76', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'406','Acomptes versés - Vooruitbetalingen','A','40', NULL, false, false, string_to_array('AP_paid', ':')); -- INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '411590'), 0.06); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '411591'), 0.21); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '451540'), 0.06); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '451541'), 0.21); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '640700'), 0.21); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (SELECT id FROM chart WHERE accno = '340')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (SELECT id FROM chart WHERE accno = '743200')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (SELECT id FROM chart WHERE accno = '604')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (SELECT id FROM chart WHERE accno = '755000')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (SELECT id FROM chart WHERE accno = '655000')); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'EUR:USD'); commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno = '55'; ledgersmb/sql/coa/ch/0000755000000000000000000000000012060044550013447 5ustar rootrootledgersmb/sql/coa/ch/gifi/0000755000000000000000000000000012060044550014365 5ustar rootrootledgersmb/sql/coa/ch/gifi/German.sql0000755000000000000000000000775010573167253016350 0ustar rootrootbegin; -- INSERT INTO gifi (accno,description) VALUES ('1','AKTIVEN'); INSERT INTO gifi (accno,description) VALUES ('2','PASSIVEN'); INSERT INTO gifi (accno,description) VALUES ('4','AUFWAND FÜR MATERIAL, WAREN UND DIENSTLEISTUNGEN'); INSERT INTO gifi (accno,description) VALUES ('5','PERSONALAUFWAND'); INSERT INTO gifi (accno,description) VALUES ('10000','ANLAGEVERMÖGEN'); INSERT INTO gifi (accno,description) VALUES ('11000','Forderungen'); INSERT INTO gifi (accno,description) VALUES ('11100','Bank'); INSERT INTO gifi (accno,description) VALUES ('11110','MWST Vorsteuer auf Investitionen'); INSERT INTO gifi (accno,description) VALUES ('11120','Angefangene Arbeiten'); INSERT INTO gifi (accno,description) VALUES ('14150','Büromaschinen, EDV'); INSERT INTO gifi (accno,description) VALUES ('18000','Gründungsaufwand'); INSERT INTO gifi (accno,description) VALUES ('20000','FREMDKAPITAL LANGFRISTIG'); INSERT INTO gifi (accno,description) VALUES ('21000','Kurzfristige Finanzverbindlichkeiten'); INSERT INTO gifi (accno,description) VALUES ('21200','Sozialversicherungen'); INSERT INTO gifi (accno,description) VALUES ('21210','Gesellschafter'); INSERT INTO gifi (accno,description) VALUES ('21220','MWST (3,6)'); INSERT INTO gifi (accno,description) VALUES ('21230','Passive Rechnungsabgrenzung'); INSERT INTO gifi (accno,description) VALUES ('24000','Gesellschafter'); INSERT INTO gifi (accno,description) VALUES ('28000','Stammkapital'); INSERT INTO gifi (accno,description) VALUES ('28290','Gewinnvortrag'); INSERT INTO gifi (accno,description) VALUES ('30000','ÜBRIGER ERTRAG'); INSERT INTO gifi (accno,description) VALUES ('31000','Computer'); INSERT INTO gifi (accno,description) VALUES ('32000','Software kommerz.'); INSERT INTO gifi (accno,description) VALUES ('34000','Beratung'); INSERT INTO gifi (accno,description) VALUES ('36000','Essen'); INSERT INTO gifi (accno,description) VALUES ('37000','Eigenleistungen'); INSERT INTO gifi (accno,description) VALUES ('38000','Bestandesänderungen'); INSERT INTO gifi (accno,description) VALUES ('39000','Rabatte, Preisnachlässe'); INSERT INTO gifi (accno,description) VALUES ('40000','AUFWANDMINDERUNGEN'); INSERT INTO gifi (accno,description) VALUES ('41000','Übrige Produkte'); INSERT INTO gifi (accno,description) VALUES ('42000','Software kommerz.'); INSERT INTO gifi (accno,description) VALUES ('44000','Aufwand für Drittleistungen'); INSERT INTO gifi (accno,description) VALUES ('47000','Einkaufsspesen'); INSERT INTO gifi (accno,description) VALUES ('48000','Bestandesänderungen'); INSERT INTO gifi (accno,description) VALUES ('49000','Aufwandminderungen'); INSERT INTO gifi (accno,description) VALUES ('50000','Löhne und Gehälter'); INSERT INTO gifi (accno,description) VALUES ('57000','FAK'); INSERT INTO gifi (accno,description) VALUES ('58000','Spesen'); INSERT INTO gifi (accno,description) VALUES ('60000','VERWALTUNGS- UND INFORMATIKAUFWAND'); INSERT INTO gifi (accno,description) VALUES ('61000','Reinigung'); INSERT INTO gifi (accno,description) VALUES ('61900','Unterhalt'); INSERT INTO gifi (accno,description) VALUES ('62000','Fahrzeugaufwand'); INSERT INTO gifi (accno,description) VALUES ('63000','Betriebsversicherungen'); INSERT INTO gifi (accno,description) VALUES ('65000','Übriger Verwaltungsaufwand'); INSERT INTO gifi (accno,description) VALUES ('66000','Werbeaufwand'); INSERT INTO gifi (accno,description) VALUES ('67000','Produkteentwicklung'); INSERT INTO gifi (accno,description) VALUES ('68000','Finanzaufwand'); INSERT INTO gifi (accno,description) VALUES ('69000','Abschreibungen'); INSERT INTO gifi (accno,description) VALUES ('80000','AUSSERORDENTLICHER UND BETRIEBSFREMDER ERFOLG, STEUERN'); INSERT INTO gifi (accno,description) VALUES ('90000','ABSCHLUSS'); INSERT INTO gifi (accno,description) VALUES ('91000','ERFOLGSRECHNUNG'); INSERT INTO gifi (accno,description) VALUES ('92000','BILANZ'); INSERT INTO gifi (accno,description) VALUES ('93000','GEWINNVERWENDUNG'); INSERT INTO gifi (accno,description) VALUES ('99000','SAMMEL- UND FEHLBUCHUNGEN'); commit; ledgersmb/sql/coa/ch/chart/0000755000000000000000000000000012060044550014550 5ustar rootrootledgersmb/sql/coa/ch/chart/German.sql0000755000000000000000000004227411726633756016542 0ustar rootrootbegin; -- Swiss chart of accounts -- adapted to numeric representation of chart no. -- SELECT account_heading_save(NULL, '10000', 'AKTIVEN', NULL); SELECT account_heading_save(NULL, '11000', 'UMLAUFSVERMÖGEN', NULL); SELECT account_heading_save(NULL, '11100', 'Flüssige Mittel', NULL); SELECT account_save(NULL,'11102','Bank CS Kt. 177929-11','A','11100', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_heading_save(NULL, '11110', 'Forderungen', NULL); SELECT account_heading_save(NULL, '11120', 'Vorräte und angefangene Arbeiten', NULL); SELECT account_save(NULL,'11128','Angefangene Arbeiten','A','11120', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'11130','Aktive Rechnungsabgrenzung','A','11000', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '14000', 'ANLAGEVERMÖGEN', NULL); SELECT account_heading_save(NULL, '18000', 'AKTIVIERTER AUFWAND UND AKTIVE BERICHTIGUNGSPOSTEN', NULL); SELECT account_save(NULL,'18182','Entwicklungsaufwand','A','18000', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '20000', 'PASSIVEN', NULL); SELECT account_heading_save(NULL, '21000', 'FREMDKAPITAL KURZFRISTIG', NULL); SELECT account_heading_save(NULL, '21200', 'Kurzfristige Verbindlichkeiten aus Lieferungen und Leistungen', NULL); SELECT account_save(NULL,'21201','Lieferanten','L','21200', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'21202','Personalaufwand','L','21200', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'21203','Sozialversicherungen','L','21200', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'21205','Leasing','L','21200', NULL, false, false, string_to_array('AP', ':')); SELECT account_heading_save(NULL, '21210', 'Kurzfristige Finanzverbindlichkeiten', NULL); SELECT account_heading_save(NULL, '21220', 'Andere kurzfristige Verbindlichkeiten', NULL); SELECT account_save(NULL,'21222','MWST (3,6)','L','21220', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'21229','Gewinnausschüttung','L','21220', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '21230', 'Passive Rechnungsabgrenzung, kurzfristige Rückstellungen', NULL); SELECT account_save(NULL,'21235','Rückstellungen','L','21230', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '24000', 'FREMDKAPITAL LANGFRISTIG', NULL); SELECT account_save(NULL,'24256','Gesellschafter','L','24000', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '28000', 'EIGENKAPITAL', NULL); SELECT account_save(NULL,'28280','Stammkapital','Q','28000', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '28290', 'Reserven, Bilanzgewinn', NULL); SELECT account_save(NULL,'28291','Reserven','Q','28290', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'28295','Gewinnvortrag','Q','28290', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'28296','Jahresgewinn','Q','28290', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '30000', 'BETRIEBSERTRAG AUS LIEFERUNGEN UND LEISTUNGEN', NULL); SELECT account_heading_save(NULL, '31000', 'PRODUKTIONSERTRAG', NULL); SELECT account_save(NULL,'31001','Computer','I','31000', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'31005','Übrige Produkte','I','31000', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL, '32000', 'HANDELSERTRAG', NULL); SELECT account_save(NULL,'32001','Hardware','I','32000', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'32002','Software OSS','I','32000', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'32003','Software kommerz.','I','32000', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_save(NULL,'32005','Übrige','I','32000', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL, '34000', 'DIENSTLEISTUNGSERTRAG', NULL); SELECT account_save(NULL,'34001','Beratung','I','34000', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'34002','Installation','I','34000', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_heading_save(NULL, '36000', 'ÜBRIGER ERTRAG', NULL); SELECT account_heading_save(NULL, '37000', 'EIGENLEISTUNGEN UND EIGENVERBRAUCH', NULL); SELECT account_save(NULL,'37001','Eigenleistungen','I','37000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'37002','Eigenverbrauch','I','37000', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '38000', 'BESTANDESÄNDERUNGEN ANGEFANGENE UND FERTIGGESTELLTE ARBEITUNG AUS PRODUKTION UND DIENSTLEISTUNG', NULL); SELECT account_save(NULL,'38001','Bestandesänderungen','I','38000', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '39000', 'ERTRAGSMINDERUNGEN AUS PRODUKTIONS-, HANDELS- UND DIENSTLEISTUNGSERTRÄGEN', NULL); SELECT account_heading_save(NULL, '40000', 'AUFWAND FÜR MATERIAL, WAREN UND DIENSTLEISTUNGEN', NULL); SELECT account_heading_save(NULL, '41000', 'MATERIALAUFWAND', NULL); SELECT account_save(NULL,'41001','Computer','E','41000', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'41005','Übrige Produkte','E','41000', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_heading_save(NULL, '42000', 'HANDELSWARENAUFWAND', NULL); SELECT account_save(NULL,'42001','Hardware','E','42000', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'42002','Software OSS','I','32000', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'42003','Software kommerz.','I','42000', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'42005','Übrige','E','42000', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_heading_save(NULL, '44000', 'AUFWAND FÜR DRITTLEISTUNGEN', NULL); SELECT account_heading_save(NULL, '46000', 'ÜBRIGER AUFWAND', NULL); SELECT account_heading_save(NULL, '47000', 'DIREKTE EINKAUFSSPESEN', NULL); SELECT account_save(NULL,'47001','Einkaufsspesen','E','47000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL, '48000', 'BESTANDESVERÄNDERUNGEN, MATERIAL- UND WARENVERLUSTE', NULL); SELECT account_save(NULL,'48001','Bestandesänderungen','E','48000', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '49000', 'AUFWANDMINDERUNGEN', NULL); SELECT account_save(NULL,'49005','Aufwandminderungen','E','49000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL, '50000', 'PERSONALAUFWAND', NULL); SELECT account_heading_save(NULL, '57000', 'SOZIALVERSICHERUNGSAUFWAND', NULL); SELECT account_heading_save(NULL, '58000', 'ÜBRIGER PERSONALAUFWAND', NULL); SELECT account_save(NULL,'58005','Sonstiger Personalaufwand','E','58000', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '59000', 'ARBEITSLEISTUNGEN DRITTER', NULL); SELECT account_heading_save(NULL, '60000', 'SONSTIGER BETRIEBSAUFWAND', NULL); SELECT account_heading_save(NULL, '61000', 'RAUMAUFWAND', NULL); SELECT account_heading_save(NULL, '61900', 'UNTERHALT, REPARATUREN, ERSATZ, LEASINGAUFWAND MOBILE SACHANLAGEN', NULL); SELECT account_save(NULL,'61901','Unterhalt','E','61900', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL, '62000', 'FAHRZEUG- UND TRANSPORTAUFWAND', NULL); SELECT account_save(NULL,'62002','Transportaufwand','E','62000', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_heading_save(NULL, '63000', 'SACHVERSICHERUNGEN, ABGABEN, GEBÜHREN, BEWILLIGUNGEN', NULL); SELECT account_heading_save(NULL, '65000', 'VERWALTUNGS- UND INFORMATIKAUFWAND', NULL); SELECT account_heading_save(NULL, '66000', 'WERBEAUFWAND', NULL); SELECT account_heading_save(NULL, '67000', 'ÜBRIGER BETRIEBSAUFWAND', NULL); SELECT account_save(NULL,'67001','Übriger Betriebsaufwand','E','67000', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '68000', 'FINANZERFOLG', NULL); SELECT account_save(NULL,'68001','Finanzaufwand','E','68000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'68002','Bankspesen','E','68000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'68005','Finanzertrag','E','68000', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '69000', 'ABSCHREIBUNGEN', NULL); SELECT account_save(NULL,'69001','Abschreibungen','E','69000', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '80000', 'AUSSERORDENTLICHER UND BETRIEBSFREMDER ERFOLG, STEUERN', NULL); SELECT account_save(NULL,'80001','Ausserordentlicher Ertrag','I','80000', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'80002','Ausserordentlicher Aufwand','I','80000', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '89000', 'STEUERAUFWAND', NULL); SELECT account_save(NULL,'89001','Steuern','E','80000', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '90000', 'ABSCHLUSS', NULL); SELECT account_heading_save(NULL, '91000', 'ERFOLGSRECHNUNG', NULL); SELECT account_heading_save(NULL, '92000', 'BILANZ', NULL); SELECT account_heading_save(NULL, '93000', 'GEWINNVERWENDUNG', NULL); SELECT account_heading_save(NULL, '99000', 'SAMMEL- UND FEHLBUCHUNGEN', NULL); SELECT account_save(NULL,'11121','Warenvorräte','A','11120', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'44001','Aufwand für Drittleistungen','E','44000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'63001','Betriebsversicherungen','E','63000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'57004','Unfallversicherung','E','57000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'57005','Krankentaggeldversicherung','E','57000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'57003','Berufliche Vorsorge','E','57000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'57002','FAK','E','57000', NULL, false, false, string_to_array('AP_amount:IC_income:IC_expense', ':')); SELECT account_save(NULL,'65009','Übriger Verwaltungsaufwand','E','65000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'65003','Porti','E','65000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'65002','Telekomm','E','65000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'65001','Büromaterial','E','65000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'18181','Gründungsaufwand','A','18000', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'50001','Löhne und Gehälter','E','50000', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'50002','Erfolgsbeteiligungen','E','50000', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'21216','Gesellschafter','L','21210', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'62001','Fahrzeugaufwand','E','62000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'58003','Spesen','E','58000', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'65004','Fachliteratur','E','65000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'39001','Skonti','I','39000', NULL, false, false, string_to_array('IC_sale:IC_cogs:IC_income:IC_expense', ':')); SELECT account_save(NULL,'39002','Rabatte, Preisnachlässe','I','39000', NULL, false, false, string_to_array('IC_sale:IC_cogs:IC_income:IC_expense', ':')); SELECT account_save(NULL,'36005','Kursgewinn','I','39000', NULL, false, false, string_to_array('IC_sale:IC_cogs:IC_income', ':')); SELECT account_save(NULL,'39006','Kursverlust','E','39000', NULL, false, false, string_to_array('IC_sale:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'39005','Verluste aus Forderungen','E','39000', NULL, false, false, string_to_array('IC_sale:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'14151','Mobiliar und Einrichtungen','A','14150', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'14152','Büromaschinen, EDV','A','14150', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'11119','Verrechnungssteuer','A','11110', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'11118','MWST Vorsteuer auf Investitionen','A','11110', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'36004','Versand','I','36000', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'36001','Reisezeit','I','36000', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'36002','Reise (Fahrt)','I','36000', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'11117','MWST Vorsteuer auf Aufwand','A','11110', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'21228','Geschuldete Steuern','L','21220', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'21223','MWST (7,6)','L','21220', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_expense:IC_taxservice', ':')); SELECT account_save(NULL,'57001','AHV, IV, EO, ALV','E','57000', NULL, false, false, string_to_array('AP_amount:IC_income:IC_expense', ':')); SELECT account_save(NULL,'21221','MWST (2,4)','L','21220', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'21224','MWST (7.6) 1/2','L','21220', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_expense:IC_taxservice', ':')); SELECT account_save(NULL,'66001','Werbeaufwand','E','66000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'21217','Privat','L','21210', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'11101','Kasse','A','11100', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'50005','Leistungen von Sozialversicherung','E','50000', NULL, false, false, string_to_array('AP_amount:IC_income:IC_expense', ':')); SELECT account_save(NULL,'65005','Informatikaufwand','E','65000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_save(NULL,'39004','Rundungsdifferenzen','I','39000', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'11111','Debitoren','A','11110', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'61001','Miete','E','61000', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'61002','Reinigung','E','61000', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'61005','Übriger Raumaufwand','E','61000', NULL, false, false, string_to_array('IC_expense', ':')); SELECT account_save(NULL,'36003','Essen','I','36000', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'21231','Passive Rechnungsabgrenzung','L','21230', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'67002','Produkteentwicklung','E','67000', NULL, false, false, string_to_array('', ':')); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '21222'),0.036); insert into tax (chart_id,rate) values ((select id from chart where accno = '21223'),0.076); insert into tax (chart_id,rate) values ((select id from chart where accno = '21221'),0.024); insert into tax (chart_id,rate) values ((select id from chart where accno = '21224'),0.076); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '11121')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '34002')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '42005')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '36005')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '39006')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'CHF:EUR:USD'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); -- commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno = '11102'; ledgersmb/sql/coa/ca/0000755000000000000000000000000012060044550013440 5ustar rootrootledgersmb/sql/coa/ca/gifi/0000755000000000000000000000000012060044550014356 5ustar rootrootledgersmb/sql/coa/ca/gifi/English.sql0000755000000000000000000017025610760336531016516 0ustar rootrootbegin; -- GIFI codes as set by the Canadian Government -- It's a dirty job, but it seems somebody allready did it -- PDF Tammes, Tue , 02 Apr 2002 -- remarks or questions to finance@bermuda-holding.com -- -- From the GIFI documentation: -- -- The GIFI information has to balance. We use the following rules to verify the information you provide. -- total assets = total liabilities + total shareholder equity -- total revenue - total expenses = net non-farming income -- total farm revenue - total farm expenses = net farm income -- -- You have to provide certain line items so that we can verify the above equations. Each GIFI must include: -- balance sheet -- Item 2599 Total assets -- Item 3499 Total liabilities -- Item 3620 Total shareholder equity -- non-farming income and expenses -- Item 8299 Total revenue -- Item 9368 Total expenses -- and/or -- farming income and expenses -- Item 9659 Total farm revenue -- Item 9898 Total farm expenses -- when reporting a breakdown of retained earnings -- Item 3849 Retained earnings/deficit end -- extraordinary items and income taxes -- Item 9999 Net income/loss after taxes and extraordinary items -- If the amount of a required item is NIL, you have to enter 0. -- INSERT INTO gifi (accno,description) VALUES ('1000', 'Cash & Deposits'); INSERT INTO gifi (accno,description) VALUES ('1001', 'Cash'); INSERT INTO gifi (accno,description) VALUES ('1002', 'Deposits In Canadian Banks And Institutions - Canadian Currency'); INSERT INTO gifi (accno,description) VALUES ('1003', 'Deposits In Canadian Banks And Institutions - Foreign Currency'); INSERT INTO gifi (accno,description) VALUES ('1004', 'Deposits In Foreign Banks - Canadian Currency'); INSERT INTO gifi (accno,description) VALUES ('1005', 'Deposits In Foreign Banks - Foreign Currency'); INSERT INTO gifi (accno,description) VALUES ('1006', 'Credit Union Central Deposits'); INSERT INTO gifi (accno,description) VALUES ('1007', 'Other Cash Like Instruments - Gold Bullion, Silver Bullion'); INSERT INTO gifi (accno,description) VALUES ('1060', 'Accounts Receivable'); INSERT INTO gifi (accno,description) VALUES ('1061', 'Allowance For Doubtfull Accounts Receivable'); INSERT INTO gifi (accno,description) VALUES ('1062', 'Trade Accounts Receivable'); INSERT INTO gifi (accno,description) VALUES ('1063', 'Allowance For Doubtfull Trade Accounts Receivable'); INSERT INTO gifi (accno,description) VALUES ('1064', 'Trade Accounts Receivable Related Parties'); INSERT INTO gifi (accno,description) VALUES ('1065', 'Allowance For Doubtfull Trade Accounts Receivable Related Parties'); INSERT INTO gifi (accno,description) VALUES ('1066', 'Taxes Receivable'); INSERT INTO gifi (accno,description) VALUES ('1067', 'Intrest Receivable'); INSERT INTO gifi (accno,description) VALUES ('1068', 'Holdbacks Receivable'); INSERT INTO gifi (accno,description) VALUES ('1069', 'Leases Receivable'); INSERT INTO gifi (accno,description) VALUES ('1070', 'Allowance For Doubtfull Leases Receivable'); INSERT INTO gifi (accno,description) VALUES ('1071', 'Accounts Receivable Employees'); INSERT INTO gifi (accno,description) VALUES ('1072', 'Allowance For Doubtfull Accounts Receivable Employees'); INSERT INTO gifi (accno,description) VALUES ('1073', 'Accounts Receivable From Members Of NPO'); INSERT INTO gifi (accno,description) VALUES ('1120', 'Inventories'); INSERT INTO gifi (accno,description) VALUES ('1121', 'Inventory Of Goods For Sale/Finished Goods'); INSERT INTO gifi (accno,description) VALUES ('1122', 'Inventory Of Parts And Supplies'); INSERT INTO gifi (accno,description) VALUES ('1123', 'Inventory Properties'); INSERT INTO gifi (accno,description) VALUES ('1124', 'Inventory of Aggregates'); INSERT INTO gifi (accno,description) VALUES ('1125', 'Work In Progress'); INSERT INTO gifi (accno,description) VALUES ('1126', 'Raw Materials'); INSERT INTO gifi (accno,description) VALUES ('1127', 'Inventory of Securities'); INSERT INTO gifi (accno,description) VALUES ('1180', 'Short Term Investments'); INSERT INTO gifi (accno,description) VALUES ('1181', 'Canadian Term Deposits'); INSERT INTO gifi (accno,description) VALUES ('1182', 'Canadian Shares'); INSERT INTO gifi (accno,description) VALUES ('1183', 'Canadian Bonds'); INSERT INTO gifi (accno,description) VALUES ('1184', 'Canadian Treasury Bills'); INSERT INTO gifi (accno,description) VALUES ('1185', 'Securities Purchased Under Resale Agreement'); INSERT INTO gifi (accno,description) VALUES ('1186', 'Other Short Term Canadian Investments'); INSERT INTO gifi (accno,description) VALUES ('1187', 'Short Term Foreign Investments'); INSERT INTO gifi (accno,description) VALUES ('1240', 'Loans & Notes Receivable'); INSERT INTO gifi (accno,description) VALUES ('1241', 'Demand Loans Receivable'); INSERT INTO gifi (accno,description) VALUES ('1242', 'Other Loans Receivable'); INSERT INTO gifi (accno,description) VALUES ('1243', 'Notes Receivable'); INSERT INTO gifi (accno,description) VALUES ('1244', 'Mortgages Receivable'); INSERT INTO gifi (accno,description) VALUES ('1300', 'Due From Shareholder(s)/Director(s)'); INSERT INTO gifi (accno,description) VALUES ('1301', 'Due From Individual Shareholder(s)'); INSERT INTO gifi (accno,description) VALUES ('1302', 'Due From Corporate Shareholder(s)'); INSERT INTO gifi (accno,description) VALUES ('1303', 'Due From Director(s)'); INSERT INTO gifi (accno,description) VALUES ('1360', 'Investment In Joint Venture(s)/Partnership(s)'); INSERT INTO gifi (accno,description) VALUES ('1380', 'Due From Joint Venture(s)/Partnership(s)'); INSERT INTO gifi (accno,description) VALUES ('1400', 'Due From/Investment In Related Parties'); INSERT INTO gifi (accno,description) VALUES ('1401', 'Demand Notes From Related Parties'); INSERT INTO gifi (accno,description) VALUES ('1402', 'Interest Receivable From Related Parties'); INSERT INTO gifi (accno,description) VALUES ('1403', 'Loans/Advances Due From Related Parties'); INSERT INTO gifi (accno,description) VALUES ('1460', 'Customer''s Liability under Acceptances'); INSERT INTO gifi (accno,description) VALUES ('1480', 'Other Current Assets'); INSERT INTO gifi (accno,description) VALUES ('1481', 'Deferred Income Taxes'); INSERT INTO gifi (accno,description) VALUES ('1482', 'Accrued Investment Income'); INSERT INTO gifi (accno,description) VALUES ('1483', 'Taxes Recoverable/Refundable'); INSERT INTO gifi (accno,description) VALUES ('1484', 'Prepaid Expenses'); INSERT INTO gifi (accno,description) VALUES ('1485', 'Drilling Advances'); INSERT INTO gifi (accno,description) VALUES ('1486', 'Security Deposits'); INSERT INTO gifi (accno,description) VALUES ('1599', 'Total Current Assets'); INSERT INTO gifi (accno,description) VALUES ('1600', 'Land'); INSERT INTO gifi (accno,description) VALUES ('1601', 'Land Improvement'); INSERT INTO gifi (accno,description) VALUES ('1602', 'Accumulated Amortization Of Land & Land Improvement'); INSERT INTO gifi (accno,description) VALUES ('1620', 'Depletable Assets'); INSERT INTO gifi (accno,description) VALUES ('1621', 'Accumulated Amortization Of Depletable Assets'); INSERT INTO gifi (accno,description) VALUES ('1622', 'Petroleum & Natural Gas Properties'); INSERT INTO gifi (accno,description) VALUES ('1623', 'Accumulated Amortization Of Petroleum & Natural Gas Properties'); INSERT INTO gifi (accno,description) VALUES ('1624', 'Mining Properties'); INSERT INTO gifi (accno,description) VALUES ('1625', 'Accumulated Amortization Of Mining Properties'); INSERT INTO gifi (accno,description) VALUES ('1626', 'Deferred Exporation & Development charges'); INSERT INTO gifi (accno,description) VALUES ('1627', 'Accumulated Amortization Of Petroleum & Deferred Exporation & Development charges'); INSERT INTO gifi (accno,description) VALUES ('1628', 'Quarries'); INSERT INTO gifi (accno,description) VALUES ('1629', 'Accumulated Amortization Of Quarries'); INSERT INTO gifi (accno,description) VALUES ('1630', 'Gravel Pits'); INSERT INTO gifi (accno,description) VALUES ('1631', 'Accumulated Amortization Of Gravel Pits'); INSERT INTO gifi (accno,description) VALUES ('1632', 'Timber Limits'); INSERT INTO gifi (accno,description) VALUES ('1633', 'Accumulated Amortization Of Timber Limits'); INSERT INTO gifi (accno,description) VALUES ('1680', 'Buildings'); INSERT INTO gifi (accno,description) VALUES ('1681', 'Accumulated Amortization Of Buildings'); INSERT INTO gifi (accno,description) VALUES ('1682', 'Manufacturing And Processing Plant'); INSERT INTO gifi (accno,description) VALUES ('1683', 'Accumulated Amortization Of Manufacturing and Processing Plant'); INSERT INTO gifi (accno,description) VALUES ('1684', 'Buildings Under Construction'); INSERT INTO gifi (accno,description) VALUES ('1740', 'Machinery, Equipment, furniture & fixtures'); INSERT INTO gifi (accno,description) VALUES ('1741', 'Accumulated Amortization Of Machinery, Equipment, furniture & fixtures'); INSERT INTO gifi (accno,description) VALUES ('1742', 'Motor Vehicles'); INSERT INTO gifi (accno,description) VALUES ('1743', 'Accumulated Amortization Of Motor Vehicles'); INSERT INTO gifi (accno,description) VALUES ('1744', 'Tools and Dies'); INSERT INTO gifi (accno,description) VALUES ('1745', 'Accumulated Amortization Of Tools and Dies'); INSERT INTO gifi (accno,description) VALUES ('1746', 'Construction & Excavating Equipment'); INSERT INTO gifi (accno,description) VALUES ('1747', 'Accumulated Amortization Of Construction & Excavating Equipment'); INSERT INTO gifi (accno,description) VALUES ('1748', 'Forestry & Logging Equipment'); INSERT INTO gifi (accno,description) VALUES ('1749', 'Accumulated Amortization Of Forestry & Logging Equipment'); INSERT INTO gifi (accno,description) VALUES ('1750', 'Fishing Gear & Nets'); INSERT INTO gifi (accno,description) VALUES ('1751', 'Accumulated Amortization Of Fishing Gear & Nets'); INSERT INTO gifi (accno,description) VALUES ('1752', 'Mining Equipment'); INSERT INTO gifi (accno,description) VALUES ('1753', 'Accumulated Amortization Of Mining Equipment'); INSERT INTO gifi (accno,description) VALUES ('1754', 'Oil & Gas Systems'); INSERT INTO gifi (accno,description) VALUES ('1755', 'Accumulated Amortization Of Oil & Gas Systems'); INSERT INTO gifi (accno,description) VALUES ('1756', 'Production Equipment for resource industries'); INSERT INTO gifi (accno,description) VALUES ('1757', 'Accumulated Amortization Of Production Equipment for resource industries'); INSERT INTO gifi (accno,description) VALUES ('1758', 'Production Equipment for other industries'); INSERT INTO gifi (accno,description) VALUES ('1759', 'Accumulated Amortization Of Production Equipment for other industries'); INSERT INTO gifi (accno,description) VALUES ('1760', 'Exploration Equipment'); INSERT INTO gifi (accno,description) VALUES ('1761', 'Accumulated Amortization Of Exploration Equipment'); INSERT INTO gifi (accno,description) VALUES ('1762', 'Shipping Equipment'); INSERT INTO gifi (accno,description) VALUES ('1763', 'Accumulated Amortization Of Shipping Equipment'); INSERT INTO gifi (accno,description) VALUES ('1764', 'Ships & Boats'); INSERT INTO gifi (accno,description) VALUES ('1765', 'Accumulated Amortization Of Ships & Boats'); INSERT INTO gifi (accno,description) VALUES ('1766', 'Aircraft'); INSERT INTO gifi (accno,description) VALUES ('1767', 'Accumulated Amortization Of Aircraft'); INSERT INTO gifi (accno,description) VALUES ('1768', 'Signs'); INSERT INTO gifi (accno,description) VALUES ('1769', 'Accumulated Amortization Of Signs'); INSERT INTO gifi (accno,description) VALUES ('1770', 'Small Tools'); INSERT INTO gifi (accno,description) VALUES ('1771', 'Accumulated Amortization Of Small Tools'); INSERT INTO gifi (accno,description) VALUES ('1772', 'Radio & Communication Equipment'); INSERT INTO gifi (accno,description) VALUES ('1773', 'Accumulated Amortization Of Radio & Communication Equipment'); INSERT INTO gifi (accno,description) VALUES ('1774', 'Computer Equipment/Software'); INSERT INTO gifi (accno,description) VALUES ('1775', 'Accumulated Amortization Of Computer Equipment/software'); INSERT INTO gifi (accno,description) VALUES ('1776', 'Musical Instruments'); INSERT INTO gifi (accno,description) VALUES ('1777', 'Accumulated Amortization Of Musical Instruments'); INSERT INTO gifi (accno,description) VALUES ('1778', 'Satellites'); INSERT INTO gifi (accno,description) VALUES ('1779', 'Accumulated Amortization Of Satellites'); INSERT INTO gifi (accno,description) VALUES ('1780', 'Earth Stations'); INSERT INTO gifi (accno,description) VALUES ('1781', 'Accumulated Amortization Of Earth Stations'); INSERT INTO gifi (accno,description) VALUES ('1782', 'Machinery & Equipment Under Construction'); INSERT INTO gifi (accno,description) VALUES ('1783', 'Transportation Equipment'); INSERT INTO gifi (accno,description) VALUES ('1784', 'Accumulated Amortization Of Transportation Equipment'); INSERT INTO gifi (accno,description) VALUES ('1785', 'Other Machinery & Equipment'); INSERT INTO gifi (accno,description) VALUES ('1786', 'Accumulated Amortization Of Other Machinery & Equipment'); INSERT INTO gifi (accno,description) VALUES ('1787', 'Furniture & Fixtures'); INSERT INTO gifi (accno,description) VALUES ('1788', 'Accumulated Amortization Of Furniture & Fixtures'); INSERT INTO gifi (accno,description) VALUES ('1900', 'Other Tangible Capital Assets'); INSERT INTO gifi (accno,description) VALUES ('1901', 'Accumulated Amortization Of Other Tangible Capital Assets'); INSERT INTO gifi (accno,description) VALUES ('1902', 'Logging Roads'); INSERT INTO gifi (accno,description) VALUES ('1903', 'Accumulated Amortization Of Logging Roads'); INSERT INTO gifi (accno,description) VALUES ('1904', 'Asphalt & Parking Areas'); INSERT INTO gifi (accno,description) VALUES ('1905', 'Accumulated Amortization Of Asphalt & Parking Areas'); INSERT INTO gifi (accno,description) VALUES ('1906', 'Wharves, Docks & Marinas'); INSERT INTO gifi (accno,description) VALUES ('1907', 'Accumulated Amortization Of Wharves, Docks & Marinas'); INSERT INTO gifi (accno,description) VALUES ('1908', 'Fences'); INSERT INTO gifi (accno,description) VALUES ('1909', 'Accumulated Amortization Of Fences'); INSERT INTO gifi (accno,description) VALUES ('1910', 'Capital Leases - Buildings'); INSERT INTO gifi (accno,description) VALUES ('1911', 'Accumulated Amortization Of Capital Leases - Buildings'); INSERT INTO gifi (accno,description) VALUES ('1912', 'Capital Leases - Equipment'); INSERT INTO gifi (accno,description) VALUES ('1913', 'Accumulated Amortization Of Capital Leases - Equipment'); INSERT INTO gifi (accno,description) VALUES ('1914', 'Capital Leases - Vehicles'); INSERT INTO gifi (accno,description) VALUES ('1915', 'Accumulated Amortization Of Capital Leases - Vehicles'); INSERT INTO gifi (accno,description) VALUES ('1916', 'Capital Leases - Other'); INSERT INTO gifi (accno,description) VALUES ('1917', 'Accumulated Amortization Of Capital Leases - Other'); INSERT INTO gifi (accno,description) VALUES ('1918', 'Leasehold Improvements'); INSERT INTO gifi (accno,description) VALUES ('1919', 'Accumulated Amortization Of Leasehold Improvements'); INSERT INTO gifi (accno,description) VALUES ('1920', 'Other Capital Assets Under Construction'); INSERT INTO gifi (accno,description) VALUES ('1921', 'Campsites'); INSERT INTO gifi (accno,description) VALUES ('1922', 'Accumulated Amortization Of Campsites'); INSERT INTO gifi (accno,description) VALUES ('2008', 'Total Tangible Capital Assets'); INSERT INTO gifi (accno,description) VALUES ('2009', 'Total Accumulated Amortization Of Tangible Capital Assets'); INSERT INTO gifi (accno,description) VALUES ('2010', 'Intangible Assets'); INSERT INTO gifi (accno,description) VALUES ('2011', 'Accumulated Amortization Of Intangible Assets'); INSERT INTO gifi (accno,description) VALUES ('2012', 'Goodwill'); INSERT INTO gifi (accno,description) VALUES ('2013', 'Accumulated Amortization Of Goodwill'); INSERT INTO gifi (accno,description) VALUES ('2014', 'Quota'); INSERT INTO gifi (accno,description) VALUES ('2015', 'Accumulated Amortization Of Quota'); INSERT INTO gifi (accno,description) VALUES ('2016', 'Licences'); INSERT INTO gifi (accno,description) VALUES ('2017', 'Accumulated Amortization Of Licences'); INSERT INTO gifi (accno,description) VALUES ('2018', 'Incorporation Costs'); INSERT INTO gifi (accno,description) VALUES ('2019', 'Accumulated Amortization Of Incorporation Costs'); INSERT INTO gifi (accno,description) VALUES ('2020', 'Trademarks & Patents'); INSERT INTO gifi (accno,description) VALUES ('2021', 'Accumulated Amortization Of Trademarks & Patents'); INSERT INTO gifi (accno,description) VALUES ('2022', 'Customer Lists'); INSERT INTO gifi (accno,description) VALUES ('2023', 'Accumulated Amortization Of Customer Lists'); INSERT INTO gifi (accno,description) VALUES ('2024', 'Rights'); INSERT INTO gifi (accno,description) VALUES ('2025', 'Accumulated Amortization Of Rights'); INSERT INTO gifi (accno,description) VALUES ('2026', 'Research & Development'); INSERT INTO gifi (accno,description) VALUES ('2027', 'Accumulated Amortization Of Research & Development'); INSERT INTO gifi (accno,description) VALUES ('2070', 'Resource Rights'); INSERT INTO gifi (accno,description) VALUES ('2071', 'Accumulated Amortization Of Resource Rights'); INSERT INTO gifi (accno,description) VALUES ('2072', 'Timber Rights'); INSERT INTO gifi (accno,description) VALUES ('2073', 'Accumulated Amortization Of Timber Rights'); INSERT INTO gifi (accno,description) VALUES ('2074', 'Mining Rights'); INSERT INTO gifi (accno,description) VALUES ('2075', 'Accumulated Amortization Of Mining Rights'); INSERT INTO gifi (accno,description) VALUES ('2076', 'Oil & Gas Rights'); INSERT INTO gifi (accno,description) VALUES ('2077', 'Accumulated Amortization Of Oil & Gas Rights'); INSERT INTO gifi (accno,description) VALUES ('2178', 'Total Intangible Capital Assets'); INSERT INTO gifi (accno,description) VALUES ('2179', 'Total Accumulated Amortization Of Intangible Capital Assets'); INSERT INTO gifi (accno,description) VALUES ('2180', 'Due From Shareholder(s)/Director(s)'); INSERT INTO gifi (accno,description) VALUES ('2181', 'Due From Individual Shareholder(s)'); INSERT INTO gifi (accno,description) VALUES ('2182', 'Due From Corporate Shareholder(s)'); INSERT INTO gifi (accno,description) VALUES ('2183', 'Due From Director(s)'); INSERT INTO gifi (accno,description) VALUES ('2190', 'Due from Members'); INSERT INTO gifi (accno,description) VALUES ('2200', 'Investment In Joint Venture(s)/Partnership(s)'); INSERT INTO gifi (accno,description) VALUES ('2220', 'Due From Joint Venture(s)/Partnership(s)'); INSERT INTO gifi (accno,description) VALUES ('2240', 'Due From/Investment In Related Parties'); INSERT INTO gifi (accno,description) VALUES ('2241', 'Due From/Investment In Canadian Related Parties'); INSERT INTO gifi (accno,description) VALUES ('2242', 'Shares In Canadian Related Corporations'); INSERT INTO gifi (accno,description) VALUES ('2243', 'Loans/Advances To Canadian Related Corporations'); INSERT INTO gifi (accno,description) VALUES ('2244', 'Investment In Canadian Related Corporations At Cost'); INSERT INTO gifi (accno,description) VALUES ('2245', 'Investment In Canadian Related Corporations At Equity'); INSERT INTO gifi (accno,description) VALUES ('2246', 'Due From/Investment In Foreign Related Parties'); INSERT INTO gifi (accno,description) VALUES ('2247', 'Shares In Foreign Related Corporations'); INSERT INTO gifi (accno,description) VALUES ('2248', 'Loans/Advances To Foreign Related Corporations'); INSERT INTO gifi (accno,description) VALUES ('2249', 'Investment In Foreign Related Corporations At Cost'); INSERT INTO gifi (accno,description) VALUES ('2250', 'Investment In Foreign Related Corporations At Equity'); INSERT INTO gifi (accno,description) VALUES ('2280', 'Investment In Co-Tenancy'); INSERT INTO gifi (accno,description) VALUES ('2300', 'Long Term Investments'); INSERT INTO gifi (accno,description) VALUES ('2301', 'Foreign Shares'); INSERT INTO gifi (accno,description) VALUES ('2302', 'Other Type Of Foreign Investments'); INSERT INTO gifi (accno,description) VALUES ('2303', 'Canadian Shares'); INSERT INTO gifi (accno,description) VALUES ('2304', 'Government Of Canada Debt'); INSERT INTO gifi (accno,description) VALUES ('2305', 'Canadian Provinvial & Municipal Government Debt'); INSERT INTO gifi (accno,description) VALUES ('2306', 'Canadian Corporate Bonds & Debentures'); INSERT INTO gifi (accno,description) VALUES ('2307', 'Debt Securities'); INSERT INTO gifi (accno,description) VALUES ('2308', 'Equity Securities'); INSERT INTO gifi (accno,description) VALUES ('2309', 'Securities Purchased Under Resale Agreements'); INSERT INTO gifi (accno,description) VALUES ('2310', 'Central Credit Union Shares'); INSERT INTO gifi (accno,description) VALUES ('2311', 'Other Long Term Canadian Investments'); INSERT INTO gifi (accno,description) VALUES ('2360', 'Long Term Loans'); INSERT INTO gifi (accno,description) VALUES ('2361', 'Mortgages'); INSERT INTO gifi (accno,description) VALUES ('2362', 'Personal & Credit Card Loans'); INSERT INTO gifi (accno,description) VALUES ('2363', 'Business & Government Loans'); INSERT INTO gifi (accno,description) VALUES ('2364', 'Line Of Credit'); INSERT INTO gifi (accno,description) VALUES ('2420', 'Other Long Term Assets'); INSERT INTO gifi (accno,description) VALUES ('2421', 'Deferred Income Taxes / Tax Reserves'); INSERT INTO gifi (accno,description) VALUES ('2422', 'Deferred Pension Charges'); INSERT INTO gifi (accno,description) VALUES ('2423', 'Deferred Unrealized Exchange Losses'); INSERT INTO gifi (accno,description) VALUES ('2424', 'Other Deferred Items/Charges'); INSERT INTO gifi (accno,description) VALUES ('2425', 'Accumulated Amortization Of Deferred Charges'); INSERT INTO gifi (accno,description) VALUES ('2426', 'Reserve Fund'); INSERT INTO gifi (accno,description) VALUES ('2427', 'Cash Surrender Value Of Life Insurance'); INSERT INTO gifi (accno,description) VALUES ('2589', 'Total Long Term Assets'); INSERT INTO gifi (accno,description) VALUES ('2590', 'Assets Held In Trust'); INSERT INTO gifi (accno,description) VALUES ('2599', 'Total Assets'); INSERT INTO gifi (accno,description) VALUES ('2600', 'Bank Overdraft'); INSERT INTO gifi (accno,description) VALUES ('2620', 'Amounts Payable & Accrued Liabilities'); INSERT INTO gifi (accno,description) VALUES ('2621', 'Accounts Payable Trade'); INSERT INTO gifi (accno,description) VALUES ('2622', 'Accounts Payable To Related Parties'); INSERT INTO gifi (accno,description) VALUES ('2623', 'Holdbacks Payable'); INSERT INTO gifi (accno,description) VALUES ('2624', 'Wages Payable'); INSERT INTO gifi (accno,description) VALUES ('2625', 'Management Fees Payable'); INSERT INTO gifi (accno,description) VALUES ('2626', 'Bonuses Payable'); INSERT INTO gifi (accno,description) VALUES ('2627', 'Employee Deductions Payable'); INSERT INTO gifi (accno,description) VALUES ('2628', 'Withholding Taxes Payable'); INSERT INTO gifi (accno,description) VALUES ('2629', 'Intrest Payable'); INSERT INTO gifi (accno,description) VALUES ('2680', 'Taxes Payable'); INSERT INTO gifi (accno,description) VALUES ('2681', 'Capital Taxes Payable'); INSERT INTO gifi (accno,description) VALUES ('2682', 'Foreign Taxes Payable'); INSERT INTO gifi (accno,description) VALUES ('2683', 'Federal Taxes Payable'); INSERT INTO gifi (accno,description) VALUES ('2684', 'Provincial Taxes Payable'); INSERT INTO gifi (accno,description) VALUES ('2685', 'GST Payable'); INSERT INTO gifi (accno,description) VALUES ('2686', 'PST Payable'); INSERT INTO gifi (accno,description) VALUES ('2700', 'Short Term Debt'); INSERT INTO gifi (accno,description) VALUES ('2701', 'Loans From Canadian Banks'); INSERT INTO gifi (accno,description) VALUES ('2702', 'Liability For Securities Sold Short'); INSERT INTO gifi (accno,description) VALUES ('2703', 'Liability For Securities Sold Under Repurchase Agreements'); INSERT INTO gifi (accno,description) VALUES ('2704', 'Gold & Silver Certificates'); INSERT INTO gifi (accno,description) VALUES ('2705', 'Cheques & Other Items In Transit'); INSERT INTO gifi (accno,description) VALUES ('2706', 'Lien Notes'); INSERT INTO gifi (accno,description) VALUES ('2770', 'Deferred Income'); INSERT INTO gifi (accno,description) VALUES ('2780', 'Due To Shareholder(s)/Director(s)'); INSERT INTO gifi (accno,description) VALUES ('2781', 'Due To Individual Shareholder(s)'); INSERT INTO gifi (accno,description) VALUES ('2782', 'Due To Corporate Shareholder(s)'); INSERT INTO gifi (accno,description) VALUES ('2783', 'Due To Director(s)'); INSERT INTO gifi (accno,description) VALUES ('2840', 'Due To Joint Venture(s)/Partnership(s)'); INSERT INTO gifi (accno,description) VALUES ('2860', 'Due To Related Parties'); INSERT INTO gifi (accno,description) VALUES ('2861', 'Demand Notes Due To Related Parties'); INSERT INTO gifi (accno,description) VALUES ('2862', 'Interest Payable To Related Parties'); INSERT INTO gifi (accno,description) VALUES ('2863', 'Advances Due To Related Parties'); INSERT INTO gifi (accno,description) VALUES ('2920', 'Current Portion Of Long Term Liability'); INSERT INTO gifi (accno,description) VALUES ('2960', 'Other Current Liabilities'); INSERT INTO gifi (accno,description) VALUES ('2961', 'Deposits Received'); INSERT INTO gifi (accno,description) VALUES ('2962', 'Dividends Payable'); INSERT INTO gifi (accno,description) VALUES ('2963', 'Deferred Income Taxes'); INSERT INTO gifi (accno,description) VALUES ('2964', 'Reserves For Guarantees, Warranties Or Indemnities'); INSERT INTO gifi (accno,description) VALUES ('2965', 'General Reserves / Provisions'); INSERT INTO gifi (accno,description) VALUES ('2966', 'Crew Shares'); INSERT INTO gifi (accno,description) VALUES ('3139', 'Total Current Liabilities'); INSERT INTO gifi (accno,description) VALUES ('3140', 'Long Term Debt'); INSERT INTO gifi (accno,description) VALUES ('3141', 'Mortgages'); INSERT INTO gifi (accno,description) VALUES ('3142', 'Farm Credit Corporation Loan'); INSERT INTO gifi (accno,description) VALUES ('3143', 'Chartered Bank Loan'); INSERT INTO gifi (accno,description) VALUES ('3144', 'Credit Union/Caisse Populaire Loan'); INSERT INTO gifi (accno,description) VALUES ('3145', 'Provincial Government Loan'); INSERT INTO gifi (accno,description) VALUES ('3146', 'Supply Company Loan'); INSERT INTO gifi (accno,description) VALUES ('3147', 'Private Loan'); INSERT INTO gifi (accno,description) VALUES ('3148', 'Central, Leagues And Federation Loans'); INSERT INTO gifi (accno,description) VALUES ('3149', 'Line Of Credit'); INSERT INTO gifi (accno,description) VALUES ('3150', 'Liability For Securities Sold Short'); INSERT INTO gifi (accno,description) VALUES ('3151', 'Liability For Securities Sold Under Repurchase Agreements'); INSERT INTO gifi (accno,description) VALUES ('3152', 'Lien Notes'); INSERT INTO gifi (accno,description) VALUES ('3210', 'Bonds And Debentures'); INSERT INTO gifi (accno,description) VALUES ('3220', 'Deferred Income'); INSERT INTO gifi (accno,description) VALUES ('3240', 'Deferred Income Taxes'); INSERT INTO gifi (accno,description) VALUES ('3260', 'Long Term Due To Shareholder(s)/Director(s)'); INSERT INTO gifi (accno,description) VALUES ('3261', 'Long Term Due To Individual Shareholder(s)'); INSERT INTO gifi (accno,description) VALUES ('3262', 'Long Term Due To Corporate Shareholder(s)'); INSERT INTO gifi (accno,description) VALUES ('3263', 'Long Term Due To Director(s)'); INSERT INTO gifi (accno,description) VALUES ('3280', 'Long Term Due To Joint Venture(s)/Partnership(s)'); INSERT INTO gifi (accno,description) VALUES ('3300', 'Long Term Due To Related Parties'); INSERT INTO gifi (accno,description) VALUES ('3301', 'Amounts Owing To Related Canadian Parties'); INSERT INTO gifi (accno,description) VALUES ('3302', 'Amounts Owing To Related Foreign Parties'); INSERT INTO gifi (accno,description) VALUES ('3320', 'Other Long Term Liabilities'); INSERT INTO gifi (accno,description) VALUES ('3321', 'Long Term Obligations/Commitments/Leases'); INSERT INTO gifi (accno,description) VALUES ('3322', 'Reserves For Guarantees, Warranties Or Indemnities'); INSERT INTO gifi (accno,description) VALUES ('3323', 'Provision For Site Restoration'); INSERT INTO gifi (accno,description) VALUES ('3324', 'Contributions To Qualifying Environmental Trust'); INSERT INTO gifi (accno,description) VALUES ('3325', 'General Provisions / Reserves'); INSERT INTO gifi (accno,description) VALUES ('3326', 'Preference Shares Restated'); INSERT INTO gifi (accno,description) VALUES ('3327', 'Member Allocations'); INSERT INTO gifi (accno,description) VALUES ('3328', 'Deferred Income From Incomplete Contracts'); INSERT INTO gifi (accno,description) VALUES ('3450', 'Total Long Term Liabilities'); INSERT INTO gifi (accno,description) VALUES ('3460', 'Subordinated Debt'); INSERT INTO gifi (accno,description) VALUES ('3470', 'Amounts Held In Trust'); INSERT INTO gifi (accno,description) VALUES ('3499', 'Total Liabilities'); INSERT INTO gifi (accno,description) VALUES ('3500', 'Common Shares'); INSERT INTO gifi (accno,description) VALUES ('3520', 'Preferred Shares'); INSERT INTO gifi (accno,description) VALUES ('3540', 'Contributed & Other Surplus'); INSERT INTO gifi (accno,description) VALUES ('3541', 'Contributed Surplus'); INSERT INTO gifi (accno,description) VALUES ('3542', 'Appraisal Surplus'); INSERT INTO gifi (accno,description) VALUES ('3543', 'General Reserve'); INSERT INTO gifi (accno,description) VALUES ('3570', 'Head Office Account'); INSERT INTO gifi (accno,description) VALUES ('3600', 'Retained Earnings/Deficit'); INSERT INTO gifi (accno,description) VALUES ('3620', 'Total Shareholder Equity'); INSERT INTO gifi (accno,description) VALUES ('3640', 'Total Liabilities & Shareholder Equity'); INSERT INTO gifi (accno,description) VALUES ('3660', 'Retained Earnings/Deficit Start'); INSERT INTO gifi (accno,description) VALUES ('3680', 'Net Income/Loss'); INSERT INTO gifi (accno,description) VALUES ('3700', 'Dividend Declared'); INSERT INTO gifi (accno,description) VALUES ('3701', 'Cash Dividend'); INSERT INTO gifi (accno,description) VALUES ('3702', 'Patronage Dividend'); INSERT INTO gifi (accno,description) VALUES ('3720', 'Prior Year Adjustments'); INSERT INTO gifi (accno,description) VALUES ('3740', 'Other Items Affecting Retained Earnings'); INSERT INTO gifi (accno,description) VALUES ('3741', 'Share Redemptions'); INSERT INTO gifi (accno,description) VALUES ('3742', 'Special Reserves'); INSERT INTO gifi (accno,description) VALUES ('3743', 'Currency Adjustments'); INSERT INTO gifi (accno,description) VALUES ('3744', 'Unusual Revenue Items'); INSERT INTO gifi (accno,description) VALUES ('3745', 'Interfund Transfers (NPO)'); INSERT INTO gifi (accno,description) VALUES ('3849', 'Retained Earnings/Deficit End'); INSERT INTO gifi (accno,description) VALUES ('8000', 'Trade Sales of Goods and Services'); INSERT INTO gifi (accno,description) VALUES ('8020', 'Sales To Related Parties'); INSERT INTO gifi (accno,description) VALUES ('8030', 'Interdivisional Sales'); INSERT INTO gifi (accno,description) VALUES ('8040', 'Sales From Resource Properties'); INSERT INTO gifi (accno,description) VALUES ('8041', 'Petroleum & Natural Gas Sales'); INSERT INTO gifi (accno,description) VALUES ('8042', 'Petroleum & Natural Gas Sales To Related Parties'); INSERT INTO gifi (accno,description) VALUES ('8043', 'Gas Marketing'); INSERT INTO gifi (accno,description) VALUES ('8044', 'Processing Revenue'); INSERT INTO gifi (accno,description) VALUES ('8045', 'Pipeline Revenue'); INSERT INTO gifi (accno,description) VALUES ('8046', 'Seismic Sales'); INSERT INTO gifi (accno,description) VALUES ('8047', 'Mining Revenue'); INSERT INTO gifi (accno,description) VALUES ('8048', 'Coal Revenue'); INSERT INTO gifi (accno,description) VALUES ('8049', 'Oil Sands Revenue'); INSERT INTO gifi (accno,description) VALUES ('8050', 'Royalty Income'); INSERT INTO gifi (accno,description) VALUES ('8051', 'Oil & Gas Partnership/Joint Venture Income/Loss'); INSERT INTO gifi (accno,description) VALUES ('8052', 'Mining Partnership/Joint Venture Income/Loss'); INSERT INTO gifi (accno,description) VALUES ('8053', 'Other Production Revenue'); INSERT INTO gifi (accno,description) VALUES ('8089', 'Total Sales Of Goods And Services'); INSERT INTO gifi (accno,description) VALUES ('8090', 'Investment Revenue'); INSERT INTO gifi (accno,description) VALUES ('8091', 'Interest From Foreign Sources'); INSERT INTO gifi (accno,description) VALUES ('8092', 'Interest From Canadian Bonds And Debentures'); INSERT INTO gifi (accno,description) VALUES ('8093', 'Interest From Canadian Mortgage Loans'); INSERT INTO gifi (accno,description) VALUES ('8094', 'Interest From Other Canadian Sources'); INSERT INTO gifi (accno,description) VALUES ('8095', 'Dividend Income'); INSERT INTO gifi (accno,description) VALUES ('8096', 'Dividend From Canadian Sources'); INSERT INTO gifi (accno,description) VALUES ('8097', 'Interest From Foreign Sources'); INSERT INTO gifi (accno,description) VALUES ('8120', 'Commission Revenue'); INSERT INTO gifi (accno,description) VALUES ('8121', 'Commission Income On Real Estate Transactions'); INSERT INTO gifi (accno,description) VALUES ('8140', 'Rental Revenue'); INSERT INTO gifi (accno,description) VALUES ('8141', 'Real Estate Rental Revenue'); INSERT INTO gifi (accno,description) VALUES ('8150', 'Vehicle Leasing'); INSERT INTO gifi (accno,description) VALUES ('8160', 'Fishing Revenue'); INSERT INTO gifi (accno,description) VALUES ('8161', 'Fish Products'); INSERT INTO gifi (accno,description) VALUES ('8162', 'Other Marine Products'); INSERT INTO gifi (accno,description) VALUES ('8163', 'Fishing Grants, Credits & Rebates'); INSERT INTO gifi (accno,description) VALUES ('8164', 'Fishing Subsidies'); INSERT INTO gifi (accno,description) VALUES ('8165', 'Compensation For Loss Of Fishing Income/Property'); INSERT INTO gifi (accno,description) VALUES ('8166', 'Sharesman Income'); INSERT INTO gifi (accno,description) VALUES ('8210', 'Realized Gains/Losses On Disposal Of Assets'); INSERT INTO gifi (accno,description) VALUES ('8211', 'Realized Gains/Losses On Sale Of Investments'); INSERT INTO gifi (accno,description) VALUES ('8212', 'Realized Gains/Losses On Sale Of Resource Properties'); INSERT INTO gifi (accno,description) VALUES ('8220', 'NPO Amounts Received'); INSERT INTO gifi (accno,description) VALUES ('8221', 'Membership Fees'); INSERT INTO gifi (accno,description) VALUES ('8222', 'Assessments'); INSERT INTO gifi (accno,description) VALUES ('8223', 'Gifts'); INSERT INTO gifi (accno,description) VALUES ('8224', 'Gross Sales And Revenues From Organizational Activities'); INSERT INTO gifi (accno,description) VALUES ('8230', 'Other Revenue'); INSERT INTO gifi (accno,description) VALUES ('8231', 'Foreign Exchange Gains/Losses'); INSERT INTO gifi (accno,description) VALUES ('8232', 'Income/Loss Of Subsidiaries/Affiliates'); INSERT INTO gifi (accno,description) VALUES ('8233', 'Income/Loss Of Other Divisions'); INSERT INTO gifi (accno,description) VALUES ('8234', 'Income/Loss Of Joint Ventures'); INSERT INTO gifi (accno,description) VALUES ('8235', 'Income/Loss Of Partnerships'); INSERT INTO gifi (accno,description) VALUES ('8236', 'RealizaTion Of Deferred Revenues'); INSERT INTO gifi (accno,description) VALUES ('8237', 'Royalty Income Other Than Resource'); INSERT INTO gifi (accno,description) VALUES ('8238', 'Alberta Royalty Tax Credits'); INSERT INTO gifi (accno,description) VALUES ('8239', 'Management & Administration Fees'); INSERT INTO gifi (accno,description) VALUES ('8240', 'Telecommunications Revenues'); INSERT INTO gifi (accno,description) VALUES ('8241', 'Consulting Fees'); INSERT INTO gifi (accno,description) VALUES ('8242', 'Subsidies & Grants'); INSERT INTO gifi (accno,description) VALUES ('8243', 'Sale Of By-Products'); INSERT INTO gifi (accno,description) VALUES ('8244', 'Deposit Services'); INSERT INTO gifi (accno,description) VALUES ('8245', 'Credit Services'); INSERT INTO gifi (accno,description) VALUES ('8246', 'Card Services'); INSERT INTO gifi (accno,description) VALUES ('8247', 'Patronage Dividends'); INSERT INTO gifi (accno,description) VALUES ('8248', 'Insurance Recoveries'); INSERT INTO gifi (accno,description) VALUES ('8249', 'Expense Recoveries'); INSERT INTO gifi (accno,description) VALUES ('8250', 'Bad Debt Recoveries'); INSERT INTO gifi (accno,description) VALUES ('8299', 'Total Revenue'); INSERT INTO gifi (accno,description) VALUES ('8300', 'Opening Inventory'); INSERT INTO gifi (accno,description) VALUES ('8301', 'Opening Inventory - finished goods'); INSERT INTO gifi (accno,description) VALUES ('8302', 'Opening Inventory - raw materials'); INSERT INTO gifi (accno,description) VALUES ('8303', 'Opening Inventory - goods in process'); INSERT INTO gifi (accno,description) VALUES ('8304', 'Opening Inventory - work in process'); INSERT INTO gifi (accno,description) VALUES ('8320', 'Purchases / Cost of Materials'); INSERT INTO gifi (accno,description) VALUES ('8321', 'Purchases Product A'); INSERT INTO gifi (accno,description) VALUES ('8322', 'Purchases Product B'); INSERT INTO gifi (accno,description) VALUES ('8331', 'Price Differences & Discounts On Purchases'); INSERT INTO gifi (accno,description) VALUES ('8340', 'Direct Wages'); INSERT INTO gifi (accno,description) VALUES ('8350', 'Benefits On Direct Wages'); INSERT INTO gifi (accno,description) VALUES ('8360', 'Trades & Sub-contracts'); INSERT INTO gifi (accno,description) VALUES ('8370', 'Production Costs Other Than Resource'); INSERT INTO gifi (accno,description) VALUES ('8400', 'Resource Production Costs'); INSERT INTO gifi (accno,description) VALUES ('8401', 'Pipeline Operations'); INSERT INTO gifi (accno,description) VALUES ('8402', 'Drilling'); INSERT INTO gifi (accno,description) VALUES ('8403', 'Site Restoration Costs'); INSERT INTO gifi (accno,description) VALUES ('8404', 'Gross Overriding Royalty'); INSERT INTO gifi (accno,description) VALUES ('8405', 'Freehold Royalties'); INSERT INTO gifi (accno,description) VALUES ('8406', 'Other Producing Properties Rental'); INSERT INTO gifi (accno,description) VALUES ('8407', 'Prospect & Geological'); INSERT INTO gifi (accno,description) VALUES ('8408', 'Well Operating, Fuel & Equipment'); INSERT INTO gifi (accno,description) VALUES ('8409', 'Well Abandonment & Dry Holes'); INSERT INTO gifi (accno,description) VALUES ('8410', 'Other Lease Rentals'); INSERT INTO gifi (accno,description) VALUES ('8411', 'Exploration Expenses, Aerial Surveys'); INSERT INTO gifi (accno,description) VALUES ('8412', 'Development Expenses, stripping costs'); INSERT INTO gifi (accno,description) VALUES ('8435', 'Crown Charges'); INSERT INTO gifi (accno,description) VALUES ('8436', 'Crown royalties'); INSERT INTO gifi (accno,description) VALUES ('8437', 'Crown lease rentals'); INSERT INTO gifi (accno,description) VALUES ('8438', 'Freehold mineral tax'); INSERT INTO gifi (accno,description) VALUES ('8439', 'Mining taxes'); INSERT INTO gifi (accno,description) VALUES ('8440', 'Oil and Sand leases'); INSERT INTO gifi (accno,description) VALUES ('8441', 'Saskatchewan resource surcharge'); INSERT INTO gifi (accno,description) VALUES ('8450', 'Other Direct Costs'); INSERT INTO gifi (accno,description) VALUES ('8451', 'Equipment Hire & Operation'); INSERT INTO gifi (accno,description) VALUES ('8452', 'Log Yard'); INSERT INTO gifi (accno,description) VALUES ('8453', 'Forestry costs'); INSERT INTO gifi (accno,description) VALUES ('8454', 'Logging Road costs'); INSERT INTO gifi (accno,description) VALUES ('8455', 'Stumpage costs'); INSERT INTO gifi (accno,description) VALUES ('8456', 'Royalty costs'); INSERT INTO gifi (accno,description) VALUES ('8457', 'Freight In & Customs Duty'); INSERT INTO gifi (accno,description) VALUES ('8458', 'Inventory Write Down'); INSERT INTO gifi (accno,description) VALUES ('8459', 'Direct cost amortization of tangible assets'); INSERT INTO gifi (accno,description) VALUES ('8460', 'Direct cost amortization of natural resource assets'); INSERT INTO gifi (accno,description) VALUES ('8461', 'Overhead expenses allocated to cost of sales'); INSERT INTO gifi (accno,description) VALUES ('8500', 'Closing Inventory'); INSERT INTO gifi (accno,description) VALUES ('8501', 'Closing Inventory - Finished Goods'); INSERT INTO gifi (accno,description) VALUES ('8502', 'Closing Inventory - Raw Materials'); INSERT INTO gifi (accno,description) VALUES ('8503', 'Closing Inventory - Goods In Process'); INSERT INTO gifi (accno,description) VALUES ('8504', 'Closing Inventory - Work In Process'); INSERT INTO gifi (accno,description) VALUES ('8518', 'Cost Of Sales'); INSERT INTO gifi (accno,description) VALUES ('8519', 'Gross Profit/Loss'); INSERT INTO gifi (accno,description) VALUES ('8520', 'Advertising & Promotion'); INSERT INTO gifi (accno,description) VALUES ('8521', 'Advertising'); INSERT INTO gifi (accno,description) VALUES ('8522', 'Donations'); INSERT INTO gifi (accno,description) VALUES ('8523', 'Meals & Entertainment'); INSERT INTO gifi (accno,description) VALUES ('8524', 'Promotion'); INSERT INTO gifi (accno,description) VALUES ('8570', 'Amortization Of Intangible Assets'); INSERT INTO gifi (accno,description) VALUES ('8590', 'Bad Debt Expense'); INSERT INTO gifi (accno,description) VALUES ('8610', 'Loan Losses'); INSERT INTO gifi (accno,description) VALUES ('8611', 'Provision for Loan Losses'); INSERT INTO gifi (accno,description) VALUES ('8620', 'Employee Benefits'); INSERT INTO gifi (accno,description) VALUES ('8621', 'Group Insurance Benefits'); INSERT INTO gifi (accno,description) VALUES ('8622', 'Employers Portion Of Employee Benefits'); INSERT INTO gifi (accno,description) VALUES ('8623', 'Contributions To Deferred Income Plans'); INSERT INTO gifi (accno,description) VALUES ('8650', 'Amortization Of Natural Resource Assets'); INSERT INTO gifi (accno,description) VALUES ('8670', 'Amortization Of Tangible Assets'); INSERT INTO gifi (accno,description) VALUES ('8690', 'Insurance'); INSERT INTO gifi (accno,description) VALUES ('8691', 'Life Insurance On Executives'); INSERT INTO gifi (accno,description) VALUES ('8710', 'Interest & Bank Charges'); INSERT INTO gifi (accno,description) VALUES ('8711', 'Interest On Short Term Debt'); INSERT INTO gifi (accno,description) VALUES ('8712', 'Interest On Bonds And Debentures'); INSERT INTO gifi (accno,description) VALUES ('8713', 'Interest On Mortgages'); INSERT INTO gifi (accno,description) VALUES ('8714', 'Interest On Long Term Debt'); INSERT INTO gifi (accno,description) VALUES ('8715', 'Bank Charges'); INSERT INTO gifi (accno,description) VALUES ('8716', 'Credit Card Charges'); INSERT INTO gifi (accno,description) VALUES ('8717', 'Collection & Credit costs'); INSERT INTO gifi (accno,description) VALUES ('8760', 'Business Taxes, Licences & Memberships'); INSERT INTO gifi (accno,description) VALUES ('8761', 'Memberships'); INSERT INTO gifi (accno,description) VALUES ('8762', 'Business Taxes'); INSERT INTO gifi (accno,description) VALUES ('8763', 'Franchise Fees'); INSERT INTO gifi (accno,description) VALUES ('8764', 'Government Fees'); INSERT INTO gifi (accno,description) VALUES ('8780', 'New Brunswick Tax On Large Corporations'); INSERT INTO gifi (accno,description) VALUES ('8790', 'Nova Scotia Tax On Large Corporations'); INSERT INTO gifi (accno,description) VALUES ('8810', 'Office Expenses'); INSERT INTO gifi (accno,description) VALUES ('8811', 'Office Stationary And Supplies'); INSERT INTO gifi (accno,description) VALUES ('8812', 'Office Utilities'); INSERT INTO gifi (accno,description) VALUES ('8813', 'Data Processing'); INSERT INTO gifi (accno,description) VALUES ('8860', 'Professional Fees'); INSERT INTO gifi (accno,description) VALUES ('8861', 'Legal Fees'); INSERT INTO gifi (accno,description) VALUES ('8862', 'Accounting Fees'); INSERT INTO gifi (accno,description) VALUES ('8863', 'Consulting Fees'); INSERT INTO gifi (accno,description) VALUES ('8864', 'Architect Fees'); INSERT INTO gifi (accno,description) VALUES ('8865', 'Appraisal Fees'); INSERT INTO gifi (accno,description) VALUES ('8866', 'Laboratory Fees'); INSERT INTO gifi (accno,description) VALUES ('8867', 'Medical Fees'); INSERT INTO gifi (accno,description) VALUES ('8868', 'Veterinary Fees'); INSERT INTO gifi (accno,description) VALUES ('8869', 'Brokerage Fees'); INSERT INTO gifi (accno,description) VALUES ('8870', 'Transfer Fees'); INSERT INTO gifi (accno,description) VALUES ('8871', 'Management & Administration Fees'); INSERT INTO gifi (accno,description) VALUES ('8872', 'Refining & Assay'); INSERT INTO gifi (accno,description) VALUES ('8873', 'Registrar & Transfer Agent Fees'); INSERT INTO gifi (accno,description) VALUES ('8874', 'Restructuring Costs'); INSERT INTO gifi (accno,description) VALUES ('8875', 'Security & Exchange Commission Fees'); INSERT INTO gifi (accno,description) VALUES ('8876', 'Training Expense'); INSERT INTO gifi (accno,description) VALUES ('8877', 'Studio & Recording'); INSERT INTO gifi (accno,description) VALUES ('8910', 'Rental'); INSERT INTO gifi (accno,description) VALUES ('8911', 'Real Estate Rental'); INSERT INTO gifi (accno,description) VALUES ('8912', 'Occupancy Costs'); INSERT INTO gifi (accno,description) VALUES ('8913', 'Condominium Fees'); INSERT INTO gifi (accno,description) VALUES ('8914', 'Equipment Rental'); INSERT INTO gifi (accno,description) VALUES ('8915', 'Motor Vehicle Rental'); INSERT INTO gifi (accno,description) VALUES ('8916', 'Moorage (Boat)'); INSERT INTO gifi (accno,description) VALUES ('8917', 'Storage'); INSERT INTO gifi (accno,description) VALUES ('8918', 'Quota Rental'); INSERT INTO gifi (accno,description) VALUES ('8960', 'Repairs & Maintenance - Aircraft'); INSERT INTO gifi (accno,description) VALUES ('8961', 'Repairs & Maintenance - Buildings'); INSERT INTO gifi (accno,description) VALUES ('8962', 'Repairs & Maintenance - Vehicles'); INSERT INTO gifi (accno,description) VALUES ('8963', 'Repairs & Maintenance - Boats'); INSERT INTO gifi (accno,description) VALUES ('8964', 'Repairs & Maintenance - Machinery & Equipment'); INSERT INTO gifi (accno,description) VALUES ('9010', 'Other Repairs & Maintenance - Janitor & Yard'); INSERT INTO gifi (accno,description) VALUES ('9011', 'Machine Shop Expense'); INSERT INTO gifi (accno,description) VALUES ('9012', 'Road Costs'); INSERT INTO gifi (accno,description) VALUES ('9013', 'Security'); INSERT INTO gifi (accno,description) VALUES ('9014', 'Garbage Removal'); INSERT INTO gifi (accno,description) VALUES ('9060', 'Salaries & Wages'); INSERT INTO gifi (accno,description) VALUES ('9061', 'Commissions'); INSERT INTO gifi (accno,description) VALUES ('9062', 'Crew Share'); INSERT INTO gifi (accno,description) VALUES ('9063', 'Bonuses'); INSERT INTO gifi (accno,description) VALUES ('9064', 'Director''s Fees'); INSERT INTO gifi (accno,description) VALUES ('9065', 'Management Salaries'); INSERT INTO gifi (accno,description) VALUES ('9066', 'Employee Salaries'); INSERT INTO gifi (accno,description) VALUES ('9110', 'Sub-Contracts'); INSERT INTO gifi (accno,description) VALUES ('9130', 'Supplies'); INSERT INTO gifi (accno,description) VALUES ('9131', 'Small Tools'); INSERT INTO gifi (accno,description) VALUES ('9132', 'Shop Expense'); INSERT INTO gifi (accno,description) VALUES ('9133', 'Uniforms'); INSERT INTO gifi (accno,description) VALUES ('9134', 'Laundry'); INSERT INTO gifi (accno,description) VALUES ('9135', 'Food & Catering'); INSERT INTO gifi (accno,description) VALUES ('9136', 'Fishing Gear'); INSERT INTO gifi (accno,description) VALUES ('9137', 'Nets & Traps'); INSERT INTO gifi (accno,description) VALUES ('9138', 'Salt, Bait & Ice'); INSERT INTO gifi (accno,description) VALUES ('9139', 'Camp Supplies'); INSERT INTO gifi (accno,description) VALUES ('9150', 'Computer Related Expenses'); INSERT INTO gifi (accno,description) VALUES ('9151', 'Upgrade'); INSERT INTO gifi (accno,description) VALUES ('9152', 'Internet'); INSERT INTO gifi (accno,description) VALUES ('9180', 'Property Taxes'); INSERT INTO gifi (accno,description) VALUES ('9200', 'Travel Expenses'); INSERT INTO gifi (accno,description) VALUES ('9201', 'Meetings & Conventions'); INSERT INTO gifi (accno,description) VALUES ('9220', 'Utilities'); INSERT INTO gifi (accno,description) VALUES ('9221', 'Electricity'); INSERT INTO gifi (accno,description) VALUES ('9222', 'Water'); INSERT INTO gifi (accno,description) VALUES ('9223', 'Heat'); INSERT INTO gifi (accno,description) VALUES ('9224', 'Fuel Costs'); INSERT INTO gifi (accno,description) VALUES ('9225', 'Telephone & Communications'); INSERT INTO gifi (accno,description) VALUES ('9270', 'Other Expenses'); INSERT INTO gifi (accno,description) VALUES ('9271', 'Cash Over/Short'); INSERT INTO gifi (accno,description) VALUES ('9272', 'Reimbursement Of Parent Company Expense'); INSERT INTO gifi (accno,description) VALUES ('9273', 'Selling Expenses'); INSERT INTO gifi (accno,description) VALUES ('9274', 'Shipping & Warehouse Expenses'); INSERT INTO gifi (accno,description) VALUES ('9275', 'Delivery, Freight & Express'); INSERT INTO gifi (accno,description) VALUES ('9276', 'Warranty Expenses'); INSERT INTO gifi (accno,description) VALUES ('9277', 'Royalty Expenses - Resident'); INSERT INTO gifi (accno,description) VALUES ('9278', 'Royalty Expenses - Non-Resident'); INSERT INTO gifi (accno,description) VALUES ('9279', 'Dumping Charges'); INSERT INTO gifi (accno,description) VALUES ('9280', 'Land Fill Fees'); INSERT INTO gifi (accno,description) VALUES ('9281', 'Vehicle Expenses'); INSERT INTO gifi (accno,description) VALUES ('9282', 'Research & Development'); INSERT INTO gifi (accno,description) VALUES ('9283', 'Withholding Taxes'); INSERT INTO gifi (accno,description) VALUES ('9284', 'General & Administrative Expenses'); INSERT INTO gifi (accno,description) VALUES ('9285', 'Interdivisional Expenses'); INSERT INTO gifi (accno,description) VALUES ('9286', 'Interfund Transfer (NPO)'); INSERT INTO gifi (accno,description) VALUES ('9367', 'Total Operating Expenses'); INSERT INTO gifi (accno,description) VALUES ('9368', 'Total Expenses'); INSERT INTO gifi (accno,description) VALUES ('9369', 'Net Non-Farming Income'); INSERT INTO gifi (accno,description) VALUES ('9370', 'Grains And Oilseeds'); INSERT INTO gifi (accno,description) VALUES ('9371', 'Wheat'); INSERT INTO gifi (accno,description) VALUES ('9372', 'Oats'); INSERT INTO gifi (accno,description) VALUES ('9373', 'Barley'); INSERT INTO gifi (accno,description) VALUES ('9374', 'Mixed Grains'); INSERT INTO gifi (accno,description) VALUES ('9375', 'Corn'); INSERT INTO gifi (accno,description) VALUES ('9376', 'Canola'); INSERT INTO gifi (accno,description) VALUES ('9377', 'Flaxseed'); INSERT INTO gifi (accno,description) VALUES ('9378', 'Soya Beans'); INSERT INTO gifi (accno,description) VALUES ('9379', 'Wheat Board Payments'); INSERT INTO gifi (accno,description) VALUES ('9420', 'Other Crop Revenues'); INSERT INTO gifi (accno,description) VALUES ('9321', 'Fruit'); INSERT INTO gifi (accno,description) VALUES ('9322', 'Potatoes'); INSERT INTO gifi (accno,description) VALUES ('9323', 'Vegetables'); INSERT INTO gifi (accno,description) VALUES ('9324', 'Tobacco'); INSERT INTO gifi (accno,description) VALUES ('9325', 'Greenhouse & Nursery Products'); INSERT INTO gifi (accno,description) VALUES ('9326', 'Forage Crops'); INSERT INTO gifi (accno,description) VALUES ('9470', 'Livestock & Animal Products Revenue'); INSERT INTO gifi (accno,description) VALUES ('9471', 'Cattle'); INSERT INTO gifi (accno,description) VALUES ('9472', 'Swine'); INSERT INTO gifi (accno,description) VALUES ('9473', 'Poultry'); INSERT INTO gifi (accno,description) VALUES ('9474', 'Sheep & Lambs'); INSERT INTO gifi (accno,description) VALUES ('9475', 'Pregnant Mare Urine (PMU)'); INSERT INTO gifi (accno,description) VALUES ('9476', 'Milk & Cream - Excluding Dairy Subsidies'); INSERT INTO gifi (accno,description) VALUES ('9477', 'Eggs For Consumption'); INSERT INTO gifi (accno,description) VALUES ('9478', 'Hatching Eggs'); INSERT INTO gifi (accno,description) VALUES ('9479', 'Aquaculture'); INSERT INTO gifi (accno,description) VALUES ('9480', 'Horses - Breeding & Meat'); INSERT INTO gifi (accno,description) VALUES ('9520', 'Other Commodities'); INSERT INTO gifi (accno,description) VALUES ('9521', 'Maple Products'); INSERT INTO gifi (accno,description) VALUES ('9522', 'Artificial Insemination (AI)'); INSERT INTO gifi (accno,description) VALUES ('9523', 'Semen Production'); INSERT INTO gifi (accno,description) VALUES ('9524', 'Embryo Production'); INSERT INTO gifi (accno,description) VALUES ('9540', 'Program Payment Revenues'); INSERT INTO gifi (accno,description) VALUES ('9541', 'Dairy Subsidies'); INSERT INTO gifi (accno,description) VALUES ('9542', 'Crop Insurance'); INSERT INTO gifi (accno,description) VALUES ('9543', 'NISA Payments'); INSERT INTO gifi (accno,description) VALUES ('9544', 'Disaster Assistance Program Payments'); INSERT INTO gifi (accno,description) VALUES ('9570', 'Rebates'); INSERT INTO gifi (accno,description) VALUES ('9571', 'Rebates - Fuel'); INSERT INTO gifi (accno,description) VALUES ('9572', 'Rebates - Interest'); INSERT INTO gifi (accno,description) VALUES ('9573', 'Rebates - Property Taxes'); INSERT INTO gifi (accno,description) VALUES ('9574', 'Resales, Rebates, GST For NISA Eligible Expenses'); INSERT INTO gifi (accno,description) VALUES ('9575', 'Rebates, GST For NISA Non-Eligible Expenses'); INSERT INTO gifi (accno,description) VALUES ('9600', 'Other Farm Revenues/Losses'); INSERT INTO gifi (accno,description) VALUES ('9601', 'Custom Or Contract Work'); INSERT INTO gifi (accno,description) VALUES ('9602', 'Wood Sales'); INSERT INTO gifi (accno,description) VALUES ('9603', 'Horse Racing'); INSERT INTO gifi (accno,description) VALUES ('9604', 'Insurance Proceeds'); INSERT INTO gifi (accno,description) VALUES ('9605', 'Patronage Dividends'); INSERT INTO gifi (accno,description) VALUES ('9606', 'Rental Income'); INSERT INTO gifi (accno,description) VALUES ('9607', 'Interest Income'); INSERT INTO gifi (accno,description) VALUES ('9608', 'Dividend Income'); INSERT INTO gifi (accno,description) VALUES ('9609', 'Gains/Losses On Disposal Of Assets'); INSERT INTO gifi (accno,description) VALUES ('9610', 'Gravel'); INSERT INTO gifi (accno,description) VALUES ('9611', 'Trucking'); INSERT INTO gifi (accno,description) VALUES ('9612', 'Resale Of Commodities Purchased'); INSERT INTO gifi (accno,description) VALUES ('9613', 'Leases'); INSERT INTO gifi (accno,description) VALUES ('9614', 'Machine Rentals'); INSERT INTO gifi (accno,description) VALUES ('9615', 'Farming Partnership Income/Loss'); INSERT INTO gifi (accno,description) VALUES ('9616', 'Farming Joint Venture Income/Loss'); INSERT INTO gifi (accno,description) VALUES ('9650', 'Non-Farming Income'); INSERT INTO gifi (accno,description) VALUES ('9659', 'Total Farm Revenue'); INSERT INTO gifi (accno,description) VALUES ('9660', 'Crop Expenses'); INSERT INTO gifi (accno,description) VALUES ('9661', 'Containers, Twine And Baling Wire'); INSERT INTO gifi (accno,description) VALUES ('9662', 'Fertilizers And Lime'); INSERT INTO gifi (accno,description) VALUES ('9663', 'Pesticides'); INSERT INTO gifi (accno,description) VALUES ('9664', 'Seeds & Plants'); INSERT INTO gifi (accno,description) VALUES ('9665', 'Insurance Premiums (Crop) NISA ACS'); INSERT INTO gifi (accno,description) VALUES ('9710', 'Livestock Expenses'); INSERT INTO gifi (accno,description) VALUES ('9711', 'Feed, Supplements, Straw & Bedding'); INSERT INTO gifi (accno,description) VALUES ('9712', 'Livestock Purchases'); INSERT INTO gifi (accno,description) VALUES ('9713', 'Veterinary Fees, Medicine & Breeding Fees'); INSERT INTO gifi (accno,description) VALUES ('9760', 'Machinery Expenses'); INSERT INTO gifi (accno,description) VALUES ('9761', 'Machinery Insurance'); INSERT INTO gifi (accno,description) VALUES ('9762', 'Machinery Licences'); INSERT INTO gifi (accno,description) VALUES ('9763', 'Machinery Repairs'); INSERT INTO gifi (accno,description) VALUES ('9764', 'Machinery Fuel'); INSERT INTO gifi (accno,description) VALUES ('9765', 'Machinery Lease'); INSERT INTO gifi (accno,description) VALUES ('9790', 'General Farm Expenses'); INSERT INTO gifi (accno,description) VALUES ('9791', 'Amortization Of Tangible Assets'); INSERT INTO gifi (accno,description) VALUES ('9792', 'Advertising, Marketing Costs & Promotion'); INSERT INTO gifi (accno,description) VALUES ('9793', 'Bad Debt'); INSERT INTO gifi (accno,description) VALUES ('9794', 'Benefits Related To Employee Salaries'); INSERT INTO gifi (accno,description) VALUES ('9795', 'Building Repairs & Maintenance'); INSERT INTO gifi (accno,description) VALUES ('9796', 'Clearing, Levelling & Draining Land'); INSERT INTO gifi (accno,description) VALUES ('9797', 'Crop Insurance, GRIP and Stabilization Premiums'); INSERT INTO gifi (accno,description) VALUES ('9798', 'Custom Or Contract Work'); INSERT INTO gifi (accno,description) VALUES ('9799', 'Electricity'); INSERT INTO gifi (accno,description) VALUES ('9800', 'Fence Repairs & Maintenance'); INSERT INTO gifi (accno,description) VALUES ('9801', 'Freight & Trucking'); INSERT INTO gifi (accno,description) VALUES ('9802', 'Heating Fuel & Curing Fuel'); INSERT INTO gifi (accno,description) VALUES ('9803', 'Insurance Program Overpayment Recapture'); INSERT INTO gifi (accno,description) VALUES ('9804', 'Other Insurance Premiums'); INSERT INTO gifi (accno,description) VALUES ('9805', 'Interest & Bank Charges'); INSERT INTO gifi (accno,description) VALUES ('9806', 'Marketing Board Fees'); INSERT INTO gifi (accno,description) VALUES ('9807', 'Membership/Subscription Fees'); INSERT INTO gifi (accno,description) VALUES ('9808', 'Office Expenses'); INSERT INTO gifi (accno,description) VALUES ('9809', 'Professional Fees'); INSERT INTO gifi (accno,description) VALUES ('9810', 'Property Taxes'); INSERT INTO gifi (accno,description) VALUES ('9811', 'Rent - Land & Buildings'); INSERT INTO gifi (accno,description) VALUES ('9812', 'Rent - Machinery'); INSERT INTO gifi (accno,description) VALUES ('9813', 'Other Rental Expenses'); INSERT INTO gifi (accno,description) VALUES ('9814', 'Salaries & Wages'); INSERT INTO gifi (accno,description) VALUES ('9815', 'Salaries & Wages Other Than Spouse Or Dependants'); INSERT INTO gifi (accno,description) VALUES ('9816', 'Salaries & Wages Paid To Dependants'); INSERT INTO gifi (accno,description) VALUES ('9817', 'Selling Costs'); INSERT INTO gifi (accno,description) VALUES ('9818', 'Supplies'); INSERT INTO gifi (accno,description) VALUES ('9819', 'Motor Vehicle Expenses'); INSERT INTO gifi (accno,description) VALUES ('9820', 'Small Tools'); INSERT INTO gifi (accno,description) VALUES ('9821', 'Soil Testing'); INSERT INTO gifi (accno,description) VALUES ('9822', 'Storage/Drying'); INSERT INTO gifi (accno,description) VALUES ('9823', 'Licences/Permits'); INSERT INTO gifi (accno,description) VALUES ('9824', 'Telephone'); INSERT INTO gifi (accno,description) VALUES ('9825', 'Quota Rental'); INSERT INTO gifi (accno,description) VALUES ('9826', 'Gravel'); INSERT INTO gifi (accno,description) VALUES ('9827', 'Purchases Of Commodities Resold'); INSERT INTO gifi (accno,description) VALUES ('9828', 'Salaries & Wages Paid To Spouse'); INSERT INTO gifi (accno,description) VALUES ('9829', 'Motor Vehicle Interest And Leasing Costs'); INSERT INTO gifi (accno,description) VALUES ('9830', 'Prepared Feed'); INSERT INTO gifi (accno,description) VALUES ('9831', 'Custom Feed'); INSERT INTO gifi (accno,description) VALUES ('9832', 'Amortization Of Intangible Assets'); INSERT INTO gifi (accno,description) VALUES ('9833', 'Amortization Of Milk Quota'); INSERT INTO gifi (accno,description) VALUES ('9834', 'Travel Expenses'); INSERT INTO gifi (accno,description) VALUES ('9835', 'Capital/Business Taxes'); INSERT INTO gifi (accno,description) VALUES ('9850', 'Non-Farming Expenses'); INSERT INTO gifi (accno,description) VALUES ('9870', 'Net Inventory Adjustment'); INSERT INTO gifi (accno,description) VALUES ('9898', 'Total Farm Expenses'); INSERT INTO gifi (accno,description) VALUES ('9899', 'Net Farm Income'); INSERT INTO gifi (accno,description) VALUES ('9970', 'Net Income/Loss Before Taxes And Extraordinary Items'); INSERT INTO gifi (accno,description) VALUES ('9975', 'Extraordinary Items'); INSERT INTO gifi (accno,description) VALUES ('9976', 'Legal Settlements'); INSERT INTO gifi (accno,description) VALUES ('9980', 'Unrealized Gains/Losses'); INSERT INTO gifi (accno,description) VALUES ('9985', 'Unusual Items'); INSERT INTO gifi (accno,description) VALUES ('9990', 'Current Income Taxes'); INSERT INTO gifi (accno,description) VALUES ('9995', 'Deferred Income Tax Provision'); INSERT INTO gifi (accno,description) VALUES ('9999', 'Net Income/Loss After Taxes And Extraordinary Items'); -- This item represents the net amount of: -- Item 9970 - Net income/loss before taxes and extraordinary items minus -- Item 9975 - Extraordinary item(s) minus -- Item 9976 - Legal settlements plus -- Item 9980 - Unrealized gains/losses minus -- Item 9985 - Unusual items minus -- Item 9990 - Current income taxes minus -- Item 9995 - Deferred income tax provision -- and must be reported. -- Any amount reported in this item should be equal to the amount reported at Item 3680 - Net income/loss, -- in the retained earnings section. -- commit; ledgersmb/sql/coa/ca/gifi/French.sql0000755000000000000000000017645010760336531016334 0ustar rootrootbegin; -- French Canadian GIFI -- Céline des Ligneris -- checked DS. March 3, 2004 -- INSERT INTO gifi (accno,description) VALUES ('1000','Encaisse et dépôts'); INSERT INTO gifi (accno,description) VALUES ('1001','Encaisse'); INSERT INTO gifi (accno,description) VALUES ('1002','Dépôts dans des banques et des institutions canadiennes ­ monnaie canadienne'); INSERT INTO gifi (accno,description) VALUES ('1003','Dépôts dans des banques et des institutions canadiennes ­ devises étrangères'); INSERT INTO gifi (accno,description) VALUES ('1004','Dépôts dans des banques étrangères ­ monnaie canadienne'); INSERT INTO gifi (accno,description) VALUES ('1005','Dépôts dans des banques étrangères ­ devises étrangères'); INSERT INTO gifi (accno,description) VALUES ('1006','Caisse de crédit ­ dépôt central'); INSERT INTO gifi (accno,description) VALUES ('1007','Autres éléments de l''actif assimilables à de l''encaisse'); INSERT INTO gifi (accno,description) VALUES ('1060','Comptes clients'); INSERT INTO gifi (accno,description) VALUES ('1061','Provision pour créances douteuses'); INSERT INTO gifi (accno,description) VALUES ('1062','Comptes clients commerciaux'); INSERT INTO gifi (accno,description) VALUES ('1063','Provision pour mauvaises créances ­ comptes clients commerciaux'); INSERT INTO gifi (accno,description) VALUES ('1064','Comptes clients de personnes apparentées'); INSERT INTO gifi (accno,description) VALUES ('1065','Provision pour mauvaises créances ­ personnes apparentées'); INSERT INTO gifi (accno,description) VALUES ('1066','Impôts à recevoir'); INSERT INTO gifi (accno,description) VALUES ('1067','Intérêts à recevoir'); INSERT INTO gifi (accno,description) VALUES ('1068','Retenues de garantie à recevoir'); INSERT INTO gifi (accno,description) VALUES ('1069','Créances au titre de baux'); INSERT INTO gifi (accno,description) VALUES ('1070','Provision pour éléments douteux contenus dans certaines créances au titre de baux'); INSERT INTO gifi (accno,description) VALUES ('1071','Comptes à recevoir d''employés'); INSERT INTO gifi (accno,description) VALUES ('1072','Provision pour mauvaises créances ­ employés'); INSERT INTO gifi (accno,description) VALUES ('1073','Montants à recevoir de membres d''OSBL'); INSERT INTO gifi (accno,description) VALUES ('1120','Stocks'); INSERT INTO gifi (accno,description) VALUES ('1121','Stock de marchandises à vendre'); INSERT INTO gifi (accno,description) VALUES ('1122','Pièces et fournitures en stock'); INSERT INTO gifi (accno,description) VALUES ('1123','Biens immobiliers figurant dans un inventaire'); INSERT INTO gifi (accno,description) VALUES ('1124','Stocks d''agrégats'); INSERT INTO gifi (accno,description) VALUES ('1125','Travaux en cours'); INSERT INTO gifi (accno,description) VALUES ('1126','Matières premières'); INSERT INTO gifi (accno,description) VALUES ('1127','Titres figurant dans un inventaire'); INSERT INTO gifi (accno,description) VALUES ('1180','Placements à court terme'); INSERT INTO gifi (accno,description) VALUES ('1181','Dépôts à terme canadiens'); INSERT INTO gifi (accno,description) VALUES ('1182','Actions de sociétés canadiennes'); INSERT INTO gifi (accno,description) VALUES ('1183','Obligations canadiennes'); INSERT INTO gifi (accno,description) VALUES ('1184','Bonds du Trésor canadien'); INSERT INTO gifi (accno,description) VALUES ('1185','Titres acquis avec entente de rachat'); INSERT INTO gifi (accno,description) VALUES ('1186','Autres placements canadiens à court terme'); INSERT INTO gifi (accno,description) VALUES ('1187','Placements étrangers à court terme'); INSERT INTO gifi (accno,description) VALUES ('1240','Prêts et effets à recevoir'); INSERT INTO gifi (accno,description) VALUES ('1241','Prêts remboursables sur demande'); INSERT INTO gifi (accno,description) VALUES ('1242','Autres prêts non remboursés'); INSERT INTO gifi (accno,description) VALUES ('1243','Effets à recevoir'); INSERT INTO gifi (accno,description) VALUES ('1244','Hypothèques à recevoir'); INSERT INTO gifi (accno,description) VALUES ('1300','Sommes exigibles d''actionnaire(s)/d''administrateur(s)'); INSERT INTO gifi (accno,description) VALUES ('1301','Sommes exigibles d''actionnaire(s) (particuliers)'); INSERT INTO gifi (accno,description) VALUES ('1302','Sommes exigibles d''actionnaire(s) (sociétés)'); INSERT INTO gifi (accno,description) VALUES ('1303','Sommes exigibles d''administrateur(s)'); INSERT INTO gifi (accno,description) VALUES ('1360','Placements dans une(des) coentreprise(s)/ société(s) de personnes'); INSERT INTO gifi (accno,description) VALUES ('1380','Sommes exigibles de coentreprise(s)/société(s) de personnes'); INSERT INTO gifi (accno,description) VALUES ('1400','Sommes exigibles des personnes apparentées/placements dans des personnes apparentées'); INSERT INTO gifi (accno,description) VALUES ('1401','Billets à demande de personnes apparentées'); INSERT INTO gifi (accno,description) VALUES ('1402','Intérêts à recevoir de personnes apparentées'); INSERT INTO gifi (accno,description) VALUES ('1403','Prêts/avances à des personnes apparentées'); INSERT INTO gifi (accno,description) VALUES ('1460','Dettes des clients pour acceptation'); INSERT INTO gifi (accno,description) VALUES ('1480','Autres éléments d''actif à court terme'); INSERT INTO gifi (accno,description) VALUES ('1481','Impôts sur le revenu reportés'); INSERT INTO gifi (accno,description) VALUES ('1482','Revenus de placements accumulés'); INSERT INTO gifi (accno,description) VALUES ('1483','Impôts recouvrables/remboursables'); INSERT INTO gifi (accno,description) VALUES ('1484','Dépenses payées d''avance'); INSERT INTO gifi (accno,description) VALUES ('1485','Avances de forage'); INSERT INTO gifi (accno,description) VALUES ('1486','Cautionnement/dépôts sur soumissions'); INSERT INTO gifi (accno,description) VALUES ('1599','Total de l''actif à court terme'); INSERT INTO gifi (accno,description) VALUES ('1600','Terrains'); INSERT INTO gifi (accno,description) VALUES ('1601','Frais d''amélioration des terrains'); INSERT INTO gifi (accno,description) VALUES ('1602','Amortissement cumulé de l''amélioration des terrains'); INSERT INTO gifi (accno,description) VALUES ('1620','Biens épuisables'); INSERT INTO gifi (accno,description) VALUES ('1621','Amortissement cumulé des biens épuisables'); INSERT INTO gifi (accno,description) VALUES ('1622','Biens en ressources pétrolifères et en gaz naturel'); INSERT INTO gifi (accno,description) VALUES ('1623','Amortissement cumulé des biens en ressources'); INSERT INTO gifi (accno,description) VALUES ('1624','Biens miniers'); INSERT INTO gifi (accno,description) VALUES ('1625','Amortissement cumulé des biens miniers'); INSERT INTO gifi (accno,description) VALUES ('1626','Frais d''exploration et d''exploitation reportés'); INSERT INTO gifi (accno,description) VALUES ('1627','Amortissement cumulé des frais d''exploration et d''exploitation reportés'); INSERT INTO gifi (accno,description) VALUES ('1628','Carrières'); INSERT INTO gifi (accno,description) VALUES ('1629','Amortissement cumulé des carrières'); INSERT INTO gifi (accno,description) VALUES ('1630','Carrières de gravier'); INSERT INTO gifi (accno,description) VALUES ('1631','Amortissement cumulé des carrières de gravier'); INSERT INTO gifi (accno,description) VALUES ('1632','Concessions forestières'); INSERT INTO gifi (accno,description) VALUES ('1633','Amortissement cumulé des concessions forestières'); INSERT INTO gifi (accno,description) VALUES ('1680','Bâtiments'); INSERT INTO gifi (accno,description) VALUES ('1681','Amortissement cumulé des bâtiments'); INSERT INTO gifi (accno,description) VALUES ('1682','Installations de fabrication et de traitement'); INSERT INTO gifi (accno,description) VALUES ('1683','Amortissement cumulé des installations de fabrication et de traitement'); INSERT INTO gifi (accno,description) VALUES ('1684','Bâtiments en construction'); INSERT INTO gifi (accno,description) VALUES ('1740','Machines, matériel, meubles et accessoires'); INSERT INTO gifi (accno,description) VALUES ('1741','Amortissement cumulé des machines, du matériel, des meubles et des accessoires'); INSERT INTO gifi (accno,description) VALUES ('1742','Véhicules automobiles'); INSERT INTO gifi (accno,description) VALUES ('1743','Amortissement cumulé des véhicules automobiles'); INSERT INTO gifi (accno,description) VALUES ('1744','Outils et matrices'); INSERT INTO gifi (accno,description) VALUES ('1745','Amortissement cumulé sur les outils et les matrices'); INSERT INTO gifi (accno,description) VALUES ('1746','Matériel de construction et d''excavation'); INSERT INTO gifi (accno,description) VALUES ('1747','Amortissement cumulé du matériel de construction et d''excavation'); INSERT INTO gifi (accno,description) VALUES ('1748','Matériel d''exploitation forestière'); INSERT INTO gifi (accno,description) VALUES ('1749','Amortissement cumulé du matériel d''exploitation forestière'); INSERT INTO gifi (accno,description) VALUES ('1750','Filets et matériel de pêche'); INSERT INTO gifi (accno,description) VALUES ('1751','Amortissement cumulé des filets et du matériel de pêche'); INSERT INTO gifi (accno,description) VALUES ('1752','Matériel d''exploitation minière'); INSERT INTO gifi (accno,description) VALUES ('1753','Amortissement cumulé du matériel d''exploitation minière'); INSERT INTO gifi (accno,description) VALUES ('1754','Réseaux pétroliers et gaziers'); INSERT INTO gifi (accno,description) VALUES ('1755','Amortissement cumulé des réseaux pétroliers et gaziers'); INSERT INTO gifi (accno,description) VALUES ('1756','Matériel de production pour les industries de ressources naturelles'); INSERT INTO gifi (accno,description) VALUES ('1757','Amortissement cumulé du matériel de production de ressources naturelles'); INSERT INTO gifi (accno,description) VALUES ('1758','Matériel de production autre que pour les industries de ressources naturelles'); INSERT INTO gifi (accno,description) VALUES ('1759','Amortissement cumulé du matériel de production autre que pour les industries des ressources naturelles'); INSERT INTO gifi (accno,description) VALUES ('1760','Matériel d''exploration'); INSERT INTO gifi (accno,description) VALUES ('1761','Amortissement cumulé du matériel d''exploration'); INSERT INTO gifi (accno,description) VALUES ('1762','Matériel d''expédition'); INSERT INTO gifi (accno,description) VALUES ('1763','Amortissement cumulé du matériel d''expédition'); INSERT INTO gifi (accno,description) VALUES ('1764','Navires et bateaux'); INSERT INTO gifi (accno,description) VALUES ('1765','Amortissement cumulé des navires et des bateaux'); INSERT INTO gifi (accno,description) VALUES ('1766','Aéronefs'); INSERT INTO gifi (accno,description) VALUES ('1767','Amortissement cumulé des aéronefs'); INSERT INTO gifi (accno,description) VALUES ('1768','Panneaux indicateurs'); INSERT INTO gifi (accno,description) VALUES ('1769','Amortissement cumulé des panneaux indicateurs'); INSERT INTO gifi (accno,description) VALUES ('1770','Petits outils'); INSERT INTO gifi (accno,description) VALUES ('1771','Amortissement cumulé des petits outils'); INSERT INTO gifi (accno,description) VALUES ('1772','Matériel de radio et de communication'); INSERT INTO gifi (accno,description) VALUES ('1773','Amortissement cumulé du matériel de radio et de communication'); INSERT INTO gifi (accno,description) VALUES ('1774','Matériel informatique/logiciels'); INSERT INTO gifi (accno,description) VALUES ('1775','Amortissement cumulé du matériel informatique / logiciels'); INSERT INTO gifi (accno,description) VALUES ('1776','Instruments de musique'); INSERT INTO gifi (accno,description) VALUES ('1777','Amortissement cumulé des instruments de musique'); INSERT INTO gifi (accno,description) VALUES ('1778','Satellites'); INSERT INTO gifi (accno,description) VALUES ('1779','Amortissement cumulé des satellites'); INSERT INTO gifi (accno,description) VALUES ('1780','Stations terrestres'); INSERT INTO gifi (accno,description) VALUES ('1781','Amortissement cumulé des stations terrestres'); INSERT INTO gifi (accno,description) VALUES ('1782','Machines et matériel en cours de fabrication'); INSERT INTO gifi (accno,description) VALUES ('1783','Matériel de transport'); INSERT INTO gifi (accno,description) VALUES ('1784','Amortissement cumulé du matériel de transport'); INSERT INTO gifi (accno,description) VALUES ('1785','Autres machines et matériel'); INSERT INTO gifi (accno,description) VALUES ('1786','Amortissement cumulé des autres machines et d''autre matériel'); INSERT INTO gifi (accno,description) VALUES ('1787','Meubles et accessoires'); INSERT INTO gifi (accno,description) VALUES ('1788','Amortissement cumulé des meubles et des accessoires'); INSERT INTO gifi (accno,description) VALUES ('1900','Autres immobilisations'); INSERT INTO gifi (accno,description) VALUES ('1901','Amortissement cumulé des autres immobilisations'); INSERT INTO gifi (accno,description) VALUES ('1902','Chemins d''exploitation forestière'); INSERT INTO gifi (accno,description) VALUES ('1903','Amortissement cumulé des chemins d''exploitation forestière'); INSERT INTO gifi (accno,description) VALUES ('1904','Aires asphaltées et parcs de stationnement'); INSERT INTO gifi (accno,description) VALUES ('1905','Amortissement des aires asphaltées et des parcs de stationnement'); INSERT INTO gifi (accno,description) VALUES ('1906','Quais'); INSERT INTO gifi (accno,description) VALUES ('1907','Amortissement cumulé des quais'); INSERT INTO gifi (accno,description) VALUES ('1908','Clôtures'); INSERT INTO gifi (accno,description) VALUES ('1909','Amortissement cumulé des clôtures'); INSERT INTO gifi (accno,description) VALUES ('1910','Contrats de location ­ acquisition (bâtiments)'); INSERT INTO gifi (accno,description) VALUES ('1911','Amortissement cumulé des contrats de location - acquisition (bâtiments)'); INSERT INTO gifi (accno,description) VALUES ('1912','Contrats de location ­ acquisition (matériel)'); INSERT INTO gifi (accno,description) VALUES ('1913','Amortissement cumulé des contrats de location ­ acquisition (matériel)'); INSERT INTO gifi (accno,description) VALUES ('1914','Contrats de location ­ acquisition (véhicules)'); INSERT INTO gifi (accno,description) VALUES ('1915','Amortissement cumulé des contrats de location ­ acquisition (véhicules)'); INSERT INTO gifi (accno,description) VALUES ('1916','Contrats de location ­ acquisition (autres)panneaux'); INSERT INTO gifi (accno,description) VALUES ('1917','Amortissement cumulé des contrats de location ­ acquisition (autres)'); INSERT INTO gifi (accno,description) VALUES ('1918','Améliorations locatives'); INSERT INTO gifi (accno,description) VALUES ('1919','Amortissement cumulé des améliorations locatives'); INSERT INTO gifi (accno,description) VALUES ('1920','Autres immobilisations en construction'); INSERT INTO gifi (accno,description) VALUES ('1921','Aires de campings'); INSERT INTO gifi (accno,description) VALUES ('1922','Amortissement cumulé des aires de campings'); INSERT INTO gifi (accno,description) VALUES ('2008','Total des immobilisations'); INSERT INTO gifi (accno,description) VALUES ('2009','Total de l''amortissement cumulé des immobilisations'); INSERT INTO gifi (accno,description) VALUES ('2010','Actif incorporel'); INSERT INTO gifi (accno,description) VALUES ('2011','Amortissement cumulé de l''actif incorporel'); INSERT INTO gifi (accno,description) VALUES ('2012','Achalandage'); INSERT INTO gifi (accno,description) VALUES ('2013','Amortissement cumulé de l''achalandage'); INSERT INTO gifi (accno,description) VALUES ('2014','Contingents'); INSERT INTO gifi (accno,description) VALUES ('2015','Amortissement cumulé des contingents'); INSERT INTO gifi (accno,description) VALUES ('2016','Permis'); INSERT INTO gifi (accno,description) VALUES ('2017','Amortissement cumulé des permis'); INSERT INTO gifi (accno,description) VALUES ('2018','Frais de constitution en société'); INSERT INTO gifi (accno,description) VALUES ('2019','Amortissement cumulé des frais de constitution en société'); INSERT INTO gifi (accno,description) VALUES ('2020','Marques de commerce et brevets'); INSERT INTO gifi (accno,description) VALUES ('2021','Amortissement cumulé des marques de commerce et des brevets'); INSERT INTO gifi (accno,description) VALUES ('2022','Listes de clients'); INSERT INTO gifi (accno,description) VALUES ('2023','Amortissement cumulé des listes de clients'); INSERT INTO gifi (accno,description) VALUES ('2024','Droits'); INSERT INTO gifi (accno,description) VALUES ('2025','Amortissement cumulé des droits'); INSERT INTO gifi (accno,description) VALUES ('2026','Recherche et développement'); INSERT INTO gifi (accno,description) VALUES ('2027','Amortissement cumulé de la recherche et du développement'); INSERT INTO gifi (accno,description) VALUES ('2070','Droits relatifs à des ressources'); INSERT INTO gifi (accno,description) VALUES ('2071','Amortissement cumulé des droits relatifs à des ressources'); INSERT INTO gifi (accno,description) VALUES ('2072','Droits de coupe'); INSERT INTO gifi (accno,description) VALUES ('2073','Amortissement cumulé des droits de coupe'); INSERT INTO gifi (accno,description) VALUES ('2074','Droits miniers'); INSERT INTO gifi (accno,description) VALUES ('2075','Amortissement cumulé des droits miniers'); INSERT INTO gifi (accno,description) VALUES ('2076','Droits pétroliers et gaziers'); INSERT INTO gifi (accno,description) VALUES ('2077','Amortissement cumulé des droits pétroliers et gaziers'); INSERT INTO gifi (accno,description) VALUES ('2178','Total de l''actif incorporel'); INSERT INTO gifi (accno,description) VALUES ('2179','Total de l''amortissement cumulé de l''actif incorporel'); INSERT INTO gifi (accno,description) VALUES ('2180','Sommes exigibles d''actionnaire(s)/ d''administrateur(s)'); INSERT INTO gifi (accno,description) VALUES ('2181','Sommes exigibles d''actionnaire(s) (particuliers)'); INSERT INTO gifi (accno,description) VALUES ('2182','Sommes exigibles d''actionnaire(s) (sociétés)'); INSERT INTO gifi (accno,description) VALUES ('2183','Sommes exigibles d''administrateur(s)'); INSERT INTO gifi (accno,description) VALUES ('2190','Sommes exigibles des membres'); INSERT INTO gifi (accno,description) VALUES ('2200','Placements dans une(des) coentreprise(s)/société(s) de personnes'); INSERT INTO gifi (accno,description) VALUES ('2220','Sommes exigibles de coentreprise(s)/société(s)de personnes'); INSERT INTO gifi (accno,description) VALUES ('2240','Sommes exigibles des personnes apparentées/'); INSERT INTO gifi (accno,description) VALUES ('2241','Sommes exigibles de/placements dans des personnes canadiennes apparentées'); INSERT INTO gifi (accno,description) VALUES ('2242','Actions dans des sociétés canadiennes apparentées'); INSERT INTO gifi (accno,description) VALUES ('2243','Prêts/avances à des sociétés canadiennes apparentées'); INSERT INTO gifi (accno,description) VALUES ('2244','Placements dans des sociétés canadiennes apparentées à la valeur d''acquisition'); INSERT INTO gifi (accno,description) VALUES ('2245','Placements dans des sociétés canadiennes apparentées à la valeur de consolidation'); INSERT INTO gifi (accno,description) VALUES ('2246','Sommes exigibles de/placements dans des parties étrangères apparentées'); INSERT INTO gifi (accno,description) VALUES ('2247','Actions dans des sociétés étrangères apparentées'); INSERT INTO gifi (accno,description) VALUES ('2248','Prêts/avances à des sociétés étrangères apparentées'); INSERT INTO gifi (accno,description) VALUES ('2249','Placements dans des sociétés étrangères apparentées à la valeur d''acquisition'); INSERT INTO gifi (accno,description) VALUES ('2250','Placements dans des sociétés étrangères apparentées à la valeur de consolidation'); INSERT INTO gifi (accno,description) VALUES ('2280','Placements dans des locations en partenariat'); INSERT INTO gifi (accno,description) VALUES ('2300','Placements à long terme'); INSERT INTO gifi (accno,description) VALUES ('2301','Actions dans des sociétés étrangères'); INSERT INTO gifi (accno,description) VALUES ('2302','Autres genres de placements à l''étranger'); INSERT INTO gifi (accno,description) VALUES ('2303','Actions dans des sociétés canadiennes'); INSERT INTO gifi (accno,description) VALUES ('2304','Titres de créances du gouvernement du Canada'); INSERT INTO gifi (accno,description) VALUES ('2305','Titres de créances des gouvernements provinciaux et des administrations municipales du Canada'); INSERT INTO gifi (accno,description) VALUES ('2306','Obligations et débentures de sociétés canadiennes'); INSERT INTO gifi (accno,description) VALUES ('2307','Titres de créances'); INSERT INTO gifi (accno,description) VALUES ('2308','Titres de participation'); INSERT INTO gifi (accno,description) VALUES ('2309','Titres acquis à la suite d''une entente de rachat'); INSERT INTO gifi (accno,description) VALUES ('2310','Actions de la caisse de crédit centrale'); INSERT INTO gifi (accno,description) VALUES ('2311','Autres placements canadiens à long terme'); INSERT INTO gifi (accno,description) VALUES ('2360','Prêts à long terme'); INSERT INTO gifi (accno,description) VALUES ('2361','Prêts hypothécaires'); INSERT INTO gifi (accno,description) VALUES ('2362','Prêts personnels et prêts sur carte de crédit'); INSERT INTO gifi (accno,description) VALUES ('2363','Prêts au gouvernement et prêts commerciaux'); INSERT INTO gifi (accno,description) VALUES ('2364','Marge de crédit'); INSERT INTO gifi (accno,description) VALUES ('2420','Autres éléments d''actif à long terme'); INSERT INTO gifi (accno,description) VALUES ('2421','Impôts sur le revenu reportés'); INSERT INTO gifi (accno,description) VALUES ('2422','Frais du régime de pension reportés'); INSERT INTO gifi (accno,description) VALUES ('2423','Pertes de change non matérialisées reportées'); INSERT INTO gifi (accno,description) VALUES ('2424','Autres éléments/frais reportés'); INSERT INTO gifi (accno,description) VALUES ('2425','Amortissement cumulé des frais reportés'); INSERT INTO gifi (accno,description) VALUES ('2426','Fonds de réserve'); INSERT INTO gifi (accno,description) VALUES ('2427','Valeur de rachat de l''assurance-vie'); INSERT INTO gifi (accno,description) VALUES ('2589','Total de l''actif à long terme'); INSERT INTO gifi (accno,description) VALUES ('2590','Actif détenu en fiducie'); INSERT INTO gifi (accno,description) VALUES ('2599','Total de l''actif'); INSERT INTO gifi (accno,description) VALUES ('2600','Découvert bancaire'); INSERT INTO gifi (accno,description) VALUES ('2620','Montants et charges à payer'); INSERT INTO gifi (accno,description) VALUES ('2621','Effets commerciaux à payer'); INSERT INTO gifi (accno,description) VALUES ('2622','Effets commerciaux à payer à des personnes apparentées'); INSERT INTO gifi (accno,description) VALUES ('2623','Retenues de garantie à payer'); INSERT INTO gifi (accno,description) VALUES ('2624','Salaires à payer'); INSERT INTO gifi (accno,description) VALUES ('2625','Frais de gestion à payer'); INSERT INTO gifi (accno,description) VALUES ('2626','Gratifications à payer'); INSERT INTO gifi (accno,description) VALUES ('2627','Retenues salariales à payer'); INSERT INTO gifi (accno,description) VALUES ('2628','Retenues d''impôts et de taxes à payer'); INSERT INTO gifi (accno,description) VALUES ('2629','Intérêts à payer'); INSERT INTO gifi (accno,description) VALUES ('2630','Montants à payer aux membres d''OSBL'); INSERT INTO gifi (accno,description) VALUES ('2680','Taxes et impôts à payer'); INSERT INTO gifi (accno,description) VALUES ('2700','Dettes à court terme'); INSERT INTO gifi (accno,description) VALUES ('2701','Emprunts auprès de banques canadiennes'); INSERT INTO gifi (accno,description) VALUES ('2702','Élément de passif pour les titres vendus à découvert'); INSERT INTO gifi (accno,description) VALUES ('2703','Élément de passif pour les titres vendus à la suite d''une entente de rachat'); INSERT INTO gifi (accno,description) VALUES ('2704','Titres sur l''or et sur l''argent'); INSERT INTO gifi (accno,description) VALUES ('2705','Chèques et autres items en circulation'); INSERT INTO gifi (accno,description) VALUES ('2706','Billets garantis'); INSERT INTO gifi (accno,description) VALUES ('2770','Revenus reportés'); INSERT INTO gifi (accno,description) VALUES ('2780','Sommes dues à un(des) actionnaire(s)/administrateur(s)'); INSERT INTO gifi (accno,description) VALUES ('2781','Sommes dues à un(des) actionnaire(s) (particuliers)'); INSERT INTO gifi (accno,description) VALUES ('2782','Sommes dues à un(des) actionnaire(s) (sociétés)'); INSERT INTO gifi (accno,description) VALUES ('2783','Sommes dues à un(des) administrateur(s)'); INSERT INTO gifi (accno,description) VALUES ('2840','Sommes dues à une(des) coentreprise(s)/ société(s) de personnes'); INSERT INTO gifi (accno,description) VALUES ('2860','Sommes dues à des personnes apparentées'); INSERT INTO gifi (accno,description) VALUES ('2861','Billets à demande dus à des personnes apparentées'); INSERT INTO gifi (accno,description) VALUES ('2862','Intérêts à payer à des personnes apparentées'); INSERT INTO gifi (accno,description) VALUES ('2863','Avances à payer à des personnes apparentées'); INSERT INTO gifi (accno,description) VALUES ('2920','Portion à court terme du passif à long terme'); INSERT INTO gifi (accno,description) VALUES ('2940','Acceptations de banque'); INSERT INTO gifi (accno,description) VALUES ('2960','Autres éléments du passif à court terme'); INSERT INTO gifi (accno,description) VALUES ('2961','Sommes reçues en dépôts'); INSERT INTO gifi (accno,description) VALUES ('2962','Dividendes à payer'); INSERT INTO gifi (accno,description) VALUES ('2963','Impôts sur le revenu reportés'); INSERT INTO gifi (accno,description) VALUES ('2964','Réserve pour garanties et indemnités'); INSERT INTO gifi (accno,description) VALUES ('2965','Provisions et réserves générales'); INSERT INTO gifi (accno,description) VALUES ('2966','Parts des membres de l''équipage'); INSERT INTO gifi (accno,description) VALUES ('3139','Total du passif à court terme'); INSERT INTO gifi (accno,description) VALUES ('3140','Dette à long terme'); INSERT INTO gifi (accno,description) VALUES ('3141','Hypothèques'); INSERT INTO gifi (accno,description) VALUES ('3142','Emprunts d''une société de crédit agricole'); INSERT INTO gifi (accno,description) VALUES ('3143','Emprunt d''une banque à charte'); INSERT INTO gifi (accno,description) VALUES ('3144','Emprunt d''une caisse populaire/d''une coopérative de crédit'); INSERT INTO gifi (accno,description) VALUES ('3145','Emprunt du gouvernement provincial'); INSERT INTO gifi (accno,description) VALUES ('3146','Emprunt d''un fournisseur'); INSERT INTO gifi (accno,description) VALUES ('3147','Prêt personnel'); INSERT INTO gifi (accno,description) VALUES ('3148','Emprunts d''une fédération, d''une centrale ou de'); INSERT INTO gifi (accno,description) VALUES ('3149','Marge de crédit'); INSERT INTO gifi (accno,description) VALUES ('3150','Élément de passif pour les titres vendus à'); INSERT INTO gifi (accno,description) VALUES ('3151','Élément de passif pour les titres vendus à la suite d''une entente de rachat'); INSERT INTO gifi (accno,description) VALUES ('3152','Billets garantis'); INSERT INTO gifi (accno,description) VALUES ('3200','Cautionnement des institutions financières'); INSERT INTO gifi (accno,description) VALUES ('3210','Obligations et débentures'); INSERT INTO gifi (accno,description) VALUES ('3220','Revenus reportés'); INSERT INTO gifi (accno,description) VALUES ('3240','Impôts sur le revenu reportés'); INSERT INTO gifi (accno,description) VALUES ('3260','Sommes dues à un(des) actionnaire(s)/ administrateur(s)'); INSERT INTO gifi (accno,description) VALUES ('3261','Sommes dues à un(des) actionnaire(s) (particuliers)'); INSERT INTO gifi (accno,description) VALUES ('3262','Sommes dues à un(des) actionnaire(s) (sociétés)'); INSERT INTO gifi (accno,description) VALUES ('3263','Sommes dues à un(des) administrateur(s)'); INSERT INTO gifi (accno,description) VALUES ('3270','Sommes dues à des membres'); INSERT INTO gifi (accno,description) VALUES ('3280','Sommes dues à une(des) coentreprise(s)/société(s) de personnes'); INSERT INTO gifi (accno,description) VALUES ('3300','Sommes dues à des personnes apparentées'); INSERT INTO gifi (accno,description) VALUES ('3301','Sommes dues à des personnes canadiennes apparentées'); INSERT INTO gifi (accno,description) VALUES ('3302','Sommes dues à des personnes étrangères apparentées'); INSERT INTO gifi (accno,description) VALUES ('3320','Autres éléments de passif à long terme'); INSERT INTO gifi (accno,description) VALUES ('3321','Obligations, engagements et location-acquisition à long terme'); INSERT INTO gifi (accno,description) VALUES ('3322','Réserves pour garanties et indemnités'); INSERT INTO gifi (accno,description) VALUES ('3323','Provision pour la restauration des sites d''exploitation'); INSERT INTO gifi (accno,description) VALUES ('3324','Contribution à une fiducie pour l''environnement'); INSERT INTO gifi (accno,description) VALUES ('3325','Provisions et réserves générales'); INSERT INTO gifi (accno,description) VALUES ('3326','Redressement pour les actions privilégiées'); INSERT INTO gifi (accno,description) VALUES ('3327','Répartition aux membres'); INSERT INTO gifi (accno,description) VALUES ('3328','Revenus différés de contrats incomplets'); INSERT INTO gifi (accno,description) VALUES ('3450','Total du passif à long terme'); INSERT INTO gifi (accno,description) VALUES ('3460','Dettes de second rang'); INSERT INTO gifi (accno,description) VALUES ('3470','Sommes détenues en fiducie'); INSERT INTO gifi (accno,description) VALUES ('3499','Total du passif'); INSERT INTO gifi (accno,description) VALUES ('3500','Actions ordinaires'); INSERT INTO gifi (accno,description) VALUES ('3520','Actions privilégiées'); INSERT INTO gifi (accno,description) VALUES ('3540','Surplus d''apport et autres surplus'); INSERT INTO gifi (accno,description) VALUES ('3541','Surplus d''apport'); INSERT INTO gifi (accno,description) VALUES ('3542','Surplus d''expertise'); INSERT INTO gifi (accno,description) VALUES ('3543','Réserve générale'); INSERT INTO gifi (accno,description) VALUES ('3570','Compte du siège social'); INSERT INTO gifi (accno,description) VALUES ('3600','Bénéfices non répartis/déficit'); INSERT INTO gifi (accno,description) VALUES ('3620','Total des capitaux propres'); INSERT INTO gifi (accno,description) VALUES ('3640','Total du passif et des capitaux propres'); INSERT INTO gifi (accno,description) VALUES ('3680','Revenu net/perte nette'); INSERT INTO gifi (accno,description) VALUES ('3700','Dividendes déclarés'); INSERT INTO gifi (accno,description) VALUES ('3701','Dividendes en espèces'); INSERT INTO gifi (accno,description) VALUES ('3702','Ristournes'); INSERT INTO gifi (accno,description) VALUES ('3720','Redressements sur exercices antérieurs'); INSERT INTO gifi (accno,description) VALUES ('3740','Autres éléments touchant les bénéfices non répartis'); INSERT INTO gifi (accno,description) VALUES ('3741','Rachat d''actions'); INSERT INTO gifi (accno,description) VALUES ('3742','Réserves spéciales'); INSERT INTO gifi (accno,description) VALUES ('3743','Redressements relatifs aux devises'); INSERT INTO gifi (accno,description) VALUES ('3744','Éléments inhabituels de revenus'); INSERT INTO gifi (accno,description) VALUES ('3745','Transferts interfonds'); INSERT INTO gifi (accno,description) VALUES ('3849','Bénéfices non répartis/déficit ­ fin de l''exercice'); INSERT INTO gifi (accno,description) VALUES ('8000','Ventes commerciales de biens et services'); INSERT INTO gifi (accno,description) VALUES ('8020','Ventes de biens et de services à des personnes apparentées'); INSERT INTO gifi (accno,description) VALUES ('8030','Ventes entre divisions'); INSERT INTO gifi (accno,description) VALUES ('8040','Ventes de ressources naturelles'); INSERT INTO gifi (accno,description) VALUES ('8041','Ventes de pétrole et de gaz naturel'); INSERT INTO gifi (accno,description) VALUES ('8042','Ventes de pétrole et de gaz naturel à des personnes apparentées'); INSERT INTO gifi (accno,description) VALUES ('8043','Commercialisation du gaz'); INSERT INTO gifi (accno,description) VALUES ('8044','Revenus de traitement'); INSERT INTO gifi (accno,description) VALUES ('8045','Revenus de transport par pipeline'); INSERT INTO gifi (accno,description) VALUES ('8046','Ventes reliées à l''exploration séismique'); INSERT INTO gifi (accno,description) VALUES ('8047','Revenus provenant de l''exploitation minière'); INSERT INTO gifi (accno,description) VALUES ('8048','Revenus provenant du charbon'); INSERT INTO gifi (accno,description) VALUES ('8049','Revenus de sables bitumineux'); INSERT INTO gifi (accno,description) VALUES ('8050','Revenus provenant des redevances'); INSERT INTO gifi (accno,description) VALUES ('8051','Revenus/pertes d''une société de personnes/coentreprise ­ pétrole et gaz'); INSERT INTO gifi (accno,description) VALUES ('8052','Revenus/pertes d''une société de personnes/coentreprise ­ mines'); INSERT INTO gifi (accno,description) VALUES ('8053','Autres revenus de production'); INSERT INTO gifi (accno,description) VALUES ('8089','Total des ventes de biens et services'); INSERT INTO gifi (accno,description) VALUES ('8090','Revenus de placements'); INSERT INTO gifi (accno,description) VALUES ('8091','Intérêt de sources étrangères'); INSERT INTO gifi (accno,description) VALUES ('8092','Intérêt d''obligations et de débentures canadiennes'); INSERT INTO gifi (accno,description) VALUES ('8093','Intérêt de prêts hypothécaires canadiens'); INSERT INTO gifi (accno,description) VALUES ('8094','Intérêt d''autres sources canadiennes'); INSERT INTO gifi (accno,description) VALUES ('8095','Revenus de dividendes'); INSERT INTO gifi (accno,description) VALUES ('8096','Dividendes de sources canadiennes'); INSERT INTO gifi (accno,description) VALUES ('8097','Dividendes de sources étrangères'); INSERT INTO gifi (accno,description) VALUES ('8100','Revenus d''intérêt (institutions financières)'); INSERT INTO gifi (accno,description) VALUES ('8101','Intérêt de prêts'); INSERT INTO gifi (accno,description) VALUES ('8102','Intérêt de valeurs mobilières'); INSERT INTO gifi (accno,description) VALUES ('8103','Intérêt des dépôts en banque'); INSERT INTO gifi (accno,description) VALUES ('8120','Revenus de commissions'); INSERT INTO gifi (accno,description) VALUES ('8121','Revenus de commissions sur les transactions immobilières'); INSERT INTO gifi (accno,description) VALUES ('8140','Revenus de location'); INSERT INTO gifi (accno,description) VALUES ('8141','Revenus de location immobilière'); INSERT INTO gifi (accno,description) VALUES ('8142','Revenus de location de films'); INSERT INTO gifi (accno,description) VALUES ('8150','Contrats de location de véhicules'); INSERT INTO gifi (accno,description) VALUES ('8160','Revenus provenant de la pêche'); INSERT INTO gifi (accno,description) VALUES ('8161','Ventes de poisson'); INSERT INTO gifi (accno,description) VALUES ('8162','Autres produits marins'); INSERT INTO gifi (accno,description) VALUES ('8163','Subventions, crédits et dégrèvements de pêche'); INSERT INTO gifi (accno,description) VALUES ('8164','Subventions de pêche'); INSERT INTO gifi (accno,description) VALUES ('8165','Indemnité pour perte d''un revenu ou d''un bien de pêche'); INSERT INTO gifi (accno,description) VALUES ('8166','Revenu de pêcheur à la part'); INSERT INTO gifi (accno,description) VALUES ('8210','Profits/pertes sur la disposition d''éléments d''actif'); INSERT INTO gifi (accno,description) VALUES ('8211','Profits/pertes sur la vente de placements'); INSERT INTO gifi (accno,description) VALUES ('8212','Profits/pertes sur la disposition d''avoir minier'); INSERT INTO gifi (accno,description) VALUES ('8220','Montants reçus d''OSBL'); INSERT INTO gifi (accno,description) VALUES ('8221','Frais d''adhésion'); INSERT INTO gifi (accno,description) VALUES ('8222','Cotisations'); INSERT INTO gifi (accno,description) VALUES ('8223','Dons'); INSERT INTO gifi (accno,description) VALUES ('8224','Ventes et recettes brutes provenant d''activités de l''organisme'); INSERT INTO gifi (accno,description) VALUES ('8230','Autres revenus'); INSERT INTO gifi (accno,description) VALUES ('8231','Gains/pertes sur devises étrangères'); INSERT INTO gifi (accno,description) VALUES ('8232','Revenus/pertes de filiales/de sociétés affiliées'); INSERT INTO gifi (accno,description) VALUES ('8233','Revenus/pertes d''autres divisions'); INSERT INTO gifi (accno,description) VALUES ('8234','Revenus/pertes des coentreprises'); INSERT INTO gifi (accno,description) VALUES ('8235','Revenus/pertes des sociétés de personnes'); INSERT INTO gifi (accno,description) VALUES ('8236','Réalisation de revenus différés'); INSERT INTO gifi (accno,description) VALUES ('8237','Revenus de redevances autres que l''exploitation des ressources naturelles'); INSERT INTO gifi (accno,description) VALUES ('8238','Crédits d''impôts pour redevances de l''Alberta'); INSERT INTO gifi (accno,description) VALUES ('8239','Honoraires de gestion et d''administration'); INSERT INTO gifi (accno,description) VALUES ('8240','Revenus de télécommunications'); INSERT INTO gifi (accno,description) VALUES ('8241','Honoraires de consultation'); INSERT INTO gifi (accno,description) VALUES ('8242','Subventions et octrois'); INSERT INTO gifi (accno,description) VALUES ('8243','Ventes de sous-produits'); INSERT INTO gifi (accno,description) VALUES ('8244','Frais d''administration provenant du service des dépôts'); INSERT INTO gifi (accno,description) VALUES ('8245','Frais d''administration provenant du service du crédit'); INSERT INTO gifi (accno,description) VALUES ('8246','Frais d''administration provenant du service des cartes bancaires'); INSERT INTO gifi (accno,description) VALUES ('8247','Ristournes'); INSERT INTO gifi (accno,description) VALUES ('8248','Recouvrement d''assurance'); INSERT INTO gifi (accno,description) VALUES ('8249','Recouvrement de frais'); INSERT INTO gifi (accno,description) VALUES ('8250','Recouvrement des mauvaises créances'); INSERT INTO gifi (accno,description) VALUES ('8299','Total des revenus'); INSERT INTO gifi (accno,description) VALUES ('8300','Stock d''ouverture'); INSERT INTO gifi (accno,description) VALUES ('8301','Stock d''ouverture ­ produits finis'); INSERT INTO gifi (accno,description) VALUES ('8302','Stock d''ouverture ­ matières premières'); INSERT INTO gifi (accno,description) VALUES ('8303','Stock d''ouverture ­ produits en cours de fabrication'); INSERT INTO gifi (accno,description) VALUES ('8320','Achats/coût des matériaux'); INSERT INTO gifi (accno,description) VALUES ('8340','Salaires directs'); INSERT INTO gifi (accno,description) VALUES ('8350','Avantages sociaux relatifs aux salaires directs'); INSERT INTO gifi (accno,description) VALUES ('8360','Fournisseurs et sous-traitants'); INSERT INTO gifi (accno,description) VALUES ('8370','Coûts de production (autres que ressources naturelles)'); INSERT INTO gifi (accno,description) VALUES ('8400','Coûts de production des ressources naturelles'); INSERT INTO gifi (accno,description) VALUES ('8401','Exploitation des pipelines'); INSERT INTO gifi (accno,description) VALUES ('8402','Forage'); INSERT INTO gifi (accno,description) VALUES ('8403','Coûts de restauration des sites d''exploitation'); INSERT INTO gifi (accno,description) VALUES ('8404','Redevances dérogatoires brutes'); INSERT INTO gifi (accno,description) VALUES ('8405','Redevances de propriété franche'); INSERT INTO gifi (accno,description) VALUES ('8406','Paiements de location de concessions publiques'); INSERT INTO gifi (accno,description) VALUES ('8407','Prospection/travaux de géologie'); INSERT INTO gifi (accno,description) VALUES ('8408','Exploitation des puits, carburant et matériel'); INSERT INTO gifi (accno,description) VALUES ('8409','Abandon de puits et puits secs'); INSERT INTO gifi (accno,description) VALUES ('8410','Autres paiements de location'); INSERT INTO gifi (accno,description) VALUES ('8411','Frais d''exploration'); INSERT INTO gifi (accno,description) VALUES ('8412','Frais d''aménagement'); INSERT INTO gifi (accno,description) VALUES ('8435','Sommes exigées par la Couronne'); INSERT INTO gifi (accno,description) VALUES ('8436','Redevances à la Couronne'); INSERT INTO gifi (accno,description) VALUES ('8437','Frais de location de la Couronne'); INSERT INTO gifi (accno,description) VALUES ('8438','Impôts sur le minerai de propriété franche'); INSERT INTO gifi (accno,description) VALUES ('8439','Impôts miniers'); INSERT INTO gifi (accno,description) VALUES ('8440','Frais de location des sables bitumineux'); INSERT INTO gifi (accno,description) VALUES ('8441','Surtaxe de la Saskatchewan sur les ressources'); INSERT INTO gifi (accno,description) VALUES ('8450','Autres coûts directs'); INSERT INTO gifi (accno,description) VALUES ('8451','Location et exploitation de matériel'); INSERT INTO gifi (accno,description) VALUES ('8452','Cour à bois'); INSERT INTO gifi (accno,description) VALUES ('8453','Coûts d''exploitation forestière'); INSERT INTO gifi (accno,description) VALUES ('8454','Coûts des chemins forestiers'); INSERT INTO gifi (accno,description) VALUES ('8455','Droits de coupe'); INSERT INTO gifi (accno,description) VALUES ('8456','Coûts des redevances'); INSERT INTO gifi (accno,description) VALUES ('8457','Frais de transport à l''achat et droits'); INSERT INTO gifi (accno,description) VALUES ('8458','Moins-value de l''inventaire'); INSERT INTO gifi (accno,description) VALUES ('8459','Coût direct de l''amortissement des biens corporels'); INSERT INTO gifi (accno,description) VALUES ('8460','Coût direct de l''amortissement des biens constitués'); INSERT INTO gifi (accno,description) VALUES ('8461','Autres frais indirects attribués au coût des ventes'); INSERT INTO gifi (accno,description) VALUES ('8500','Stock de fermeture'); INSERT INTO gifi (accno,description) VALUES ('8501','Stock de fermeture ­ produits finis'); INSERT INTO gifi (accno,description) VALUES ('8502','Stock de fermeture ­ matières premières'); INSERT INTO gifi (accno,description) VALUES ('8503','Stock de fermeture ­ travaux en cours de fabrication'); INSERT INTO gifi (accno,description) VALUES ('8518','Coût des ventes'); INSERT INTO gifi (accno,description) VALUES ('8519','Profit brut/perte brute'); INSERT INTO gifi (accno,description) VALUES ('8520','Publicité et promotion'); INSERT INTO gifi (accno,description) VALUES ('8521','Publicité'); INSERT INTO gifi (accno,description) VALUES ('8522','Dons'); INSERT INTO gifi (accno,description) VALUES ('8523','Repas et frais de représentation'); INSERT INTO gifi (accno,description) VALUES ('8524','Promotion'); INSERT INTO gifi (accno,description) VALUES ('8570','Amortissement de biens incorporels'); INSERT INTO gifi (accno,description) VALUES ('8590','Créances irrécouvrables'); INSERT INTO gifi (accno,description) VALUES ('8610','Pertes sur prêts'); INSERT INTO gifi (accno,description) VALUES ('8611','Provision pour les pertes sur prêts'); INSERT INTO gifi (accno,description) VALUES ('8620','Avantages sociaux'); INSERT INTO gifi (accno,description) VALUES ('8621','Assurances collectives'); INSERT INTO gifi (accno,description) VALUES ('8622','Partie de l''employeur des avantages sociaux'); INSERT INTO gifi (accno,description) VALUES ('8623','Cotisations aux régimes de revenus différés'); INSERT INTO gifi (accno,description) VALUES ('8650','Amortissement des biens constitués par des ressources naturelles'); INSERT INTO gifi (accno,description) VALUES ('8670','Amortissement des biens corporels'); INSERT INTO gifi (accno,description) VALUES ('8690','Assurances'); INSERT INTO gifi (accno,description) VALUES ('8691','Assurance sur la vie des dirigeants'); INSERT INTO gifi (accno,description) VALUES ('8710','Intérêts et frais bancaires'); INSERT INTO gifi (accno,description) VALUES ('8711','Intérêts sur les dettes à court terme'); INSERT INTO gifi (accno,description) VALUES ('8712','Intérêts sur les obligations et les débentures'); INSERT INTO gifi (accno,description) VALUES ('8713','Intérêts sur les prêts hypothécaires'); INSERT INTO gifi (accno,description) VALUES ('8714','Intérêts sur les dettes à long terme'); INSERT INTO gifi (accno,description) VALUES ('8715','Frais bancaires'); INSERT INTO gifi (accno,description) VALUES ('8716','Frais de cartes de crédit'); INSERT INTO gifi (accno,description) VALUES ('8717','Frais de recouvrement et de crédit'); INSERT INTO gifi (accno,description) VALUES ('8740','Intérêts payés (institutions financières)'); INSERT INTO gifi (accno,description) VALUES ('8741','Intérêts payés sur dépôts'); INSERT INTO gifi (accno,description) VALUES ('8742','Intérêts payés sur les obligations et les débentures'); INSERT INTO gifi (accno,description) VALUES ('8760','Taxes d''affaires, droits d''adhésion et licences'); INSERT INTO gifi (accno,description) VALUES ('8761','Droits d''adhésion'); INSERT INTO gifi (accno,description) VALUES ('8762','Taxes d''affaires'); INSERT INTO gifi (accno,description) VALUES ('8763','Frais de franchise'); INSERT INTO gifi (accno,description) VALUES ('8764','Frais à verser aux gouvernements'); INSERT INTO gifi (accno,description) VALUES ('8780','Taxe des grandes sociétés du Nouveau-Brunswick'); INSERT INTO gifi (accno,description) VALUES ('8790','Taxe des grandes sociétés de la Nouvelle-Écosse'); INSERT INTO gifi (accno,description) VALUES ('8810','Frais de bureau'); INSERT INTO gifi (accno,description) VALUES ('8811','Papeterie et fournitures de bureau'); INSERT INTO gifi (accno,description) VALUES ('8812','Services de bureau'); INSERT INTO gifi (accno,description) VALUES ('8813','Traitement des données'); INSERT INTO gifi (accno,description) VALUES ('8860','Honoraires professionnels'); INSERT INTO gifi (accno,description) VALUES ('8861','Frais légaux'); INSERT INTO gifi (accno,description) VALUES ('8862','Frais comptables'); INSERT INTO gifi (accno,description) VALUES ('8863','Honoraires d''experts-conseils'); INSERT INTO gifi (accno,description) VALUES ('8864','Honoraires d''architectes'); INSERT INTO gifi (accno,description) VALUES ('8865','Frais d''évaluation'); INSERT INTO gifi (accno,description) VALUES ('8866','Frais de laboratoire'); INSERT INTO gifi (accno,description) VALUES ('8867','Honoraires médicaux'); INSERT INTO gifi (accno,description) VALUES ('8868','Frais de vétérinaire'); INSERT INTO gifi (accno,description) VALUES ('8869','Frais de courtage'); INSERT INTO gifi (accno,description) VALUES ('8870','Frais de transfert'); INSERT INTO gifi (accno,description) VALUES ('8871','Frais de gestion et d''administration'); INSERT INTO gifi (accno,description) VALUES ('8872','Affinage et dosage'); INSERT INTO gifi (accno,description) VALUES ('8873','Droits d''enregistrement et frais d''agents de transfert'); INSERT INTO gifi (accno,description) VALUES ('8874','Coûts de restructuration'); INSERT INTO gifi (accno,description) VALUES ('8875','Commissions sur les titres et les valeurs mobilières'); INSERT INTO gifi (accno,description) VALUES ('8876','Frais de formation'); INSERT INTO gifi (accno,description) VALUES ('8877','Studio et enregistrement'); INSERT INTO gifi (accno,description) VALUES ('8910','Frais de location'); INSERT INTO gifi (accno,description) VALUES ('8911','Loyer de biens immobiliers'); INSERT INTO gifi (accno,description) VALUES ('8912','Frais d''occupation'); INSERT INTO gifi (accno,description) VALUES ('8913','Frais de copropriété'); INSERT INTO gifi (accno,description) VALUES ('8914','Location de matériel'); INSERT INTO gifi (accno,description) VALUES ('8915','Location de véhicules motorisés'); INSERT INTO gifi (accno,description) VALUES ('8916','Amarrage (bateau)'); INSERT INTO gifi (accno,description) VALUES ('8917','Entreposage'); INSERT INTO gifi (accno,description) VALUES ('8918','Location de contingents'); INSERT INTO gifi (accno,description) VALUES ('8960','Réparations et entretien'); INSERT INTO gifi (accno,description) VALUES ('8961','Réparations et entretien ­ bâtiments'); INSERT INTO gifi (accno,description) VALUES ('8962','Réparations et entretien ­ véhicules'); INSERT INTO gifi (accno,description) VALUES ('8963','Réparations et entretien ­ bateaux'); INSERT INTO gifi (accno,description) VALUES ('8964','Réparations et entretien ­ machines et matériel'); INSERT INTO gifi (accno,description) VALUES ('9010','Autres frais de réparation et d''entretien'); INSERT INTO gifi (accno,description) VALUES ('9011','Dépense d''usinage'); INSERT INTO gifi (accno,description) VALUES ('9012','Frais relatifs aux routes'); INSERT INTO gifi (accno,description) VALUES ('9013','Sécurité'); INSERT INTO gifi (accno,description) VALUES ('9014','Enlèvement des déchets'); INSERT INTO gifi (accno,description) VALUES ('9060','Salaires et traitements'); INSERT INTO gifi (accno,description) VALUES ('9061','Commissions'); INSERT INTO gifi (accno,description) VALUES ('9062','Part de l''équipage'); INSERT INTO gifi (accno,description) VALUES ('9063','Gratifications'); INSERT INTO gifi (accno,description) VALUES ('9064','Jetons de présence des administrateurs'); INSERT INTO gifi (accno,description) VALUES ('9065','Salaires des cadres'); INSERT INTO gifi (accno,description) VALUES ('9066','Salaires des employés'); INSERT INTO gifi (accno,description) VALUES ('9110','Contrats de sous-traitance'); INSERT INTO gifi (accno,description) VALUES ('9130','Fournitures'); INSERT INTO gifi (accno,description) VALUES ('9131','Petit outillage'); INSERT INTO gifi (accno,description) VALUES ('9132','Frais d''atelier'); INSERT INTO gifi (accno,description) VALUES ('9133','Uniformes'); INSERT INTO gifi (accno,description) VALUES ('9134','Blanchissage'); INSERT INTO gifi (accno,description) VALUES ('9135','Alimentation et restauration'); INSERT INTO gifi (accno,description) VALUES ('9136','Matériel de pêche'); INSERT INTO gifi (accno,description) VALUES ('9137','Filets et pièges'); INSERT INTO gifi (accno,description) VALUES ('9138','Sel, appâts et glace'); INSERT INTO gifi (accno,description) VALUES ('9139','Fournitures de camp'); INSERT INTO gifi (accno,description) VALUES ('9150','Dépenses liées à l''informatique'); INSERT INTO gifi (accno,description) VALUES ('9151','Améliorations et modernisations'); INSERT INTO gifi (accno,description) VALUES ('9152','Internet'); INSERT INTO gifi (accno,description) VALUES ('9180','Taxes foncières'); INSERT INTO gifi (accno,description) VALUES ('9200','Frais de déplacement'); INSERT INTO gifi (accno,description) VALUES ('9220','Services publics'); INSERT INTO gifi (accno,description) VALUES ('9221','Électricité'); INSERT INTO gifi (accno,description) VALUES ('9222','Eau'); INSERT INTO gifi (accno,description) VALUES ('9223','Chauffage'); INSERT INTO gifi (accno,description) VALUES ('9224','Frais de carburant'); INSERT INTO gifi (accno,description) VALUES ('9270','Autres dépenses'); INSERT INTO gifi (accno,description) VALUES ('9271','Écarts de caisse'); INSERT INTO gifi (accno,description) VALUES ('9272','Remboursement de frais de la société mère'); INSERT INTO gifi (accno,description) VALUES ('9273','Frais de vente'); INSERT INTO gifi (accno,description) VALUES ('9274','Frais de transport et d''entreposage'); INSERT INTO gifi (accno,description) VALUES ('9275','Livraison, fret et messageries'); INSERT INTO gifi (accno,description) VALUES ('9276','Frais de garantie'); INSERT INTO gifi (accno,description) VALUES ('9277','Frais de redevances ­ résidents'); INSERT INTO gifi (accno,description) VALUES ('9278','Frais de redevances ­ non-résidents'); INSERT INTO gifi (accno,description) VALUES ('9279','Frais de déchargement'); INSERT INTO gifi (accno,description) VALUES ('9280','Frais d''enfouissement'); INSERT INTO gifi (accno,description) VALUES ('9281','Frais de véhicules'); INSERT INTO gifi (accno,description) VALUES ('9282','Recherche et développement'); INSERT INTO gifi (accno,description) VALUES ('9283','Retenues d''impôts'); INSERT INTO gifi (accno,description) VALUES ('9284','Frais d''administration et frais généraux'); INSERT INTO gifi (accno,description) VALUES ('9285','Dépenses entre divisions'); INSERT INTO gifi (accno,description) VALUES ('9286','Transferts interfonds'); INSERT INTO gifi (accno,description) VALUES ('9367','Total des frais d''exploitation'); INSERT INTO gifi (accno,description) VALUES ('9368','Total des dépenses'); INSERT INTO gifi (accno,description) VALUES ('9369','Revenu non agricole net'); INSERT INTO gifi (accno,description) VALUES ('9370','Grains et oléagineux'); INSERT INTO gifi (accno,description) VALUES ('9371','Blé'); INSERT INTO gifi (accno,description) VALUES ('9372','Avoine'); INSERT INTO gifi (accno,description) VALUES ('9373','Orge'); INSERT INTO gifi (accno,description) VALUES ('9374','Grains mixtes'); INSERT INTO gifi (accno,description) VALUES ('9375','Maïs'); INSERT INTO gifi (accno,description) VALUES ('9376','Canola'); INSERT INTO gifi (accno,description) VALUES ('9377','Graine de lin'); INSERT INTO gifi (accno,description) VALUES ('9378','Fèves soya'); INSERT INTO gifi (accno,description) VALUES ('9379','Paiements de la Commission canadienne du blé'); INSERT INTO gifi (accno,description) VALUES ('9420','Revenus d''autres récoltes'); INSERT INTO gifi (accno,description) VALUES ('9421','Fruits'); INSERT INTO gifi (accno,description) VALUES ('9422','Pommes de terre'); INSERT INTO gifi (accno,description) VALUES ('9423','Légumes'); INSERT INTO gifi (accno,description) VALUES ('9424','Tabac'); INSERT INTO gifi (accno,description) VALUES ('9425','Produits de serre et de pépinière'); INSERT INTO gifi (accno,description) VALUES ('9426','Récolte de fourrage'); INSERT INTO gifi (accno,description) VALUES ('9470','Revenus du bétail et des produits d''origine'); INSERT INTO gifi (accno,description) VALUES ('9471','Bovins'); INSERT INTO gifi (accno,description) VALUES ('9472','Porcins'); INSERT INTO gifi (accno,description) VALUES ('9473','Volaille'); INSERT INTO gifi (accno,description) VALUES ('9474','Ovins'); INSERT INTO gifi (accno,description) VALUES ('9475','Urine de jument gravide (UJG)'); INSERT INTO gifi (accno,description) VALUES ('9476','Lait et crème (à l''exclusion des subventions pour'); INSERT INTO gifi (accno,description) VALUES ('9477','OEufs pour la consommation'); INSERT INTO gifi (accno,description) VALUES ('9478','Couvaison des oeufs'); INSERT INTO gifi (accno,description) VALUES ('9479','Aquaculture (couvée et élevage)'); INSERT INTO gifi (accno,description) VALUES ('9480','Chevaux (reproduction et viande)'); INSERT INTO gifi (accno,description) VALUES ('9520','Autres produits'); INSERT INTO gifi (accno,description) VALUES ('9521','Produits de l''érable'); INSERT INTO gifi (accno,description) VALUES ('9522','Insémination artificielle'); INSERT INTO gifi (accno,description) VALUES ('9523','Production de sperme'); INSERT INTO gifi (accno,description) VALUES ('9524','Production d''embryon'); INSERT INTO gifi (accno,description) VALUES ('9540','Revenus des paiements de programmes'); INSERT INTO gifi (accno,description) VALUES ('9541','Subventions laitières'); INSERT INTO gifi (accno,description) VALUES ('9542','Assurance-récolte'); INSERT INTO gifi (accno,description) VALUES ('9543','Paiements du CSRN'); INSERT INTO gifi (accno,description) VALUES ('9544','Paiements provenant du programme d''aide en cas de catastrophe'); INSERT INTO gifi (accno,description) VALUES ('9570','Remises'); INSERT INTO gifi (accno,description) VALUES ('9571','Remises ­ carburant'); INSERT INTO gifi (accno,description) VALUES ('9572','Remises ­ intérêt'); INSERT INTO gifi (accno,description) VALUES ('9573','Remises ­ taxes foncières'); INSERT INTO gifi (accno,description) VALUES ('9574','Reventes, Remises de la TPS pour les dépenses'); INSERT INTO gifi (accno,description) VALUES ('9575','Remises de la TPS pour les dépenses non'); INSERT INTO gifi (accno,description) VALUES ('9600','Autres revenus/pertes agricoles'); INSERT INTO gifi (accno,description) VALUES ('9601','Travail sur commande ou en sous-traitance'); INSERT INTO gifi (accno,description) VALUES ('9602','Ventes de bois'); INSERT INTO gifi (accno,description) VALUES ('9603','Courses de chevaux'); INSERT INTO gifi (accno,description) VALUES ('9604','Produits d''assurance'); INSERT INTO gifi (accno,description) VALUES ('9605','Ristournes'); INSERT INTO gifi (accno,description) VALUES ('9606','Revenu de location'); INSERT INTO gifi (accno,description) VALUES ('9607','Revenu en intérêt'); INSERT INTO gifi (accno,description) VALUES ('9608','Revenu de dividendes'); INSERT INTO gifi (accno,description) VALUES ('9609','Profits/pertes sur la disposition de biens'); INSERT INTO gifi (accno,description) VALUES ('9610','Gravier'); INSERT INTO gifi (accno,description) VALUES ('9611','Camionnage'); INSERT INTO gifi (accno,description) VALUES ('9612','Revente des denrées achetées'); INSERT INTO gifi (accno,description) VALUES ('9613','Contrat-location (carburant, huile, puits, superficie, etc.)'); INSERT INTO gifi (accno,description) VALUES ('9614','Location de machines'); INSERT INTO gifi (accno,description) VALUES ('9615','Revenus/pertes des sociétés de personnes agricoles'); INSERT INTO gifi (accno,description) VALUES ('9616','Revenus/pertes des coentreprises agricoles'); INSERT INTO gifi (accno,description) VALUES ('9650','Revenu non agricole'); INSERT INTO gifi (accno,description) VALUES ('9659','Total des revenus agricoles'); INSERT INTO gifi (accno,description) VALUES ('9660','Dépenses liées aux récoltes'); INSERT INTO gifi (accno,description) VALUES ('9661','Contenants, ficelles et fils pour emballage'); INSERT INTO gifi (accno,description) VALUES ('9662','Engrais et chaux'); INSERT INTO gifi (accno,description) VALUES ('9663','Pesticides'); INSERT INTO gifi (accno,description) VALUES ('9664','Semences et plantes'); INSERT INTO gifi (accno,description) VALUES ('9665','Primes d''assurance (récolte) CSRN SAR'); INSERT INTO gifi (accno,description) VALUES ('9710','Dépenses liées au bétail'); INSERT INTO gifi (accno,description) VALUES ('9711','Fourrage, suppléments, paille et litière'); INSERT INTO gifi (accno,description) VALUES ('9712','Achats de bétail'); INSERT INTO gifi (accno,description) VALUES ('9713','Frais de vétérinaire, de médicaments et de reproduction'); INSERT INTO gifi (accno,description) VALUES ('9714','Sel et minéraux'); INSERT INTO gifi (accno,description) VALUES ('9760','Dépenses liées aux machines'); INSERT INTO gifi (accno,description) VALUES ('9761','Assurance pour les machines'); INSERT INTO gifi (accno,description) VALUES ('9762','Plaques pour les machines'); INSERT INTO gifi (accno,description) VALUES ('9763','Réparation des machines'); INSERT INTO gifi (accno,description) VALUES ('9764','Carburant pour les machines'); INSERT INTO gifi (accno,description) VALUES ('9765','Contrat-location de machines'); INSERT INTO gifi (accno,description) VALUES ('9790','Dépenses agricoles générales'); INSERT INTO gifi (accno,description) VALUES ('9791','Amortissement des biens corporels'); INSERT INTO gifi (accno,description) VALUES ('9792','Publicité, promotion et dépenses de mise en marché'); INSERT INTO gifi (accno,description) VALUES ('9793','Mauvaises créances'); INSERT INTO gifi (accno,description) VALUES ('9794','Avantages sociaux liés aux salaires des employés'); INSERT INTO gifi (accno,description) VALUES ('9795','Réparations et entretien des bâtiments'); INSERT INTO gifi (accno,description) VALUES ('9796','Défrichage, nivellement et drainage de terrains'); INSERT INTO gifi (accno,description) VALUES ('9797','Primes d''assurance-récolte, de RARB et de'); INSERT INTO gifi (accno,description) VALUES ('9798','Travail sur commande ou en sous-traitance'); INSERT INTO gifi (accno,description) VALUES ('9799','Électricité'); INSERT INTO gifi (accno,description) VALUES ('9800','Réparations et entretien des clôtures'); INSERT INTO gifi (accno,description) VALUES ('9801','Fret et camionnage'); INSERT INTO gifi (accno,description) VALUES ('9802','Combustible pour chauffage et pour salaison'); INSERT INTO gifi (accno,description) VALUES ('9803','Remboursement de paiements en trop provenant'); INSERT INTO gifi (accno,description) VALUES ('9804','Autres primes d''assurance'); INSERT INTO gifi (accno,description) VALUES ('9805','Intérêts et frais bancaires'); INSERT INTO gifi (accno,description) VALUES ('9806','Droits versés à des offices de commercialisation'); INSERT INTO gifi (accno,description) VALUES ('9807','Frais d''adhésion'); INSERT INTO gifi (accno,description) VALUES ('9808','Dépenses de bureau'); INSERT INTO gifi (accno,description) VALUES ('9809','Honoraires professionnels'); INSERT INTO gifi (accno,description) VALUES ('9810','Taxes foncières'); INSERT INTO gifi (accno,description) VALUES ('9811','Location ­ terrain et bâtiments'); INSERT INTO gifi (accno,description) VALUES ('9812','Location ­ machines'); INSERT INTO gifi (accno,description) VALUES ('9813','Autres frais de location'); INSERT INTO gifi (accno,description) VALUES ('9814','Salaires et traitements'); INSERT INTO gifi (accno,description) VALUES ('9815','Salaires (autre que conjoint et personnes à charge)'); INSERT INTO gifi (accno,description) VALUES ('9816','Salaires versés aux personnes à charge'); INSERT INTO gifi (accno,description) VALUES ('9817','Coûts des ventes'); INSERT INTO gifi (accno,description) VALUES ('9818','Fournitures'); INSERT INTO gifi (accno,description) VALUES ('9819','Dépenses concernant les véhicules motorisés'); INSERT INTO gifi (accno,description) VALUES ('9820','Petit outillage'); INSERT INTO gifi (accno,description) VALUES ('9821','Analyses des sols'); INSERT INTO gifi (accno,description) VALUES ('9822','Entreposage/séchage'); INSERT INTO gifi (accno,description) VALUES ('9823','Licences/permis'); INSERT INTO gifi (accno,description) VALUES ('9824','Téléphone'); INSERT INTO gifi (accno,description) VALUES ('9825','Location de contingents (tabac, laitier)'); INSERT INTO gifi (accno,description) VALUES ('9826','Gravier'); INSERT INTO gifi (accno,description) VALUES ('9827','Achats de produits pour la revente'); INSERT INTO gifi (accno,description) VALUES ('9828','Salaires et traitements payés au conjoint'); INSERT INTO gifi (accno,description) VALUES ('9829','Coûts de location et intérêt sur un véhicule'); INSERT INTO gifi (accno,description) VALUES ('9830','Aliments préparés'); INSERT INTO gifi (accno,description) VALUES ('9831','Engraissement à forfait'); INSERT INTO gifi (accno,description) VALUES ('9832','Amortissement des biens incorporels'); INSERT INTO gifi (accno,description) VALUES ('9833','Amortissement de quote-part de lait'); INSERT INTO gifi (accno,description) VALUES ('9834','Frais de déplacement'); INSERT INTO gifi (accno,description) VALUES ('9835','Taxes d''affaires/sur le capital'); INSERT INTO gifi (accno,description) VALUES ('9850','Dépenses non agricoles'); INSERT INTO gifi (accno,description) VALUES ('9870','Régularisation des stocks'); INSERT INTO gifi (accno,description) VALUES ('9899','Total des revenus agricoles nets'); INSERT INTO gifi (accno,description) VALUES ('9970','Revenu net/perte nette avant impôts et éléments'); INSERT INTO gifi (accno,description) VALUES ('9975','Élément(s) extraordinaire(s)'); INSERT INTO gifi (accno,description) VALUES ('9976','Règlements juridiques'); INSERT INTO gifi (accno,description) VALUES ('9980','Profits/pertes non matérialisés'); INSERT INTO gifi (accno,description) VALUES ('9985','Éléments inhabituels'); INSERT INTO gifi (accno,description) VALUES ('9990','Impôts sur le revenu exigibles de l''exercice'); INSERT INTO gifi (accno,description) VALUES ('9995','Provision pour impôts sur le revenu différés'); INSERT INTO gifi (accno,description) VALUES ('9999','Revenu net/perte nette après impôts et éléments'); commit; ledgersmb/sql/coa/ca/chart/0000755000000000000000000000000012060044550014541 5ustar rootrootledgersmb/sql/coa/ca/chart/English_General.sql0000755000000000000000000001732511726630426020336 0ustar rootrootbegin; -- General Canadian COA -- sample only SELECT account_heading_save(NULL, '1000', 'CURRENT ASSETS', NULL); SELECT account_save(NULL,'1060','Chequing Account','A','1002', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1065','Petty Cash','A','1001', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno in ('1060', '1065'); SELECT account_save(NULL,'1200','Accounts Receivables','A','1060', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1205','Allowance for doubtful accounts','A','1063', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '1500', 'INVENTORY ASSETS', NULL); SELECT account_save(NULL,'1520','Inventory / General','A','1122', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1530','Inventory / Aftermarket Parts','A','1122', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1540','Inventory / Raw Materials','A','1122', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL, '1800', 'CAPITAL ASSETS', NULL); SELECT account_save(NULL,'1820','Office Furniture & Equipment','A','1787', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1825','Accum. Amort. -Furn. & Equip.','A','1788', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'1840','Vehicle','A','1742', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1845','Accum. Amort. -Vehicle','A','1743', NULL, true, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '2000', 'CURRENT LIABILITIES', NULL); SELECT account_save(NULL,'2100','Accounts Payable','L','2621', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'2160','Federal Taxes Payable','L','2683', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2170','Provincial Taxes Payable','L','2684', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2310','GST','L','2685', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2320','PST','L','2686', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2380','Vacation Pay Payable','L','2624', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2390','WCB Payable','L','2627', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '2400', 'PAYROLL DEDUCTIONS', NULL); SELECT account_save(NULL,'2410','EI Payable','L','2627', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2420','CPP Payable','L','2627', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2450','Income Tax Payable','L','2628', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '2600', 'LONG TERM LIABILITIES', NULL); SELECT account_save(NULL,'2620','Bank Loans','L','2701', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2680','Loans from Shareholders','L','2780', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_heading_save(NULL, '3300', 'SHARE CAPITAL', NULL); SELECT account_save(NULL,'3350','Common Shares','Q','3500', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '4000', 'SALES REVENUE', NULL); SELECT account_save(NULL,'4020','General Sales','I','8000', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'4030','Aftermarket Parts','I','8000', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL, '4400', 'OTHER REVENUE', NULL); SELECT account_save(NULL,'4430','Shipping & Handling','I','8457', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'4440','Interest','I','8090', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'4450','Foreign Exchange Gain / (Loss)','I','8231', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '5000', 'COST OF GOODS SOLD', NULL); SELECT account_save(NULL,'5010','Purchases','E','8320', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5050','Aftermarket Parts','E','8320', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5100','Freight','E','8457', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL, '5400', 'PAYROLL EXPENSES', NULL); SELECT account_save(NULL,'5410','Wages & Salaries','E','9060', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5420','EI Expense','E','8622', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5430','CPP Expense','E','8622', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5440','WCB Expense','E','8622', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '5600', 'GENERAL & ADMINISTRATIVE EXPENSES', NULL); SELECT account_save(NULL,'5610','Accounting & Legal','E','8862', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5615','Advertising & Promotions','E','8520', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5620','Bad Debts','E','8590', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5660','Amortization Expense','E','8670', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5680','Income Taxes','E','9990', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5685','Insurance','E','9804', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5690','Interest & Bank Charges','E','9805', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5700','Office Supplies','E','8811', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5760','Rent','E','9811', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5765','Repair & Maintenance','E','8964', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5780','Telephone','E','9225', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5785','Travel & Entertainment','E','8523', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5790','Utilities','E','8812', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5800','Licenses','E','8760', NULL, false, false, string_to_array('AP_amount', ':')); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '2310'),0.05); insert into tax (chart_id,rate) values ((select id from chart where accno = '2320'),0.08); -- INSERT INTO defaults (setting_key, value) values ('inventory_accno_id', (select id from chart where accno = '1520')); INSERT INTO defaults (setting_key, value) values ('income_accno_id', (select id from chart where accno = '4020')); INSERT INTO defaults (setting_key, value) values ('expense_accno_id', (select id from chart where accno = '5010')); INSERT INTO defaults (setting_key, value) values ('fxgain_accno_id', (select id from chart where accno = '4450')); INSERT INTO defaults (setting_key, value) values ('fxloss_accno_id', (select id from chart where accno = '4450')); INSERT INTO defaults (setting_key, value) values ('curr', 'CAD:USD:EUR'); INSERT INTO defaults (setting_key, value) values ('weightunit', 'kg'); -- commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/ca/chart/French-Quebec_General.sql0000755000000000000000000002134211726630426021346 0ustar rootrootbegin; -- General French-Canadian (AKA Québécois) COA -- sample only -- translated and adapted from the General Canadian COA, with the help -- of the Grand Dictionnaire Terminologique: -- http://granddictionnaire.com/ -- Some provisions have been made for Québec-specifics, namely: -- TVQ/TPS terminology, CSST, Assurance-emploi, RRQ, TVQ rate SELECT account_heading_save(NULL, '1000', 'ACTIF COURANT', NULL); SELECT account_save(NULL,'1060','Compte chèque','A','1002', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_save(NULL,'1065','Petite caisse','A','1001', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE accno in ('1060', '1065'); SELECT account_save(NULL,'1200','Comptes clients','A','1060', NULL, false, false, string_to_array('AR', ':')); SELECT account_save(NULL,'1205','Provisions pour créances douteuses','A','1063', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '1500', 'INVENTAIRE', NULL); SELECT account_save(NULL,'1520','Inventaire / Général','A','1122', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1530','Inventaire / Pièces de rechange','A','1122', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'1540','Inventaire / Matières premières','A','1122', NULL, false, false, string_to_array('IC', ':')); SELECT account_heading_save(NULL, '1800', 'AUTRES IMMOBILISATIONS', NULL); SELECT account_save(NULL,'1820','Meubles et accessoires','A','1787', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1825','Amortissement cumulé des meubles et des accessoires','A','1788', NULL, true, false, string_to_array('', ':')); SELECT account_save(NULL,'1840','Véhicules automobiles','A','1742', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'1845','Amortissement cumulé des véhicules automobiles','A','1743', NULL, true, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '2000', 'PASSIF COURANT', NULL); SELECT account_save(NULL,'2100','Comptes fournisseurs','L','2621', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'2160','Taxes fédérales à payer','L','2683', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2170','Taxes provinciales à payer','L','2684', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2310','TPS','L','2685', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2320','TVQ','L','2686', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'2380','Indemnités de vacances à payer','L','2624', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2390','CSST à payer','L','2627', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '2400', 'RETENUES SUR SALAIRE', NULL); SELECT account_save(NULL,'2410','Assurance-emploi à payer','L','2627', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2420','RRQ à payer','L','2627', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2450','Impôt sur le revenu à payer','L','2628', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '2600', 'PASSIF À LONG TERME', NULL); SELECT account_save(NULL,'2620','Emprunts bancaires','L','2701', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'2680','Emprunt auprès des actionnaires','L','2780', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_heading_save(NULL, '3300', 'CAPITAL SOCIAL', NULL); SELECT account_save(NULL,'3350','Actions ordinaires','Q','3500', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '4000', 'REVENUS DE VENTE', NULL); SELECT account_save(NULL,'4020','Ventes générales','I','8000', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':')); SELECT account_save(NULL,'4030','Pièces de rechange','I','8000', NULL, false, false, string_to_array('AR_amount:IC_sale', ':')); SELECT account_heading_save(NULL, '4400', 'AUTRES REVENUS', NULL); SELECT account_save(NULL,'4430','Transport et manutention','I','8457', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'4440','Intérêts','I','8090', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'4450','Gain sur change','I','8231', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '5000', 'COÛT DES PRODUITS VENDUS', NULL); SELECT account_save(NULL,'5010','Achats','E','8320', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':')); SELECT account_save(NULL,'5050','Pièces de rechange','E','8320', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'5100','Frais de transport','E','8457', NULL, false, false, string_to_array('AP_amount:IC_expense', ':')); SELECT account_heading_save(NULL, '5400', 'FRAIS DE PERSONNEL', NULL); SELECT account_save(NULL,'5410','Salaires','E','9060', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5420','Dépenses d''assurance-emploi','E','8622', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5430','Dépenses RRQ','E','8622', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5440','Dépenses CSST','E','8622', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5450','Dépenses FSS','E','8622', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5460','Dépenses RQAP','E','8622', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5470','Dépenses vacances','E','8622', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '5600', 'DÉPENSES ADMINISTRATIVES ET GÉNÉRALES', NULL); SELECT account_save(NULL,'5610','Frais comptables et juridiques','E','8862', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5615','Publicité et promotion','E','8520', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5620','Créances irrévocables','E','8590', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5660','Amortissement de l''exercice','E','8670', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5680','Impôt sur le revenu','E','9990', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5685','Assurances','E','9804', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5690','Intérêts et frais bancaires','E','9805', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5700','Fournitures de bureau','E','8811', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5760','Loyer','E','9811', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5780','Téléphone','E','9225', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5785','Voyages et loisirs','E','8523', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'5790','Services publics','E','8812', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5765','Réparation et entretien','E','8964', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5800','Taxes d''affaires, droits d''adhésion et permis','E','8760', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'5810','Perte sur change','E','8231', NULL, false, false, string_to_array('', ':')); -- insert into tax (chart_id,rate) values ((select id from chart where accno = '2310'),0.05); insert into tax (chart_id,rate,pass) values ((select id from chart where accno = '2320'),0.075,1); -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '1520')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '4020')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '5010')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '4450')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '4450')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'CAD:USD:EUR'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/coa/fr/0000755000000000000000000000000012060044550013464 5ustar rootrootledgersmb/sql/coa/fr/chart/0000755000000000000000000000000012060044550014565 5ustar rootrootledgersmb/sql/coa/fr/chart/General.sql0000755000000000000000000040500711730345473016707 0ustar rootrootbegin; -- Chart of Accounts for France -- From: Oscar Buijten -- Mon, 6 Aug 2001 -- SELECT account_heading_save(NULL, '0000', '----', NULL); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('101000', 'CAPITAL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('101100', 'CAPITAL SOUSCRIT NON APPELE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('101200', 'CAPITAL SOUSCRIT APPELE NON VERSE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('101300', 'CAPITAL SOUSCRIT APPELE VERSE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('101310', 'CAPITAL NON AMORTI', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('101320', 'CAPITAL AMORTI', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('101800', 'CAPITAL SOUSCR. A REGLEM. PART.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('104000', 'PRIMES LIEES AU CAPITAL SOCIAL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('104100', 'PRIMES D\'EMISSION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('104200', 'PRIMES DE FUSION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('104300', 'PRIMES D\'APPORT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('104400', 'PRIMES CONVERS. OBLIGAT. ACTIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('104500', 'BONS DE SOUSCRIPTION D\'ACTION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('105000', 'ECARTS DE REEVALUATION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('105100', 'RESERVE SPECIALE DE REEVALUATION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('105200', 'ECART DE REEVALUATION LIBRE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('105300', 'RESERVE DE REEVALUATION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('105500', 'ECARTS REEVAL. (AUT. OPER. LEG.)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('105700', 'AUT. ECARTS REEVAL. EN FRANCE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('105800', 'AUT. ECARTS REEVAL. A L\'ETRANGER', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('106000', 'RESERVES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('106100', 'RESERVE LEGALE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('106110', 'RESERVE LEGALE PROPREMENT DITE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('106120', 'PLUS-VALUES NETTES A LONG TERME', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('106200', 'RESERVES INDISPONIBLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('106300', 'RESERVES STATUT. OU CONTRACTUELLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('106400', 'RESERVES REGLEMENTEES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('106410', 'PLUS-VALUES NETTES A LONG TERME', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('106430', 'RESER. CONSEC. OCTROI SUBV. INVEST', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('106480', 'AUTRES RESERVES REGLEMENTEES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('106800', 'AUTRES RESERVES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('106810', 'RESERVE DE PROPRE ASSUREUR', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('106880', 'RESERVES DIVERSES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('107000', 'ECART D\'EQUIVALENCE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('109000', 'ACTIONN. CAPITAL SOUSC. NON APPELE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('110000', 'REPORT A NOUVEAU (SOLDE CREDITEUR)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('119000', 'REPORT A NOUVEAU (SOLDE DEBITEUR)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('120000', 'RESULTAT DE L\'EXERCICE (BENEFICE)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('129000', 'RESULTAT DE L\'EXERCICE (PERTE)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('131000', 'SUBVENTIONS D\'EQUIPEMENT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('131100', 'ETAT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('131200', 'REGIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('131300', 'DEPARTEMENTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('131400', 'COMMUNES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('131500', 'COLLECTIVITES PUBLIQUES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('131600', 'ENTREPRISES PUBLIQUES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('131700', 'ENTREPRISES ET ORGANISMES PRIVES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('131800', 'AUTRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('138000', 'AUTRES SUBVENTIONS D\'INVESTIS.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('139000', 'SUBV. INVES. INSC. AU CPTE RESULT.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('139100', 'SUBVENTIONS D\'EQUIPEMENT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('139110', 'ETAT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('139120', 'REGIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('139130', 'DEPARTEMENTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('139140', 'COMMUNES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('139150', 'COLLECTIVITES PUBLIQUES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('139160', 'ENTREPRISES PUBLIQUES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('139170', 'ENTREPRISES ET ORGANISMES PRIVES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('139180', 'AUTRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('139800', 'AUTRES SUBVENTIONS D\'INVESTIS.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('142000', 'PROVIS. REGLEM. RELATIV. AUX IMMO.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('142300', 'PROVIS. POUR RECONSTITUTION GIS.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('142400', 'PROVIS. INVESTIS. (PARTIC. SALAR.)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('143000', 'PROVIS. REGLEMENT. RELATIV. STOCKS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('143100', 'HAUSSE DES PRIX', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('143200', 'FLUCTUATION DES COURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('144000', 'PROVIS. REGLEM. RELAT. ELEM. ACTIF', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('145000', 'AMORTISSEMENTS DEROGATOIRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('146000', 'PROVISION SPECIALE DE REEVALUATION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('147000', 'PLUS-VALUES REINVESTIES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('148000', 'AUTRES PROVISIONS REGLEMENTEES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('151000', 'PROVISIONS POUR RISQUES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('151100', 'PROVISIONS POUR LITIGES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('151200', 'PROV. GARANT. DONNEES AUX CLIENTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('151300', 'PROV. PERTES SUR MARCHES A TERME.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('151400', 'PROVIS. POUR AMENDES ET PENALITES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('151500', 'PROVIS. POUR PERTES DE CHANGE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('151800', 'AUTRES PROVISIONS POUR RISQUES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('153000', 'PROVIS. PENSIONS ET OBLIG. SIMIL.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('155000', 'PROVISIONS POUR IMPOTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('156000', 'PROVIS. RENOUV. IMMO (ETS CONCESS)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('157000', 'PROV. CHARG. A REPART. SUR EXERC.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('157200', 'PROVIS. POUR GROSSES REPARATIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('158000', 'AUTRES PROVISIONS POUR CHARGES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('158200', 'PROVIS. CHARG. SOCIA. FISC. SUR CP', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('161000', 'EMPRUNTS OBLIGATOIRES CONVERTIBLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('163000', 'AUTRES EMPRUNTS OBLIGATAIRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('164000', 'EMPRUNTS AUPRES ETABLIS. DE CREDIT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('165000', 'DEPOTS ET CAUTIONNEMENTS RECUS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('165100', 'DEPOTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('165500', 'CAUTIONNEMENTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('166000', 'PARTICIP. SALARIES AUX RESULTAS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('166100', 'COMPTES BLOQUES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('166200', 'FONDS DE PARTICIPATION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('167000', 'EMPR. DETTES ASSORT. CONDIT. PART.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('167100', 'EMISSION DE TITRES PARTICIPATIFS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('167400', 'AVANCES CONDITIONNEES DE L\'ETAT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('167500', 'EMPRUNTS PARTICIPATIFS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('168000', 'AUTRES EMPR. ET DETTES ASSIMILEES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('168100', 'AUTRES EMPRUNTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('168500', 'RENTES VIAGERES CAPITALISEES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('168700', 'AUTRES DETTES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('168800', 'INTERETS COURUS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('168810', 'SUR EMPR. OBLIGATAIR. CONVERTIBLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('168830', 'SUR AUTRES EMPRUNTS OBLIGATAIRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('168840', 'SUR EMPRUNTS AUPRES ETABLI. CREDIT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('168850', 'SUR DEPOTS ET CAUTIONNEMENTS RECUS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('168860', 'SUR PARTICIP. SALAR. RESULTATS ETS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('168870', 'SUR EMPR. DETTES ASSOR. COND. PART', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('168880', 'SUR AUTRES EMPR. DETTES ASSIMILEES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('169000', 'PRIMES REMBOURSEMENT OBLIGATIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('171000', 'DETTES RATTACH. A PARTIC. (GROUPE)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('174000', 'DETTES RATT. A PART. (HORS GROUPE)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('178000', 'DETTES RATTACH. A STES EN PARTIC.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('178100', 'PRINCIPAL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('178800', 'INTERETS COURUS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('181000', 'COMPTE DE LIAISON ETABLISSEMENTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('186000', 'BIENS PREST. SERV. ECH. (CHARGES)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('187000', 'BIENS PREST. SERV. ECH. (PRODUITS)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('188000', 'COMPTES DE LIAISON STES EN PARTIC.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('201100', 'FRAIS DE CONSTITUTION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('201200', 'FRAIS DE PREMIER ETABLISSEMENT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('201210', 'FRAIS DE PROSPECTION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('201220', 'FRAIS DE PUBLICITE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('201300', 'FRAIS AUGMEN. CAPIT. OPER. DIVERS.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('203000', 'FRAIS RECHERCHE ET DEVELOPPEMENT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('205000', 'CONCESSIONS ET DROITS SIMILAIRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('206000', 'DROIT AU BAIL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('207000', 'FONDS COMMERCIAL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('208000', 'AUTRES IMMOBILISATIONS INCORPOR.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('211000', 'TERRAINS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('211100', 'TERRAINS NUS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('211200', 'TERRAINS AMENAGES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('211300', 'SOUS-SOLS ET SUR-SOLS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('211400', 'TERRAINS DE GISEMENT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('211410', 'CARRIERES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('211500', 'TERRAINS BATIS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('211510', 'ENSEMBLES IMMOBILIERS INDUSTRIELS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('211550', 'ENSEMBLES IMMOB. ADM. ET COMMERC.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('211580', 'AUTRES ENSEMBLES IMMOBILIERS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('211581', 'AFFECTES AUX OPERAT. PROFESSION.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('211588', 'AFFECTES AUX OPERAT. NON PROF.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('211600', 'COMPTE D\'ORDRE SUR IMMOBILISATIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('212000', 'AGENCEMENTS AMENAGEMENTS TERRAINS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('213000', 'CONSTRUCTIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('213100', 'BATIMENTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('213110', 'ENSEMBLES IMMOB. INDUSTRIELS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('213150', 'ENSEMBLES IMMOB. ADM. ET COMMERC.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('213180', 'AUTRES ENSEMBLES IMMOBILIERS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('213181', 'AFFECTES AUX OPERAT. PROFESSION.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('213188', 'AFFECTES AUX OPERAT. NON PROF.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('213500', 'INSTALLATIONS GENERALES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('213800', 'OUVRAGES D\'INFRASTRUCTURE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('213810', 'VOIES DE TERRE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('213820', 'VOIES DE FER', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('213830', 'VOIES D\'EAU', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('213840', 'BARRAGES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('213850', 'PISTES D\'AERODROMES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('214000', 'CONSTRUCTIONS SUR SOL D\'AUTRUI', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('215000', 'INSTALL. TECH. MAT. OUTIL. INDUS.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('215100', 'INSTALL. COMPLEXES SPECIALISEES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('215110', 'SUR SOL PROPRE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('215140', 'SUR SOL D\'AUTRUI', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('215300', 'INSTALL. A CARACTERE SPECIFIQUE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('215310', 'SUR SOL PROPRE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('215340', 'SUR SOL D\'AUTRUI', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('215400', 'MATERIEL INDUSTRIEL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('215500', 'OUTILLAGE INDUSTRIEL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('215700', 'AGENCEM. AMENAG. MAT. OUTIL. INDUS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('218000', 'AUTRES IMMOBILISATIONS CORPORELLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('218100', 'INSTALL. GENE. AGENC. AMENAG. DIV.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('218200', 'MATERIEL DE TRANSPORT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('218300', 'MATERIEL DE BUREAU ET INFORMATIQUE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('218400', 'MOBILIER', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('218500', 'CHEPTEL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('218600', 'EMBALLAGES RECUPERABLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('231000', 'IMMOBILISAT. CORPORELLES EN COURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('231200', 'TERRAINS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('231300', 'CONSTRUCTIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('231500', 'INSTALL. TECH. MAT. OUTIL. INDUST.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('231800', 'AUTRES IMMOBILISATIONS CORPORELLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('232000', 'IMMO. INCORPORELLES EN COURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('237000', 'AVANC. ACOMPT. VERSES SUR IMM. INC', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('238000', 'AVANC. ACOMP. VERSES CDES IMM. COR', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('238200', 'TERRAINS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('238300', 'CONSTRUCTIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('238500', 'INSTALL. TECH. MAT. OUTIL. INDUST.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('238800', 'AUTRES IMMOBILISATIONS CORPORELLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('261000', 'TITRES DE PARTICIPATION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('261100', 'ACTIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('261800', 'AUTRES TITRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('266000', 'AUTRES FORMES DE PARTICIPATION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('267000', 'CREANCES RATTACHEES A PARTICIPAT.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('267100', 'CREANCES RATT. A PART. (GROUPE)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('267400', 'CREANC. RATT. PART. (HORS GROUPE)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('267500', 'VERSEM. D\'APPORTS NON CAPITALISES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('267600', 'AVANCES CONSOLIDABLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('267700', 'AUTRES CREANCES RATT. A PART.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('267800', 'INTERETS COURUS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('268000', 'CREANCES RATT. A STE EN PART.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('268100', 'PRINCIPAL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('268800', 'INTERETS COURUS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('269000', 'VERS. REST. A EFFECT. SUR T.P.N.L.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('271000', 'TITRES IMMOBILISES (DROIT PROP.)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('271100', 'ACTIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('271800', 'AUTRES TITRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('272000', 'TITRES IMMOBILISES (DROIT CREANCE)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('272100', 'OBLIGATIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('272200', 'BONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('273000', 'TITRES IMMOBILISES DE L\'ACT. DE PORTEF.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('274000', 'PRETS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('274100', 'PRETS PARTICIPATIFS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('274200', 'PRETS AUX ASSOCIES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('274300', 'PRETS AU PERSONNEL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('274800', 'AUTRES PRETS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('275000', 'DEPOTS ET CAUTIONNEMENTS VERSES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('275100', 'DEPOTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('275500', 'CAUTIONNEMENTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('276000', 'AUTRES CREANCES IMMOBILISEES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('276100', 'CREANCES DIVERSES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('276800', 'INTERETS COURUS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('276820', 'SUR TITRES IMMOB. (DROIT CREANCE)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('276840', 'SUR PRETS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('276850', 'SUR DEPOTS ET CAUTIONNEMENTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('276880', 'SUR CREANCES DIVERSES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('277100', 'ACTIONS PROPRES OU PARTS PROPRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('277200', 'ACT. PRO. OU PARTS PRO. VOIE D\'ANNUL.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('279000', 'VERSEM. A EFFECT. SUR T.I.N.L.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('280000', 'AMORTISS. IMMOBILISATIONS INCORP.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('280100', 'FRAIS D\'ETABLISSEMENT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('280300', 'FRAIS DE RECHERCHE ET DEVELOPP.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('280500', 'CONCESSIONS ET DROITS SIMILAIRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('280700', 'FONDS COMMERCIAL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('280800', 'AUTRES IMMOBILISATIONS INCORPOR.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('281000', 'AMORTISS. IMMOBILISATIONS CORPOR.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('281100', 'TERRAINS DE GISEMENT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('281200', 'AGENCEMENTS AMENAGEMENTS TERRAINS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('281300', 'CONSTRUCTIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('281400', 'CONSTRUCTIONS SUR SOL D\'AUTRUI', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('281500', 'INSTALL TECH. MAT. OUTIL. INDUST.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('281800', 'AUTRES IMMOBILISATIONS CORPORELLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('282000', 'AMORTISS. IMMOBIL. EN CONCESSION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('290000', 'PROVIS. DEPRECIATION IMMOB. INCORP', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('290500', 'MARQUES PROCEDES DROITS ET VALEURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('290600', 'DROIT AU BAIL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('290700', 'FONDS COMMERCIAL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('290800', 'AUTRES IMMOB. INCORPORELLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('291000', 'PROVIS. DEPRECIATION IMMOB. CORPOR', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('291100', 'TERRAINS (AUTRES QUE GISEMENT)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('292000', 'PROVIS. DEPRECIAT. IMMOB. CONCESS.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('293000', 'PROVIS. DEPRECIAT. IMMOB. EN COURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('293100', 'IMMOBILISATIONS CORPOR. EN COURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('293200', 'IMMO. INCORPORELLES EN COURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('296000', 'PROV. DEPREC. PART ET CREANC. PART', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('296100', 'TITRES DE PARTICIPATION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('296600', 'AUTRES FORMES DE PARTICIPATION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('296700', 'CREANCES RATT. A PARTICIPATION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('296800', 'CREANCES RATT. A STE EN PARTICIP.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('297000', 'PROVIS. DEPRECIATION AUTRES IMMOB.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('297100', 'TITRES IMMOBILISES DROIT PROPRIETE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('297200', 'TITRES IMMOBILISES DROIT CREANCE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('297300', 'TITRES IMMO. DE L\'ACT. DE PORTEF.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('297400', 'PRETS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('297500', 'DEPOTS ET CAUTIONNEMENTS VERSES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('297600', 'AUTRES CREANCES IMMOBILISEES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('311000', 'MATIERE (OU GROUPE) A', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('312000', 'MATIERE (OU GROUPE) B', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('317000', 'FOURNITURES A, B, C...', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('321000', 'MATIERES CONSOMMABLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('321100', 'MATIERE (OU GROUPE) C', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('321200', 'MATIERE (OU GROUPE) D', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('322000', 'FOURNITURES CONSOMMABLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('322100', 'COMBUSTIBLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('322200', 'PRODUITS D\'ENTRETIEN', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('322300', 'FOURNITURES D\'ATELIER ET D\'USINE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('322400', 'FOURNITURES DE MAGASIN', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('322500', 'FOURNITURES DE BUREAU', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('326000', 'EMBALLAGES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('326100', 'EMBALLAGES PERDUS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('326500', 'EMBAL. RECUPER. NON IDENTIFIABLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('326700', 'EMBALLAGES A USAGE MIXTE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('331000', 'PRODUITS EN COURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('331100', 'PRODUITS EN COURS P1', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('331200', 'PRODUITS EN COURS P2', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('335000', 'TRAVAUX EN COURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('335100', 'TRAVAUX EN COURS T1', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('335200', 'TRAVAUX EN COURS T2', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('341000', 'ETUDES EN COURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('341100', 'ETUDE EN COURS E1', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('341200', 'ETUDE EN COURS E2', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('345000', 'PRESTATIONS DE SERVICES EN COURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('345100', 'PRESTATION DE SERVICES S1', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('345200', 'PRESTATION DE SERVICES S2', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('351000', 'PRODUITS INTERMEDIAIRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('351100', 'PRODUIT INTERMEDIAIRE (OU GRPE) A', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('351200', 'PRODUIT INTERMEDIAIRE (OU GRPE) B', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('355000', 'PRODUITS FINIS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('355100', 'PRODUIT FINI (OU GROUPE) A', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('355200', 'PRODUIT FINI (OU GROUPE) B', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('358000', 'PROD. RESIDUELS (OU MAT. RECUP.)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('358100', 'DECHETS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('358500', 'REBUTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('358600', 'MATIERES DE RECUPERATION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('371000', 'MARCHANDISE (OU GROUPE) A', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('372000', 'MARCHANDISE (OU GROUPE) B', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('391000', 'PROVIS. POUR DEPRECIAT. MAT. PREM.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('391100', 'MATIERE (OU GROUPE) A', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('391200', 'MATIERE (OU GROUPE) B', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('391700', 'FOURNITURE A, B, C...', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('392000', 'PROVIS. POUR DEPRECIAT. AUT. APPRO', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('392100', 'MATIERES CONSOMMABLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('392200', 'FOURNITURES CONSOMMABLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('392600', 'EMBALLAGES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('393000', 'PROV. DEPREC. EN-COURS PROD. BIENS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('393100', 'PRODUITS EN COURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('393500', 'TRAVAUX EN COURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('394000', 'PROV. DEPREC. EN-COURS PROD. SERV.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('394100', 'ETUDES EN COURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('394500', 'PRESTATIONS DE SERVICES EN COURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('395000', 'PROV. POUR DEPREC. STOCKS DE PROD.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('395100', 'PRODUITS INTERMEDIAIRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('395500', 'PRODUITS FINIS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('397000', 'PROV. POUR DEPREC. STOCKS MARCHAN.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('397100', 'MARCHANDISE OU GROUPE A', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('397200', 'MARCHANDISE OU GROUPE B', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('401000', 'FOURNISSEURS DIVERS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('403000', 'FOURNISSEURS - EFFETS A PAYER', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('404000', 'FOURNISSEURS D\'IMMOBILISATIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('404100', 'FOURNISSEURS ACHATS D\'IMMOBILISAT.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('404700', 'FOURNIS. D\'IMMOB. RETENUES DE GAR.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('405000', 'FOURNIS. D\'IMMOB. EFFETS A PAYER', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('408000', 'FOURNIS. FACTURES NON PARVENUES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('408100', 'FOURNISSEURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('408400', 'FOURNISSEURS D\'IMMOBILISATIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('408800', 'FOURNISSEURS INTERETS COURUS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('409000', 'FOURNISSEURS DEBITEURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('409100', 'FOURNIS. AVANC. & ACOMPT. SUR CDES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('409600', 'FOURN. CREAN. EMB. & MAT. A RENDRE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('409700', 'FOURNISSEURS AUTRES AVOIRS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('409710', 'FOURNISSEURS D\'EXPLOITATION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('409740', 'FOURNISSEURS D\'IMMOBILISATIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('409800', 'RABAIS REMISES RISTOUR. A OBTENIR', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('410000', 'CLIENTS ET COMPTES RATTACHES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('411000', 'CLIENTS DIVERS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('413000', 'CLIENTS EFFETS A RECEVOIR', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('416000', 'CLIENTS DOUTEUX OU LITIGIEUX', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('417000', 'CREANC. SUR TRAV. NON ENCORE FACT.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('418000', 'CLIENTS PRODUITS NON ENCORE FACT.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('418100', 'CLIENTS FACTURES A ETABLIR', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('418800', 'CLIENTS INTERETS COURUS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('419000', 'CLIENTS CREDITEURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('419100', 'CLTS AVANC. & ACOMP. RECUS SUR CDE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('419600', 'CLTS DETT. POUR EMB. & MAT. CONSIG', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('419700', 'CLIENTS - AUTRES AVOIRS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('419800', 'RABAIS REMISES RIST. A ACCORDER', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('421000', 'PERSONNEL REMUNERATIONS DUES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('422000', 'COMITES D\'ENTREPRISE, D\'ETABLIS.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('424000', 'PARTICIP. DES SALAR. AUX RESULTATS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('424600', 'RESERVE SPECIALE (ART L442.2)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('424800', 'COMPTES COURANTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('425000', 'PERSONNEL AVANCES ET ACOMPTES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('426000', 'PERSONNEL DEPOTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('427000', 'PERSONNEL OPPOSITIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('428000', 'PERS. CHARG. A PAY. & PROD. A REC.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('428200', 'DETTES PROVISIO. POUR CONGES PAYES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('428400', 'DETT. PROV. PART. SAL. AUX RESULT.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('428600', 'AUTRES CHARGES A PAYER', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('428700', 'PRODUITS A RECEVOIR', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('438000', 'ORG. SOC. CHARG. A PAY. & PROD.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('438200', 'CHARGES SOCIALES SUR CONGES PAYES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('438700', 'PRODUITS A RECEVOIR', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('441000', 'ETATS SUBVENTIONS A RECEVOIR', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('441100', 'SUBVENTIONS D\'INVESTISSEMENT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('441700', 'SUBVENTIONS D\'EXPLOITATION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('441800', 'SUBVENTIONS D\'EQUILIBRE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('441900', 'AVANCES SUR SUBVENTIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('442000', 'ETAT IMP. & TAX. RECOUV. SUR TIERS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('442400', 'OBLIGATAIRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('442500', 'ASSOCIES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('443000', 'OPERATIONS PART. AVEC L\'ETAT,...', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('443100', 'CREANCES ETAT SUPPR. DECAL. TVA', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('443800', 'INTERES COURUS CREANCES CPTE 443100', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('444000', 'ETAT IMPOTS SUR LES BENEFICES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('444500', 'ETAT TAXES SUR LE CHIFFRE D\'AFF.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445200', 'TVA DUE INTRACOMMUNAUTAIRE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445510', 'TVA A DECAISSER', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445580', 'TAXES ASSIMILEES A TVA', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445600', 'TAXES SUR LE CA DEDUCTIBLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445621', 'TVA SUR IMMO. 5.5%', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445622', 'TVA SUR IMMO. 20.6%', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445623', 'TVA SUR IMMO. 19.6%', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445630', 'TVA TRANSFEREE PAR D\'AUTRES ETS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445662', 'TVA DEDUCTIBLE 20.6%', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445670', 'CREDIT DE TVA A REPORTER', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445680', 'TAXES ASSIMILEES A LA TVA', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445700', 'TAXE SUR LE C.A. COLLECT. ENTREPR.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445712', 'TVA COLLECTEE 20.6%', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445800', 'TAXES SUR CA A REGULAR. OU EN ATT.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445810', 'ACOMPTES REGIME SIMPLIFIE D\'IMPOS.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445820', 'ACOMPTES REGIME DU FORFAIT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445830', 'REMBOURS. TAXES SUR CA DEMANDE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445840', 'TVA RECUPEREE D\'AVANCE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445861', 'TVA EN ATTENTE DEDUCTIBLE 5.5%', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445862', 'TVA EN ATTENTE DEDUCTIBLE 20.6%', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445863', 'TVA EN ATTENTE DEDUCTIBLE 19.6%', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445871', 'TVA EN ATTENTE COLLECTEE 5.5%', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445872', 'TVA EN ATTENTE COLLECTEE 20.6%', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445873', 'TVA EN ATTENTE COLLECTEE 19.6%', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('446000', 'TITRES SUR TVA', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('446100', 'OBLIGATIONS CAUTIONNEES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('446900', 'CREANCE TVA DECALAGE D\'UN MOIS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('447000', 'AUTRES IMPOTS, TAX. ET VERS. ASSIM', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('448000', 'ETAT CHARG. A PAY. & PROD. A RECEV', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('448200', 'CHARGES FISCALES SUR CONG. A PAYER', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('448600', 'AUTRES CHARGES A PAYER', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('448700', 'PRODUITS A RECEVOIR', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('451000', 'GROUPE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('455000', 'ASSOCIES COMPTES COURANTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('455100', 'PRINCIPAL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('455780', 'TAXES ASSIMILEES A LA TVA', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('455800', 'INTERETS COURUS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('456000', 'ASSOCIES OPERATIONS SUR LE CAPITAL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('456100', 'ASSOCIES COMPTES D\'APPORT EN STE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('456110', 'APPORTS EN NATURE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('456150', 'APPORTS EN NUMERAIRE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('456200', 'APPORTEURS CAPIT. APPELE NON VERSE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('456210', 'ACTION. CAP. SOUSC. APP. NON VERSE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('456250', 'ASSOCIES CAPITAL APPELE NON VERSE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('456300', 'ASSOC. VERS. RECUS SUR AUGM. CAPIT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('456400', 'ASSOCIES VERSEMENTS ANTICIPES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('456600', 'ACTIONNAIRES DEFAILLANTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('456700', 'ASSOCIES CAPITAL A REMBOURSER', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('457000', 'ASSOCIES DIVIDENDES A PAYER', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('458000', 'ASSOC. OPERAT. EN COMMUN ET EN GIE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('458100', 'OPERATIONS COURANTES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('458800', 'INTERETS COURUS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('462000', 'CREANCES SUR CESSIONS D\'IMMOBILIS.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('464000', 'DETTES SUR ACQUIS. VALEURS MOBI.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('465000', 'CREANC. SUR CESSIONS VALEURS MOB.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('467000', 'AUTRES COMPTES DEBIT. OU CREDIT.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('467200', 'DEBOURS PAYES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('468000', 'DIVERS CHARG. A PAY. & PROD. A REC', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('468600', 'CHARGES A PAYER', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('468700', 'PRODUITS A RECEVOIR', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('471000', 'COMPTES D\'ATTENTE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('471100', 'REIMPUTATION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('476000', 'DIFFERENCES DE CONVERSION ACTIF', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('476100', 'DIMINUTION DES CREANCES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('476200', 'AUGMENTATION DES DETTES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('476800', 'DIFFER. COMPENS. PAR COUV. CHANGE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('477000', 'DIFFERENCES DE CONVERSION PASSIF', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('477100', 'AUGMENTATION DES CREANCES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('477200', 'DIMINUTION DES DETTES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('477800', 'DIFFER. COMPENS. PAR COUV. CHANGE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('478000', 'AUTRES COMPTES TRANSITOIRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('481000', 'CHARG. A REPART. SUR PLUS. EXERC.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('481100', 'CHARGES DIFFEREES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('481200', 'FRAIS D\'ACQUISITION DES IMMOBILIS.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('481600', 'FRAIS D\'EMISSION DES EMPRUNTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('481800', 'CHARGES A ETALER', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('486000', 'CHARGES CONSTATEES D\'AVANCE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('487000', 'PRODUITS CONSTATES D\'AVANCE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('488000', 'CPTES REPART. PERIO. CHARG. & PROD', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('488600', 'CHARGES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('488700', 'PRODUITS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('491000', 'PROVIS. POUR DEPREC. CPTES CLIENTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('495000', 'PROV. POUR DEPREC. CPTES GRPE ASS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('495100', 'COMPTES DU GROUPE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('495500', 'COMPTES COURANTS DES ASSOCIES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('495800', 'OPERAT. FAITES EN COMMUN & EN GIE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('496000', 'PROVIS. POUR DEPREC. CPTES DEBIT.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('496200', 'CREANCES SUR CESSIONS D\'IMMOBILIS.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('496500', 'CREANC. SUR CESSIONS VALEURS MOB.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('496700', 'AUTRES COMPTES DEBITEURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('501000', 'PARTS DANS DES ENTREPRISES LIEES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('502000', 'ACTIONS PROPRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('503000', 'ACTIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('503100', 'TITRES COTES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('503500', 'TITRES NON COTES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('504000', 'AUTRES TITRES CONFERANT DROIT PROP', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('505000', 'OBLIG. & BONS EMIS PAR LA SOCIETE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('506000', 'OBLIGATIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('506100', 'TITRES COTES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('506500', 'TITRES NON COTES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('507000', 'BONS TRESOR & BONS CAISSE A CT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('508000', 'AUTRES VALEURS MOB. ET CREANC. ASS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('508100', 'AUTRES VALEURS MOBILIERES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('508200', 'BONS DE SOUSCRIPTION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('508800', 'INTER. COURUS SUR OBLIGATIONS BONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('509000', 'VERS. A EFFECT. SUR VALEURS MOBIL.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('511000', 'VALEURS A L\'ENCAISSEMENT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('511100', 'COUPONS ECHUS A L\'ENCAISSEMENT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('511200', 'CHEQUES A ENCAISSER', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('511300', 'EFFETS A L\'ENCAISSEMENT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('511400', 'EFFETS A L\'ESCOMPTE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('512100', 'COMPTES EN MONNAIE NATIONALE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('512400', 'COMPTES EN DEVISES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('514000', 'CHEQUES POSTAUX', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('515000', 'CAISSES DU TRESOR ET ETS PUBLICS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('516000', 'SOCIETE DE BOURSE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('517000', 'AUTRES ORGANISMES FINANCIERS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('518000', 'INTERETS EN COURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('518600', 'INTERETS COURUS A PAYER', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('518700', 'INTERETS COURUS A RECEVOIR', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('519000', 'CONCOURS BANCAIRES COURANTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('519100', 'CREDIT MOBIL. CREANC. CCIALES CMCC', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('519300', 'MOBIL. CREANCES NEES A L\'ETRANGER', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('519800', 'INT. COURUS SUR CONCOURS BANCAIRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('520000', 'INSTRUMENTS DE TRESORERIE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('531000', 'CAISSE SIEGE SOCIAL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('531100', 'CAISSE EN MONNAIE NATIONALE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('531400', 'CAISSE EN DEVISES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('532000', 'CAISSE SUCCURSALE (OU USINE) A', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('533000', 'CAISSE SUCCURSALE (OU USINE) B', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('580100', 'VIREMENT DE TRESORERIE A TRESORERIE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('590000', 'PROVIS. POUR DEPREC. VALEURS MOB.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('590300', 'ACTIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('590400', 'AUTRES TIT. CONFERANT DROIT PROP.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('590600', 'OBLIGATIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('590800', 'AUTRES VALEURS MOB. & CREANC. ASS.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('601100', 'MATIERE (OU GROUPE) A', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('601200', 'MATIERE (OU GROUPE) B', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('601700', 'FOURNITURES A, B, C...', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('602000', 'ACHATS STOCKES AUTRES APPROV.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('602100', 'MATIERES CONSOMMABLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('602110', 'MATIERE (OU GROUPE) C', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('602120', 'MATIERE (OU GROUPE) D', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('602200', 'FOURNITURES CONSOMMABLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('602210', 'COMBUSTIBLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('602220', 'PRODUITS D\'ENTRETIEN', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('602230', 'FOURNITURES D\'ATELIER / USINES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('602240', 'FOURNITURES DE MAGASINS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('602250', 'FOURNITURES DE BUREAU', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('602600', 'EMBALLAGES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('602610', 'EMBALLAGES PERDUS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('602650', 'EMBALL. RECUPERA. NON IDENTIF.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('602670', 'EMBALLAGES A USAGE MIXTE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('603000', 'VARIATION DES STOCKS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('603100', 'VARIAT. STOCKS MAT. PREM. ET FOURN', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('603200', 'VARIAT. STOCKS AUTRES APPROVISION.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('603700', 'VARIATION STOCKS DE MARCHANDISES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('604000', 'ACHATS ETUDES ET PRESTAT. SERVICES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('605000', 'ACHATS MATERIEL EQUIPEM. TRAVAUX', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('606000', 'ACHATS NON STOCKES DE MAT. PREM.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('606400', 'FOURNITURES ADMINISTRATIVES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('606500', 'ACHATS SPECIAUX', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('606800', 'AUTRES MATIERES ET FOURNITURES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('607100', 'MARCHANDISE (OU GROUPE) A', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('607200', 'MARCHANDISE (OU GROUPE) B', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('608000', 'FRAIS ACCESSOIRES D\'ACHAT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('609000', 'RABAIS REMISES RIST. SUR ACHATS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('609100', 'DE MATIERES PREMIERES (ET FOURN.)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('609200', 'D\'AUTRES APPROVISIONN. STOCKES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('609500', 'DE MATERIEL EQUIPEMENTS DE TRAVAUX', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('609600', 'D\'APPROVISIONNEMENTS NON STOCKES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('609700', 'DE MARCHANDISES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('609800', 'RABAIS REMISES RIST. NON AFFECTES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('612000', 'REDEVANCES DE CREDIT-BAIL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('612200', 'CREDIT-BAIL MOBILIER', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('612500', 'CREDIT-BAIL IMMOBILIER', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('613000', 'LOCATIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('613600', 'MALIS SUR EMBALLAGES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('614000', 'CHARGES LOCATIVES & DE COPROPRIETE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('615200', 'SUR BIENS IMMOBILIERS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('615500', 'SUR BIENS MOBILIERS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('615600', 'MAINTENANCE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('616100', 'MULTIRISQUES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('616200', 'ASSUR. OBLIGAT. DOMMAGE-CONSTRUCT.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('616300', 'ASSURANCE-TRANSPORT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('616360', 'SUR ACHATS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('616370', 'SUR VENTES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('616380', 'SUR AUTRES BIENS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('616400', 'RISQUES D\'EXPLOITATION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('616500', 'INSOLVABILITE CLIENTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('618000', 'DIVERS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('618100', 'DOCUMENTATION GENERALE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('618500', 'FRAIS DE COLLOQUES, SEMIN., CONFER', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('619000', 'RABAIS REMISES RIST. SUR SERV. EXT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('621000', 'PERSONNEL EXTERIEUR A L\'ENTREPRISE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('621400', 'PERSONNEL DETACHE OU PRETE A L\'ETS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('622000', 'REMUNERAT. D\'INTERM. ET HONORAIRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('622100', 'COMMISSIONS & COURTAGES SUR ACHATS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('622200', 'COMMISSIONS & COURTAGES SUR VENTES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('622400', 'REMUNERATIONS DES TRANSITAIRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('622500', 'REMUNERATIONS D\'AFFACTURAGE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('622800', 'DIVERS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('623000', 'PUBLICITE PUBLICAT. RELAT. PUBLIQ.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('623100', 'ANNONCES ET INSERTIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('623200', 'ECHANTILLONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('623300', 'FOIRES ET EXPOSITIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('623500', 'PRIMES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('623600', 'CATALOGUES ET IMPRIMES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('623700', 'PUBLICATIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('623800', 'DIVERS (POURBOIRES, DONS COURANTS)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('624000', 'TRANSP. BIENS & TRANSP. COLL. PERS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('624100', 'TRANSPORTS SUR ACHATS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('624200', 'TRANSPORTS SUR VENTES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('624300', 'TRANSPORTS ENTRE ETS OU CHANTIERS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('624400', 'TRANSPORTS ADMINISTRATIFS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('624700', 'TRANSPORTS COLLECTIFS DU PERSONNEL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('624800', 'DIVERS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('625000', 'DEPLACEM. MISSIONS ET RECEPTIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('625500', 'FRAIS DE DEMENAGEMENT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('625700', 'RECEPTIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('627000', 'SERVICES BANCAIRES ET ASSIMILES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('627100', 'FRAIS SUR TITRES (ACHAT, VENTE,.).', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('627200', 'COMMISSIONS & FRAIS SUR EMPRUNTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('627500', 'FRAIS SUR EFFETS (COMM. D\'ENDOS,.)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('627600', 'LOCATION DE COFFRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('627800', 'AUTRES FRAIS & COMM. PREST. SERV.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('628000', 'DIVERS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('628400', 'FRAIS DE RECRUTEMENT DU PERSONNEL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('629000', 'RABAIS REMISES RIST. SUR SERV. EXT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('631000', 'IMPOTS TAXES & VERS. SUR REMUNER.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('631100', 'TAXE SUR LES SALAIRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('631200', 'TAXE D\'APPRENTISSAGE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('631300', 'PART. EMPLOY. A FORM. PROF. CONT.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('631400', 'COTIS. DEFAUT INVEST. DANS CONST.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('631800', 'AUTRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('633000', 'IMPOTS TAXES & VERS. SUR REMUNER.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('633100', 'VERSEMENT SUR LE TRANSPORT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('633200', 'ALLOCATION LOGEMENT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('633300', 'PART. EMPLOY. A FORM. PROF. CONT.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('633400', 'PART. EMPLOY. A EFFORT CONSTRUCT.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('633500', 'VERS. LIBERAT. A EXONER. TAXE APP.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('635000', 'AUTRES IMPOTS TAXES & VERS. ASS.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('635100', 'IMPOTS DIRECTS (SAUF IMPOT BENEF.)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('635120', 'TAXES FONCIERES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('635130', 'AUTRES IMPOTS LOCAUX', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('635140', 'TAXE SUR LES VEHICULES SOCIETES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('635200', 'TAXES SUR CA NON RECUPERABLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('635300', 'IMPOTS INDIRECTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('635400', 'DROITS D\'ENREGISTREMENT ET TIMBRE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('635410', 'DROIT DE MUTATION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('635800', 'AUTRES DROITS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('637000', 'AUTRES IMPOTS TAXES ET VERS. ASS.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('637100', 'CONTRIB. SOC. SOLID. A CHARGE STES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('637200', 'TAXES PERCUES PAR ORG. PUBLICS INT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('637400', 'IMPOTS & TAXES EXIGIB. A L\'ETRANG.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('637800', 'TAXES DIVERSES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('641100', 'SALAIRES APPOINT. COMMIS. DE BASE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('641200', 'CONGES PAYES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('641300', 'PRIMES ET GRATIFICATIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('641400', 'SALAIRES, APPOINTEMENTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('641500', 'SUPPLEMENT FAMILIAL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('644000', 'REMUNERATION TRAVAIL DE L\'EXPLOIT.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('647000', 'AUTRES CHARGES SOCIALES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('647100', 'PRESTATIONS DIRECTES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('647200', 'VERS. AUX COMITES D\'ETS & D\'ETAB.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('647300', 'VERS. AUX COMITES HYGIENE ET SECUR', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('647400', 'VERSEMENTS AUX OEUVRES SOCIALES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('647500', 'MEDECINE DU TRAVAIL, PHARMACIE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('648000', 'AUTRES CHARGES DE PERSONNEL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('651000', 'REDEVANC. CONCESS. BREV. LICENC,..', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('651100', 'REDEV. CONCESS. BREV, LIC, MARQ,..', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('651600', 'DROITS D\'AUTEUR ET DE REPRODUCT.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('651800', 'AUTRES DROITS & VALEURS SIMILAIRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('653000', 'JETONS DE PRESENCE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('654000', 'PERTES SUR CREANCES IRRECOUVRAB.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('654100', 'CREANCES DE L\'EXERCICE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('654400', 'CREANCES DES EXERCICES ANTERIEURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('655000', 'QUOTE-PARTS RESULT. OPER. EN COMM.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('655100', 'Q-P BENEF. TRANSF. (CPTA GERANT)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('655500', 'QUOTE-PART PERTE SUPP. (CPTA ASS)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('658000', 'CHARGES DIVERSES GESTION COURANTE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('661000', 'CHARGES D\'INTERETS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('661100', 'INTERETS DES EMPRUNTS ET DETTES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('661160', 'DES EMPRUNTS ET DETTES ASSIMILEES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('661170', 'DES DETTES RATT. A PARTICIPATIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('661500', 'INTERETS CPTES COUR. & DEP. CREDIT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('661600', 'INTERETS BANC. & SUR OPER. FINANC.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('661700', 'INTERETS OBLIGATIONS CAUTIONNEES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('661800', 'INTERETS DES AUTRES DETTES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('661810', 'DES DETTES COMMERCIALES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('661880', 'DES DETTES DIVERSES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('664000', 'PERTES CREANCES LIEES A PARTICIP.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('665000', 'ESCOMPTES ACCORDES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('667000', 'CHARG. NETTES SUR CESS. VAL. MOBIL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('668000', 'AUTRES CHARGES FINANCIERES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('668800', 'ECART DE CONVERSION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('671000', 'CHARG. EXCEPT. SUR OPERAT. GESTION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('671100', 'PENALITES SUR MARCHES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('671200', 'PENALITES AMENDES FISC. & PENALES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('671300', 'DONS, LIBERALITES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('671400', 'CREANC. DEVEN. IRRECOUV. SUR BENEF', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('671500', 'SUBVENTIONS ACCORDEES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('671700', 'RAPPEL D\'IMPOTS (AUTRE QUE BENEF)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('671800', 'AUT. CHARG. EXCEP. SUR OPER. GEST.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('672000', 'CHARGES SUR EXERCICES ANTERIEURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('675000', 'VAL. COMPT. DES ELEM. ACTIF CEDES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('675100', 'IMMOBILISATIONS INCORPORELLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('675200', 'IMMOBILISATIONS CORPORELLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('675600', 'IMMOBILISATIONS FINANCIERES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('675800', 'AUTRES ELEMENTS D\'ACTIF', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('678000', 'AUTRES CHARGES EXCEPTIONNELLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('678100', 'MALIS PROVENANT DE CLAUSES INDEXAT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('678200', 'LOTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('678300', 'MALIS DU RACHAT PAR ETS D\'ACTIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('678800', 'CHARGES EXCEPTIONNELLES DIVERSES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('681100', 'DOTAT. AUX AMORT. DES IMMOB. CORPO', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('681110', 'IMMOBILISATIONS INCORPORELLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('681120', 'IMMOBILISATIONS CORPORELLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('681200', 'DOTAT. AUX AMORT. CHARG. EXPLOIT.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('681500', 'DOTAT. AUX PROV. RISQ. & CHARG. EX', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('681600', 'DOTAT. AUX PROV. DEPREC. IMMOB.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('681610', 'IMMOBILISATIONS INCORPORELLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('681620', 'IMMOBILISATIONS CORPORELLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('681700', 'DOTAT. AUX PROV. DEPREC. ACTIFS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('681740', 'CREANCES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('686000', 'DOTAT. AUX AMORT. ET AUX PROVIS.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('686100', 'DOT. AUX AMORT. PRIME REMB. OBLIG.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('686500', 'DOT. AUX PROV. RISQ. & CHARG. FIN.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('686600', 'DOT. AUX PROV. DEPREC. ELEM. FINAN', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('686620', 'IMMOBILISATIONS FINANCIERES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('686650', 'VALEURS MOBILIERES DE PLACEMENT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('686800', 'AUTRES DOTATIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('687000', 'DOTAT. AUX AMORT. ET PROVISIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('687100', 'DOTAT. AUX AMORT. EXCEPT. IMMOB.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('687200', 'DOTAT. AUX PROV. REGLEM. (IMMOB)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('687250', 'AMORTISSEMENTS DEROGATOIRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('687300', 'DOTAT. AUX PROV. REGLEM. (STOCKS)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('687400', 'DOTAT. AUX AUTRES PROV. REGLEMENT.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('687500', 'DOTAT. PROV. RISQ. & CHARG. EXCEP.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('691000', 'PARTICIPATIONS DES SALARIES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('695200', 'CONTRIB. ADDITIO. IMPOT BENEFICES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('695400', 'IMPOTS DUS A L\'ETRANGER', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('696000', 'SUPPLEMENT D\'IMPOTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('697000', 'IMPOSITION FORF. ANUELLE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('698000', 'INTEGRATION FISCALE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('698100', 'INTEGRATION FISCALE - CHARGES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('698900', 'INTEGRATION FISCALE - PRODUITS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('699000', 'PRODUITS REP. EN ARR. DES DEFICITS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('701000', 'VENTES DE PRODUITS FINIS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('701100', 'PRODUIT FINI (OU GROUPE) A', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('701200', 'PRODUIT FINI (OU GROUPE) B', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('702000', 'VENTES DE PRODUITS INTERMEDIAIRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('703000', 'VENTES DE PRODUITS RESIDUELS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('704000', 'TRAVAUX', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('704100', 'TRAVAUX DE CATEG. (OU ACTIV.) A', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('704200', 'TRAVAUX DE CATEG. (OU ACTIV.) B', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('705000', 'ETUDES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('707100', 'MARCHANDISE (OU GROUPE) A', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('707200', 'MARCHANDISE (OU GROUPE) B', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('708000', 'PRODUITS DES ACTIVITES ANNEXES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('708100', 'PROD. SERV. EXPLOIT. INTER. PERSON', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('708200', 'COMMISSIONS ET COURTAGES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('708300', 'LOCATIONS DIVERSES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('708400', 'MISE A DISPOS. PERSONNEL FACTUREE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('708500', 'PORTS ET FRAIS ACCESSOIRES FACT.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('708600', 'BONIS SUR REPRISES EMBALL. CONSIG.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('708700', 'BONIFICAT. CLTS & PRIMES VENTES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('708800', 'AUTRES PRODUITS ACTIVITES ANNEXES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('709000', 'RABAIS REMISES RIST. ACCORD. A ETS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('709100', 'SUR VENTES DE PRODUITS FINIS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('709200', 'SUR VENTES PRODUITS INTERMEDIAIRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('709400', 'SUR TRAVAUX', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('709500', 'SUR ETUDES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('709600', 'SUR PRESTATIONS DE SERVICES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('709700', 'SUR VENTES MARCHANDISES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('709800', 'SUR PRODUITS ACTIVITES ANNEXES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('713000', 'VARIAT. STOCKS (EN-COURS PRODUCT.)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('713300', 'VARIATION EN-COURS PRODUC. BIENS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('713310', 'PRODUITS EN COURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('713350', 'TRAVAUX EN COURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('713400', 'VARIATION EN-COURS PROD. SERVICES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('713410', 'ETUDES EN COURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('713450', 'PRESTATIONS SERVICES EN COURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('713500', 'VARIATION STOCKS DE PRODUITS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('713510', 'PRODUITS INTERMEDIAIRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('713550', 'PRODUITS FINIS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('713580', 'PRODUITS RESIDUELS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('721000', 'IMMOBILISATIONS INCORPORELLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('722000', 'IMMOBILISATIONS CORPORELLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('731000', 'PROD. NETS PART. SUR OP. EN COURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('739000', 'PROD. NETS PART. SUR OP. TERMINEES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('751000', 'REDEV. POUR CONCES. BREV. LIC....', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('751100', 'REDEV. POUR CONCES. BREV. LIC...', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('751600', 'DROITS D\'AUTEUR ET DE REPRODUCTION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('751800', 'AUTRES DROITS & VALEURS SIMILAIRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('752000', 'REV. IMMEUB. NON AFFECT. ACT. PROF', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('753000', 'JETONS PRESENCE ET REMUN. ADMINIST', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('754000', 'RISTOURNES PERCUES COOPERATIVES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('755000', 'QUOTES-PARTS RESULT. OP. EN COMMUN', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('755100', 'QUOTE-PART PERTE TRANSFEREE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('755500', 'QUOTE-PART BENEFICE ATTRIBUEE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('758000', 'PRODUITS DIVERS GESTION COURANTE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('761000', 'PRODUITS DE PARTICIPATIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('761100', 'REVENUS TITRES DE PARTICIPATION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('761600', 'REVENUS AUTRES FORMES PARTICIP.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('762000', 'PRODUITS AUTRES IMMOB. FINANC.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('762100', 'REVENUS DES TITRES IMMOBILISES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('762400', 'REVENUS DES PRETS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('762700', 'REVENUS CREANCES IMMOBILISEES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('763000', 'REVENUS DES AUTRES CREANCES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('763100', 'REVENUS CREANCES COMMERCIALES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('763800', 'REVENUS DES CREANCES DIVERSES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('764000', 'REVENUS VALEURS MOBIL. PLACEMENT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('765000', 'ESCOMPTES OBTENUS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('767000', 'PROD. NETS SUR CESS. VALEURS MOB.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('767100', 'REVENUS CRE. RATT. PARTICIPATIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('768000', 'AUTRES PRODUITS FINANCIERS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('771000', 'PRODUITS EXCEPT. SUR OPER. GESTION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('771100', 'DEDITS PENAL. SUR ACHATS & VENTES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('771300', 'LIBERALITES PERCUES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('771400', 'RENTREES SUR CREANCES AMORTIES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('771500', 'SUBVENTIONS D\'EQUILIBRE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('771700', 'DEGREVEM. IMPOTS (AUT. IMP. BENEF)', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('771800', 'AUTRES PROD. EXCEPT. SUR OP. GEST.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('772000', 'PRODUITS SUR EXERCICES ANTERIEURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('775000', 'PRODUITS CESSIONS ELEMENTS D\'ACTIF', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('775100', 'IMMOBILISATIONS INCORPORELLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('775200', 'IMMOBILISATIONS CORPORELLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('775600', 'IMMOBILISATIONS FINANCIERES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('775800', 'AUTRES ELEMENTS D\'ACTIF', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('777000', 'Q-P SUBV. INVEST. AU RESULT. EXERC', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('778000', 'AUTRES PRODUITS EXCEPTIONNELS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('778100', 'BONIS PROVENANT CLAUSES D\'INDEXAT.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('778200', 'LOTS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('778300', 'BONIS RACHAT PAR ETS ACT. & OBLIG.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('778800', 'PRODUITS EXCEPTIONNELS DIVERS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('781000', 'REPRISES SUR AMORTISS. & PROVIS.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('781100', 'REPRIS. AMORT. IMMOB. CORP. & INC', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('781110', 'IMMOBILISATIONS INCORPORELLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('781120', 'IMMOBILISATIONS CORPORELLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('781500', 'REPRIS. PROVIS. RISQ. & CH. EXPLOI', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('781600', 'REP. PROV. DEPREC. IMM. CORP & INC', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('781610', 'IMMOBILISATIONS INCORPORELLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('781620', 'IMMOBILISATIONS CORPORELLES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('781700', 'REPRIS. PROV. DEPREC. ACT. CIRCUL.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('781730', 'STOCKS ET EN-COURS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('781740', 'CREANCES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('786000', 'REPRISES SUR PROVIS. POUR RISQUES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('786500', 'REP. PROV. RISQ. & CHARG. FINANC.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('786600', 'REPRIS. PROV. DEPREC. ELEM. FINANC', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('786620', 'IMMOBILISATIONS FINANCIERES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('786650', 'VALEURS MOBILIERES DE PLACEMENT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('787000', 'REPRISES SUR PROVISIONS', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('787200', 'REPRISES SUR PROV. REGLEMENTEES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('787250', 'AMORTISSEMENTS DEROGATOIRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('787260', 'PROVISION SPECIALE DE REEVALUATION', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('787270', 'PLUS-VALUES REINVESTIES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('787300', 'REPRISES SUR PROV. REGLEMENTEES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('787400', 'REPRIS. SUR AUTRES PROV. REGLEMENT', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('787500', 'REPRIS. PROV. RISQ. & CHARG. EXPL.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('787600', 'REPRIS. PROV. POUR DEPREC. EXCEPT.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('791000', 'TRANSFERTS DE CHARGES D\'EXPLOIT.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('796000', 'TRANSFERTS DE CHARGES FINANC.', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('797000', 'TRANSFERTS DE CHARGES EXCEPT.', 'A', '', '', ''); SELECT account_save(NULL,'201000','FRAIS D\'ETABLISSEMENT','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'209000','SORTIE D\'IMMOBILISATION','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'474100','DIVERS A REINTEGRER','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'474200','BENEFICE SCM','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'475000','PLUS VALUES A COURT TERME','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'530000','CAISSE','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'760000','PRODUITS FINANCIERS','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'770000','PRODUITS EXCEPTIONNELS','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'530010','CAISSE','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'607000','ACHATS DE MARCHANDISES','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'622700','FRAIS D\'ACTES ET DE CONTENTIEUX','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'438600','AUTRES CHARGES A PAYER','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'473000','DIVERS A DEDUIRE','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'613200','LOCATIONS IMMOBILIERES','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'616000','PRIMES D\'ASSURANCE','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'633800','AUTRES','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'695000','IMPOTS SUR LES BENEFICES','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'108100','COMPTE DE LEXPLOITANT','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'512030','EPARGNE','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); SELECT account_heading_save(NULL, '100000', 'CLASSE 1', NULL); SELECT account_heading_save(NULL, '300000', 'CLASSE 3', NULL); SELECT account_heading_save(NULL, '500000', 'CLASSE 5', NULL); SELECT account_heading_save(NULL, '600000', 'CLASSE 6', NULL); SELECT account_heading_save(NULL, '700000', 'CLASSE 7', NULL); SELECT account_save(NULL,'108000','COMPTE DE LEXPLOITANT','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'200001','IMMOBILISATION','E','', NULL, false, false, string_to_array('', ':')); SELECT account_heading_save(NULL, '200000', 'CLASSE 2', NULL); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('400001', 'FOURNISSEURS ET COMPTES RATTACHES', 'A', '', '', ''); SELECT account_heading_save(NULL, '400000', 'CLASSE 4', NULL); SELECT account_save(NULL,'695100','IMPOTS DUS EN FRANCE','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'646000','COTIS. SOCIAL. PERSON. EXPLOITANT','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'645000','CHARGES DE SECUR. SOC. ET PREVOY.','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'617000','ETUDES ET RECHERCHES','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'615000','ENTRETIEN ET REPARATIONS','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'613500','LOCATIONS MOBILIERES','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'611000','SOUS-TRAITANCE GENERALE','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'695500','DEBOURS PAYES POUR LE COMPTE','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'690000','PARTICIP. SAL. / IMPOTS SUR BEN.','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'687600','DOTAT. AUX PROV. DEPREC. EXCEPT.','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'681000','DOTATIONS AUX AMORT. & AUX PROVIS.','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'628100','CONCOURS DIVERS (COTISATIONS,...)','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'625600','MISSIONS','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'645800','COTISATIONS AUX AUTRES ORG. SOC.','E','', NULL, false, false, string_to_array('AP_amount', ':')); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('641000', 'REMUNERATIONS DU PERSONNEL', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('625020', 'DEPLACEMENTS MOTO', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('622600', 'HONORAIRES', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('621100', 'PERSONNEL INTERIMAIRE', 'A', '', '', ''); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('445500', 'TAXES SUR CA A DECAISSER', 'A', '', '', ''); SELECT account_save(NULL,'706000','PRESTATIONS DE SERVICES','I','', NULL, false, false, string_to_array('IC_income', ':')); SELECT account_save(NULL,'707000','VENTES DE MARCHANDISES','I','', NULL, false, false, string_to_array('IC_sale', ':')); SELECT account_save(NULL,'445713','TVA COLLECTEE 19.6%','I','', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'512020','BANQUE DEBIT','E','', NULL, false, false, string_to_array('AP', ':')); SELECT account_save(NULL,'445711','TVA COLLECTEE 5.5%','I','', NULL, false, false, string_to_array('AR_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'445661','TVA DEDUCTIBLE 5.5%','E','', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'512010','BANQUE CREDIT','I','', NULL, false, false, string_to_array('AR_amount', ':')); SELECT account_save(NULL,'681730','STOCKS ET EN-COURS','A','', NULL, false, false, string_to_array('IC', ':')); SELECT account_save(NULL,'580010','VIREMENT INTERNE','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'580000','VIREMENT INTERNE','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'766000','GAINS DE CHANGE','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':')); SELECT account_save(NULL,'472000','MOINS VALUES A COURT TERME','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'474000','DEFICIT SCM','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'670000','CHARGES FINANCIERES','E','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'645100','COTISATIONS A L\'URSSAF','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'645200','COTISATIONS AUX MUTUELES','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'645300','COTISATIONS AUX CAISSES RETR.','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'646400','COTISATIONS AUX ASSEDIC','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'623400','CADEAUX A LA CLIENTELE','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'437000','AUTRES ORGANISMES SOCIAUX','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'606100','FOURNITURES NON STOCK. EAU ENERG.','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'606300','FOURNIT. ENTRETIEN & PETIT EQUIP.','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'625010','DEPLACEMENTS AUTO','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'635110','TAXE PROFESSIONNELLE','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'645001','CSG','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'660000','CHARGES FINANCIERES','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'666000','PERTES DE CHANGE','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'512040','EXPLOITANT','E','', NULL, false, false, string_to_array('AP_paid', ':')); SELECT account_save(NULL,'431000','SECURITE SOCIALE','E','', NULL, false, false, string_to_array('', ':')); INSERT INTO chart (accno, description, charttype, gifi_accno, category, link) VALUES ('609400', 'D\'ETUDES & PRESTATIONS DE SERVICES', 'A', '', '', ''); SELECT account_save(NULL,'625100','VOYAGES ET DEPLACEMENTS','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'618300','DOCUMENTATION TECHNIQUE','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'445663','TVA DEDUCTIBLE 19.6%','E','', NULL, false, false, string_to_array('AP_tax:IC_taxpart:IC_taxservice', ':')); SELECT account_save(NULL,'601000','ACHATS STOCKES MAT. PREM. (FOURN.)','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':')); SELECT account_save(NULL,'626000','FRAIS POSTAUX ET TELECOMMUNIC.','E','', NULL, false, false, string_to_array('AP_amount', ':')); SELECT account_save(NULL,'512000','BANQUE','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':')); -- SELECT account_save(NULL,'999000','Foreign Exchange Gain','I','', NULL, false, false, string_to_array('', ':')); SELECT account_save(NULL,'999010','Foreign Exchange Loss','E','', NULL, false, false, string_to_array('', ':')); SELECT cr_coa_to_account_save(accno, accno || '--' || description) FROM account WHERE id IN (select account_id FROM account_link WHERE description = 'AP_paid'); -- -- insert taxes -- INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '445661'), 0.055); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '445663'), 0.196); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '445711'), 0.055); INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '445713'), 0.196); -- -- update defaults -- INSERT INTO defaults (setting_key, value) VALUES ('inventory_accno_id', (select id from chart where accno = '681730')); INSERT INTO defaults (setting_key, value) VALUES ('income_accno_id', (select id from chart where accno = '707000')); INSERT INTO defaults (setting_key, value) VALUES ('expense_accno_id', (select id from chart where accno = '601000')); INSERT INTO defaults (setting_key, value) VALUES ('fxgain_accno_id', (select id from chart where accno = '999000')); INSERT INTO defaults (setting_key, value) VALUES ('fxloss_accno_id', (select id from chart where accno = '999010')); INSERT INTO defaults (setting_key, value) VALUES ('curr', 'EUR'); INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg'); -- commit; UPDATE account SET tax = true WHERE id IN (SELECT account_id FROM account_link WHERE description LIKE '%_tax'); ledgersmb/sql/Pg-database.sql0000644000000000000000000052773012057054327015173 0ustar rootrootCREATE LANGUAGE PLPGSQL; -- separate transaction since may already exist CREATE EXTENSION tablefunc; -- Separate transaction, only needed for 9.1 CREATE EXTENSION pg_trgm; -- Separate transaction, only needed for 9.1 CREATE EXTENSION btree_gist; -- Separate transaction, only needed for 9.1 begin; CREATE SEQUENCE id; -- As of 1.3 there is no central db anymore. --CT CREATE OR REPLACE FUNCTION concat_colon(TEXT, TEXT) returns TEXT as $$ select CASE WHEN $1 IS NULL THEN $2 ELSE $1 || ':' || $2 END; $$ language sql; COMMENT ON FUNCTION concat_colon(TEXT, TEXT) IS $$ This function takes two arguments and creates a list out of them. It's useful as an aggregate base (see aggregate concat_colon). However this is a temporary function only and should not be relied upon.$$; --' CREATE AGGREGATE concat_colon ( BASETYPE = text, STYPE = text, SFUNC = concat_colon ); COMMENT ON AGGREGATE concat_colon(text) IS $$ This is a sumple aggregate to return values from the database in a colon-separated list. Other programs probably should not rely on this since it is primarily included for the chart view.$$; CREATE TABLE account_heading ( id serial not null unique, accno text primary key, parent_id int references account_heading(id), description text ); COMMENT ON TABLE account_heading IS $$ This table holds the account headings in the system. Each account must belong to a heading, and a heading can belong to another heading. In this way it is possible to nest accounts for reporting purposes.$$; CREATE TABLE account ( id serial not null unique, accno text primary key, description text, category CHAR(1) NOT NULL, gifi_accno text, heading int not null references account_heading(id), contra bool not null default false, tax bool not null default false ); COMMENT ON TABLE account IS $$ This table stores the main account info.$$; CREATE TABLE account_checkpoint ( end_date date not null, account_id int not null references account(id), amount numeric not null, id serial not null unique, debits NUMERIC, credits NUMERIC, primary key (end_date, account_id) ); COMMENT ON TABLE account_checkpoint IS $$ This table holds account balances at various dates. Transactions MUST NOT be posted prior to the latest end_date in this table, and no unapproved transactions (vouchers or drafts) can remain in the closed period.$$; CREATE TABLE account_link_description ( description text primary key, summary boolean not null, custom boolean not null ); COMMENT ON TABLE account_link_description IS $$ This is a lookup table which provide basic information as to categories and dropdowns of accounts. In general summary accounts cannot belong to more than one category (an AR summary account cannot appear in other dropdowns for example). Custom fields are not overwritten when the account is edited from the front-end.$$; INSERT INTO account_link_description (description, summary, custom) VALUES --summary links ('AR', TRUE, FALSE), ('AP', TRUE, FALSE), ('IC', TRUE, FALSE), --custom links NOT INCLUDED ('AR_amount', FALSE, FALSE), ('AR_tax', FALSE, FALSE), ('AR_paid', FALSE, FALSE), ('AR_overpayment', FALSE, FALSE), ('AR_discount', FALSE, FALSE), ('AP_amount', FALSE, FALSE), ('AP_expense', FALSE, FALSE), ('AP_tax', FALSE, FALSE), ('AP_paid', FALSE, FALSE), ('AP_overpayment', FALSE, FALSE), ('AP_discount', FALSE, FALSE), ('IC_sale', FALSE, FALSE), ('IC_tax', FALSE, FALSE), ('IC_cogs', FALSE, FALSE), ('IC_taxpart', FALSE, FALSE), ('IC_taxservice', FALSE, FALSE), ('IC_income', FALSE, FALSE), ('IC_expense', FALSE, FALSE), ('Asset_Dep', FALSE, FALSE), ('Fixed_Asset', FALSE, FALSE), ('asset_expense', FALSE, FALSE), ('asset_gain', FALSE, FALSE), ('asset_loss', FALSE, FALSE); CREATE TABLE account_link ( account_id int references account(id), description text references account_link_description(description), primary key (account_id, description) ); CREATE VIEW chart AS SELECT id, accno, description, 'H' as charttype, NULL as category, NULL as link, NULL as account_heading, null as gifi_accno, false as contra, false as tax from account_heading UNION select c.id, c.accno, c.description, 'A' as charttype, c.category, concat_colon(l.description) as link, heading, gifi_accno, contra, tax from account c left join account_link l ON (c.id = l.account_id) group by c.id, c.accno, c.description, c.category, c.heading, c.gifi_accno, c.contra, c.tax; GRANT SELECT ON chart TO public; COMMENT ON VIEW chart IS $$Compatibility chart for 1.2 and earlier.$$; -- pricegroup added here due to references CREATE TABLE pricegroup ( id serial PRIMARY KEY, pricegroup text ); COMMENT ON TABLE pricegroup IS $$ Pricegroups are groups of customers who are assigned prices and discounts together.$$; --TABLE language moved here because of later references CREATE TABLE language ( code varchar(6) PRIMARY KEY, description text ); COMMENT ON TABLE language IS $$ Languages for manual translations and so forth.$$; INSERT INTO language (code, description) VALUES ('ar_EG', 'Arabic (Egypt)'), ('es_AR', 'Spanish (Argentina)'), ('bg', 'Bulgarian'), ('ca', 'Catalan'), ('cs', 'Czech'), ('da', 'Danish'), ('de', 'German'), ('de_CH', 'German (Switzerland)'), ('el', 'Greek'), ('en', 'English'), ('en_US', 'English (US)'), ('en_GB', 'English (UK)'), ('es', 'Spanish'), ('es_CO', 'Spanish (Colombia)'), ('es_EC', 'Spanish (Ecuador)'), ('es_MX', 'Spanish (Mexico)'), ('es_PA', 'Spanish (Panama)'), ('es_PY', 'Spanish (Paraguay)'), ('es_VE', 'Spanish (Venezuela)'), ('et', 'Estonian'), ('fi', 'Finnish'), ('fr', 'French'), ('fr_BE', 'French (Belgium)'), ('fr_CA', 'French (Canada)'), ('hu', 'Hungarian'), ('id', 'Indonesian'), ('is', 'Icelandic'), ('it', 'Italian'), ('lt', 'Latvian'), ('nb', 'Norwegian'), ('nl', 'Dutch'), ('nl_BE', 'Dutch (Belgium)'), ('pl', 'Polish'), ('pt', 'Portuguese'), ('pt_BR', 'Portuguese (Brazil)'), ('ru', 'Russian'), ('sv', 'Swedish'), ('tr', 'Turkish'), ('uk', 'Ukranian'), ('zh_CN', 'Chinese (China)'), ('zh_TW', 'Chinese (Taiwan)'); -- country and tax form CREATE TABLE country ( id serial PRIMARY KEY, name text check (name ~ '[[:alnum:]_]') NOT NULL, short_name text check (short_name ~ '[[:alnum:]_]') NOT NULL, itu text); COMMENT ON COLUMN country.itu IS $$ The ITU Telecommunication Standardization Sector code for calling internationally. For example, the US is 1, Great Britain is 44 $$; CREATE UNIQUE INDEX country_name_idx on country(lower(name)); -- Populate some country data INSERT INTO country(short_name,name) VALUES ('AC','Ascension Island'); INSERT INTO country(short_name,name) VALUES ('AD','Andorra'); INSERT INTO country(short_name,name) VALUES ('AE','United Arab Emirates'); INSERT INTO country(short_name,name) VALUES ('AF','Afghanistan'); INSERT INTO country(short_name,name) VALUES ('AG','Antigua and Barbuda'); INSERT INTO country(short_name,name) VALUES ('AI','Anguilla'); INSERT INTO country(short_name,name) VALUES ('AL','Albania'); INSERT INTO country(short_name,name) VALUES ('AM','Armenia'); INSERT INTO country(short_name,name) VALUES ('AN','Netherlands Antilles'); INSERT INTO country(short_name,name) VALUES ('AO','Angola'); INSERT INTO country(short_name,name) VALUES ('AQ','Antarctica'); INSERT INTO country(short_name,name) VALUES ('AR','Argentina'); INSERT INTO country(short_name,name) VALUES ('AS','American Samoa'); INSERT INTO country(short_name,name) VALUES ('AT','Austria'); INSERT INTO country(short_name,name) VALUES ('AU','Australia'); INSERT INTO country(short_name,name) VALUES ('AW','Aruba'); INSERT INTO country(short_name,name) VALUES ('AX','Aland Islands'); INSERT INTO country(short_name,name) VALUES ('AZ','Azerbaijan'); INSERT INTO country(short_name,name) VALUES ('BA','Bosnia and Herzegovina'); INSERT INTO country(short_name,name) VALUES ('BB','Barbados'); INSERT INTO country(short_name,name) VALUES ('BD','Bangladesh'); INSERT INTO country(short_name,name) VALUES ('BE','Belgium'); INSERT INTO country(short_name,name) VALUES ('BF','Burkina Faso'); INSERT INTO country(short_name,name) VALUES ('BG','Bulgaria'); INSERT INTO country(short_name,name) VALUES ('BH','Bahrain'); INSERT INTO country(short_name,name) VALUES ('BI','Burundi'); INSERT INTO country(short_name,name) VALUES ('BJ','Benin'); INSERT INTO country(short_name,name) VALUES ('BM','Bermuda'); INSERT INTO country(short_name,name) VALUES ('BN','Brunei Darussalam'); INSERT INTO country(short_name,name) VALUES ('BO','Bolivia'); INSERT INTO country(short_name,name) VALUES ('BR','Brazil'); INSERT INTO country(short_name,name) VALUES ('BS','Bahamas'); INSERT INTO country(short_name,name) VALUES ('BT','Bhutan'); INSERT INTO country(short_name,name) VALUES ('BV','Bouvet Island'); INSERT INTO country(short_name,name) VALUES ('BW','Botswana'); INSERT INTO country(short_name,name) VALUES ('BY','Belarus'); INSERT INTO country(short_name,name) VALUES ('BZ','Belize'); INSERT INTO country(short_name,name) VALUES ('CA','Canada'); INSERT INTO country(short_name,name) VALUES ('CC','Cocos (Keeling) Islands'); INSERT INTO country(short_name,name) VALUES ('CD','Congo, Democratic Republic'); INSERT INTO country(short_name,name) VALUES ('CF','Central African Republic'); INSERT INTO country(short_name,name) VALUES ('CG','Congo'); INSERT INTO country(short_name,name) VALUES ('CH','Switzerland'); INSERT INTO country(short_name,name) VALUES ('CI','Cote D''Ivoire (Ivory Coast)'); INSERT INTO country(short_name,name) VALUES ('CK','Cook Islands'); INSERT INTO country(short_name,name) VALUES ('CL','Chile'); INSERT INTO country(short_name,name) VALUES ('CM','Cameroon'); INSERT INTO country(short_name,name) VALUES ('CN','China'); INSERT INTO country(short_name,name) VALUES ('CO','Colombia'); INSERT INTO country(short_name,name) VALUES ('CR','Costa Rica'); INSERT INTO country(short_name,name) VALUES ('CS','Czechoslovakia (former)'); INSERT INTO country(short_name,name) VALUES ('CU','Cuba'); INSERT INTO country(short_name,name) VALUES ('CV','Cape Verde'); INSERT INTO country(short_name,name) VALUES ('CX','Christmas Island'); INSERT INTO country(short_name,name) VALUES ('CY','Cyprus'); INSERT INTO country(short_name,name) VALUES ('CZ','Czech Republic'); INSERT INTO country(short_name,name) VALUES ('DE','Germany'); INSERT INTO country(short_name,name) VALUES ('DJ','Djibouti'); INSERT INTO country(short_name,name) VALUES ('DK','Denmark'); INSERT INTO country(short_name,name) VALUES ('DM','Dominica'); INSERT INTO country(short_name,name) VALUES ('DO','Dominican Republic'); INSERT INTO country(short_name,name) VALUES ('DZ','Algeria'); INSERT INTO country(short_name,name) VALUES ('EC','Ecuador'); INSERT INTO country(short_name,name) VALUES ('EE','Estonia'); INSERT INTO country(short_name,name) VALUES ('EG','Egypt'); INSERT INTO country(short_name,name) VALUES ('EH','Western Sahara'); INSERT INTO country(short_name,name) VALUES ('ER','Eritrea'); INSERT INTO country(short_name,name) VALUES ('ES','Spain'); INSERT INTO country(short_name,name) VALUES ('ET','Ethiopia'); INSERT INTO country(short_name,name) VALUES ('FI','Finland'); INSERT INTO country(short_name,name) VALUES ('FJ','Fiji'); INSERT INTO country(short_name,name) VALUES ('FK','Falkland Islands (Malvinas)'); INSERT INTO country(short_name,name) VALUES ('FM','Micronesia'); INSERT INTO country(short_name,name) VALUES ('FO','Faroe Islands'); INSERT INTO country(short_name,name) VALUES ('FR','France'); INSERT INTO country(short_name,name) VALUES ('FX','France, Metropolitan'); INSERT INTO country(short_name,name) VALUES ('GA','Gabon'); INSERT INTO country(short_name,name) VALUES ('GB','Great Britain (UK)'); INSERT INTO country(short_name,name) VALUES ('GD','Grenada'); INSERT INTO country(short_name,name) VALUES ('GE','Georgia'); INSERT INTO country(short_name,name) VALUES ('GF','French Guiana'); INSERT INTO country(short_name,name) VALUES ('GH','Ghana'); INSERT INTO country(short_name,name) VALUES ('GI','Gibraltar'); INSERT INTO country(short_name,name) VALUES ('GL','Greenland'); INSERT INTO country(short_name,name) VALUES ('GM','Gambia'); INSERT INTO country(short_name,name) VALUES ('GN','Guinea'); INSERT INTO country(short_name,name) VALUES ('GP','Guadeloupe'); INSERT INTO country(short_name,name) VALUES ('GQ','Equatorial Guinea'); INSERT INTO country(short_name,name) VALUES ('GR','Greece'); INSERT INTO country(short_name,name) VALUES ('GS','S. Georgia and S. Sandwich Isls.'); INSERT INTO country(short_name,name) VALUES ('GT','Guatemala'); INSERT INTO country(short_name,name) VALUES ('GU','Guam'); INSERT INTO country(short_name,name) VALUES ('GW','Guinea-Bissau'); INSERT INTO country(short_name,name) VALUES ('GY','Guyana'); INSERT INTO country(short_name,name) VALUES ('HK','Hong Kong'); INSERT INTO country(short_name,name) VALUES ('HM','Heard and McDonald Islands'); INSERT INTO country(short_name,name) VALUES ('HN','Honduras'); INSERT INTO country(short_name,name) VALUES ('HR','Croatia (Hrvatska)'); INSERT INTO country(short_name,name) VALUES ('HT','Haiti'); INSERT INTO country(short_name,name) VALUES ('HU','Hungary'); INSERT INTO country(short_name,name) VALUES ('ID','Indonesia'); INSERT INTO country(short_name,name) VALUES ('IE','Ireland'); INSERT INTO country(short_name,name) VALUES ('IL','Israel'); INSERT INTO country(short_name,name) VALUES ('IM','Isle of Man'); INSERT INTO country(short_name,name) VALUES ('IN','India'); INSERT INTO country(short_name,name) VALUES ('IO','British Indian Ocean Territory'); INSERT INTO country(short_name,name) VALUES ('IQ','Iraq'); INSERT INTO country(short_name,name) VALUES ('IR','Iran'); INSERT INTO country(short_name,name) VALUES ('IS','Iceland'); INSERT INTO country(short_name,name) VALUES ('IT','Italy'); INSERT INTO country(short_name,name) VALUES ('JE','Jersey'); INSERT INTO country(short_name,name) VALUES ('JM','Jamaica'); INSERT INTO country(short_name,name) VALUES ('JO','Jordan'); INSERT INTO country(short_name,name) VALUES ('JP','Japan'); INSERT INTO country(short_name,name) VALUES ('KE','Kenya'); INSERT INTO country(short_name,name) VALUES ('KG','Kyrgyzstan'); INSERT INTO country(short_name,name) VALUES ('KH','Cambodia'); INSERT INTO country(short_name,name) VALUES ('KI','Kiribati'); INSERT INTO country(short_name,name) VALUES ('KM','Comoros'); INSERT INTO country(short_name,name) VALUES ('KN','Saint Kitts and Nevis'); INSERT INTO country(short_name,name) VALUES ('KP','Korea (North)'); INSERT INTO country(short_name,name) VALUES ('KR','Korea (South)'); INSERT INTO country(short_name,name) VALUES ('KW','Kuwait'); INSERT INTO country(short_name,name) VALUES ('KY','Cayman Islands'); INSERT INTO country(short_name,name) VALUES ('KZ','Kazakhstan'); INSERT INTO country(short_name,name) VALUES ('LA','Laos'); INSERT INTO country(short_name,name) VALUES ('LB','Lebanon'); INSERT INTO country(short_name,name) VALUES ('LC','Saint Lucia'); INSERT INTO country(short_name,name) VALUES ('LI','Liechtenstein'); INSERT INTO country(short_name,name) VALUES ('LK','Sri Lanka'); INSERT INTO country(short_name,name) VALUES ('LR','Liberia'); INSERT INTO country(short_name,name) VALUES ('LS','Lesotho'); INSERT INTO country(short_name,name) VALUES ('LT','Lithuania'); INSERT INTO country(short_name,name) VALUES ('LU','Luxembourg'); INSERT INTO country(short_name,name) VALUES ('LV','Latvia'); INSERT INTO country(short_name,name) VALUES ('LY','Libya'); INSERT INTO country(short_name,name) VALUES ('MA','Morocco'); INSERT INTO country(short_name,name) VALUES ('MC','Monaco'); INSERT INTO country(short_name,name) VALUES ('MD','Moldova'); INSERT INTO country(short_name,name) VALUES ('MG','Madagascar'); INSERT INTO country(short_name,name) VALUES ('MH','Marshall Islands'); INSERT INTO country(short_name,name) VALUES ('MK','F.Y.R.O.M. (Macedonia)'); INSERT INTO country(short_name,name) VALUES ('ML','Mali'); INSERT INTO country(short_name,name) VALUES ('MM','Myanmar'); INSERT INTO country(short_name,name) VALUES ('MN','Mongolia'); INSERT INTO country(short_name,name) VALUES ('MO','Macau'); INSERT INTO country(short_name,name) VALUES ('MP','Northern Mariana Islands'); INSERT INTO country(short_name,name) VALUES ('MQ','Martinique'); INSERT INTO country(short_name,name) VALUES ('MR','Mauritania'); INSERT INTO country(short_name,name) VALUES ('MS','Montserrat'); INSERT INTO country(short_name,name) VALUES ('MT','Malta'); INSERT INTO country(short_name,name) VALUES ('MU','Mauritius'); INSERT INTO country(short_name,name) VALUES ('MV','Maldives'); INSERT INTO country(short_name,name) VALUES ('MW','Malawi'); INSERT INTO country(short_name,name) VALUES ('MX','Mexico'); INSERT INTO country(short_name,name) VALUES ('MY','Malaysia'); INSERT INTO country(short_name,name) VALUES ('MZ','Mozambique'); INSERT INTO country(short_name,name) VALUES ('NA','Namibia'); INSERT INTO country(short_name,name) VALUES ('NC','New Caledonia'); INSERT INTO country(short_name,name) VALUES ('NE','Niger'); INSERT INTO country(short_name,name) VALUES ('NF','Norfolk Island'); INSERT INTO country(short_name,name) VALUES ('NG','Nigeria'); INSERT INTO country(short_name,name) VALUES ('NI','Nicaragua'); INSERT INTO country(short_name,name) VALUES ('NL','Netherlands'); INSERT INTO country(short_name,name) VALUES ('NO','Norway'); INSERT INTO country(short_name,name) VALUES ('NP','Nepal'); INSERT INTO country(short_name,name) VALUES ('NR','Nauru'); INSERT INTO country(short_name,name) VALUES ('NT','Neutral Zone'); INSERT INTO country(short_name,name) VALUES ('NU','Niue'); INSERT INTO country(short_name,name) VALUES ('NZ','New Zealand (Aotearoa)'); INSERT INTO country(short_name,name) VALUES ('OM','Oman'); INSERT INTO country(short_name,name) VALUES ('PA','Panama'); INSERT INTO country(short_name,name) VALUES ('PE','Peru'); INSERT INTO country(short_name,name) VALUES ('PF','French Polynesia'); INSERT INTO country(short_name,name) VALUES ('PG','Papua New Guinea'); INSERT INTO country(short_name,name) VALUES ('PH','Philippines'); INSERT INTO country(short_name,name) VALUES ('PK','Pakistan'); INSERT INTO country(short_name,name) VALUES ('PL','Poland'); INSERT INTO country(short_name,name) VALUES ('PM','St. Pierre and Miquelon'); INSERT INTO country(short_name,name) VALUES ('PN','Pitcairn'); INSERT INTO country(short_name,name) VALUES ('PR','Puerto Rico'); INSERT INTO country(short_name,name) VALUES ('PS','Palestinian Territory, Occupied'); INSERT INTO country(short_name,name) VALUES ('PT','Portugal'); INSERT INTO country(short_name,name) VALUES ('PW','Palau'); INSERT INTO country(short_name,name) VALUES ('PY','Paraguay'); INSERT INTO country(short_name,name) VALUES ('QA','Qatar'); INSERT INTO country(short_name,name) VALUES ('RE','Reunion'); INSERT INTO country(short_name,name) VALUES ('RO','Romania'); INSERT INTO country(short_name,name) VALUES ('RS','Serbia'); INSERT INTO country(short_name,name) VALUES ('RU','Russian Federation'); INSERT INTO country(short_name,name) VALUES ('RW','Rwanda'); INSERT INTO country(short_name,name) VALUES ('SA','Saudi Arabia'); INSERT INTO country(short_name,name) VALUES ('SB','Solomon Islands'); INSERT INTO country(short_name,name) VALUES ('SC','Seychelles'); INSERT INTO country(short_name,name) VALUES ('SD','Sudan'); INSERT INTO country(short_name,name) VALUES ('SE','Sweden'); INSERT INTO country(short_name,name) VALUES ('SG','Singapore'); INSERT INTO country(short_name,name) VALUES ('SH','St. Helena'); INSERT INTO country(short_name,name) VALUES ('SI','Slovenia'); INSERT INTO country(short_name,name) VALUES ('SJ','Svalbard & Jan Mayen Islands'); INSERT INTO country(short_name,name) VALUES ('SK','Slovak Republic'); INSERT INTO country(short_name,name) VALUES ('SL','Sierra Leone'); INSERT INTO country(short_name,name) VALUES ('SM','San Marino'); INSERT INTO country(short_name,name) VALUES ('SN','Senegal'); INSERT INTO country(short_name,name) VALUES ('SO','Somalia'); INSERT INTO country(short_name,name) VALUES ('SR','Suriname'); INSERT INTO country(short_name,name) VALUES ('ST','Sao Tome and Principe'); INSERT INTO country(short_name,name) VALUES ('SU','USSR (former)'); INSERT INTO country(short_name,name) VALUES ('SV','El Salvador'); INSERT INTO country(short_name,name) VALUES ('SY','Syria'); INSERT INTO country(short_name,name) VALUES ('SZ','Swaziland'); INSERT INTO country(short_name,name) VALUES ('TC','Turks and Caicos Islands'); INSERT INTO country(short_name,name) VALUES ('TD','Chad'); INSERT INTO country(short_name,name) VALUES ('TF','French Southern Territories'); INSERT INTO country(short_name,name) VALUES ('TG','Togo'); INSERT INTO country(short_name,name) VALUES ('TH','Thailand'); INSERT INTO country(short_name,name) VALUES ('TJ','Tajikistan'); INSERT INTO country(short_name,name) VALUES ('TK','Tokelau'); INSERT INTO country(short_name,name) VALUES ('TM','Turkmenistan'); INSERT INTO country(short_name,name) VALUES ('TN','Tunisia'); INSERT INTO country(short_name,name) VALUES ('TO','Tonga'); INSERT INTO country(short_name,name) VALUES ('TP','East Timor'); INSERT INTO country(short_name,name) VALUES ('TR','Turkey'); INSERT INTO country(short_name,name) VALUES ('TT','Trinidad and Tobago'); INSERT INTO country(short_name,name) VALUES ('TV','Tuvalu'); INSERT INTO country(short_name,name) VALUES ('TW','Taiwan'); INSERT INTO country(short_name,name) VALUES ('TZ','Tanzania'); INSERT INTO country(short_name,name) VALUES ('UA','Ukraine'); INSERT INTO country(short_name,name) VALUES ('UG','Uganda'); INSERT INTO country(short_name,name) VALUES ('UK','United Kingdom'); INSERT INTO country(short_name,name) VALUES ('UM','US Minor Outlying Islands'); INSERT INTO country(short_name,name) VALUES ('US','United States'); INSERT INTO country(short_name,name) VALUES ('UY','Uruguay'); INSERT INTO country(short_name,name) VALUES ('UZ','Uzbekistan'); INSERT INTO country(short_name,name) VALUES ('VA','Vatican City State (Holy See)'); INSERT INTO country(short_name,name) VALUES ('VC','Saint Vincent & the Grenadines'); INSERT INTO country(short_name,name) VALUES ('VE','Venezuela'); INSERT INTO country(short_name,name) VALUES ('VG','British Virgin Islands'); INSERT INTO country(short_name,name) VALUES ('VI','Virgin Islands (U.S.)'); INSERT INTO country(short_name,name) VALUES ('VN','Viet Nam'); INSERT INTO country(short_name,name) VALUES ('VU','Vanuatu'); INSERT INTO country(short_name,name) VALUES ('WF','Wallis and Futuna Islands'); INSERT INTO country(short_name,name) VALUES ('WS','Samoa'); INSERT INTO country(short_name,name) VALUES ('YE','Yemen'); INSERT INTO country(short_name,name) VALUES ('YT','Mayotte'); INSERT INTO country(short_name,name) VALUES ('YU','Yugoslavia (former)'); INSERT INTO country(short_name,name) VALUES ('ZA','South Africa'); INSERT INTO country(short_name,name) VALUES ('ZM','Zambia'); INSERT INTO country(short_name,name) VALUES ('ZR','Zaire'); INSERT INTO country(short_name,name) VALUES ('ZW','Zimbabwe'); create table country_tax_form (country_id int references country(id) not null, form_name text not null, id serial not null unique, default_reportable bool not null default false, primary key(country_id, form_name) ); COMMENT ON TABLE country_tax_form IS $$ This table was designed for holding information relating to reportable sales or purchases, such as IRS 1099 forms and international equivalents.$$; -- BEGIN new entity management CREATE TABLE entity_class ( id serial primary key, class text check (class ~ '[[:alnum:]_]') NOT NULL, country_id int references country(id), active boolean not null default TRUE); COMMENT ON TABLE entity_class IS $$ Defines the class type such as vendor, customer, contact, employee $$; COMMENT ON COLUMN entity_class.id IS $$ The first 7 values are reserved and permanent. Individuals who create new classes, however, should coordinate with others for ranges to use.$$; CREATE index entity_class_idx ON entity_class(lower(class)); CREATE TABLE entity ( id serial UNIQUE, name text check (name ~ '[[:alnum:]_]'), entity_class integer references entity_class(id) not null , created date not null default current_date, control_code text unique, country_id int references country(id) not null, PRIMARY KEY(control_code, entity_class)); COMMENT ON TABLE entity IS $$ The primary entity table to map to all contacts $$; COMMENT ON COLUMN entity.name IS $$ This is the common name of an entity. If it was a person it may be Joshua Drake, a company Acme Corp. You may also choose to use a domain such as commandprompt.com $$; ALTER TABLE entity ADD FOREIGN KEY (entity_class) REFERENCES entity_class(id); INSERT INTO entity_class (id,class) VALUES (1,'Vendor'); INSERT INTO entity_class (id,class) VALUES (2,'Customer'); INSERT INTO entity_class (id,class) VALUES (3,'Employee'); INSERT INTO entity_class (id,class) VALUES (4,'Contact'); INSERT INTO entity_class (id,class) VALUES (5,'Lead'); INSERT INTO entity_class (id,class) VALUES (6,'Referral'); SELECT setval('entity_class_id_seq',7); CREATE TABLE entity_class_to_entity ( entity_class_id integer not null references entity_class(id) ON DELETE CASCADE, entity_id integer not null references entity(id) ON DELETE CASCADE, PRIMARY KEY(entity_class_id,entity_id) ); COMMENT ON TABLE entity_class_to_entity IS $$ Relation builder for classes to entity $$; -- USERS stuff -- CREATE TABLE users ( id serial UNIQUE, username varchar(30) primary key, notify_password interval not null default '7 days'::interval, entity_id int not null references entity(id) on delete cascade ); COMMENT ON TABLE users IS $$username is the actual primary key here because we do not want duplicate users$$; CREATE OR REPLACE FUNCTION person__get_my_entity_id() RETURNS INT AS $$ SELECT entity_id from users where username = SESSION_USER; $$ LANGUAGE SQL; COMMENT ON FUNCTION person__get_my_entity_id() IS $$ Returns the entity_id of the current, logged in user.$$; create table lsmb_roles ( user_id integer not null references users(id) ON DELETE CASCADE, role text not null ); COMMENT ON TABLE lsmb_roles IS $$ Tracks role assignments in the front end. Not sure why we need this. Will rethink for 1.4. $$; -- Session tracking table CREATE TABLE session( session_id serial PRIMARY KEY, token VARCHAR(32) CHECK(length(token) = 32), last_used TIMESTAMP default now(), ttl int default 3600 not null, users_id INTEGER NOT NULL references users(id), notify_pasword interval not null default '7 days'::interval ); COMMENT ON TABLE session IS $$ This table is used to track sessions on a database level across page requests (discretionary locks,open forms for anti-xsrf measures). Because of the way LedgerSMB authentication works currently we do not time out authentication when the session times out. We do time out highly pessimistic locks used for large batch payment workflows.$$; CREATE TABLE open_forms ( id SERIAL PRIMARY KEY, session_id int REFERENCES session(session_id) ON DELETE CASCADE ); COMMENT ON TABLE open_forms IS $$ This is our primary anti-xsrf measure, as this allows us to require a full round trip to the web server in order to save data.$$; -- CREATE TABLE transactions ( id int PRIMARY KEY, table_name text, locked_by int references "session" (session_id) ON DELETE SET NULL, approved_by int references entity (id), approved_at timestamp ); CREATE INDEX transactions_locked_by_i ON transactions(locked_by); COMMENT on TABLE transactions IS $$ This table provides referential integrity between AR, AP, GL tables on one hand and acc_trans on the other, pending the refactoring of those tables. It also is used to provide discretionary locking of financial transactions across database connections, for example in batch payment workflows.$$; CREATE OR REPLACE FUNCTION lock_record (in_id int, in_session_id int) returns bool as $$ declare locked int; begin SELECT locked_by into locked from transactions where id = $1; IF NOT FOUND THEN RETURN FALSE; ELSEIF locked is not null AND locked <> $2 THEN RETURN FALSE; END IF; UPDATE transactions set locked_by = $2 where id = $1; RETURN TRUE; end; $$ language plpgsql; COMMENT ON FUNCTION lock_record(int, int) is $$ This function seeks to lock a record with an id of in_id to a session with an id of in_session_id. If possible, it returns true. If it is already locked, false. These are not hard locks and the application is free to disregard or not even ask. They time out when the session is destroyed. $$; COMMENT ON column transactions.locked_by IS $$ This should only be used in pessimistic locking measures as required by large batch work flows. $$; -- LOCATION AND COUNTRY CREATE TABLE location_class ( id serial UNIQUE, class text check (class ~ '[[:alnum:]_]') not null, authoritative boolean not null, PRIMARY KEY (class,authoritative)); COMMENT ON TABLE location_class is $$ Individuals seeking to add new location classes should coordinate with others. $$; CREATE UNIQUE INDEX lower_class_unique ON location_class(lower(class)); INSERT INTO location_class(id,class,authoritative) VALUES ('1','Billing',TRUE); INSERT INTO location_class(id,class,authoritative) VALUES ('2','Sales',TRUE); INSERT INTO location_class(id,class,authoritative) VALUES ('3','Shipping',TRUE); SELECT SETVAL('location_class_id_seq',4); CREATE TABLE location ( id serial PRIMARY KEY, line_one text check (line_one ~ '[[:alnum:]_]') NOT NULL, line_two text, line_three text, city text check (city ~ '[[:alnum:]_]') NOT NULL, state text check(state ~ '[[:alnum:]_]'), country_id integer not null REFERENCES country(id), mail_code text not null check (mail_code ~ '[[:alnum:]_]'), created date not null default now(), inactive_date timestamp default null, active boolean not null default TRUE ); COMMENT ON TABLE location IS $$ This table stores addresses, such as shipto and bill to addresses. $$; CREATE TABLE company ( id serial UNIQUE, entity_id integer not null references entity(id), legal_name text check (legal_name ~ '[[:alnum:]_]'), tax_id text, sic_code varchar, created date default current_date not null, PRIMARY KEY (entity_id,legal_name)); COMMENT ON COLUMN company.tax_id IS $$ In the US this would be a EIN. $$; CREATE TABLE company_to_location ( location_id integer references location(id) not null, location_class integer not null references location_class(id), company_id integer not null references company(id) ON DELETE CASCADE, PRIMARY KEY(location_id,company_id, location_class)); COMMENT ON TABLE company_to_location IS $$ This table is used for locations generic to companies. For contract-bound addresses, use eca_to_location instead $$; CREATE TABLE salutation ( id serial unique, salutation text primary key); INSERT INTO salutation (id,salutation) VALUES ('1','Dr.'); INSERT INTO salutation (id,salutation) VALUES ('2','Miss.'); INSERT INTO salutation (id,salutation) VALUES ('3','Mr.'); INSERT INTO salutation (id,salutation) VALUES ('4','Mrs.'); INSERT INTO salutation (id,salutation) VALUES ('5','Ms.'); INSERT INTO salutation (id,salutation) VALUES ('6','Sir.'); SELECT SETVAL('salutation_id_seq',7); CREATE TABLE person ( id serial PRIMARY KEY, entity_id integer references entity(id) not null, salutation_id integer references salutation(id), first_name text check (first_name ~ '[[:alnum:]_]') NOT NULL, middle_name text, last_name text check (last_name ~ '[[:alnum:]_]') NOT NULL, created date not null default current_date, unique(entity_id) -- needed due to entity_employee assumptions --CT ); COMMENT ON TABLE person IS $$ Every person, must have an entity to derive a common or display name. The correct way to get class information on a person would be person.entity_id->entity_class_to_entity.entity_id. $$; create table entity_employee ( entity_id integer references entity(id) not null unique, startdate date not null default current_date, enddate date, role varchar(20), ssn text, sales bool default 'f', manager_id integer references entity(id), employeenumber varchar(32), dob date, PRIMARY KEY (entity_id) ); COMMENT ON TABLE entity_employee IS $$ This contains employee-specific extensions to person/entity. $$; CREATE TABLE person_to_location ( location_id integer not null references location(id), location_class integer not null references location_class(id), person_id integer not null references person(id) ON DELETE CASCADE, PRIMARY KEY (location_id,person_id)); CREATE TABLE person_to_company ( location_id integer references location(id) not null, person_id integer not null references person(id) ON DELETE CASCADE, company_id integer not null references company(id) ON DELETE CASCADE, PRIMARY KEY (location_id,person_id)); COMMENT ON TABLE person_to_company IS $$ currently unused in the front-end, but can be used to map persons to companies.$$; CREATE TABLE entity_other_name ( entity_id integer not null references entity(id) ON DELETE CASCADE, other_name text check (other_name ~ '[[:alnum:]_]'), PRIMARY KEY (other_name, entity_id)); COMMENT ON TABLE entity_other_name IS $$ Similar to company_other_name, a person may be jd, Joshua Drake, linuxpoet... all are the same person. Currently unused in the front-end but will likely be added in future versions.$$; CREATE TABLE person_to_entity ( person_id integer not null references person(id) ON DELETE CASCADE, entity_id integer not null check (entity_id != person_id) references entity(id) ON DELETE CASCADE, related_how text, created date not null default current_date, PRIMARY KEY (person_id,entity_id)); COMMENT ON TABLE person_to_entity IS $$ This provides a map so that entities can also be used like groups.$$; CREATE TABLE company_to_entity ( company_id integer not null references company(id) ON DELETE CASCADE, entity_id integer check (company_id != entity_id) not null references entity(id) ON DELETE CASCADE, related_how text, created date not null default current_date, PRIMARY KEY (company_id,entity_id)); COMMENT ON TABLE company_to_entity IS $$ This provides a map so that entities can also be used like groups.$$; CREATE TABLE contact_class ( id serial UNIQUE, class text check (class ~ '[[:alnum:]_]') NOT NULL, PRIMARY KEY (class)); COMMENT ON TABLE contact_class IS $$ Stores type of contact information attached to companies and persons. Please coordinate with others before adding new types.$$; CREATE UNIQUE INDEX contact_class_class_idx ON contact_class(lower(class)); INSERT INTO contact_class (id,class) values (1,'Primary Phone'); INSERT INTO contact_class (id,class) values (2,'Secondary Phone'); INSERT INTO contact_class (id,class) values (3,'Cell Phone'); INSERT INTO contact_class (id,class) values (4,'AIM'); INSERT INTO contact_class (id,class) values (5,'Yahoo'); INSERT INTO contact_class (id,class) values (6,'Gtalk'); INSERT INTO contact_class (id,class) values (7,'MSN'); INSERT INTO contact_class (id,class) values (8,'IRC'); INSERT INTO contact_class (id,class) values (9,'Fax'); INSERT INTO contact_class (id,class) values (10,'Generic Jabber'); INSERT INTO contact_class (id,class) values (11,'Home Phone'); -- The e-mail classes are hard-coded into LedgerSMB/Form.pm by class_id -- i.e. 'class_id's 12 - 17 INSERT INTO contact_class (id,class) values (12,'Email'); INSERT INTO contact_class (id,class) values (13,'CC'); INSERT INTO contact_class (id,class) values (14,'BCC'); INSERT INTO contact_class (id,class) values (15,'Billing Email'); INSERT INTO contact_class (id,class) values (16,'Billing CC'); INSERT INTO contact_class (id,class) values (17,'Billing BCC'); SELECT SETVAL('contact_class_id_seq',17); CREATE TABLE person_to_contact ( person_id integer not null references person(id) ON DELETE CASCADE, contact_class_id integer references contact_class(id) not null, contact text check(contact ~ '[[:alnum:]_]') not null, description text, PRIMARY KEY (person_id,contact_class_id,contact)); COMMENT ON TABLE person_to_contact IS $$ This table stores contact information for persons$$; CREATE TABLE company_to_contact ( company_id integer not null references company(id) ON DELETE CASCADE, contact_class_id integer references contact_class(id) not null, contact text check(contact ~ '[[:alnum:]_]') not null, description text, PRIMARY KEY (company_id, contact_class_id, contact)); COMMENT ON TABLE person_to_contact IS $$ This table stores contact information for companies$$; CREATE TABLE entity_bank_account ( id serial not null, entity_id int not null references entity(id) ON DELETE CASCADE, bic varchar, iban varchar, UNIQUE (id), PRIMARY KEY (entity_id, bic, iban) ); COMMENT ON TABLE entity_bank_account IS $$This stores bank account information for both companies and persons.$$; COMMENT ON COLUMN entity_bank_account.bic IS $$ Banking Institution Code, such as routing number of SWIFT code.$$; COMMENT ON COLUMN entity_bank_account.iban IS $$ International Bank Account Number. used to store the actual account number for the banking institution.$$; CREATE TABLE entity_credit_account ( id serial not null unique, entity_id int not null references entity(id) ON DELETE CASCADE, entity_class int not null references entity_class(id) check ( entity_class in (1,2) ), pay_to_name text, discount numeric, description text, discount_terms int default 0, discount_account_id int references account(id), taxincluded bool default 'f', creditlimit NUMERIC default 0, terms int2 default 0, meta_number varchar(32), business_id int, language_code varchar(6) DEFAULT 'en' references language(code) ON DELETE SET DEFAULT, pricegroup_id int references pricegroup(id), curr char(3), startdate date DEFAULT CURRENT_DATE, enddate date, threshold numeric default 0, employee_id int references entity_employee(entity_id), primary_contact int references person(id), ar_ap_account_id int references account(id), cash_account_id int references account(id), bank_account int references entity_bank_account(id), taxform_id int references country_tax_form(id), PRIMARY KEY(entity_id, meta_number, entity_class), CHECK (ar_ap_account_id IS NOT NULL OR entity_id = 0) ); COMMENT ON TABLE entity_credit_account IS $$This table stores information relating to general relationships regarding moneys owed on invoice. Invoices, whether AR or AP, must be attached to a record in this table.$$; COMMENT ON COLUMN entity_credit_account.meta_number IS $$ This stores the human readable control code for the customer/vendor record. This is typically called the customer/vendor "account" in the application.$$; CREATE UNIQUE INDEX entity_credit_ar_accno_idx_u ON entity_credit_account(meta_number) WHERE entity_class = 2; COMMENT ON INDEX entity_credit_ar_accno_idx_u IS $$This index is used to ensure that AR accounts are not reused.$$; CREATE TABLE eca_to_contact ( credit_id integer not null references entity_credit_account(id) ON DELETE CASCADE, contact_class_id integer references contact_class(id) not null, contact text check(contact ~ '[[:alnum:]_]') not null, description text, PRIMARY KEY (credit_id, contact_class_id, contact)); COMMENT ON TABLE eca_to_contact IS $$ To keep track of the relationship between multiple contact methods and a single vendor or customer account. For generic contacts, use company_to_contact or person_to_contact instead.$$; CREATE TABLE eca_to_location ( location_id integer references location(id) not null, location_class integer not null references location_class(id), credit_id integer not null references entity_credit_account(id) ON DELETE CASCADE, PRIMARY KEY(location_id,credit_id, location_class)); CREATE UNIQUE INDEX eca_to_location_billing_u ON eca_to_location(credit_id) WHERE location_class = 1; COMMENT ON TABLE eca_to_location IS $$ This table is used for locations bound to contracts. For generic contact addresses, use company_to_location instead $$; -- Begin rocking notes interface -- Begin rocking notes interface CREATE TABLE note_class(id serial primary key, class text not null check (class ~ '[[:alnum:]_]')); INSERT INTO note_class(id,class) VALUES (1,'Entity'); INSERT INTO note_class(id,class) VALUES (2,'Invoice'); INSERT INTO note_class(id,class) VALUES (3,'Entity Credit Account'); CREATE UNIQUE INDEX note_class_idx ON note_class(lower(class)); COMMENT ON TABLE note_class IS $$ Coordinate with others before adding entries. $$; CREATE TABLE note (id serial primary key, note_class integer not null references note_class(id), note text not null, vector tsvector not null default '', created timestamp not null default now(), created_by text DEFAULT SESSION_USER, ref_key integer not null, subject text); COMMENT ON TABLE note IS $$ This is an abstract table which should have zero rows. It is inherited by other tables for specific notes.$$; COMMENT ON COLUMN note.ref_key IS $$ Subclassed tables use this column as a foreign key against the table storing the record a note is attached to.$$; COMMENT ON COLUMN note.note IS $$Body of note.$$; COMMENT ON COLUMN note.vector IS $$tsvector for full text indexing, requires both setting up tsearch dictionaries and adding triggers to use at present.$$; CREATE TABLE entity_note( entity_id int references entity(id), primary key(id)) INHERITS (note); ALTER TABLE entity_note ADD CHECK (note_class = 1); ALTER TABLE entity_note ADD FOREIGN KEY (ref_key) REFERENCES entity(id) ON DELETE CASCADE; CREATE INDEX entity_note_id_idx ON entity_note(id); CREATE UNIQUE INDEX entity_note_class_idx ON note_class(lower(class)); CREATE INDEX entity_note_vectors_idx ON entity_note USING gist(vector); CREATE TABLE invoice_note(primary key(id)) INHERITS (note); CREATE INDEX invoice_note_id_idx ON invoice_note(id); CREATE UNIQUE INDEX invoice_note_class_idx ON note_class(lower(class)); CREATE INDEX invoice_note_vectors_idx ON invoice_note USING gist(vector); CREATE TABLE eca_note(primary key(id)) INHERITS (note); ALTER TABLE eca_note ADD CHECK (note_class = 3); ALTER TABLE eca_note ADD FOREIGN KEY (ref_key) REFERENCES entity_credit_account(id) ON DELETE CASCADE; COMMENT ON TABLE eca_note IS $$ Notes for entity_credit_account entries.$$; COMMENT ON COLUMN eca_note.ref_key IS $$ references entity_credit_account.id$$; -- END entity -- CREATE TABLE makemodel ( parts_id int, make text, model text, PRIMARY KEY (parts_id, make, model) ); COMMENT ON TABLE makemodel IS $$ A single parts entry can have multiple make/model entries. These store manufacturer/model number info.$$; -- CREATE TABLE gl ( id int DEFAULT nextval ( 'id' ) PRIMARY KEY REFERENCES transactions(id), reference text, description text, transdate date DEFAULT current_date, person_id integer references person(id), notes text, approved bool default true, department_id int default 0 ); COMMENT ON TABLE gl IS $$ This table holds summary information for entries in the general journal. Does not hold summary information in 1.3 for AR or AP entries.$$; COMMENT ON COLUMN gl.person_id is $$ the person_id of the employee who created the entry.$$; -- CREATE TABLE gifi ( accno text PRIMARY KEY, description text ); COMMENT ON TABLE gifi IS $$ GIFI labels for accounts, used in Canada and some EU countries for tax reporting$$; -- CREATE TABLE defaults ( setting_key text primary key, value text ); COMMENT ON TABLE defaults IS $$ This is a free-form table for managing application settings per company database. We use key-value modelling here because this most accurately maps the actual semantics of the data. $$ ; \COPY defaults FROM stdin WITH DELIMITER '|' timeout|90 minutes sinumber|1 sonumber|1 yearend|1 businessnumber|1 version|1.3.25 closedto|\N revtrans|1 ponumber|1 sqnumber|1 rfqnumber|1 audittrail|0 vinumber|1 employeenumber|1 partnumber|1 customernumber|1 vendornumber|1 glnumber|1 projectnumber|1 queue_payments|0 poll_frequency|1 rcptnumber|1 paynumber|1 separate_duties|1 entity_control|A-00001 batch_cc|B-11111 check_prefix|CK \. -- */ -- batch stuff CREATE TABLE batch_class ( id serial unique, class varchar primary key ); COMMENT ON TABLE batch_class IS $$ These values are hard-coded. Please coordinate before adding standard values.$$; insert into batch_class (id,class) values (1,'ap'); insert into batch_class (id,class) values (2,'ar'); insert into batch_class (id,class) values (3,'payment'); insert into batch_class (id,class) values (4,'payment_reversal'); insert into batch_class (id,class) values (5,'gl'); insert into batch_class (id,class) values (6,'receipt'); insert into batch_class (id,class) values (7,'receipt_reversal'); SELECT SETVAL('batch_class_id_seq',6); CREATE TABLE batch ( id serial primary key, batch_class_id integer references batch_class(id) not null, control_code text NOT NULL, description text, default_date date not null, approved_on date default null, approved_by int references entity_employee(entity_id), created_by int references entity_employee(entity_id), locked_by int references session(session_id), created_on date default now(), CHECK (length(control_code) > 0) ); COMMENT ON TABLE batch IS $$ Stores batch header info. Batches are groups of vouchers that are posted together.$$; COMMENT ON COLUMN batch.batch_class_id IS $$ Note that this field is largely used for sorting the vouchers. A given batch is NOT restricted to this type.$$; -- Although I am moving the primary key to voucher.id for now, as of 1.4, I -- would expect trans_id to be primary key CREATE TABLE voucher ( trans_id int REFERENCES transactions(id) NOT NULL, batch_id int references batch(id) not null, id serial PRIMARY KEY, batch_class int references batch_class(id) not null ); COMMENT ON TABLE voucher IS $$Mapping transactions to batches for batch approval.$$; COMMENT ON COLUMN voucher.batch_class IS $$ This is the authoritative class of the voucher. $$; COMMENT ON COLUMN voucher.id IS $$ This is simply a surrogate key for easy reference.$$; CREATE TABLE acc_trans ( trans_id int NOT NULL REFERENCES transactions(id), chart_id int NOT NULL REFERENCES account(id), amount NUMERIC, transdate date DEFAULT current_date, source text, cleared bool DEFAULT 'f', fx_transaction bool DEFAULT 'f', project_id int, memo text, invoice_id int, approved bool default true, cleared_on date, reconciled_on date, voucher_id int references voucher(id), entry_id SERIAL PRIMARY KEY ); COMMENT ON TABLE acc_trans IS $$This table stores line items for financial transactions. Please note that payments in 1.3 are not full-fledged transactions.$$; COMMENT ON COLUMN acc_trans.source IS $$Document Source identifier for individual line items, usually used for payments.$$; CREATE INDEX acc_trans_voucher_id_idx ON acc_trans(voucher_id); -- CREATE TABLE parts ( id serial PRIMARY KEY, partnumber text, description text, unit varchar(5), listprice NUMERIC, sellprice NUMERIC, lastcost NUMERIC, priceupdate date DEFAULT current_date, weight numeric, onhand numeric DEFAULT 0, notes text, makemodel bool DEFAULT 'f', assembly bool DEFAULT 'f', alternate bool DEFAULT 'f', rop numeric, inventory_accno_id int, income_accno_id int, expense_accno_id int, bin text, obsolete bool DEFAULT 'f', bom bool DEFAULT 'f', image text, drawing text, microfiche text, partsgroup_id int, project_id int, avgcost NUMERIC ); COMMENT ON TABLE parts IS $$This stores detail information about goods and services. The type of part is currently defined according to the following rules: * If assembly is true, then an assembly * If inventory_accno_id, income_accno_id, and expense_accno_id are not null then a part. * If inventory_accno_id is null but the other two are not, then a service. * Otherwise, a labor/overhead entry. $$; COMMENT ON COLUMN parts.rop IS $$Re-order point. Used to select parts for short inventory report.$$; COMMENT ON COLUMN parts.bin IS $$Text identifier for where a part is stored.$$; COMMENT ON COLUMN parts.bom is $$Show on Bill of Materials.$$; COMMENT ON COLUMN parts.image IS $$Hyperlink to product image.$$; CREATE UNIQUE INDEX parts_partnumber_index_u ON parts (partnumber) WHERE obsolete is false; CREATE TABLE invoice ( id serial PRIMARY KEY, trans_id int REFERENCES transactions(id), parts_id int REFERENCES parts(id), description text, qty NUMERIC, allocated integer, sellprice NUMERIC, precision int, fxsellprice NUMERIC, discount numeric, assemblyitem bool DEFAULT 'f', unit varchar(5), project_id int, deliverydate date, serialnumber text, notes text ); COMMENT ON TABLE invoice IS $$Line items of invoices with goods/services attached.$$; COMMENT ON COLUMN invoice.allocated IS $$Number of allocated items, negative relative to qty. When qty + allocated = 0, then the item is fully used for purposes of COGS calculations.$$; COMMENT ON COLUMN invoice.qty IS $$Positive is normal for sales invoices, negative for vendor invoices.$$; -- Added for Entity but can't be added due to order ALTER TABLE invoice_note ADD FOREIGN KEY (ref_key) REFERENCES invoice(id); -- -- -- THe following credit accounts are used for inventory adjustments. INSERT INTO entity (id, name, entity_class, control_code,country_id) values (0, 'Inventory Entity', 1, 'AUTO-01','232'); INSERT INTO company (legal_name, entity_id) values ('Inventory Entity', 0); INSERT INTO entity_credit_account (entity_id, meta_number, entity_class) VALUES (0, '00000', 1); INSERT INTO entity_credit_account (entity_id, meta_number, entity_class) VALUES (0, '00000', 2); -- CREATE TABLE assembly ( id int REFERENCES parts(id), parts_id int REFERENCES parts(id), qty numeric, bom bool, adj bool, PRIMARY KEY (id, parts_id) ); COMMENT ON TABLE assembly IS $$Holds mapping for parts that are members of assemblies.$$; COMMENT ON COLUMN assembly.id IS $$This is the id of the assembly the part is being mapped to.$$; COMMENT ON COLUMN assembly.parts_id IS $$ID of part that is a member of the assembly.$$; -- CREATE TABLE ar ( id int DEFAULT nextval ( 'id' ) PRIMARY KEY REFERENCES transactions(id), invnumber text, transdate date DEFAULT current_date, entity_id int REFERENCES entity(id), taxincluded bool, amount NUMERIC, netamount NUMERIC, paid NUMERIC, datepaid date, duedate date, invoice bool DEFAULT 'f', shippingpoint text, terms int2 DEFAULT 0, notes text, curr char(3) CHECK ( (amount IS NULL AND curr IS NULL) OR (amount IS NOT NULL AND curr IS NOT NULL)), ordnumber text, person_id integer references entity_employee(entity_id), till varchar(20), quonumber text, intnotes text, department_id int default 0, shipvia text, language_code varchar(6), ponumber text, on_hold bool default false, reverse bool default false, approved bool default true, entity_credit_account int references entity_credit_account(id) not null, force_closed bool, description text, unique(invnumber) -- probably a good idea as per Erik's request --CT ); COMMENT ON TABLE ar IS $$ Summary/header information for AR transactions and sales invoices. Note that some constraints here are hard to enforce because we haven not gotten to rewriting the relevant code here. HV TODO drop entity_id $$; COMMENT ON COLUMN ar.invnumber IS $$ Text identifier for the invoice. Must be unique.$$; COMMENT ON COLUMN ar.invoice IS $$ True if the transaction tracks goods/services purchase using the invoice table. False otherwise.$$; COMMENT ON COLUMN ar.amount IS $$ This stores the total amount (including taxes) for the transaction.$$; COMMENT ON COLUMN ar.netamount IS $$ Total amount excluding taxes for the transaction.$$; COMMENT ON COLUMN ar.curr IS $$ 3 letters to identify the currency.$$; COMMENT ON COLUMN ar.ordnumber IS $$ Order Number$$; COMMENT ON COLUMN ar.ponumber is $$Purchase Order Number$$; COMMENT ON COLUMN ar.person_id IS $$Person who created the transaction$$; COMMENT ON COLUMN ar.quonumber IS $$Quotation Number$$; COMMENT ON COLUMN ar.notes IS $$These notes are displayed on the invoice when printed or emailed$$; COMMENT ON COLUMN ar.intnotes IS $$These notes are not displayed when the invoice is printed or emailed and may be updated without reposting hte invocie.$$; COMMENT ON COLUMN ar.reverse IS $$If true numbers are displayed after multiplying by -1$$; COMMENT ON COLUMN ar.approved IS $$Only show in financial reports if true.$$; COMMENT ON COLUMN ar.entity_credit_account IS $$ reference for the customer account used.$$; COMMENT ON COLUMN ar.force_closed IS $$ Not exposed to the UI, but can be set to prevent an invoice from showing up for payment or in outstanding reports.$$; -- CREATE TABLE ap ( id int DEFAULT nextval ( 'id' ) PRIMARY KEY REFERENCES transactions(id), invnumber text, transdate date DEFAULT current_date, entity_id int REFERENCES entity(id), taxincluded bool DEFAULT 'f', amount NUMERIC, netamount NUMERIC, paid NUMERIC, datepaid date, duedate date, invoice bool DEFAULT 'f', ordnumber text, curr char(3) CHECK ( (amount IS NULL AND curr IS NULL) OR (amount IS NOT NULL AND curr IS NOT NULL)) , -- This can be null, but shouldn't be. notes text, person_id integer references entity_employee(entity_id), till varchar(20), quonumber text, intnotes text, department_id int DEFAULT 0, shipvia text, language_code varchar(6), ponumber text, shippingpoint text, on_hold bool default false, approved bool default true, reverse bool default false, terms int2 DEFAULT 0, description text, force_closed bool, entity_credit_account int references entity_credit_account(id) NOT NULL ); COMMENT ON TABLE ap IS $$ Summary/header information for AP transactions and vendor invoices. Note that some constraints here are hard to enforce because we haven not gotten to rewriting the relevant code here. HV TODO drop entity_id $$; COMMENT ON COLUMN ap.invnumber IS $$ Text identifier for the invoice. Must be unique.$$; COMMENT ON COLUMN ap.invoice IS $$ True if the transaction tracks goods/services purchase using the invoice table. False otherwise.$$; COMMENT ON COLUMN ap.amount IS $$ This stores the total amount (including taxes) for the transaction.$$; COMMENT ON COLUMN ap.netamount IS $$ Total amount excluding taxes for the transaction.$$; COMMENT ON COLUMN ap.curr IS $$ 3 letters to identify the currency.$$; COMMENT ON COLUMN ap.ordnumber IS $$ Order Number$$; COMMENT ON COLUMN ap.ponumber is $$Purchase Order Number$$; COMMENT ON COLUMN ap.person_id IS $$Person who created the transaction$$; COMMENT ON COLUMN ap.quonumber IS $$Quotation Number$$; COMMENT ON COLUMN ap.notes IS $$These notes are displayed on the invoice when printed or emailed$$; COMMENT ON COLUMN ap.intnotes IS $$These notes are not displayed when the invoice is printed or emailed and may be updated without reposting hte invocie.$$; COMMENT ON COLUMN ap.reverse IS $$If true numbers are displayed after multiplying by -1$$; COMMENT ON COLUMN ap.approved IS $$Only show in financial reports if true.$$; COMMENT ON COLUMN ap.entity_credit_account IS $$ reference for the vendor account used.$$; COMMENT ON COLUMN ap.force_closed IS $$ Not exposed to the UI, but can be set to prevent an invoice from showing up for payment or in outstanding reports.$$; -- CREATE TABLE taxmodule ( taxmodule_id serial PRIMARY KEY, taxmodulename text NOT NULL ); COMMENT ON TABLE taxmodule IS $$This is used to store information on tax modules. the module name is used to determine the Perl class for the taxes.$$; -- CREATE TABLE taxcategory ( taxcategory_id serial PRIMARY KEY, taxcategoryname text NOT NULL, taxmodule_id int NOT NULL, FOREIGN KEY (taxmodule_id) REFERENCES taxmodule (taxmodule_id) ); -- CREATE TABLE partstax ( parts_id int, chart_id int, taxcategory_id int, PRIMARY KEY (parts_id, chart_id), FOREIGN KEY (parts_id) REFERENCES parts (id) on delete cascade, FOREIGN KEY (chart_id) REFERENCES account(id), FOREIGN KEY (taxcategory_id) REFERENCES taxcategory (taxcategory_id) ); COMMENT ON TABLE partstax IS $$ Mapping of parts to taxes.$$; -- CREATE TABLE tax ( chart_id int REFERENCES account(id), rate numeric, minvalue numeric, maxvalue numeric, taxnumber text, validto timestamp not null default 'infinity', pass integer DEFAULT 0 NOT NULL, taxmodule_id int DEFAULT 1 NOT NULL, FOREIGN KEY (chart_id) REFERENCES account(id), FOREIGN KEY (taxmodule_id) REFERENCES taxmodule (taxmodule_id), PRIMARY KEY (chart_id, validto) ); COMMENT ON TABLE tax IS $$Information on tax rates.$$; COMMENT ON COLUMN tax.pass IS $$This is an integer indicating the pass of the tax. This is to support cumultative sales tax rules (for example, Quebec charging taxes on the federal taxes collected).$$; -- CREATE TABLE customertax ( customer_id int references entity_credit_account(id) on delete cascade, chart_id int REFERENCES account(id), PRIMARY KEY (customer_id, chart_id) ); COMMENT ON TABLE customertax IS $$ Mapping customer to taxes.$$; -- CREATE TABLE vendortax ( vendor_id int references entity_credit_account(id) on delete cascade, chart_id int REFERENCES account(id), PRIMARY KEY (vendor_id, chart_id) ); -- COMMENT ON TABLE vendortax IS $$ Mapping vendor to taxes.$$; CREATE TABLE oe_class ( id smallint unique check(id IN (1,2,3,4)), oe_class text primary key); INSERT INTO oe_class(id,oe_class) values (1,'Sales Order'); INSERT INTO oe_class(id,oe_class) values (2,'Purchase Order'); INSERT INTO oe_class(id,oe_class) values (3,'Quotation'); INSERT INTO oe_class(id,oe_class) values (4,'RFQ'); -- Moving this comment to SQL comments because it is about this code rather than -- the database structure as API. --CT -- This could probably be done better. But I need to remove the -- customer_id/vendor_id relationship and instead rely on a classification; -- JD COMMENT ON TABLE oe_class IS $$ Hardwired classifications for orders and quotations. Coordinate before adding.$$; CREATE TABLE oe ( id serial PRIMARY KEY, ordnumber text, transdate date default current_date, entity_id integer references entity(id), amount NUMERIC, netamount NUMERIC, reqdate date, taxincluded bool, shippingpoint text, notes text, curr char(3), person_id integer references person(id), closed bool default 'f', quotation bool default 'f', quonumber text, intnotes text, department_id int default 0, shipvia text, language_code varchar(6), ponumber text, terms int2 DEFAULT 0, entity_credit_account int references entity_credit_account(id) not null, oe_class_id int references oe_class(id) NOT NULL ); COMMENT ON TABLE oe IS $$ Header information for: * Sales orders * Purchase Orders * Quotations * Requests for Quotation $$; -- CREATE TABLE orderitems ( id serial PRIMARY KEY, trans_id int, parts_id int, description text, qty numeric, sellprice NUMERIC, precision int, discount numeric, unit varchar(5), project_id int, reqdate date, ship numeric, serialnumber text, notes text ); COMMENT ON TABLE orderitems IS $$ Line items for sales/purchase orders and quotations.$$; -- CREATE TABLE exchangerate ( curr char(3), transdate date, buy numeric, sell numeric, PRIMARY KEY (curr, transdate) ); COMMENT ON TABLE exchangerate IS $$ When you receive money in a foreign currency, it is worth to you in your local currency whatever you can get for it when you sell the acquired currency (sell rate). When you have to pay someone in a foreign currency, the equivalent amount is the amount you have to spend to acquire the foreign currency (buy rate).$$; -- CREATE TABLE project ( id serial PRIMARY KEY, projectnumber text, description text, startdate date, enddate date, parts_id int, production numeric default 0, completed numeric default 0, credit_id int references entity_credit_account(id) ); COMMENT ON COLUMN project.parts_id IS $$ Job costing/manufacturing here not implemented.$$; -- CREATE TABLE partsgroup ( id serial PRIMARY KEY, partsgroup text ); COMMENT ON TABLE partsgroup is $$ Groups of parts for Point of Sale screen.$$; -- CREATE TABLE status ( trans_id int, formname text, printed bool default 'f', emailed bool default 'f', spoolfile text, PRIMARY KEY (trans_id, formname) ); COMMENT ON TABLE status IS $$ Whether AR/AP transactions and invoices have been emailed and/or printed $$; -- CREATE TABLE department ( id serial PRIMARY KEY, description text, role char(1) default 'P' ); COMMENT ON COLUMN department.role IS $$P for Profit Center, C for Cost Center$$; -- -- department transaction table CREATE TABLE dpt_trans ( trans_id int PRIMARY KEY, department_id int ); COMMENT ON TABLE dpt_trans IS $$Department to Transaction Map$$; -- -- business table CREATE TABLE business ( id serial PRIMARY KEY, description text, discount numeric ); COMMENT ON TABLE business IS $$Groups of Customers assigned joint discounts.$$; -- -- SIC CREATE TABLE sic ( code varchar(6) PRIMARY KEY, sictype char(1), description text ); COMMENT ON TABLE sic IS $$ This can be used SIC codes or any equivalent, such as ISIC, NAICS, etc. $$; -- CREATE TABLE warehouse ( id serial PRIMARY KEY, description text ); -- CREATE TABLE inventory ( entity_id integer references entity_employee(entity_id), warehouse_id int, parts_id int, trans_id int, orderitems_id int, qty numeric, shippingdate date, entry_id SERIAL PRIMARY KEY ); COMMENT ON TABLE inventory IS $$ This table contains inventory mappings to warehouses, not general inventory management data.$$; -- CREATE TABLE yearend ( trans_id int PRIMARY KEY REFERENCES gl(id), reversed bool default false, transdate date ); COMMENT ON TABLE yearend IS $$ An extension to the gl table to track transactionsactions which close out the books at yearend.$$; -- CREATE TABLE partsvendor ( credit_id int not null references entity_credit_account(id) on delete cascade, parts_id int, partnumber text, leadtime int2, lastcost NUMERIC, curr char(3), entry_id SERIAL PRIMARY KEY ); COMMENT ON TABLE partsvendor IS $$ Tracks vendor's pricing, as well as vendor's part number, lead time required and currency.$$; -- CREATE TABLE partscustomer ( parts_id int, credit_id int references entity_credit_account(id) on delete cascade, pricegroup_id int references pricegroup(id), pricebreak numeric, sellprice NUMERIC, validfrom date, validto date, curr char(3), entry_id SERIAL PRIMARY KEY ); COMMENT ON TABLE partscustomer IS $$ Tracks per-customer pricing. Discounts can be offered for periods of time and for pricegroups as well as per customer$$; -- -- CREATE TABLE audittrail ( trans_id int, tablename text, reference text, formname text, action text, transdate timestamp default current_timestamp, person_id integer references person(entity_id) not null, entry_id BIGSERIAL PRIMARY KEY ); COMMENT ON TABLE audittrail IS $$ This stores information on who entered or updated rows in the ar, ap, or gl tables.$$; -- CREATE TABLE translation ( trans_id int, language_code varchar(6), description text, PRIMARY KEY (trans_id, language_code) ); COMMENT ON TABLE translation IS $$abstract table for manual translation data. Should have zero rows.$$; CREATE TABLE parts_translation (PRIMARY KEY (trans_id, language_code)) INHERITS (translation); ALTER TABLE parts_translation ADD foreign key (trans_id) REFERENCES parts(id); COMMENT ON TABLE parts_translation IS $$ Translation information for parts.$$; CREATE TABLE project_translation (PRIMARY KEY (trans_id, language_code)) INHERITS (translation); ALTER TABLE project_translation ADD foreign key (trans_id) REFERENCES project(id); COMMENT ON TABLE project_translation IS $$ Translation information for projects.$$; CREATE TABLE partsgroup_translation (PRIMARY KEY (trans_id, language_code)) INHERITS (translation); ALTER TABLE partsgroup_translation ADD foreign key (trans_id) REFERENCES partsgroup(id); COMMENT ON TABLE partsgroup_translation IS $$ Translation information for partsgroups.$$; -- CREATE TABLE user_preference ( id int PRIMARY KEY REFERENCES users(id), language varchar(6) REFERENCES language(code), stylesheet text default 'ledgersmb.css' not null, printer text, dateformat text default 'yyyy-mm-dd' not null, numberformat text default '1000.00' not null ); -- user_preference is here due to a dependency on language.code COMMENT ON TABLE user_preference IS $$ This table sets the basic preferences for formats, languages, printers, and user-selected stylesheets.$$; CREATE TABLE recurring ( id int DEFAULT nextval ( 'id' ) PRIMARY KEY, reference text, startdate date, nextdate date, enddate date, repeat int2, unit varchar(6), howmany int, payment bool default 'f' ); COMMENT ON TABLE recurring IS $$ Stores recurring information on transactions which will recur in the future. Note that this means that only fully posted transactions can recur. I would highly recommend depricating this table and working instead on extending the template transaction addon to handle recurring information.$$; CREATE TABLE payment_type ( id serial not null unique, label text primary key ); -- CREATE TABLE recurringemail ( id int, formname text, format text, message text, PRIMARY KEY (id, formname) ); COMMENT ON TABLE recurringemail IS $$Email to be sent out when recurring transaction is posted.$$; -- CREATE TABLE recurringprint ( id int, formname text, format text, printer text, PRIMARY KEY (id, formname) ); COMMENT ON TABLE recurringprint IS $$ Template, printer etc. to print to when recurring transaction posts.$$; -- CREATE TABLE jcitems ( id serial PRIMARY KEY, project_id int, parts_id int, description text, qty numeric, allocated numeric, sellprice NUMERIC, fxsellprice NUMERIC, serialnumber text, checkedin timestamp with time zone, checkedout timestamp with time zone, person_id integer references person(id) not null, notes text, total numeric not null, non_billable numeric not null default 0 ); COMMENT ON TABLE jcitems IS $$ Time and materials cards. Materials cards not implemented.$$; CREATE OR REPLACE FUNCTION track_global_sequence() RETURNS TRIGGER AS $$ BEGIN IF tg_op = 'INSERT' THEN INSERT INTO transactions (id, table_name) VALUES (new.id, TG_RELNAME); ELSEIF tg_op = 'UPDATE' THEN IF new.id = old.id THEN return new; ELSE UPDATE transactions SET id = new.id WHERE id = old.id; END IF; ELSE DELETE FROM transactions WHERE id = old.id; END IF; RETURN new; END; $$ LANGUAGE PLPGSQL; COMMENT ON FUNCTION track_global_sequence() is $$ This trigger is used to track the id sequence entries across the transactions table, and with the ar, ap, and gl tables. This is necessary because these have not been properly refactored yet. $$; CREATE TRIGGER ap_track_global_sequence BEFORE INSERT OR UPDATE ON ap FOR EACH ROW EXECUTE PROCEDURE track_global_sequence(); CREATE TRIGGER ar_track_global_sequence BEFORE INSERT OR UPDATE ON ar FOR EACH ROW EXECUTE PROCEDURE track_global_sequence(); CREATE TRIGGER gl_track_global_sequence BEFORE INSERT OR UPDATE ON gl FOR EACH ROW EXECUTE PROCEDURE track_global_sequence(); CREATE TABLE custom_table_catalog ( table_id SERIAL PRIMARY KEY, extends TEXT, table_name TEXT ); COMMENT ON TABLE custom_table_catalog IS $$ Deprecated, use only with old code.$$; CREATE TABLE custom_field_catalog ( field_id SERIAL PRIMARY KEY, table_id INT REFERENCES custom_table_catalog, field_name TEXT ); COMMENT ON TABLE custom_field_catalog IS $$ Deprecated, use only with old code.$$; INSERT INTO taxmodule ( taxmodule_id, taxmodulename ) VALUES ( 1, 'Simple' ); CREATE TABLE ac_tax_form ( entry_id int references acc_trans(entry_id) primary key, reportable bool ); COMMENT ON TABLE ac_tax_form IS $$ Mapping acc_trans to country_tax_form for reporting purposes.$$; CREATE TABLE invoice_tax_form ( invoice_id int references invoice(id) primary key, reportable bool ); COMMENT ON TABLE invoice_tax_form IS $$ Maping invoice to country_tax_form.$$; CREATE OR REPLACE FUNCTION gl_audit_trail_append() RETURNS TRIGGER AS $$ DECLARE t_reference text; t_row RECORD; BEGIN IF TG_OP = 'INSERT' then t_row := NEW; ELSE t_row := OLD; END IF; IF TG_RELNAME IN ('ar', 'ap') THEN t_reference := t_row.invnumber; ELSE t_reference := t_row.reference; END IF; INSERT INTO audittrail (trans_id,tablename,reference, action, person_id) values (t_row.id,TG_RELNAME,t_reference, TG_OP, person__get_my_entity_id()); return null; -- AFTER TRIGGER ONLY, SAFE END; $$ language plpgsql security definer; COMMENT ON FUNCTION gl_audit_trail_append() IS $$ This provides centralized support for insertions into audittrail. $$; CREATE TRIGGER gl_audit_trail AFTER insert or update or delete ON gl FOR EACH ROW EXECUTE PROCEDURE gl_audit_trail_append(); CREATE TRIGGER ar_audit_trail AFTER insert or update or delete ON ar FOR EACH ROW EXECUTE PROCEDURE gl_audit_trail_append(); CREATE TRIGGER ap_audit_trail AFTER insert or update or delete ON ap FOR EACH ROW EXECUTE PROCEDURE gl_audit_trail_append(); create index acc_trans_trans_id_key on acc_trans (trans_id); create index acc_trans_chart_id_key on acc_trans (chart_id); create index acc_trans_transdate_key on acc_trans (transdate); create index acc_trans_source_key on acc_trans (lower(source)); -- create index ap_id_key on ap (id); create index ap_transdate_key on ap (transdate); create index ap_invnumber_key on ap (invnumber); create index ap_ordnumber_key on ap (ordnumber); create index ap_quonumber_key on ap (quonumber); create index ap_curr_idz on ap(curr); -- create index ar_id_key on ar (id); create index ar_transdate_key on ar (transdate); create index ar_ordnumber_key on ar (ordnumber); create index ar_quonumber_key on ar (quonumber); create index ar_curr_idz on ar(curr); -- create index assembly_id_key on assembly (id); -- create index customer_customer_id_key on customertax (customer_id); -- create index exchangerate_ct_key on exchangerate (curr, transdate); -- create unique index gifi_accno_key on gifi (accno); -- create index gl_id_key on gl (id); create index gl_transdate_key on gl (transdate); create index gl_reference_key on gl (reference); create index gl_description_key on gl (lower(description)); -- create index invoice_id_key on invoice (id); create index invoice_trans_id_key on invoice (trans_id); -- create index makemodel_parts_id_key on makemodel (parts_id); create index makemodel_make_key on makemodel (lower(make)); create index makemodel_model_key on makemodel (lower(model)); -- create index oe_id_key on oe (id); create index oe_transdate_key on oe (transdate); create index oe_ordnumber_key on oe (ordnumber); create index orderitems_trans_id_key on orderitems (trans_id); create index orderitems_id_key on orderitems (id); -- create index parts_id_key on parts (id); create index parts_partnumber_key on parts (lower(partnumber)); create index parts_description_key on parts (lower(description)); create index partstax_parts_id_key on partstax (parts_id); -- -- create index project_id_key on project (id); create unique index projectnumber_key on project (projectnumber); -- create index partsgroup_id_key on partsgroup (id); create unique index partsgroup_key on partsgroup (partsgroup); -- create index status_trans_id_key on status (trans_id); -- create index department_id_key on department (id); -- create index partsvendor_parts_id_key on partsvendor (parts_id); -- create index pricegroup_pricegroup_key on pricegroup (pricegroup); create index pricegroup_id_key on pricegroup (id); -- create index audittrail_trans_id_key on audittrail (trans_id); -- create index translation_trans_id_key on translation (trans_id); -- create unique index language_code_key on language (code); -- create index jcitems_id_key on jcitems (id); -- CREATE FUNCTION del_yearend() RETURNS TRIGGER AS ' begin delete from yearend where trans_id = old.id; return NULL; end; ' language 'plpgsql'; -- end function -- CREATE TRIGGER del_yearend AFTER DELETE ON gl FOR EACH ROW EXECUTE PROCEDURE del_yearend(); -- end trigger -- CREATE FUNCTION del_department() RETURNS TRIGGER AS ' begin delete from dpt_trans where trans_id = old.id; return NULL; end; ' language 'plpgsql'; -- end function -- CREATE TRIGGER del_department AFTER DELETE ON ar FOR EACH ROW EXECUTE PROCEDURE del_department(); -- end trigger CREATE TRIGGER del_department AFTER DELETE ON ap FOR EACH ROW EXECUTE PROCEDURE del_department(); -- end trigger CREATE TRIGGER del_department AFTER DELETE ON gl FOR EACH ROW EXECUTE PROCEDURE del_department(); -- end trigger CREATE TRIGGER del_department AFTER DELETE ON oe FOR EACH ROW EXECUTE PROCEDURE del_department(); -- end trigger -- CREATE FUNCTION del_exchangerate() RETURNS TRIGGER AS ' declare t_transdate date; t_curr char(3); t_id int; d_curr text; begin select into d_curr substr(value,1,3) from defaults where setting_key = ''curr''; if TG_RELNAME = ''ar'' then select into t_curr, t_transdate curr, transdate from ar where id = old.id; end if; if TG_RELNAME = ''ap'' then select into t_curr, t_transdate curr, transdate from ap where id = old.id; end if; if TG_RELNAME = ''oe'' then select into t_curr, t_transdate curr, transdate from oe where id = old.id; end if; if d_curr != t_curr then select into t_id a.id from acc_trans ac join ar a on (a.id = ac.trans_id) where a.curr = t_curr and ac.transdate = t_transdate except select a.id from ar a where a.id = old.id union select a.id from acc_trans ac join ap a on (a.id = ac.trans_id) where a.curr = t_curr and ac.transdate = t_transdate except select a.id from ap a where a.id = old.id union select o.id from oe o where o.curr = t_curr and o.transdate = t_transdate except select o.id from oe o where o.id = old.id; if not found then delete from exchangerate where curr = t_curr and transdate = t_transdate; end if; end if; return old; end; ' language 'plpgsql'; -- end function -- CREATE TRIGGER del_exchangerate BEFORE DELETE ON ar FOR EACH ROW EXECUTE PROCEDURE del_exchangerate(); -- end trigger -- CREATE TRIGGER del_exchangerate BEFORE DELETE ON ap FOR EACH ROW EXECUTE PROCEDURE del_exchangerate(); -- end trigger -- CREATE TRIGGER del_exchangerate BEFORE DELETE ON oe FOR EACH ROW EXECUTE PROCEDURE del_exchangerate(); -- end trigger -- CREATE FUNCTION check_department() RETURNS TRIGGER AS ' declare dpt_id int; begin if new.department_id = 0 then delete from dpt_trans where trans_id = new.id; return NULL; end if; select into dpt_id trans_id from dpt_trans where trans_id = new.id; if dpt_id > 0 then update dpt_trans set department_id = new.department_id where trans_id = dpt_id; else insert into dpt_trans (trans_id, department_id) values (new.id, new.department_id); end if; return NULL; end; ' language 'plpgsql'; -- end function -- CREATE TRIGGER check_department AFTER INSERT OR UPDATE ON ar FOR EACH ROW EXECUTE PROCEDURE check_department(); -- end trigger CREATE TRIGGER check_department AFTER INSERT OR UPDATE ON ap FOR EACH ROW EXECUTE PROCEDURE check_department(); -- end trigger CREATE TRIGGER check_department AFTER INSERT OR UPDATE ON gl FOR EACH ROW EXECUTE PROCEDURE check_department(); -- end trigger CREATE TRIGGER check_department AFTER INSERT OR UPDATE ON oe FOR EACH ROW EXECUTE PROCEDURE check_department(); -- end trigger -- CREATE FUNCTION del_recurring() RETURNS TRIGGER AS ' BEGIN DELETE FROM recurring WHERE id = old.id; DELETE FROM recurringemail WHERE id = old.id; DELETE FROM recurringprint WHERE id = old.id; RETURN NULL; END; ' language 'plpgsql'; --end function CREATE TRIGGER del_recurring AFTER DELETE ON ar FOR EACH ROW EXECUTE PROCEDURE del_recurring(); -- end trigger CREATE TRIGGER del_recurring AFTER DELETE ON ap FOR EACH ROW EXECUTE PROCEDURE del_recurring(); -- end trigger CREATE TRIGGER del_recurring AFTER DELETE ON gl FOR EACH ROW EXECUTE PROCEDURE del_recurring(); -- end trigger -- CREATE FUNCTION avgcost(int) RETURNS FLOAT AS ' DECLARE v_cost float; v_qty float; v_parts_id alias for $1; BEGIN SELECT INTO v_cost, v_qty SUM(i.sellprice * i.qty), SUM(i.qty) FROM invoice i JOIN ap a ON (a.id = i.trans_id) WHERE i.parts_id = v_parts_id; IF v_cost IS NULL THEN v_cost := 0; END IF; IF NOT v_qty IS NULL THEN IF v_qty = 0 THEN v_cost := 0; ELSE v_cost := v_cost/v_qty; END IF; END IF; RETURN v_cost; END; ' language 'plpgsql'; -- end function -- CREATE FUNCTION lastcost(int) RETURNS FLOAT AS ' DECLARE v_cost float; v_parts_id alias for $1; BEGIN SELECT INTO v_cost sellprice FROM invoice i JOIN ap a ON (a.id = i.trans_id) WHERE i.parts_id = v_parts_id ORDER BY a.transdate desc, a.id desc LIMIT 1; IF v_cost IS NULL THEN v_cost := 0; END IF; RETURN v_cost; END; ' language plpgsql; -- end function -- CREATE OR REPLACE FUNCTION trigger_parts_short() RETURNS TRIGGER AS ' BEGIN IF NEW.onhand >= NEW.rop THEN NOTIFY parts_short; END IF; RETURN NEW; END; ' LANGUAGE PLPGSQL; -- end function CREATE TRIGGER parts_short AFTER UPDATE ON parts FOR EACH ROW EXECUTE PROCEDURE trigger_parts_short(); -- end function CREATE OR REPLACE FUNCTION add_custom_field (table_name VARCHAR, new_field_name VARCHAR, field_datatype VARCHAR) RETURNS BOOL AS ' BEGIN perform TABLE_ID FROM custom_table_catalog WHERE extends = table_name; IF NOT FOUND THEN BEGIN INSERT INTO custom_table_catalog (extends) VALUES (table_name); EXECUTE ''CREATE TABLE '' || quote_ident(''custom_'' ||table_name) || '' (row_id INT PRIMARY KEY)''; EXCEPTION WHEN duplicate_table THEN -- do nothing END; END IF; INSERT INTO custom_field_catalog (field_name, table_id) values (new_field_name, (SELECT table_id FROM custom_table_catalog WHERE extends = table_name)); EXECUTE ''ALTER TABLE ''|| quote_ident(''custom_''||table_name) || '' ADD COLUMN '' || quote_ident(new_field_name) || '' '' || quote_ident(field_datatype); RETURN TRUE; END; ' LANGUAGE PLPGSQL; -- end function CREATE OR REPLACE FUNCTION drop_custom_field (VARCHAR, VARCHAR) RETURNS BOOL AS ' DECLARE table_name ALIAS FOR $1; custom_field_name ALIAS FOR $2; BEGIN DELETE FROM custom_field_catalog WHERE field_name = custom_field_name AND table_id = (SELECT table_id FROM custom_table_catalog WHERE extends = table_name); EXECUTE ''ALTER TABLE '' || quote_ident(''custom_'' || table_name) || '' DROP COLUMN '' || quote_ident(custom_field_name); RETURN TRUE; END; ' LANGUAGE PLPGSQL; -- end function CREATE TABLE menu_node ( id serial NOT NULL, label character varying NOT NULL, parent integer, "position" integer NOT NULL ); COMMENT ON TABLE menu_node IS $$This table stores the tree structure of the menu.$$; --ALTER TABLE public.menu_node OWNER TO ledgersmb; -- -- Name: menu_node_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ledgersmb -- SELECT pg_catalog.setval('menu_node_id_seq', 242, true); -- -- Data for Name: menu_node; Type: TABLE DATA; Schema: public; Owner: ledgersmb -- COPY menu_node (id, label, parent, "position") FROM stdin; 205 Transaction Approval 0 5 206 Batches 205 1 46 HR 0 6 50 Order Entry 0 7 63 Shipping 0 8 67 Quotations 0 9 73 General Journal 0 10 77 Goods and Services 0 11 0 Top-level \N 0 1 AR 0 1 2 Add Transaction 1 1 5 Transactions 4 1 6 Outstanding 4 2 7 AR Aging 4 3 9 Taxable Sales 4 4 10 Non-Taxable 4 5 12 Add Customer 11 1 13 Reports 11 2 14 Search 13 1 15 History 13 2 16 Point of Sale 0 2 17 Sale 16 1 18 Open 16 2 19 Receipts 16 3 20 Close Till 16 4 21 AP 0 3 22 Add Transaction 21 1 145 Add Department 144 1 25 Transactions 24 1 26 Outstanding 24 2 27 AP Aging 24 3 28 Taxable 24 4 29 Non-taxable 24 5 31 Add Vendor 30 1 32 Reports 30 2 33 Search 32 1 34 History 32 2 35 Cash 0 4 36 Receipt 35 1 38 Payment 35 3 223 Use Overpayment 35 4 37 Use AR Overpayment 35 2 146 List Departments 144 2 42 Receipts 41 1 43 Payments 41 2 44 Reconciliation 41 3 47 Employees 46 1 48 Add Employee 47 1 49 Search 47 2 51 Sales Order 50 1 52 Purchase Order 50 2 53 Reports 50 3 54 Sales Orders 53 1 55 Purchase Orders 53 2 57 Sales Orders 56 1 58 Purchase Orders 56 2 56 Generate 50 4 60 Consolidate 50 5 61 Sales Orders 60 1 62 Purchase Orders 60 2 64 Ship 63 1 65 Receive 63 2 66 Transfer 63 3 68 Quotation 67 1 69 RFQ 67 2 70 Reports 67 3 71 Quotations 70 1 72 RFQs 70 2 74 Journal Entry 73 1 75 Adjust Till 73 2 76 Reports 73 3 78 Add Part 77 1 79 Add Service 77 2 80 Add Assembly 77 3 81 Add Overhead 77 4 82 Add Group 77 5 83 Add Pricegroup 77 6 84 Stock Assembly 77 7 85 Reports 77 8 86 All Items 85 1 87 Parts 85 2 88 Requirements 85 3 89 Services 85 4 90 Labor 85 5 91 Groups 85 6 92 Pricegroups 85 7 93 Assembly 85 8 94 Components 85 9 95 Translations 77 9 96 Description 95 1 97 Partsgroup 95 2 99 Add Project 98 1 100 Add Timecard 98 2 101 Generate 98 3 102 Sales Orders 101 1 103 Reports 98 4 104 Search 103 1 105 Transactions 103 2 106 Time Cards 103 3 107 Translations 98 5 108 Description 107 1 110 Chart of Accounts 109 1 111 Trial Balance 109 2 112 Income Statement 109 3 113 Balance Sheet 109 4 114 Inventory Activity 109 5 117 Sales Invoices 116 1 118 Sales Orders 116 2 119 Checks 116 3 120 Work Orders 116 4 121 Quotations 116 5 122 Packing Lists 116 6 123 Pick Lists 116 7 124 Purchase Orders 116 8 125 Bin Lists 116 9 126 RFQs 116 10 127 Time Cards 116 11 129 Audit Control 128 1 130 Taxes 128 2 131 Defaults 128 3 132 Yearend 128 4 137 Add Accounts 136 1 138 List Accounts 136 2 139 Add GIFI 136 3 140 List GIFI 136 4 142 Add Warehouse 141 1 143 List Warehouse 141 2 148 Add Business 147 1 149 List Businesses 147 2 151 Add Language 150 1 152 List Languages 150 2 154 Add SIC 153 1 155 List SIC 153 2 157 Income Statement 156 1 158 Balance Sheet 156 2 159 Invoice 156 3 160 AR Transaction 156 4 161 AP Transaction 156 5 162 Packing List 156 6 163 Pick List 156 7 164 Sales Order 156 8 165 Work Order 156 9 166 Purchase Order 156 10 167 Bin List 156 11 168 Statement 156 12 169 Quotation 156 13 170 RFQ 156 14 171 Timecard 156 15 241 Letterhead 156 16 173 Invoice 172 1 174 AR Transaction 172 2 175 AP Transaction 172 3 176 Packing List 172 4 177 Pick List 172 5 178 Sales Order 172 6 179 Work Order 172 7 180 Purchase Order 172 8 181 Bin List 172 9 182 Statement 172 10 183 Check 172 11 184 Receipt 172 12 185 Quotation 172 13 186 RFQ 172 14 187 Timecard 172 15 242 Letterhead 172 16 189 POS Invoice 188 1 198 AR Voucher 1 2 3 Sales Invoice 1 3 11 Customers 1 7 4 Reports 1 6 194 Credit Note 1 4 195 Credit Invoice 1 5 199 AP Voucher 21 2 23 Vendor Invoice 21 3 24 Reports 21 6 30 Vendors 21 7 196 Debit Note 21 4 197 Debit Invoice 21 5 200 Vouchers 35 5 40 Transfer 35 6 41 Reports 35 8 45 Reconciliation 35 7 203 Receipts 200 3 204 Reverse Receipts 200 4 201 Payments 200 1 202 Reverse Payment 200 2 98 Projects 0 12 109 Reports 0 13 115 Recurring Transactions 0 14 210 Drafts 205 2 211 Reconciliation 205 3 217 Tax Forms 0 15 218 Add Tax Form 217 1 219 Admin Users 128 5 188 Text Templates 128 15 172 LaTeX Templates 128 14 156 HTML Templates 128 13 153 SIC 128 12 150 Language 128 11 147 Type of Business 128 10 144 Departments 128 9 141 Warehouses 128 8 136 Chart of Accounts 128 7 220 Add User 219 1 221 Search Users 219 2 222 Sessions 219 3 225 List Tax Forms 217 2 226 Reports 217 3 227 Fixed Assets 0 17 193 Logout 0 23 192 New Window 0 22 191 Preferences 0 21 190 Stylesheet 0 20 128 System 0 19 116 Batch Printing 0 18 228 Asset Classes 227 1 229 Assets 227 2 230 Add Class 228 1 231 List Classes 228 2 232 Add Assets 229 1 233 Search Assets 229 2 235 Import 229 3 234 Depreciate 229 4 237 Net Book Value 236 1 238 Disposal 229 5 236 Reports 229 11 239 Depreciation 236 2 240 Disposal 236 3 \. -- -- Name: menu_node_parent_key; Type: CONSTRAINT; Schema: public; Owner: ledgersmb; Tablespace: -- ALTER TABLE ONLY menu_node ADD CONSTRAINT menu_node_parent_key UNIQUE (parent, "position"); -- -- Name: menu_node_pkey; Type: CONSTRAINT; Schema: public; Owner: ledgersmb; Tablespace: -- ALTER TABLE ONLY menu_node ADD CONSTRAINT menu_node_pkey PRIMARY KEY (id); -- -- Name: menu_node_parent_fkey; Type: FK CONSTRAINT; Schema: public; Owner: ledgersmb -- ALTER TABLE ONLY menu_node ADD CONSTRAINT menu_node_parent_fkey FOREIGN KEY (parent) REFERENCES menu_node(id); CREATE TABLE menu_attribute ( node_id integer NOT NULL references menu_node(id), attribute character varying NOT NULL, value character varying NOT NULL, id serial NOT NULL, primary key(node_id, attribute) ); COMMENT ON TABLE menu_attribute IS $$ This table stores the callback information for each menu item. The attributes are stored in key/value modelling because of the fact that this best matches the semantic structure of the information. Each node should have EITHER a menu or a module attribute, menu for a menu with sub-items, module for an executiable script. The module attribute identifies the perl script to be run. The action attribute identifies the entry point. Beyond this, any other attributes that should be passed in can be done as other attributes. $$; -- -- Name: menu_attribute_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ledgersmb -- SELECT pg_catalog.setval('menu_attribute_id_seq', 649, true); -- -- Data for Name: menu_attribute; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY menu_attribute (node_id, attribute, value, id) FROM stdin; 26 outstanding 1 584 205 menu 1 574 206 module vouchers.pl 575 206 action search_batch 576 1 menu 1 1 2 module ar.pl 2 2 action add 3 3 action add 4 3 module is.pl 5 3 type invoice 6 4 menu 1 7 5 module ar.pl 8 5 action search 9 5 nextsub transactions 10 6 module ar.pl 12 6 action search 13 6 nextsub transactions 14 7 module rp.pl 15 7 action report 16 7 report ar_aging 17 6 outstanding 1 18 9 module rp.pl 21 9 action report 22 9 report tax_collected 23 10 module rp.pl 24 10 action report 25 10 report nontaxable_sales 26 11 menu 1 27 12 module customer.pl 28 12 action add 29 13 menu 1 31 14 module customer.pl 32 14 action search 36 15 db customer 37 15 action history 33 16 menu 1 38 17 module ps.pl 39 17 action add 40 17 nextsub openinvoices 41 18 action openinvoices 42 18 module ps.pl 43 19 module ps.pl 44 19 action receipts 46 20 module ps.pl 47 20 action till_closing 48 20 pos true 49 21 menu 1 50 22 action add 52 22 module ap.pl 51 23 action add 53 23 type invoice 55 23 module ir.pl 54 24 menu 1 56 25 action search 58 25 nextsub transactions 59 25 module ap.pl 57 26 action search 61 26 nextsub transactions 62 26 module ap.pl 60 27 module rp.pl 63 27 action report 64 28 module rp.pl 66 28 action report 67 28 report tax_collected 68 27 report tax_paid 65 29 module rp.pl 69 29 action report 70 29 report nontaxable_purchases 71 30 menu 1 72 31 module vendor.pl 73 31 action add 74 31 db vendor 75 32 menu 1 76 33 module vendor.pl 77 33 action search 79 33 db vendor 78 34 module vendor.pl 80 34 action history 81 34 db vendor 82 35 menu 1 83 36 module payment.pl 84 36 action payment 85 36 type receipt 86 36 account_class 2 551 37 module payment.pl 87 37 account_class 2 89 37 action use_overpayment 88 223 module payment.pl 607 223 account_class 1 608 223 action use_overpayment 609 38 module payment.pl 90 38 action payment 91 38 type check 92 38 account_class 1 554 194 module ar.pl 538 194 action add 539 40 module gl.pl 96 40 action add 97 40 transfer 1 98 41 menu 1 99 42 module rp.pl 100 42 action report 101 42 report receipts 102 43 module rp.pl 103 43 action report 104 43 report payments 105 44 report 1 110 46 menu 1 111 47 menu 1 112 48 module employee.pl 113 48 action add 114 49 action search 117 50 menu 1 119 51 module oe.pl 120 51 action add 121 51 type sales_order 122 52 module oe.pl 123 52 action add 124 52 type purchase_order 125 53 menu 1 126 54 module oe.pl 127 54 type sales_order 129 54 action search 128 55 module oe.pl 130 55 type purchase_order 132 55 action search 131 56 menu 1 133 57 module oe.pl 134 57 action search 136 58 module oe.pl 137 58 action search 139 57 type generate_sales_order 135 58 type generate_purchase_order 138 60 menu 1 550 61 module oe.pl 140 61 action search 141 62 module oe.pl 143 62 action search 144 62 type consolidate_purchase_order 145 61 type consolidate_sales_order 142 63 menu 1 146 64 module oe.pl 147 64 action search 148 64 type ship_order 149 65 module oe.pl 150 65 action search 151 65 type receive_order 152 66 module oe.pl 153 66 action search_transfer 154 67 menu 1 155 68 module oe.pl 156 68 action add 157 69 module oe.pl 159 69 action add 160 49 module employee.pl 118 68 type sales_quotation 158 69 type request_quotation 161 70 menu 1 162 71 module oe.pl 163 71 type sales_quotation 165 71 action search 164 72 module oe.pl 166 72 action search 168 72 type request_quotation 167 73 menu 1 169 74 module gl.pl 170 74 action add 171 75 module gl.pl 172 75 action add_pos_adjust 174 75 rowcount 3 175 75 pos_adjust 1 176 75 reference Adjusting Till: (Till) Source: (Source) 177 75 descripton Adjusting till due to data entry error 178 76 module gl.pl 180 76 action search 181 77 menu 1 182 78 module ic.pl 183 78 action add 184 78 item part 185 79 module ic.pl 186 79 action add 187 79 item service 188 80 module ic.pl 189 80 action add 190 81 module ic.pl 192 81 action add 193 81 item labor 194 80 item assembly 191 82 action add 195 82 module pe.pl 196 83 action add 198 83 module pe.pl 199 83 type pricegroup 200 82 type partsgroup 197 84 module ic.pl 202 84 action stock_assembly 203 85 menu 1 204 86 module ic.pl 205 86 action search 610 86 searchitems all 611 87 module ic.pl 612 87 action search 206 87 searchitems part 210 88 module ic.pl 211 88 action requirements 212 89 action search 213 89 module ic.pl 214 89 searchitems service 215 90 action search 216 90 module ic.pl 217 90 searchitems labor 218 91 module pe.pl 221 91 type partsgroup 222 91 action search 220 92 module pe.pl 224 92 type pricegroup 225 92 action search 223 93 action search 226 93 module ic.pl 227 93 searchitems assembly 228 94 action search 229 94 module ic.pl 230 94 searchitems component 231 95 menu 1 232 96 module pe.pl 233 96 action translation 234 96 translation description 235 97 module pe.pl 236 97 action translation 237 97 translation partsgroup 238 98 menu 1 239 99 module pe.pl 240 99 action add 241 99 type project 242 100 module jc.pl 243 100 action add 244 99 project project 245 100 project project 246 100 type timecard 247 101 menu 1 248 102 module pe.pl 249 102 action project_sales_order 250 103 menu 1 255 104 module pe.pl 256 104 type project 258 104 action search 257 105 action report 260 105 report projects 261 105 module rp.pl 262 106 module jc.pl 263 106 action search 264 106 type timecard 265 106 project project 266 107 menu 1 268 108 module pe.pl 269 108 action translation 270 108 translation project 271 109 menu 1 272 110 module ca.pl 273 110 action chart_of_accounts 274 111 action report 275 111 module rp.pl 276 111 report trial_balance 277 112 action report 278 112 module rp.pl 279 112 report income_statement 280 113 action report 281 113 module rp.pl 282 113 report balance_sheet 283 114 action report 284 114 module rp.pl 285 114 report inv_activity 286 115 action recurring_transactions 287 115 module am.pl 288 116 menu 1 289 119 module bp.pl 290 119 action search 291 119 type check 292 119 vc vendor 293 117 module bp.pl 294 117 action search 295 117 vc customer 297 117 type invoice 296 118 module bp.pl 298 118 action search 299 118 vc customer 300 118 type sales_order 301 120 module bp.pl 302 120 action search 303 120 vc customer 304 121 module bp.pl 306 121 action search 307 121 vc customer 308 122 module bp.pl 310 122 action search 311 122 vc customer 312 120 type work_order 305 121 type sales_quotation 309 122 type packing_list 313 123 module bp.pl 314 123 action search 315 123 vc customer 316 123 type pick_list 317 124 module bp.pl 318 124 action search 319 124 vc vendor 321 124 type purchase_order 320 125 module bp.pl 322 125 action search 323 125 vc vendor 325 126 module bp.pl 326 126 action search 327 126 vc vendor 329 127 module bp.pl 330 127 action search 331 127 type timecard 332 125 type bin_list 324 126 type request_quotation 328 127 vc employee 333 128 menu 1 334 129 module am.pl 337 130 module am.pl 338 131 module am.pl 339 129 action audit_control 340 130 taxes audit_control 341 131 action defaults 342 130 action taxes 343 132 module account.pl 346 132 action yearend_info 347 138 module am.pl 356 139 module am.pl 357 140 module am.pl 358 138 action list_account 360 139 action add_gifi 361 140 action list_gifi 362 141 menu 1 363 142 module am.pl 364 143 module am.pl 365 142 action add_warehouse 366 143 action list_warehouse 367 145 module am.pl 368 146 module am.pl 369 145 action add_department 370 146 action list_department 371 147 menu 1 372 148 module am.pl 373 149 module am.pl 374 148 action add_business 375 149 action list_business 376 150 menu 1 377 151 module am.pl 378 152 module am.pl 379 151 action add_language 380 152 action list_language 381 153 menu 1 382 154 module am.pl 383 155 module am.pl 384 154 action add_sic 385 155 action list_sic 386 156 menu 1 387 157 module am.pl 388 158 module am.pl 389 159 module am.pl 390 160 module am.pl 391 161 module am.pl 392 162 module am.pl 393 163 module am.pl 394 164 module am.pl 395 165 module am.pl 396 166 module am.pl 397 167 module am.pl 398 168 module am.pl 399 169 module am.pl 400 170 module am.pl 401 171 module am.pl 402 241 module am.pl 642 157 action list_templates 403 158 action list_templates 404 159 action list_templates 405 160 action list_templates 406 161 action list_templates 407 162 action list_templates 408 163 action list_templates 409 164 action list_templates 410 165 action list_templates 411 166 action list_templates 412 167 action list_templates 413 168 action list_templates 414 169 action list_templates 415 170 action list_templates 416 171 action list_templates 417 241 action list_templates 643 157 template income_statement 418 158 template balance_sheet 419 159 template invoice 420 160 template ar_transaction 421 161 template ap_transaction 422 162 template packing_list 423 163 template pick_list 424 164 template sales_order 425 165 template work_order 426 166 template purchase_order 427 167 template bin_list 428 168 template statement 429 169 template sales_quotation 430 170 template request_quotation 431 171 template timecard 432 241 template letterhead 644 157 format HTML 433 158 format HTML 434 159 format HTML 435 160 format HTML 436 161 format HTML 437 162 format HTML 438 163 format HTML 439 164 format HTML 440 165 format HTML 441 166 format HTML 442 167 format HTML 443 168 format HTML 444 169 format HTML 445 170 format HTML 446 171 format HTML 447 241 format HTML 645 172 menu 1 448 173 action list_templates 449 174 action list_templates 450 175 action list_templates 451 176 action list_templates 452 177 action list_templates 453 178 action list_templates 454 179 action list_templates 455 180 action list_templates 456 181 action list_templates 457 182 action list_templates 458 183 action list_templates 459 184 action list_templates 460 185 action list_templates 461 186 action list_templates 462 187 action list_templates 463 242 action list_templates 646 173 module am.pl 464 174 module am.pl 465 175 module am.pl 466 176 module am.pl 467 177 module am.pl 468 178 module am.pl 469 179 module am.pl 470 180 module am.pl 471 181 module am.pl 472 182 module am.pl 473 183 module am.pl 474 184 module am.pl 475 185 module am.pl 476 186 module am.pl 477 187 module am.pl 478 242 module am.pl 647 173 format LATEX 479 174 format LATEX 480 175 format LATEX 481 176 format LATEX 482 177 format LATEX 483 178 format LATEX 484 179 format LATEX 485 180 format LATEX 486 181 format LATEX 487 182 format LATEX 488 183 format LATEX 489 184 format LATEX 490 185 format LATEX 491 186 format LATEX 492 187 format LATEX 493 242 format LATEX 648 173 template invoice 506 174 template ar_transaction 507 175 template ap_transaction 508 176 template packing_list 509 177 template pick_list 510 178 template sales_order 511 179 template work_order 512 180 template purchase_order 513 181 template bin_list 514 182 template statement 515 185 template quotation 518 186 template rfq 519 187 template timecard 520 183 template check 516 184 template receipt 517 242 template letterhead 649 188 menu 1 521 189 module am.pl 522 189 action list_templates 523 189 template pos_invoice 524 189 format TEXT 525 190 action display_stylesheet 526 190 module am.pl 527 193 module login.pl 532 193 action logout 533 193 target _top 534 192 menu 1 530 192 new 1 531 0 menu 1 535 136 menu 1 536 144 menu 1 537 195 action add 540 195 module is.pl 541 196 action add 543 196 module ap.pl 544 197 action add 545 197 module ir.pl 547 196 type debit_note 549 194 type credit_note 548 195 type credit_invoice 542 197 type debit_invoice 546 202 batch_type payment_reversal 570 204 batch_type receipt_reversal 573 200 menu 1 552 198 action create_batch 554 198 module vouchers.pl 553 199 module vouchers.pl 559 199 action create_batch 560 201 module vouchers.pl 562 201 action create_batch 563 203 module vouchers.pl 565 203 action create_batch 566 203 batch_type receipts 567 202 module vouchers.pl 568 202 action create_batch 569 204 module vouchers.pl 571 204 action create_batch 572 201 batch_type payment 564 210 action search 585 210 module drafts.pl 586 199 batch_type ap 561 15 module customer.pl 35 45 module recon.pl 106 45 action new_report 107 44 module recon.pl 108 44 action search 109 211 module recon.pl 587 211 action search 588 211 hide_status 1 589 211 approved 0 590 211 submitted 1 591 198 batch_type ar 555 191 module user.pl 528 191 action preference_screen 529 217 menu 1 597 218 action add_taxform 598 218 module taxform.pl 599 137 module account.pl 355 137 action new 359 219 menu 1 600 220 module admin.pl 601 220 action new_user 602 221 module admin.pl 603 221 action search_users 604 222 module admin.pl 605 222 action list_sessions 606 49 l_last_name 1 115 49 l_employeenumber 1 116 49 l_first_name 1 613 49 l_id 1 614 49 l_startdate 1 615 49 l_enddate 1 616 225 module taxform.pl 613 225 action list_all 614 226 module taxform.pl 615 227 menu 1 616 228 menu 1 617 229 menu 1 618 230 action asset_category_screen 620 231 action asset_category_search 622 232 action asset_screen 624 233 action asset_search 626 234 module asset.pl 627 234 action new_report 628 235 module asset.pl 630 235 action import 631 236 menu 1 632 237 module asset.pl 633 237 action display_nbv 634 232 module asset.pl 623 230 module asset.pl 619 231 module asset.pl 621 233 module asset.pl 625 234 depreciation 1 629 238 action new_report 636 238 module asset.pl 635 239 module asset.pl 637 239 action search_reports 638 239 depreciation 1 639 240 module asset.pl 640 240 action search_reports 641 \. -- -- PostgreSQL database dump complete -- -- CREATE TABLE menu_acl ( id serial NOT NULL, role_name character varying, acl_type character varying, node_id integer, CONSTRAINT menu_acl_acl_type_check CHECK ((((acl_type)::text = 'allow'::text) OR ((acl_type)::text = 'deny'::text))), PRIMARY KEY (node_id, role_name) ); COMMENT ON TABLE menu_acl IS $$Provides access control list entries for menu nodes.$$; COMMENT ON COLUMN menu_acl.acl_type IS $$ Nodes are hidden unless a role is found of which the user is a member, and where the acl_type for that role type and node is set to 'allow' and no acl is found for any role of which the user is a member, where the acl_type is set to 'deny'.$$; ALTER TABLE ONLY menu_acl ADD CONSTRAINT menu_acl_node_id_fkey FOREIGN KEY (node_id) REFERENCES menu_node(id); -- -- PostgreSQL database dump complete -- CREATE OR REPLACE FUNCTION to_args (in_base text[], in_args text[]) RETURNS text[] AS $$ SELECT CASE WHEN $2[1] IS NULL OR $2[2] IS NULL THEN $1 ELSE $1 || ($2[1]::text || '=' || $2[2]::text) END; $$ language sql; COMMENT ON FUNCTION to_args(text[], text[]) IS $$ This function takes two arguments. The first is a one-dimensional array representing the base state of the argument array. The second is a two element array of {key, value}. If either of the args is null, it returns the first argument. Otherwise it returns the first initial array, concatenated with key || '=' || value. It primarily exists for the to_args aggregate. $$; CREATE AGGREGATE to_args ( basetype = text[], sfunc = to_args, stype = text[], INITCOND = '{}' ); COMMENT ON AGGREGATE to_args(text[]) IS $$ Turns a setof ARRAY[key,value] into an ARRAY[key||'='||value, key||'='||value,...] $$; CREATE TYPE menu_item AS ( position int, id int, level int, label varchar, path varchar, args varchar[] ); CREATE OR REPLACE FUNCTION menu_generate() RETURNS SETOF menu_item AS $$ DECLARE item menu_item; arg menu_attribute%ROWTYPE; BEGIN FOR item IN SELECT n.position, n.id, c.level, n.label, c.path, to_args(array[ma.attribute, ma.value]) FROM connectby('menu_node', 'id', 'parent', 'position', '0', 0, ',') c(id integer, parent integer, "level" integer, path text, list_order integer) JOIN menu_node n USING(id) JOIN menu_attribute ma ON (n.id = ma.node_id) WHERE n.id IN (select node_id FROM menu_acl JOIN (select rolname FROM pg_roles UNION select 'public') pgr ON pgr.rolname = role_name WHERE pg_has_role(CASE WHEN coalesce(pgr.rolname, 'public') = 'public' THEN current_user ELSE pgr.rolname END, 'USAGE') GROUP BY node_id HAVING bool_and(CASE WHEN acl_type ilike 'DENY' THEN FALSE WHEN acl_type ilike 'ALLOW' THEN TRUE END)) or exists (select cn.id, cc.path FROM connectby('menu_node', 'id', 'parent', 'position', '0', 0, ',') cc(id integer, parent integer, "level" integer, path text, list_order integer) JOIN menu_node cn USING(id) WHERE cn.id IN (select node_id FROM menu_acl JOIN (select rolname FROM pg_roles UNION select 'public') pgr ON pgr.rolname = role_name WHERE pg_has_role(CASE WHEN coalesce(pgr.rolname, 'public') = 'public' THEN current_user ELSE pgr.rolname END, 'USAGE') GROUP BY node_id HAVING bool_and(CASE WHEN acl_type ilike 'DENY' THEN false WHEN acl_type ilike 'ALLOW' THEN TRUE END)) and cc.path like c.path || ',%') GROUP BY n.position, n.id, c.level, n.label, c.path, c.list_order ORDER BY c.list_order LOOP RETURN NEXT item; END LOOP; END; $$ language plpgsql; COMMENT ON FUNCTION menu_generate() IS $$ This function returns the complete menu tree. It is used to generate nested menus for the web interface. $$; CREATE OR REPLACE FUNCTION menu_children(in_parent_id int) RETURNS SETOF menu_item AS $$ declare item menu_item; arg menu_attribute%ROWTYPE; begin FOR item IN SELECT n.position, n.id, c.level, n.label, c.path, to_args(array[ma.attribute, ma.value]) FROM connectby('menu_node', 'id', 'parent', 'position', in_parent_id, 1, ',') c(id integer, parent integer, "level" integer, path text, list_order integer) JOIN menu_node n USING(id) JOIN menu_attribute ma ON (n.id = ma.node_id) WHERE n.id IN (select node_id FROM menu_acl JOIN (select rolname FROM pg_roles UNION select 'public') pgr ON pgr.rolname = role_name WHERE pg_has_role(CASE WHEN coalesce(pgr.rolname, 'public') = 'public' THEN current_user ELSE pgr.rolname END, 'USAGE') GROUP BY node_id HAVING bool_and(CASE WHEN acl_type ilike 'DENY' THEN FALSE WHEN acl_type ilike 'ALLOW' THEN TRUE END)) or exists (select cn.id, cc.path FROM connectby('menu_node', 'id', 'parent', 'position', '0', 0, ',') cc(id integer, parent integer, "level" integer, path text, list_order integer) JOIN menu_node cn USING(id) WHERE cn.id IN (select node_id FROM menu_acl JOIN (select rolname FROM pg_roles UNION select 'public') pgr ON pgr.rolname = role_name WHERE pg_has_role(CASE WHEN coalesce(pgr.rolname, 'public') = 'public' THEN current_user ELSE pgr.rolname END, 'USAGE') GROUP BY node_id HAVING bool_and(CASE WHEN acl_type ilike 'DENY' THEN false WHEN acl_type ilike 'ALLOW' THEN TRUE END)) and cc.path like c.path || ',%') GROUP BY n.position, n.id, c.level, n.label, c.path, c.list_order ORDER BY c.list_order LOOP return next item; end loop; end; $$ language plpgsql; COMMENT ON FUNCTION menu_children(int) IS $$ This function returns all menu items which are children of in_parent_id (the only input parameter). It is thus similar to menu_generate() but it only returns the menu items associated with nodes directly descendant from the parent. It is used for menues for frameless browsers.$$; CREATE OR REPLACE FUNCTION menu_insert(in_parent_id int, in_position int, in_label text) returns int AS $$ DECLARE new_id int; BEGIN UPDATE menu_node SET position = position * -1 WHERE parent = in_parent_id AND position >= in_position; INSERT INTO menu_node (parent, position, label) VALUES (in_parent_id, in_position, in_label); SELECT INTO new_id currval('menu_node_id_seq'); UPDATE menu_node SET position = (position * -1) + 1 WHERE parent = in_parent_id AND position < 0; RETURN new_id; END; $$ language plpgsql; comment on function menu_insert(int, int, text) is $$ This function inserts menu items at arbitrary positions. The arguments are, in order: parent, position, label. The return value is the id number of the menu item created. $$; CREATE VIEW menu_friendly AS SELECT t."level", t.path, t.list_order, (repeat(' '::text, (2 * t."level")) || (n.label)::text) AS label, n.id, n."position" FROM (connectby('menu_node'::text, 'id'::text, 'parent'::text, 'position'::text, '0'::text, 0, ','::text ) t(id integer, parent integer, "level" integer, path text, list_order integer) JOIN menu_node n USING (id)); COMMENT ON VIEW menu_friendly IS $$ A nice human-readable view for investigating the menu tree. Does not show menu attributes or acls.$$; --ALTER TABLE public.menu_friendly OWNER TO ledgersmb; -- -- PostgreSQL database dump complete -- CREATE AGGREGATE as_array ( BASETYPE = ANYELEMENT, STYPE = ANYARRAY, SFUNC = ARRAY_APPEND, INITCOND = '{}' ); COMMENT ON AGGREGATE as_array(ANYELEMENT) IS $$ A basic array aggregate to take elements and return a one-dimensional array. Example: SELECT as_array(id) from entity_class; $$; CREATE AGGREGATE compound_array ( BASETYPE = ANYARRAY, STYPE = ANYARRAY, SFUNC = ARRAY_CAT, INITCOND = '{}' ); COMMENT ON AGGREGATE compound_array(ANYARRAY) is $$ Returns an n dimensional array. Example: SELECT as_array(ARRAY[id::text, class]) from contact_class $$; CREATE INDEX ap_approved_idx ON ap(approved); CREATE INDEX ar_approved_idx ON ar(approved); CREATE INDEX gl_approved_idx ON gl(approved); CREATE TABLE pending_job ( id serial not null unique, batch_class int references batch_class(id), entered_by text REFERENCES users(username) not null default SESSION_USER, entered_at timestamp default now(), batch_id int references batch(id), completed_at timestamp, success bool, error_condition text, CHECK (completed_at IS NULL OR success IS NOT NULL), CHECK (success IS NOT FALSE OR error_condition IS NOT NULL) ); COMMENT ON table pending_job IS $$ Purpose: This table stores pending/queued jobs to be processed async. Additionally, this functions as a log of all such processing for purposes of internal audits, performance tuning, and the like. $$; CREATE INDEX pending_job_batch_id_pending ON pending_job(batch_id) where success IS NULL; CREATE INDEX pending_job_entered_by ON pending_job(entered_by); CREATE OR REPLACE FUNCTION trigger_pending_job() RETURNS TRIGGER AS $$ BEGIN IF NEW.success IS NULL THEN NOTIFY job_entered; END IF; RETURN NEW; END; $$ LANGUAGE PLPGSQL; CREATE TRIGGER notify_pending_jobs BEFORE INSERT OR UPDATE ON pending_job FOR EACH ROW EXECUTE PROCEDURE trigger_pending_job(); CREATE TABLE payments_queue ( transactions numeric[], batch_id int, source text, total numeric, ar_ap_accno text, cash_accno text, payment_date date, account_class int, job_id int references pending_job(id) DEFAULT currval('pending_job_id_seq') ); CREATE INDEX payments_queue_job_id ON payments_queue(job_id); COMMENT ON table payments_queue IS $$ This is a holding table and hence not a candidate for normalization. Jobs should be deleted from this table when they complete successfully.$$; CREATE TABLE new_shipto ( id serial primary key, trans_id int references transactions(id), oe_id int references oe(id), location_id int references location(id) ); COMMENT ON TABLE new_shipto IS $$ Tracks ship_to information for orders and invoices.$$; CREATE TABLE tax_extended ( tax_basis numeric, rate numeric, entry_id int primary key references acc_trans(entry_id) ); COMMENT ON TABLE tax_extended IS $$ This stores extended information for manual tax calculations.$$; CREATE OR REPLACE VIEW periods AS SELECT 'ytd' as id, 'Year to Date' as label, now()::date as date_to, (extract('year' from now())::text || '-01-01')::date as date_from UNION SELECT 'last_year', 'Last Year', ((extract('YEAR' from now()) - 1)::text || '-12-31')::date as date_to, ((extract('YEAR' from now()) - 1)::text || '-01-01')::date as date_from ; GRANT SELECT ON periods TO public; CREATE TABLE asset_unit_class ( id int not null unique, class text primary key ); INSERT INTO asset_unit_class (id, class) values (1, 'time'); INSERT INTO asset_unit_class (id, class) values (2, 'production'); -- production-based depreciation is unlikely to be supported initially CREATE TABLE asset_dep_method( id serial unique not null, method text primary key, sproc text not null unique, unit_label text not null, short_name text not null unique, unit_class int not null references asset_unit_class(id) ); COMMENT ON TABLE asset_dep_method IS $$ Stores asset depreciation methods, and their relevant stored procedures. The fixed asset system is such depreciation methods can be plugged in via this table.$$; COMMENT ON COLUMN asset_dep_method.sproc IS $$The sproc mentioned here is a stored procedure which must have the following arguments: (in_asset_ids int[], in_report_date date, in_report_id int). Here in_asset_ids are the assets to be depreciated, in_report_date is the date of the report, and in_report_id is the id of the report. The sproc MUST insert the relevant lines into asset_report_line. $$; comment on column asset_dep_method.method IS $$ These are keyed to specific stored procedures. Currently only "straight_line" is supported$$; INSERT INTO asset_dep_method(method, unit_class, sproc, unit_label, short_name) values ('Annual Straight Line Daily', 1, 'asset_dep_straight_line_yr_d', 'in years', 'SLYD'); INSERT INTO asset_dep_method(method, unit_class, sproc, unit_label, short_name) values ('Whole Month Straight Line', 1, 'asset_dep_straight_line_whl_m', 'in months', 'SLMM'); INSERT INTO asset_dep_method(method, unit_class, sproc, unit_label, short_name) values ('Annual Straight Line Monthly', 1, 'asset_dep_straight_line_yr_m', 'in years', 'SLYM'); CREATE TABLE asset_class ( id serial not null unique, label text primary key, asset_account_id int references account(id), dep_account_id int references account(id), method int references asset_dep_method(id) ); COMMENT ON TABLE asset_class IS $$ The account fields here set the defaults for the individual asset items. They are non-authoritative. $$; CREATE TABLE asset_disposal_method ( label text primary key, id serial unique, multiple int check (multiple in (1, 0, -1)), short_label char(1) ); INSERT INTO asset_disposal_method (label, multiple, short_label) values ('Abandonment', '0', 'A'); INSERT INTO asset_disposal_method (label, multiple, short_label) values ('Sale', '1', 'S'); CREATE TABLE asset_item ( id serial primary key, -- needed due to possible null in natural key description text, tag text not null, purchase_value numeric, salvage_value numeric, usable_life numeric, purchase_date date not null, start_depreciation date not null, location_id int references warehouse(id), department_id int references department(id), invoice_id int references ap(id), asset_account_id int references account(id), dep_account_id int references account(id), exp_account_id int references account(id), obsolete_by int references asset_item(id), asset_class_id int references asset_class(id), unique (tag, obsolete_by) -- part 1 of natural key enforcement ); CREATE UNIQUE INDEX asset_item_active_tag_u ON asset_item(tag) WHERE obsolete_by is null; -- part 2 of natural key enforcement COMMENT ON TABLE asset_item IS $$ Stores details of asset items. The account fields here are authoritative, while the ones in the asset_class table are defaults.$$; COMMENT ON column asset_item.tag IS $$ This can be plugged into other routines to generate it automatically via ALTER TABLE .... SET DEFAULT.....$$; CREATE TABLE asset_note ( foreign key (ref_key) references asset_item(id), check (note_class = 4) ) inherits (note); INSERT INTO note_class (id, class) values (4, 'Asset'); ALTER TABLE asset_note alter column note_class set default 4; CREATE TABLE asset_report_class ( id int not null unique, class text primary key ); INSERT INTO asset_report_class (id, class) values (1, 'depreciation'); INSERT INTO asset_report_class (id, class) values (2, 'disposal'); INSERT INTO asset_report_class (id, class) values (3, 'import'); INSERT INTO asset_report_class (id, class) values (4, 'partial disposal'); COMMENT ON TABLE asset_report_class IS $$ By default only four types of asset reports are supported. In the future others may be added. Please correspond on the list before adding more types.$$; CREATE TABLE asset_report ( id serial primary key, report_date date, gl_id bigint references gl(id) unique, asset_class bigint references asset_class(id), report_class int references asset_report_class(id), entered_by bigint not null references entity(id), approved_by bigint references entity(id), entered_at timestamp default now(), approved_at timestamp, depreciated_qty numeric, dont_approve bool default false, submitted bool not null default false ); COMMENT ON TABLE asset_report IS $$ Asset reports are discrete sets of depreciation or disposal transctions, and each one may be turned into no more than one GL transaction.$$; CREATE TABLE asset_report_line( asset_id bigint references asset_item(id), report_id bigint references asset_report(id), amount numeric, department_id int references department(id), warehouse_id int references warehouse(id), PRIMARY KEY(asset_id, report_id) ); COMMENT ON column asset_report_line.department_id IS $$ In case assets are moved between departments, we have to store this here.$$; CREATE TABLE asset_rl_to_disposal_method ( report_id int references asset_report(id), asset_id int references asset_item(id), disposal_method_id int references asset_disposal_method(id), percent_disposed numeric, primary key (report_id, asset_id, disposal_method_id) ); COMMENT ON TABLE asset_rl_to_disposal_method IS $$ Maps disposal method to line items in the asset disposal report.$$; CREATE TABLE mime_type ( id serial not null unique, mime_type text primary key, invoice_include bool default false ); COMMENT ON TABLE mime_type IS $$ This is a lookup table for storing MIME types.$$; INSERT INTO mime_type (mime_type) VALUES('all/all'); INSERT INTO mime_type (mime_type) VALUES('all/allfiles'); INSERT INTO mime_type (mime_type) VALUES('audio/x-flac'); INSERT INTO mime_type (mime_type) VALUES('audio/x-ape'); INSERT INTO mime_type (mime_type) VALUES('audio/x-scpls'); INSERT INTO mime_type (mime_type) VALUES('audio/mp4'); INSERT INTO mime_type (mime_type) VALUES('audio/mpeg'); INSERT INTO mime_type (mime_type) VALUES('audio/x-iriver-pla'); INSERT INTO mime_type (mime_type) VALUES('audio/x-speex+ogg'); INSERT INTO mime_type (mime_type) VALUES('audio/x-mod'); INSERT INTO mime_type (mime_type) VALUES('audio/x-tta'); INSERT INTO mime_type (mime_type) VALUES('audio/annodex'); INSERT INTO mime_type (mime_type) VALUES('audio/x-mo3'); INSERT INTO mime_type (mime_type) VALUES('audio/midi'); INSERT INTO mime_type (mime_type) VALUES('audio/mp2'); INSERT INTO mime_type (mime_type) VALUES('audio/x-musepack'); INSERT INTO mime_type (mime_type) VALUES('audio/x-minipsf'); INSERT INTO mime_type (mime_type) VALUES('audio/x-mpegurl'); INSERT INTO mime_type (mime_type) VALUES('audio/x-aiff'); INSERT INTO mime_type (mime_type) VALUES('audio/x-xm'); INSERT INTO mime_type (mime_type) VALUES('audio/x-aifc'); INSERT INTO mime_type (mime_type) VALUES('audio/x-m4b'); INSERT INTO mime_type (mime_type) VALUES('audio/aac'); INSERT INTO mime_type (mime_type) VALUES('audio/x-psflib'); INSERT INTO mime_type (mime_type) VALUES('audio/x-pn-realaudio-plugin'); INSERT INTO mime_type (mime_type) VALUES('audio/basic'); INSERT INTO mime_type (mime_type) VALUES('audio/x-ms-wma'); INSERT INTO mime_type (mime_type) VALUES('audio/AMR-WB'); INSERT INTO mime_type (mime_type) VALUES('audio/x-riff'); INSERT INTO mime_type (mime_type) VALUES('audio/x-psf'); INSERT INTO mime_type (mime_type) VALUES('audio/x-adpcm'); INSERT INTO mime_type (mime_type) VALUES('audio/ogg'); INSERT INTO mime_type (mime_type) VALUES('audio/x-wav'); INSERT INTO mime_type (mime_type) VALUES('audio/x-matroska'); INSERT INTO mime_type (mime_type) VALUES('audio/x-voc'); INSERT INTO mime_type (mime_type) VALUES('audio/ac3'); INSERT INTO mime_type (mime_type) VALUES('audio/x-flac+ogg'); INSERT INTO mime_type (mime_type) VALUES('audio/x-aiffc'); INSERT INTO mime_type (mime_type) VALUES('audio/x-it'); INSERT INTO mime_type (mime_type) VALUES('audio/AMR'); INSERT INTO mime_type (mime_type) VALUES('audio/x-s3m'); INSERT INTO mime_type (mime_type) VALUES('audio/x-speex'); INSERT INTO mime_type (mime_type) VALUES('audio/x-wavpack'); INSERT INTO mime_type (mime_type) VALUES('audio/x-xi'); INSERT INTO mime_type (mime_type) VALUES('audio/x-xmf'); INSERT INTO mime_type (mime_type) VALUES('audio/x-wavpack-correction'); INSERT INTO mime_type (mime_type) VALUES('audio/prs.sid'); INSERT INTO mime_type (mime_type) VALUES('audio/x-gsm'); INSERT INTO mime_type (mime_type) VALUES('audio/x-ms-asx'); INSERT INTO mime_type (mime_type) VALUES('audio/x-vorbis+ogg'); INSERT INTO mime_type (mime_type) VALUES('audio/x-stm'); INSERT INTO mime_type (mime_type) VALUES('x-epoc/x-sisx-app'); INSERT INTO mime_type (mime_type) VALUES('image/x-fpx'); INSERT INTO mime_type (mime_type) VALUES('image/x-panasonic-raw'); INSERT INTO mime_type (mime_type) VALUES('image/x-xwindowdump'); INSERT INTO mime_type (mime_type) VALUES('image/x-nikon-nef'); INSERT INTO mime_type (mime_type) VALUES('image/x-niff'); INSERT INTO mime_type (mime_type) VALUES('image/x-pict'); INSERT INTO mime_type (mime_type) VALUES('image/svg+xml-compressed'); INSERT INTO mime_type (mime_type) VALUES('image/jp2'); INSERT INTO mime_type (mime_type) VALUES('image/x-msod'); INSERT INTO mime_type (mime_type) VALUES('image/x-dds'); INSERT INTO mime_type (mime_type) VALUES('image/x-olympus-orf'); INSERT INTO mime_type (mime_type) VALUES('image/x-portable-graymap'); INSERT INTO mime_type (mime_type) VALUES('image/x-skencil'); INSERT INTO mime_type (mime_type) VALUES('image/x-sony-srf'); INSERT INTO mime_type (mime_type) VALUES('image/x-dib'); INSERT INTO mime_type (mime_type) VALUES('image/x-emf'); INSERT INTO mime_type (mime_type) VALUES('image/x-eps'); INSERT INTO mime_type (mime_type) VALUES('image/ief'); INSERT INTO mime_type (mime_type) VALUES('image/x-pcx'); INSERT INTO mime_type (mime_type) VALUES('image/x-gzeps'); INSERT INTO mime_type (mime_type) VALUES('image/x-xcf'); INSERT INTO mime_type (mime_type) VALUES('image/x-portable-pixmap'); INSERT INTO mime_type (mime_type) VALUES('image/x-kde-raw'); INSERT INTO mime_type (mime_type) VALUES('image/openraster'); INSERT INTO mime_type (mime_type) VALUES('image/x-macpaint'); INSERT INTO mime_type (mime_type) VALUES('image/x-wmf'); INSERT INTO mime_type (mime_type) VALUES('image/x-win-bitmap'); INSERT INTO mime_type (mime_type) VALUES('image/x-sgi'); INSERT INTO mime_type (mime_type) VALUES('image/x-ilbm'); INSERT INTO mime_type (mime_type) VALUES('image/x-sony-sr2'); INSERT INTO mime_type (mime_type) VALUES('image/x-sigma-x3f'); INSERT INTO mime_type (mime_type) VALUES('image/x-bzeps'); INSERT INTO mime_type (mime_type) VALUES('image/x-icns'); INSERT INTO mime_type (mime_type) VALUES('image/g3fax'); INSERT INTO mime_type (mime_type) VALUES('image/x-applix-graphics'); INSERT INTO mime_type (mime_type) VALUES('image/x-xcursor'); INSERT INTO mime_type (mime_type) VALUES('image/x-kodak-dcr'); INSERT INTO mime_type (mime_type) VALUES('image/x-hdr'); INSERT INTO mime_type (mime_type) VALUES('image/x-cmu-raster'); INSERT INTO mime_type (mime_type) VALUES('image/x-sun-raster'); INSERT INTO mime_type (mime_type) VALUES('image/fax-g3'); INSERT INTO mime_type (mime_type) VALUES('image/x-kodak-kdc'); INSERT INTO mime_type (mime_type) VALUES('image/jpeg'); INSERT INTO mime_type (mime_type) VALUES('image/tiff'); INSERT INTO mime_type (mime_type) VALUES('image/dpx'); INSERT INTO mime_type (mime_type) VALUES('image/x-dcraw'); INSERT INTO mime_type (mime_type) VALUES('image/x-adobe-dng'); INSERT INTO mime_type (mime_type) VALUES('image/x-canon-crw'); INSERT INTO mime_type (mime_type) VALUES('image/bmp'); INSERT INTO mime_type (mime_type) VALUES('image/x-xfig'); INSERT INTO mime_type (mime_type) VALUES('image/x-lwo'); INSERT INTO mime_type (mime_type) VALUES('image/x-fuji-raf'); INSERT INTO mime_type (mime_type) VALUES('image/x-xbitmap'); INSERT INTO mime_type (mime_type) VALUES('image/x-pentax-pef'); INSERT INTO mime_type (mime_type) VALUES('image/x-exr'); INSERT INTO mime_type (mime_type) VALUES('image/rle'); INSERT INTO mime_type (mime_type) VALUES('image/x-3ds'); INSERT INTO mime_type (mime_type) VALUES('image/svg+xml'); INSERT INTO mime_type (mime_type) VALUES('image/x-lws'); INSERT INTO mime_type (mime_type) VALUES('image/x-tga'); INSERT INTO mime_type (mime_type) VALUES('image/x-compressed-xcf'); INSERT INTO mime_type (mime_type) VALUES('image/fits'); INSERT INTO mime_type (mime_type) VALUES('image/x-kodak-k25'); INSERT INTO mime_type (mime_type) VALUES('image/x-portable-bitmap'); INSERT INTO mime_type (mime_type) VALUES('image/x-quicktime'); INSERT INTO mime_type (mime_type) VALUES('image/x-sony-arw'); INSERT INTO mime_type (mime_type) VALUES('image/x-xpixmap'); INSERT INTO mime_type (mime_type) VALUES('image/gif'); INSERT INTO mime_type (mime_type) VALUES('image/x-portable-anymap'); INSERT INTO mime_type (mime_type) VALUES('image/x-jng'); INSERT INTO mime_type (mime_type) VALUES('image/x-iff'); INSERT INTO mime_type (mime_type) VALUES('image/x-canon-cr2'); INSERT INTO mime_type (mime_type) VALUES('image/cgm'); INSERT INTO mime_type (mime_type) VALUES('image/x-photo-cd'); INSERT INTO mime_type (mime_type) VALUES('image/png'); INSERT INTO mime_type (mime_type) VALUES('image/x-minolta-mrw'); INSERT INTO mime_type (mime_type) VALUES('image/x-rgb'); INSERT INTO mime_type (mime_type) VALUES('image/x-pic'); INSERT INTO mime_type (mime_type) VALUES('message/disposition-notification'); INSERT INTO mime_type (mime_type) VALUES('message/news'); INSERT INTO mime_type (mime_type) VALUES('message/partial'); INSERT INTO mime_type (mime_type) VALUES('message/x-gnu-rmail'); INSERT INTO mime_type (mime_type) VALUES('message/delivery-status'); INSERT INTO mime_type (mime_type) VALUES('message/external-body'); INSERT INTO mime_type (mime_type) VALUES('message/rfc822'); INSERT INTO mime_type (mime_type) VALUES('uri/mmst'); INSERT INTO mime_type (mime_type) VALUES('uri/rtspu'); INSERT INTO mime_type (mime_type) VALUES('uri/pnm'); INSERT INTO mime_type (mime_type) VALUES('uri/mmsu'); INSERT INTO mime_type (mime_type) VALUES('uri/rtspt'); INSERT INTO mime_type (mime_type) VALUES('uri/mms'); INSERT INTO mime_type (mime_type) VALUES('text/x-tcl'); INSERT INTO mime_type (mime_type) VALUES('text/directory'); INSERT INTO mime_type (mime_type) VALUES('text/htmlh'); INSERT INTO mime_type (mime_type) VALUES('text/x-literate-haskell'); INSERT INTO mime_type (mime_type) VALUES('text/xmcd'); INSERT INTO mime_type (mime_type) VALUES('text/x-ms-regedit'); INSERT INTO mime_type (mime_type) VALUES('text/x-microdvd'); INSERT INTO mime_type (mime_type) VALUES('text/x-erlang'); INSERT INTO mime_type (mime_type) VALUES('text/x-ssa'); INSERT INTO mime_type (mime_type) VALUES('text/plain'); INSERT INTO mime_type (mime_type) VALUES('text/spreadsheet'); INSERT INTO mime_type (mime_type) VALUES('text/sgml'); INSERT INTO mime_type (mime_type) VALUES('text/x-uil'); INSERT INTO mime_type (mime_type) VALUES('text/x-troff-mm'); INSERT INTO mime_type (mime_type) VALUES('text/x-gettext-translation'); INSERT INTO mime_type (mime_type) VALUES('text/x-vhdl'); INSERT INTO mime_type (mime_type) VALUES('text/x-java'); INSERT INTO mime_type (mime_type) VALUES('text/x-nfo'); INSERT INTO mime_type (mime_type) VALUES('text/csv'); INSERT INTO mime_type (mime_type) VALUES('text/x-install'); INSERT INTO mime_type (mime_type) VALUES('text/x-c++src'); INSERT INTO mime_type (mime_type) VALUES('text/x-subviewer'); INSERT INTO mime_type (mime_type) VALUES('text/x-adasrc'); INSERT INTO mime_type (mime_type) VALUES('text/x-dsl'); INSERT INTO mime_type (mime_type) VALUES('text/x-chdr'); INSERT INTO mime_type (mime_type) VALUES('text/calendar'); INSERT INTO mime_type (mime_type) VALUES('text/x-csharp'); INSERT INTO mime_type (mime_type) VALUES('text/x-lua'); INSERT INTO mime_type (mime_type) VALUES('text/x-ocaml'); INSERT INTO mime_type (mime_type) VALUES('text/x-iMelody'); INSERT INTO mime_type (mime_type) VALUES('text/enriched'); INSERT INTO mime_type (mime_type) VALUES('text/richtext'); INSERT INTO mime_type (mime_type) VALUES('text/x-objchdr'); INSERT INTO mime_type (mime_type) VALUES('text/x-makefile'); INSERT INTO mime_type (mime_type) VALUES('text/x-copying'); INSERT INTO mime_type (mime_type) VALUES('text/x-pascal'); INSERT INTO mime_type (mime_type) VALUES('text/x-credits'); INSERT INTO mime_type (mime_type) VALUES('text/x-mup'); INSERT INTO mime_type (mime_type) VALUES('text/x-opml+xml'); INSERT INTO mime_type (mime_type) VALUES('text/x-rpm-spec'); INSERT INTO mime_type (mime_type) VALUES('text/x-xmi'); INSERT INTO mime_type (mime_type) VALUES('text/x-dsrc'); INSERT INTO mime_type (mime_type) VALUES('text/x-patch'); INSERT INTO mime_type (mime_type) VALUES('text/x-authors'); INSERT INTO mime_type (mime_type) VALUES('text/x-ldif'); INSERT INTO mime_type (mime_type) VALUES('text/x-moc'); INSERT INTO mime_type (mime_type) VALUES('text/x-tex'); INSERT INTO mime_type (mime_type) VALUES('text/x-dcl'); INSERT INTO mime_type (mime_type) VALUES('text/x-python'); INSERT INTO mime_type (mime_type) VALUES('text/x-lilypond'); INSERT INTO mime_type (mime_type) VALUES('text/x-katefilelist'); INSERT INTO mime_type (mime_type) VALUES('text/troff'); INSERT INTO mime_type (mime_type) VALUES('text/x-hex'); INSERT INTO mime_type (mime_type) VALUES('text/x-google-video-pointer'); INSERT INTO mime_type (mime_type) VALUES('text/x-haskell'); INSERT INTO mime_type (mime_type) VALUES('text/x-ocl'); INSERT INTO mime_type (mime_type) VALUES('text/x-idl'); INSERT INTO mime_type (mime_type) VALUES('text/x-troff-me'); INSERT INTO mime_type (mime_type) VALUES('text/x-bibtex'); INSERT INTO mime_type (mime_type) VALUES('text/x-sql'); INSERT INTO mime_type (mime_type) VALUES('text/x-emacs-lisp'); INSERT INTO mime_type (mime_type) VALUES('text/x-eiffel'); INSERT INTO mime_type (mime_type) VALUES('text/css'); INSERT INTO mime_type (mime_type) VALUES('text/x-fortran'); INSERT INTO mime_type (mime_type) VALUES('text/x-xslfo'); INSERT INTO mime_type (mime_type) VALUES('text/x-matlab'); INSERT INTO mime_type (mime_type) VALUES('text/x-uri'); INSERT INTO mime_type (mime_type) VALUES('text/x-setext'); INSERT INTO mime_type (mime_type) VALUES('text/x-readme'); INSERT INTO mime_type (mime_type) VALUES('text/x-troff-ms'); INSERT INTO mime_type (mime_type) VALUES('text/x-cmake'); INSERT INTO mime_type (mime_type) VALUES('text/tab-separated-values'); INSERT INTO mime_type (mime_type) VALUES('text/x-log'); INSERT INTO mime_type (mime_type) VALUES('text/x-mpsub'); INSERT INTO mime_type (mime_type) VALUES('text/x-mof'); INSERT INTO mime_type (mime_type) VALUES('text/html'); INSERT INTO mime_type (mime_type) VALUES('text/x-txt2tags'); INSERT INTO mime_type (mime_type) VALUES('text/x-csrc'); INSERT INTO mime_type (mime_type) VALUES('text/rfc822-headers'); INSERT INTO mime_type (mime_type) VALUES('text/x-mrml'); INSERT INTO mime_type (mime_type) VALUES('text/x-vala'); INSERT INTO mime_type (mime_type) VALUES('text/x-iptables'); INSERT INTO mime_type (mime_type) VALUES('text/x-c++hdr'); INSERT INTO mime_type (mime_type) VALUES('text/x-scheme'); INSERT INTO mime_type (mime_type) VALUES('text/x-texinfo'); INSERT INTO mime_type (mime_type) VALUES('text/x-objcsrc'); INSERT INTO mime_type (mime_type) VALUES('text/x-changelog'); INSERT INTO mime_type (mime_type) VALUES('x-content/audio-dvd'); INSERT INTO mime_type (mime_type) VALUES('x-content/video-svcd'); INSERT INTO mime_type (mime_type) VALUES('x-content/video-hddvd'); INSERT INTO mime_type (mime_type) VALUES('x-content/blank-dvd'); INSERT INTO mime_type (mime_type) VALUES('x-content/video-vcd'); INSERT INTO mime_type (mime_type) VALUES('x-content/unix-software'); INSERT INTO mime_type (mime_type) VALUES('x-content/blank-cd'); INSERT INTO mime_type (mime_type) VALUES('x-content/audio-cdda'); INSERT INTO mime_type (mime_type) VALUES('x-content/win32-software'); INSERT INTO mime_type (mime_type) VALUES('x-content/blank-hddvd'); INSERT INTO mime_type (mime_type) VALUES('x-content/audio-player'); INSERT INTO mime_type (mime_type) VALUES('x-content/video-dvd'); INSERT INTO mime_type (mime_type) VALUES('x-content/image-picturecd'); INSERT INTO mime_type (mime_type) VALUES('x-content/blank-bd'); INSERT INTO mime_type (mime_type) VALUES('x-content/video-bluray'); INSERT INTO mime_type (mime_type) VALUES('x-content/image-dcf'); INSERT INTO mime_type (mime_type) VALUES('x-content/software'); INSERT INTO mime_type (mime_type) VALUES('model/vrml'); INSERT INTO mime_type (mime_type) VALUES('fonts/package'); INSERT INTO mime_type (mime_type) VALUES('application/x-hwp'); INSERT INTO mime_type (mime_type) VALUES('application/x-pkcs7-certificates'); INSERT INTO mime_type (mime_type) VALUES('application/x-shockwave-flash'); INSERT INTO mime_type (mime_type) VALUES('application/x-turtle'); INSERT INTO mime_type (mime_type) VALUES('application/x-rar'); INSERT INTO mime_type (mime_type) VALUES('application/x-bittorrent'); INSERT INTO mime_type (mime_type) VALUES('application/prs.plucker'); INSERT INTO mime_type (mime_type) VALUES('application/smil'); INSERT INTO mime_type (mime_type) VALUES('application/x-abiword'); INSERT INTO mime_type (mime_type) VALUES('application/x-blender'); INSERT INTO mime_type (mime_type) VALUES('application/x-oleo'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-sunos-news'); INSERT INTO mime_type (mime_type) VALUES('application/x-tex-gf'); INSERT INTO mime_type (mime_type) VALUES('application/x-netshow-channel'); INSERT INTO mime_type (mime_type) VALUES('application/x-m4'); INSERT INTO mime_type (mime_type) VALUES('application/x-kexiproject-sqlite2'); INSERT INTO mime_type (mime_type) VALUES('application/x-kpovmodeler'); INSERT INTO mime_type (mime_type) VALUES('application/illustrator'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-snf'); INSERT INTO mime_type (mime_type) VALUES('application/x-gedcom'); INSERT INTO mime_type (mime_type) VALUES('application/x-kexiproject-shortcut'); INSERT INTO mime_type (mime_type) VALUES('application/andrew-inset'); INSERT INTO mime_type (mime_type) VALUES('application/x-bzdvi'); INSERT INTO mime_type (mime_type) VALUES('application/x-siag'); INSERT INTO mime_type (mime_type) VALUES('application/x-ktheme'); INSERT INTO mime_type (mime_type) VALUES('application/x-kspread'); INSERT INTO mime_type (mime_type) VALUES('application/x-cbr'); INSERT INTO mime_type (mime_type) VALUES('application/x-cmakecache'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-framemaker'); INSERT INTO mime_type (mime_type) VALUES('application/x-msx-rom'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-vfont'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-ttx'); INSERT INTO mime_type (mime_type) VALUES('application/x-uml'); INSERT INTO mime_type (mime_type) VALUES('application/x-cdrdao-toc'); INSERT INTO mime_type (mime_type) VALUES('application/x-kpresenter'); INSERT INTO mime_type (mime_type) VALUES('application/x-kseg'); INSERT INTO mime_type (mime_type) VALUES('application/x-dvi'); INSERT INTO mime_type (mime_type) VALUES('application/x-java-applet'); INSERT INTO mime_type (mime_type) VALUES('application/x-palm-database'); INSERT INTO mime_type (mime_type) VALUES('application/pgp-encrypted'); INSERT INTO mime_type (mime_type) VALUES('application/x-pocket-word'); INSERT INTO mime_type (mime_type) VALUES('application/x-kmplot'); INSERT INTO mime_type (mime_type) VALUES('application/x-core'); INSERT INTO mime_type (mime_type) VALUES('application/x-profile'); INSERT INTO mime_type (mime_type) VALUES('application/x-mswinurl'); INSERT INTO mime_type (mime_type) VALUES('application/x-lha'); INSERT INTO mime_type (mime_type) VALUES('application/x-netcdf'); INSERT INTO mime_type (mime_type) VALUES('application/msword'); INSERT INTO mime_type (mime_type) VALUES('application/x-dar'); INSERT INTO mime_type (mime_type) VALUES('application/pgp-signature'); INSERT INTO mime_type (mime_type) VALUES('application/x-dmod'); INSERT INTO mime_type (mime_type) VALUES('application/x-fictionbook+xml'); INSERT INTO mime_type (mime_type) VALUES('application/x-gettext-translation'); INSERT INTO mime_type (mime_type) VALUES('application/x-ace'); INSERT INTO mime_type (mime_type) VALUES('application/x-macbinary'); INSERT INTO mime_type (mime_type) VALUES('application/x-nintendo-ds-rom'); INSERT INTO mime_type (mime_type) VALUES('application/x-troff-man-compressed'); INSERT INTO mime_type (mime_type) VALUES('application/x-java'); INSERT INTO mime_type (mime_type) VALUES('application/x-mimearchive'); INSERT INTO mime_type (mime_type) VALUES('application/xml-dtd'); INSERT INTO mime_type (mime_type) VALUES('application/x-smaf'); INSERT INTO mime_type (mime_type) VALUES('application/x-pw'); INSERT INTO mime_type (mime_type) VALUES('application/x-lhz'); INSERT INTO mime_type (mime_type) VALUES('application/x-dia-diagram'); INSERT INTO mime_type (mime_type) VALUES('application/x-kugar'); INSERT INTO mime_type (mime_type) VALUES('application/x-sv4cpio'); INSERT INTO mime_type (mime_type) VALUES('application/x-kcachegrind'); INSERT INTO mime_type (mime_type) VALUES('application/x-gnumeric'); INSERT INTO mime_type (mime_type) VALUES('application/x-fluid'); INSERT INTO mime_type (mime_type) VALUES('application/x-quattropro'); INSERT INTO mime_type (mime_type) VALUES('application/x-gzip'); INSERT INTO mime_type (mime_type) VALUES('application/x-shared-library-la'); INSERT INTO mime_type (mime_type) VALUES('application/x-gba-rom'); INSERT INTO mime_type (mime_type) VALUES('application/x-sc'); INSERT INTO mime_type (mime_type) VALUES('application/x-glade'); INSERT INTO mime_type (mime_type) VALUES('application/x-catalog'); INSERT INTO mime_type (mime_type) VALUES('application/x-php'); INSERT INTO mime_type (mime_type) VALUES('application/x-kexiproject-sqlite3'); INSERT INTO mime_type (mime_type) VALUES('application/x-asp'); INSERT INTO mime_type (mime_type) VALUES('application/x-sqlite2'); INSERT INTO mime_type (mime_type) VALUES('application/x-tzo'); INSERT INTO mime_type (mime_type) VALUES('application/x-wais-source'); INSERT INTO mime_type (mime_type) VALUES('application/x-jbuilder-project'); INSERT INTO mime_type (mime_type) VALUES('application/x-package-list'); INSERT INTO mime_type (mime_type) VALUES('application/annodex'); INSERT INTO mime_type (mime_type) VALUES('application/x-toutdoux'); INSERT INTO mime_type (mime_type) VALUES('application/x-stuffit'); INSERT INTO mime_type (mime_type) VALUES('application/pkcs10'); INSERT INTO mime_type (mime_type) VALUES('application/x-sv4crc'); INSERT INTO mime_type (mime_type) VALUES('application/x-java-keystore'); INSERT INTO mime_type (mime_type) VALUES('application/x-kommander'); INSERT INTO mime_type (mime_type) VALUES('application/x-sami'); INSERT INTO mime_type (mime_type) VALUES('application/xspf+xml'); INSERT INTO mime_type (mime_type) VALUES('application/x-killustrator'); INSERT INTO mime_type (mime_type) VALUES('application/x-kgetlist'); INSERT INTO mime_type (mime_type) VALUES('application/x-hdf'); INSERT INTO mime_type (mime_type) VALUES('application/x-mobipocket-ebook'); INSERT INTO mime_type (mime_type) VALUES('application/x-shellscript'); INSERT INTO mime_type (mime_type) VALUES('application/xhtml+xml'); INSERT INTO mime_type (mime_type) VALUES('application/x-compressed-tar'); INSERT INTO mime_type (mime_type) VALUES('application/x-nzb'); INSERT INTO mime_type (mime_type) VALUES('application/x-markaby'); INSERT INTO mime_type (mime_type) VALUES('application/x-sms-rom'); INSERT INTO mime_type (mime_type) VALUES('application/rtf'); INSERT INTO mime_type (mime_type) VALUES('application/x-tuberling'); INSERT INTO mime_type (mime_type) VALUES('application/x-kgeo'); INSERT INTO mime_type (mime_type) VALUES('application/x-n64-rom'); INSERT INTO mime_type (mime_type) VALUES('application/x-smb-server'); INSERT INTO mime_type (mime_type) VALUES('application/pkix-crl'); INSERT INTO mime_type (mime_type) VALUES('application/x-dbf'); INSERT INTO mime_type (mime_type) VALUES('application/x-webarchive'); INSERT INTO mime_type (mime_type) VALUES('application/x-smb-workgroup'); INSERT INTO mime_type (mime_type) VALUES('application/x-gnome-theme-package'); INSERT INTO mime_type (mime_type) VALUES('application/epub+zip'); INSERT INTO mime_type (mime_type) VALUES('application/x-kchart'); INSERT INTO mime_type (mime_type) VALUES('application/x-aportisdoc'); INSERT INTO mime_type (mime_type) VALUES('application/x-cisco-vpn-settings'); INSERT INTO mime_type (mime_type) VALUES('application/x-egon'); INSERT INTO mime_type (mime_type) VALUES('application/x-kword'); INSERT INTO mime_type (mime_type) VALUES('application/x-xbel'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-type1'); INSERT INTO mime_type (mime_type) VALUES('application/x-lzip'); INSERT INTO mime_type (mime_type) VALUES('application/x-gdbm'); INSERT INTO mime_type (mime_type) VALUES('application/x-executable'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-linux-psf'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-tex-tfm'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-afm'); INSERT INTO mime_type (mime_type) VALUES('application/x-kcsrc'); INSERT INTO mime_type (mime_type) VALUES('application/x-kontour'); INSERT INTO mime_type (mime_type) VALUES('application/x-msi'); INSERT INTO mime_type (mime_type) VALUES('application/x-cd-image'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-libgrx'); INSERT INTO mime_type (mime_type) VALUES('application/x-designer'); INSERT INTO mime_type (mime_type) VALUES('application/x-nautilus-link'); INSERT INTO mime_type (mime_type) VALUES('application/x-zerosize'); INSERT INTO mime_type (mime_type) VALUES('application/x-superkaramba'); INSERT INTO mime_type (mime_type) VALUES('application/x-quanta'); INSERT INTO mime_type (mime_type) VALUES('application/ram'); INSERT INTO mime_type (mime_type) VALUES('application/javascript'); INSERT INTO mime_type (mime_type) VALUES('application/rdf+xml'); INSERT INTO mime_type (mime_type) VALUES('application/x-spss-por'); INSERT INTO mime_type (mime_type) VALUES('application/x-gnuplot'); INSERT INTO mime_type (mime_type) VALUES('application/x-kformula'); INSERT INTO mime_type (mime_type) VALUES('application/x-mif'); INSERT INTO mime_type (mime_type) VALUES('application/x-amipro'); INSERT INTO mime_type (mime_type) VALUES('application/x-slp'); INSERT INTO mime_type (mime_type) VALUES('application/x-audacity-project'); INSERT INTO mime_type (mime_type) VALUES('application/x-archive'); INSERT INTO mime_type (mime_type) VALUES('application/x-windows-themepack'); INSERT INTO mime_type (mime_type) VALUES('application/x-t602'); INSERT INTO mime_type (mime_type) VALUES('application/x-mswrite'); INSERT INTO mime_type (mime_type) VALUES('application/dicom'); INSERT INTO mime_type (mime_type) VALUES('application/x-gzdvi'); INSERT INTO mime_type (mime_type) VALUES('application/x-chm'); INSERT INTO mime_type (mime_type) VALUES('application/x-lzma-compressed-tar'); INSERT INTO mime_type (mime_type) VALUES('application/x-7z-compressed'); INSERT INTO mime_type (mime_type) VALUES('application/postscript'); INSERT INTO mime_type (mime_type) VALUES('application/x-gtktalog'); INSERT INTO mime_type (mime_type) VALUES('application/x-alz'); INSERT INTO mime_type (mime_type) VALUES('application/x-ustar'); INSERT INTO mime_type (mime_type) VALUES('application/x-troff-man'); INSERT INTO mime_type (mime_type) VALUES('application/xml'); INSERT INTO mime_type (mime_type) VALUES('application/sieve'); INSERT INTO mime_type (mime_type) VALUES('application/x-konsole'); INSERT INTO mime_type (mime_type) VALUES('application/x-dc-rom'); INSERT INTO mime_type (mime_type) VALUES('application/xsd'); INSERT INTO mime_type (mime_type) VALUES('application/pkcs7-mime'); INSERT INTO mime_type (mime_type) VALUES('application/x-xz'); INSERT INTO mime_type (mime_type) VALUES('application/x-cda'); INSERT INTO mime_type (mime_type) VALUES('application/x-abicollab'); INSERT INTO mime_type (mime_type) VALUES('application/x-cpio'); INSERT INTO mime_type (mime_type) VALUES('application/x-tgif'); INSERT INTO mime_type (mime_type) VALUES('application/x-class-file'); INSERT INTO mime_type (mime_type) VALUES('application/x-desktop'); INSERT INTO mime_type (mime_type) VALUES('application/x-reject'); INSERT INTO mime_type (mime_type) VALUES('application/x-xz-compressed-tar'); INSERT INTO mime_type (mime_type) VALUES('application/x-kivio'); INSERT INTO mime_type (mime_type) VALUES('application/x-kopete-emoticons'); INSERT INTO mime_type (mime_type) VALUES('application/x-kexi-connectiondata'); INSERT INTO mime_type (mime_type) VALUES('application/x-compress'); INSERT INTO mime_type (mime_type) VALUES('application/x-gmc-link'); INSERT INTO mime_type (mime_type) VALUES('application/x-krita'); INSERT INTO mime_type (mime_type) VALUES('application/x-java-archive'); INSERT INTO mime_type (mime_type) VALUES('application/x-theme'); INSERT INTO mime_type (mime_type) VALUES('application/x-deb'); INSERT INTO mime_type (mime_type) VALUES('application/x-gnucash'); INSERT INTO mime_type (mime_type) VALUES('application/x-cabri'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-otf'); INSERT INTO mime_type (mime_type) VALUES('application/x-kexiproject-sqlite'); INSERT INTO mime_type (mime_type) VALUES('application/x-lzma'); INSERT INTO mime_type (mime_type) VALUES('application/rss+xml'); INSERT INTO mime_type (mime_type) VALUES('application/x-khtml-adaptor'); INSERT INTO mime_type (mime_type) VALUES('application/x-gzpostscript'); INSERT INTO mime_type (mime_type) VALUES('application/x-bzip'); INSERT INTO mime_type (mime_type) VALUES('application/mathml+xml'); INSERT INTO mime_type (mime_type) VALUES('application/x-chess-pgn'); INSERT INTO mime_type (mime_type) VALUES('application/x-remote-connection'); INSERT INTO mime_type (mime_type) VALUES('application/x-gameboy-rom'); INSERT INTO mime_type (mime_type) VALUES('application/pkix-pkipath'); INSERT INTO mime_type (mime_type) VALUES('application/x-shorten'); INSERT INTO mime_type (mime_type) VALUES('application/x-snes-rom'); INSERT INTO mime_type (mime_type) VALUES('application/x-quicktime-media-link'); INSERT INTO mime_type (mime_type) VALUES('application/x-ruby'); INSERT INTO mime_type (mime_type) VALUES('application/x-tarz'); INSERT INTO mime_type (mime_type) VALUES('application/ogg'); INSERT INTO mime_type (mime_type) VALUES('application/x-ole-storage'); INSERT INTO mime_type (mime_type) VALUES('application/x-shar'); INSERT INTO mime_type (mime_type) VALUES('application/x-ksysv-package'); INSERT INTO mime_type (mime_type) VALUES('application/x-x509-ca-cert'); INSERT INTO mime_type (mime_type) VALUES('application/x-par2'); INSERT INTO mime_type (mime_type) VALUES('application/x-linguist'); INSERT INTO mime_type (mime_type) VALUES('application/x-trig'); INSERT INTO mime_type (mime_type) VALUES('application/mac-binhex40'); INSERT INTO mime_type (mime_type) VALUES('application/x-qw'); INSERT INTO mime_type (mime_type) VALUES('application/xml-external-parsed-entity'); INSERT INTO mime_type (mime_type) VALUES('application/octet-stream'); INSERT INTO mime_type (mime_type) VALUES('application/x-matroska'); INSERT INTO mime_type (mime_type) VALUES('application/x-applix-spreadsheet'); INSERT INTO mime_type (mime_type) VALUES('application/x-plasma'); INSERT INTO mime_type (mime_type) VALUES('application/x-e-theme'); INSERT INTO mime_type (mime_type) VALUES('application/x-cbz'); INSERT INTO mime_type (mime_type) VALUES('application/x-java-jnlp-file'); INSERT INTO mime_type (mime_type) VALUES('application/x-kns'); INSERT INTO mime_type (mime_type) VALUES('application/x-win-lnk'); INSERT INTO mime_type (mime_type) VALUES('application/x-ufraw'); INSERT INTO mime_type (mime_type) VALUES('application/x-drgeo'); INSERT INTO mime_type (mime_type) VALUES('application/x-perl'); INSERT INTO mime_type (mime_type) VALUES('application/pkcs7-signature'); INSERT INTO mime_type (mime_type) VALUES('application/x-ms-dos-executable'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-tex'); INSERT INTO mime_type (mime_type) VALUES('application/x-kolf'); INSERT INTO mime_type (mime_type) VALUES('application/x-planperfect'); INSERT INTO mime_type (mime_type) VALUES('application/x-go-sgf'); INSERT INTO mime_type (mime_type) VALUES('application/x-kwallet'); INSERT INTO mime_type (mime_type) VALUES('application/x-rpm'); INSERT INTO mime_type (mime_type) VALUES('application/sdp'); INSERT INTO mime_type (mime_type) VALUES('application/x-java-pack200'); INSERT INTO mime_type (mime_type) VALUES('application/relaxng'); INSERT INTO mime_type (mime_type) VALUES('application/x-servicepack'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-bdf'); INSERT INTO mime_type (mime_type) VALUES('application/pkix-cert'); INSERT INTO mime_type (mime_type) VALUES('application/x-ipod-firmware'); INSERT INTO mime_type (mime_type) VALUES('application/x-object'); INSERT INTO mime_type (mime_type) VALUES('application/x-ica'); INSERT INTO mime_type (mime_type) VALUES('application/x-it87'); INSERT INTO mime_type (mime_type) VALUES('application/x-zoo'); INSERT INTO mime_type (mime_type) VALUES('application/x-gzpdf'); INSERT INTO mime_type (mime_type) VALUES('application/x-magicpoint'); INSERT INTO mime_type (mime_type) VALUES('application/docbook+xml'); INSERT INTO mime_type (mime_type) VALUES('application/x-csh'); INSERT INTO mime_type (mime_type) VALUES('application/x-nes-rom'); INSERT INTO mime_type (mime_type) VALUES('application/x-graphite'); INSERT INTO mime_type (mime_type) VALUES('application/x-spss-sav'); INSERT INTO mime_type (mime_type) VALUES('application/x-tar'); INSERT INTO mime_type (mime_type) VALUES('application/x-kvtml'); INSERT INTO mime_type (mime_type) VALUES('application/metalink+xml'); INSERT INTO mime_type (mime_type) VALUES('application/ecmascript'); INSERT INTO mime_type (mime_type) VALUES('application/x-hwt'); INSERT INTO mime_type (mime_type) VALUES('application/x-pak'); INSERT INTO mime_type (mime_type) VALUES('application/x-sqlite3'); INSERT INTO mime_type (mime_type) VALUES('application/x-trash'); INSERT INTO mime_type (mime_type) VALUES('application/x-arj'); INSERT INTO mime_type (mime_type) VALUES('application/x-k3b'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-pcf'); INSERT INTO mime_type (mime_type) VALUES('application/oda'); INSERT INTO mime_type (mime_type) VALUES('application/x-genesis-rom'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-ttf'); INSERT INTO mime_type (mime_type) VALUES('application/zip'); INSERT INTO mime_type (mime_type) VALUES('application/x-cbt'); INSERT INTO mime_type (mime_type) VALUES('application/x-kspread-crypt'); INSERT INTO mime_type (mime_type) VALUES('application/x-pef-executable'); INSERT INTO mime_type (mime_type) VALUES('application/x-brasero'); INSERT INTO mime_type (mime_type) VALUES('application/x-cb7'); INSERT INTO mime_type (mime_type) VALUES('application/x-frame'); INSERT INTO mime_type (mime_type) VALUES('application/x-lyx'); INSERT INTO mime_type (mime_type) VALUES('application/x-lzop'); INSERT INTO mime_type (mime_type) VALUES('application/x-planner'); INSERT INTO mime_type (mime_type) VALUES('application/x-vnc'); INSERT INTO mime_type (mime_type) VALUES('application/atom+xml'); INSERT INTO mime_type (mime_type) VALUES('application/x-gz-font-linux-psf'); INSERT INTO mime_type (mime_type) VALUES('application/x-xliff'); INSERT INTO mime_type (mime_type) VALUES('application/mathematica'); INSERT INTO mime_type (mime_type) VALUES('application/xslt+xml'); INSERT INTO mime_type (mime_type) VALUES('application/x-sharedlib'); INSERT INTO mime_type (mime_type) VALUES('application/x-kwordquiz'); INSERT INTO mime_type (mime_type) VALUES('application/x-bzpostscript'); INSERT INTO mime_type (mime_type) VALUES('application/x-pkcs12'); INSERT INTO mime_type (mime_type) VALUES('application/x-mozilla-bookmarks'); INSERT INTO mime_type (mime_type) VALUES('application/x-awk'); INSERT INTO mime_type (mime_type) VALUES('application/x-navi-animation'); INSERT INTO mime_type (mime_type) VALUES('application/x-cpio-compressed'); INSERT INTO mime_type (mime_type) VALUES('application/x-arc'); INSERT INTO mime_type (mime_type) VALUES('application/x-icq'); INSERT INTO mime_type (mime_type) VALUES('application/x-bzpdf'); INSERT INTO mime_type (mime_type) VALUES('application/mbox'); INSERT INTO mime_type (mime_type) VALUES('application/x-ksysguard'); INSERT INTO mime_type (mime_type) VALUES('application/x-java-jce-keystore'); INSERT INTO mime_type (mime_type) VALUES('application/x-subrip'); INSERT INTO mime_type (mime_type) VALUES('application/x-karbon'); INSERT INTO mime_type (mime_type) VALUES('application/x-python-bytecode'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-dos'); INSERT INTO mime_type (mime_type) VALUES('application/pgp-keys'); INSERT INTO mime_type (mime_type) VALUES('application/x-font-speedo'); INSERT INTO mime_type (mime_type) VALUES('application/pdf'); INSERT INTO mime_type (mime_type) VALUES('application/x-cue'); INSERT INTO mime_type (mime_type) VALUES('application/x-gnome-saved-search'); INSERT INTO mime_type (mime_type) VALUES('application/x-bcpio'); INSERT INTO mime_type (mime_type) VALUES('application/x-applix-word'); INSERT INTO mime_type (mime_type) VALUES('application/mxf'); INSERT INTO mime_type (mime_type) VALUES('application/x-wpg'); INSERT INTO mime_type (mime_type) VALUES('application/x-bzip-compressed-tar'); INSERT INTO mime_type (mime_type) VALUES('application/x-kword-crypt'); INSERT INTO mime_type (mime_type) VALUES('application/x-kig'); INSERT INTO mime_type (mime_type) VALUES('application/gnunet-directory'); INSERT INTO mime_type (mime_type) VALUES('application/x-kourse'); INSERT INTO mime_type (mime_type) VALUES('application/x-kudesigner'); INSERT INTO mime_type (mime_type) VALUES('application/x-tex-pk'); INSERT INTO mime_type (mime_type) VALUES('video/x-ms-asf'); INSERT INTO mime_type (mime_type) VALUES('video/mp4'); INSERT INTO mime_type (mime_type) VALUES('video/mpeg'); INSERT INTO mime_type (mime_type) VALUES('video/annodex'); INSERT INTO mime_type (mime_type) VALUES('video/x-sgi-movie'); INSERT INTO mime_type (mime_type) VALUES('video/isivideo'); INSERT INTO mime_type (mime_type) VALUES('video/x-ogm+ogg'); INSERT INTO mime_type (mime_type) VALUES('video/x-mng'); INSERT INTO mime_type (mime_type) VALUES('video/x-flv'); INSERT INTO mime_type (mime_type) VALUES('video/x-flic'); INSERT INTO mime_type (mime_type) VALUES('video/x-theora+ogg'); INSERT INTO mime_type (mime_type) VALUES('video/3gpp'); INSERT INTO mime_type (mime_type) VALUES('video/x-ms-wmv'); INSERT INTO mime_type (mime_type) VALUES('video/ogg'); INSERT INTO mime_type (mime_type) VALUES('video/dv'); INSERT INTO mime_type (mime_type) VALUES('video/x-matroska'); INSERT INTO mime_type (mime_type) VALUES('video/vivo'); INSERT INTO mime_type (mime_type) VALUES('video/quicktime'); INSERT INTO mime_type (mime_type) VALUES('video/x-ms-wmp'); INSERT INTO mime_type (mime_type) VALUES('video/x-msvideo'); INSERT INTO mime_type (mime_type) VALUES('video/x-anim'); INSERT INTO mime_type (mime_type) VALUES('video/wavelet'); INSERT INTO mime_type (mime_type) VALUES('video/x-nsv'); INSERT INTO mime_type (mime_type) VALUES('interface/x-winamp-skin'); INSERT INTO mime_type (mime_type) VALUES('multipart/encrypted'); INSERT INTO mime_type (mime_type) VALUES('multipart/x-mixed-replace'); INSERT INTO mime_type (mime_type) VALUES('multipart/related'); INSERT INTO mime_type (mime_type) VALUES('multipart/report'); INSERT INTO mime_type (mime_type) VALUES('multipart/signed'); INSERT INTO mime_type (mime_type) VALUES('multipart/appledouble'); INSERT INTO mime_type (mime_type) VALUES('multipart/mixed'); INSERT INTO mime_type (mime_type) VALUES('multipart/alternative'); INSERT INTO mime_type (mime_type) VALUES('multipart/digest'); INSERT INTO mime_type (mime_type) VALUES('audio/vnd.rn-realaudio'); INSERT INTO mime_type (mime_type) VALUES('image/vnd.dwg'); INSERT INTO mime_type (mime_type) VALUES('image/vnd.djvu'); INSERT INTO mime_type (mime_type) VALUES('image/vnd.rn-realpix'); INSERT INTO mime_type (mime_type) VALUES('image/vnd.dxf'); INSERT INTO mime_type (mime_type) VALUES('image/vnd.wap.wbmp'); INSERT INTO mime_type (mime_type) VALUES('image/vnd.ms-modi'); INSERT INTO mime_type (mime_type) VALUES('image/vnd.microsoft.icon'); INSERT INTO mime_type (mime_type) VALUES('image/vnd.adobe.photoshop'); INSERT INTO mime_type (mime_type) VALUES('text/vnd.wap.wml'); INSERT INTO mime_type (mime_type) VALUES('text/vnd.wap.wmlscript'); INSERT INTO mime_type (mime_type) VALUES('text/vnd.sun.j2me.app-descriptor'); INSERT INTO mime_type (mime_type) VALUES('text/vnd.abc'); INSERT INTO mime_type (mime_type) VALUES('text/vnd.rn-realtext'); INSERT INTO mime_type (mime_type) VALUES('text/vnd.graphviz'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.mozilla.xul+xml'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.text-web'); INSERT INTO mime_type (mime_type) VALUES('application/x-vnd.kde.kexi'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-word.document.macroenabled.12'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.scribus'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.sun.xml.writer.global'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.emusic-emusic_package'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.hp-pcl'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.stardivision.mail'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.google-earth.kml+xml'); INSERT INTO mime_type (mime_type) VALUES('application/x-vnd.kde.plan'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.kde.okular-archive'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.openxmlformats-officedocument.presentationml.presentation'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-wpl'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.formula'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.openxmlformats-officedocument.wordprocessingml.document'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.text-flat-xml'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.chart'); INSERT INTO mime_type (mime_type) VALUES('application/x-vnd.kde.plan.work'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-excel.sheet.macroenabled.12'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.lotus-1-2-3'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.hp-hpgl'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.sun.xml.writer'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.text-master'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.corel-draw'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.stardivision.draw'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.spreadsheet'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.stardivision.calc'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-powerpoint.presentation.macroenabled.12'); INSERT INTO mime_type (mime_type) VALUES('application/x-vnd.kde.kplato'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.text'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.stardivision.math'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.stardivision.writer'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.graphics-flat-xml'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.sun.xml.impress'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.spreadsheet-flat-xml'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.htmldoc-book'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.symbian.install'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-excel.sheet.binary.macroenabled.12'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.google-earth.kmz'); INSERT INTO mime_type (mime_type) VALUES('application/x-vnd.kde.kplato.work'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-excel'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.kde.kphotoalbum-import'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.sun.xml.draw'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.openxmlformats-officedocument.presentationml.slideshow'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.sun.xml.calc'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-cab-compressed'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.sun.xml.base'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.sun.xml.math'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-powerpoint'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.apple.mpegurl'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-works'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.image'); INSERT INTO mime_type (mime_type) VALUES('application/x-vnd.kde.contactgroup'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.presentation'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.rn-realmedia'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.database'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.stardivision.impress'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-access'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.openofficeorg.extension'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-xpsdocument'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.presentation-flat-xml'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.stardivision.chart'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.wordperfect'); INSERT INTO mime_type (mime_type) VALUES('application/x-vnd.kde.kugar.mixed'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.iccprofile'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.oasis.opendocument.graphics'); INSERT INTO mime_type (mime_type) VALUES('application/vnd.ms-tnef'); INSERT INTO mime_type (mime_type) VALUES('video/vnd.rn-realvideo'); UPDATE mime_type SET invoice_include = 'true' where mime_type like 'image/%'; CREATE TABLE file_class ( id serial not null unique, class text primary key ); insert into file_class values (1, 'transaction'); insert into file_class values (2, 'order'); insert into file_class values (3, 'part'); COMMENT ON TABLE file_class IS $$ File classes are collections of files attached against rows in specific tables in the database. They can be used in the future to implement other form of file attachment. $$; CREATE TABLE file_base ( content bytea NOT NULL, mime_type_id int not null references mime_type(id), file_name text not null, description text, uploaded_by int not null references entity(id), uploaded_at timestamp not null default now(), id serial not null unique, ref_key int not null, file_class int not null references file_class(id), primary key (ref_key, file_name, file_class) ); COMMENT ON TABLE file_base IS $$Abstract table, holds no records. Inheriting table store actual file attachment data. Can be queried however to retrieve lists of all files. $$; COMMENT ON COLUMN file_base.ref_key IS $$This column inheriting tables is used to reference the database row for the attachment. Inheriting tables MUST set the foreign key here appropriately. This can also be used to create classifications of other documents, such as by source of automatic import (where the file is not yet attached) or even standard, long-lived documents.$$; CREATE TABLE file_transaction ( check (file_class = 1), unique(id), primary key (ref_key, file_name, file_class), foreign key (ref_key) REFERENCES transactions(id) ) inherits (file_base); COMMENT ON TABLE file_transaction IS $$ File attachments primarily attached to AR/AP/GL.$$; CREATE TABLE file_order ( check (file_class=2), unique(id), primary key (ref_key, file_name, file_class), foreign key (ref_key) references oe(id) ) inherits (file_base); COMMENT ON TABLE file_order IS $$ File attachments primarily attached to orders and quotations.$$; CREATE TABLE file_part ( check (file_class=3), unique(id), primary key (ref_key, file_name, file_class), foreign key (ref_key) references parts(id) ) inherits (file_base); COMMENT ON TABLE file_part IS $$ File attachments primarily attached to orders and quotations.$$; CREATE TABLE file_secondary_attachment ( file_id int not null, source_class int references file_class(id), ref_key int not null, dest_class int references file_class(id), attached_by int not null references entity(id), attached_at timestamp not null default now(), PRIMARY KEY(file_id, source_class, dest_class, ref_key) ); COMMENT ON TABLE file_secondary_attachment IS $$Another abstract table. This one will use rewrite rules to make inserts safe because of the difficulty in managing inserts otherwise. Inheriting tables provide secondary links between the file and other database objects. Due to the nature of database inheritance and unique constraints in PostgreSQL, this must be partitioned in a star format.$$; CREATE TABLE file_tx_to_order ( PRIMARY KEY(file_id, source_class, dest_class, ref_key), foreign key (file_id) references file_transaction(id), foreign key (ref_key) references oe(id), check (source_class = 1), check (dest_class = 2) ) INHERITS (file_secondary_attachment); CREATE RULE file_sec_insert_tx_oe AS ON INSERT TO file_secondary_attachment WHERE source_class = 1 and dest_class = 2 DO INSTEAD INSERT INTO file_tx_to_order(file_id, source_class, ref_key, dest_class, attached_by, attached_at) VALUES (new.file_id, 1, new.ref_key, 2, new.attached_by, coalesce(new.attached_at, now())); COMMENT ON TABLE file_tx_to_order IS $$ Secondary links from transactions to orders.$$; CREATE TABLE file_order_to_order ( PRIMARY KEY(file_id, source_class, dest_class, ref_key), foreign key (file_id) references file_order(id), foreign key (ref_key) references oe(id), check (source_class = 2), check (dest_class = 2) ) INHERITS (file_secondary_attachment); COMMENT ON TABLE file_order_to_order IS $$ Secondary links from one order to another, for example to support order consolidation.$$; CREATE RULE file_sec_insert_oe_oe AS ON INSERT TO file_secondary_attachment WHERE source_class = 2 and dest_class = 2 DO INSTEAD INSERT INTO file_order_to_order(file_id, source_class, ref_key, dest_class, attached_by, attached_at) VALUES (new.file_id, 2, new.ref_key, 2, new.attached_by, coalesce(new.attached_at, now())); CREATE TABLE file_order_to_tx ( PRIMARY KEY(file_id, source_class, dest_class, ref_key), foreign key (file_id) references file_order(id), foreign key (ref_key) references transactions(id), check (source_class = 2), check (dest_class = 1) ) INHERITS (file_secondary_attachment); COMMENT ON TABLE file_order_to_tx IS $$ Secondary links from orders to transactions, for example to track files when invoices are generated from orders.$$; CREATE RULE file_sec_insert_oe_tx AS ON INSERT TO file_secondary_attachment WHERE source_class = 2 and dest_class = 1 DO INSTEAD INSERT INTO file_order_to_order(file_id, source_class, ref_key, dest_class, attached_by, attached_at) VALUES (new.file_id, 2, new.ref_key, 1, new.attached_by, coalesce(new.attached_at, now())); CREATE TABLE file_view_catalog ( file_class int references file_class(id) primary key, view_name text not null unique ); CREATE TABLE cr_report ( id bigserial primary key not null, chart_id int not null references account(id), their_total numeric not null, approved boolean not null default 'f', submitted boolean not null default 'f', end_date date not null default now(), updated timestamp not null default now(), entered_by int not null default person__get_my_entity_id() references entity(id), entered_username text not null default SESSION_USER, deleted boolean not null default 'f'::boolean, deleted_by int references entity(id), approved_by int references entity(id), approved_username text, recon_fx bool default false, CHECK (deleted is not true or approved is not true) ); COMMENT ON TABLE cr_report IS $$This table holds header data for cash reports.$$; CREATE TABLE cr_report_line ( id bigserial primary key not null, report_id int NOT NULL references cr_report(id), scn text, -- SCN is the check # their_balance numeric, our_balance numeric, errorcode INT, "user" int references entity(id) not null, clear_time date, insert_time TIMESTAMPTZ NOT NULL DEFAULT now(), trans_type text, post_date date, ledger_id int REFERENCES acc_trans(entry_id), voucher_id int REFERENCES voucher(id), overlook boolean not null default 'f', cleared boolean not null default 'f' ); COMMENT ON TABLE cr_report_line IS $$ This stores line item data on transaction lines and whether they are cleared.$$; COMMENT ON COLUMN cr_report_line.scn IS $$ This is the check number. Maps to acc_trans.source $$; CREATE TABLE cr_coa_to_account ( chart_id int not null references account(id), account text not null ); COMMENT ON TABLE cr_coa_to_account IS $$ Provides name mapping for the cash reconciliation screen.$$; -- -- WE NEED A PAYMENT TABLE -- CREATE TABLE payment ( id serial primary key, reference text NOT NULL, gl_id integer references gl(id), payment_class integer NOT NULL, payment_date date default current_date, closed bool default FALSE, entity_credit_id integer references entity_credit_account(id), employee_id integer references person(id), currency char(3), notes text, department_id integer default 0); COMMENT ON TABLE payment IS $$ This table will store the main data on a payment, prepayment, overpayment, et$$; COMMENT ON COLUMN payment.reference IS $$ This field will store the code for both receipts and payment order $$; COMMENT ON COLUMN payment.closed IS $$ This will store the current state of a payment/receipt order $$; COMMENT ON COLUMN payment.gl_id IS $$ A payment should always be linked to a GL movement $$; CREATE INDEX payment_id_idx ON payment(id); CREATE TABLE payment_links ( payment_id integer references Payment(id), entry_id integer references acc_trans(entry_id), type integer); COMMENT ON TABLE payment_links IS $$ An explanation to the type field. * A type 0 means the link is referencing an ar/ap and was created using an overpayment movement after the receipt was created * A type 1 means the link is referencing an ar/ap and was made on the payment creation, its not the product of an overpayment movement * A type 2 means the link is not referencing an ar/ap and its the product of the overpayment logic With this ideas in order we can do the following To get the payment amount we will sum the entries with type > 0. To get the linked amount we will sum the entries with type < 2. The overpayment account can be obtained from the entries with type = 2. This reasoning is hacky and i hope it can dissapear when we get to 1.4 - D.M. $$; -- helpful to keeping the selection of all years fast create index ac_transdate_year_idx on acc_trans(EXTRACT ('YEAR' FROM transdate)); commit; ledgersmb/LedgerSMB.pm0000755000000000000000000010707712057054327013646 0ustar rootroot =head1 NAME LedgerSMB - The Base class for many LedgerSMB objects, including DBObject. =head1 SYNOPSIS This module creates a basic request handler with utility functions available in database objects (LedgerSMB::DBObject) =head1 METHODS =over =item new () This method creates a new base request instance. It also validates the session/user credentials, as appropriate for the run mode. Finally, it sets up the database connections for the user. =item date_to_number (user => $LedgerSMB::User, date => $string); This function takes the date in the format provided and returns a numeric string in YYMMDD format. This may be moved to User in the future. =item open_form() This sets a $self->{form_id} to be used in later form validation (anti-XSRF measure). =item check_form() This returns true if the form_id was associated with the session, and false if not. Use this if the form may be re-used (back-button actions are valid). =item close_form() Identical with check_form() above, but also removes the form_id from the session. This should be used when back-button actions are not valid. =item debug (file => $path); This dumps the current object to the file if that is defined and otherwise to standard output. =item escape (string => $string); This function returns the current string escaped using %hexhex notation. =item unescape (string => $string); This function returns the $string encoded using %hexhex using ordinary notation. =item format_amount (user => $LedgerSMB::User::hash, amount => $string, precision => $integer, neg_format => (-|DRCR)); The function takes a monetary amount and formats it according to the user preferences, the negative format (- or DR/CR). Note that it may move to LedgerSMB::User at some point in the future. =item parse_amount (user => $LedgerSMB::User::hash, amount => $variable); If $amount is a Bigfloat, it is returned as is. If it is a string, it is parsed according to the user preferences stored in the LedgerSMB::User object. =item is_blank (name => $string) This function returns true if $self->{$string} only consists of whitespace characters or is an empty string. =item is_run_mode ('(cli|cgi|mod_perl)') This function returns 1 if the run mode is what is specified. Otherwise returns 0. =item is_allowed_role({allowed_roles => @role_names}) This function returns 1 if the user's roles include any of the roles in @role_names. =item num_text_rows (string => $string, cols => $number, max => $number); This function determines the likely number of rows needed to hold text in a textbox. It returns either that number or max, which ever is lower. =item merge ($hashref, keys => @list, index => $number); This command merges the $hashref into the current object. If keys are specified, only those keys are used. Otherwise all keys are merged. If an index is specified, the merged keys are given a form of "$key" . "_$index", otherwise the key is used on both sides. =item redirect (msg => $string) This function redirects to the script and argument set determined by $self->{callback}, and if this is not set, goes to an info screen and prints $msg. =item redo_rows (fields => \@list, count => $integer, [index => $string); This function is undergoing serious redesign at the moment. If index is defined, that field is used for ordering the rows. If not, runningnumber is used. Behavior is not defined when index points to a field containing non-numbers. =item set (@attrs) Copies the given key=>vars to $self. Allows for finer control of merging hashes into self. =item remove_cgi_globals() Removes all elements starting with a . because these elements conflict with the ability to hide the entire structure for things like CSV lookups. =item get_default_value_by_key($key) Retrieves a default value for the given key, it is just a wrapper on LedgerSMB::Setting; =item call_procedure( procname => $procname, args => $args ) Function that allows you to call a stored procedure by name and map the appropriate argument to the function values. Args is an arrayref. The members of args can be scalars or arrayrefs in which case they are just bound to the placeholders (arrayref to Pg array conversion occurs automatically in DBD::Pg 2.x), or they can be hashrefs of the following syntax: {value => $data, type=> $db_type}. The type field is any SQL type DBD::Pg supports (such as 'PG_BYTEA'). =item dberror() Localizes and returns database errors and error codes within LedgerSMB =item error() Returns HTML errors in LedgerSMB. Needs refactored into a general Error class. =item get_user_info() Loads user configuration info from LedgerSMB::User =item round_amount() Uses Math::Float with an amount and a set number of decimal places to round the amount and return it. Defaults to the default decimal places setting in the LedgerSMB configuration if there is no places argument passed in. They should be changed to allow different rules for different accounts. =item sanitize_for_display() Expands a hash into human-readable key => value pairs, and formats and rounds amounts, recursively expanding hashes until there are no hash members present. =item take_top_level() Removes blank keys and non-reference keys from a hash and returns a hash with only non-blank and referenced keys. =item type() Ensures that the $ENV{REQUEST_METHOD} is defined and either "HEAD", "GET", "POST". =item finalize_request() This function throws a CancelFurtherProcessing exception to be caught by the outermost processing script. This construct allows the outer script and intermediate levels to clean up, if required. This construct replaces 'exit;' calls randomly scattered around the code everywhere. =cut =back =head1 Copyright (C) 2006, The LedgerSMB core team. # This work contains copyrighted information from a number of sources # all used with permission. # # This file contains source code included with or based on SQL-Ledger # which is Copyright Dieter Simader and DWS Systems Inc. 2000-2005 # and licensed under the GNU General Public License version 2 or, at # your option, any later version. For a full list including contact # information of contributors, maintainers, and copyright holders, # see the CONTRIBUTORS file. # # Original Copyright Notice from SQL-Ledger 2.6.17 (before the fork): # Copyright (C) 2000 # # Author: DWS Systems Inc. # Web: http://www.sql-ledger.org # # Contributors: Thomas Bayen # Antti Kaihola # Moritz Bunkus (tex) # Jim Rawlings (DB2) #==================================================================== =cut use CGI::Simple; $CGI::Simple::DISABLE_UPLOADS = 0; use Math::BigFloat; use LedgerSMB::Sysconfig; use Data::Dumper; use Error; use LedgerSMB::Auth; use LedgerSMB::CancelFurtherProcessing; use LedgerSMB::Template; use LedgerSMB::Locale; use LedgerSMB::User; use LedgerSMB::Setting; use LedgerSMB::App_State; use LedgerSMB::Log; use LedgerSMB::Company_Config; use strict; use utf8; $CGI::Simple::POST_MAX = -1; package LedgerSMB; our $VERSION = '1.3.25'; my $logger = Log::Log4perl->get_logger('LedgerSMB'); sub new { #my $type = "" unless defined shift @_; #my $argstr = "" unless defined shift @_; (my $package,my $filename,my $line)=caller; my $type = shift @_; my $argstr = shift @_; my %cookie; my $self = {}; $type = "" unless defined $type; $argstr = "" unless defined $argstr; $logger->debug("Begin called from \$filename=$filename \$line=$line \$type=$type \$argstr=$argstr ref argstr=".ref $argstr); $self->{version} = $VERSION; $self->{dbversion} = "1.3.25"; bless $self, $type; my $query; my %params=(); if(ref($argstr) eq 'DBI::db') { $self->{dbh}=$argstr; $logger->info("setting dbh from argstr \$self->{dbh}=$self->{dbh}"); } else { $query = ($argstr) ? new CGI::Simple($argstr) : new CGI::Simple; # my $params = $query->Vars; returns a tied hash with keys that # are not parameters of the CGI query. %params = $query->Vars; for my $p(keys %params){ utf8::decode($params{$p}); utf8::upgrade($params{$p}); } $logger->debug("params=", Data::Dumper::Dumper(\%params)); } $self->{VERSION} = $VERSION; $self->{_request} = $query; $self->merge(\%params); $self->{have_latex} = $LedgerSMB::Sysconfig::latex; # Adding this so that empty values are stored in the db as NULL's. If # stored procedures want to handle them differently, they must opt to do so. # -- CT for (keys %$self){ if ($self->{$_} eq ''){ $self->{$_} = undef; } } if ($self->is_run_mode('cgi', 'mod_perl')) { $ENV{HTTP_COOKIE} =~ s/;\s*/;/g; my @cookies = split /;/, $ENV{HTTP_COOKIE}; foreach (@cookies) { my ( $name, $value ) = split /=/, $_, 2; $cookie{$name} = $value; } } #HV set _locale already to default here,so routines lower in stack can use it;e.g. login.pl $self->{_locale}=LedgerSMB::Locale->get_handle(${LedgerSMB::Sysconfig::language}) or $self->error( __FILE__ . ':' . __LINE__ .": Locale not loaded: $!\n" ); $self->{action} = "" unless defined $self->{action}; $self->{action} =~ s/\W/_/g; $self->{action} = lc $self->{action}; $self->{path} = "" unless defined $self->{path}; if ( $self->{path} eq "bin/lynx" ) { $self->{menubar} = 1; # Applying the path is deprecated. Use menubar instead. CT. $self->{lynx} = 1; $self->{path} = "bin/lynx"; } else { $self->{path} = "bin/mozilla"; } $ENV{SCRIPT_NAME} = "" unless defined $ENV{SCRIPT_NAME}; $ENV{SCRIPT_NAME} =~ m/([^\/\\]*.pl)\?*.*$/; $self->{script} = $1 unless !defined $1; $self->{script} = "" unless defined $self->{script}; if ( ( $self->{script} =~ m#(\.\.|\\|/)# ) ) { $self->error("Access Denied"); } if (!$self->{script}) { $self->{script} = 'login.pl'; } $logger->debug("\$self->{script} = $self->{script} \$self->{action} = $self->{action}"); # if ($self->{action} eq 'migrate_user'){ # return $self; # } # This is suboptimal. We need to have a better way for 1.4 #HV we should try to have DBI->connect in one place? #HV why not trying _db_init also in case of login authenticate? quid logout-function? if ($self->{script} eq 'login.pl' && ($self->{action} eq 'authenticate' || $self->{action} eq '__default' || !$self->{action})){ return $self; } if ($self->{script} eq 'setup.pl'){ return $self; } my $ccookie; if (!$self->{company} && $self->is_run_mode('cgi', 'mod_perl')){ $ccookie = $cookie{${LedgerSMB::Sysconfig::cookie_name}}; $ccookie =~ s/.*:([^:]*)$/$1/; if($ccookie ne 'Login') { $self->{company} = $ccookie; } } $logger->debug("\$ccookie=$ccookie cookie.LedgerSMB::Sysconfig::cookie_name=".$cookie{${LedgerSMB::Sysconfig::cookie_name}}." \$self->{company}=$self->{company}"); if(! $cookie{${LedgerSMB::Sysconfig::cookie_name}} && $self->{action} eq 'logout') { $logger->debug("quitting because of logout and no cookie,avoid _db_init"); return $self; } #dbh may have been set elsewhere,by DBObject.pm? if(!$self->{dbh}) { $self->_db_init; } LedgerSMB::Company_Config::initialize($self); #TODO move before _db_init to avoid _db_init with invalid session? if ($self->is_run_mode('cgi', 'mod_perl') and !$ENV{LSMB_NOHEAD}) { #check for valid session unless this is an inital authentication #request -- CT if (!LedgerSMB::Auth::session_check( $cookie{${LedgerSMB::Sysconfig::cookie_name}}, $self) ) { $logger->error("Session did not check"); $self->_get_password("Session Expired"); die; } $logger->debug("session_check completed OK \$self->{session_id}=$self->{session_id} caller=\$filename=$filename \$line=$line"); } $self->get_user_info; my %date_setting = ( 'mm/dd/yy' => "SQL, US", 'mm-dd-yy' => "POSTGRES, US", 'dd/mm/yy' => "SQL, EUROPEAN", 'dd-mm-yy' => "POSTGRES, EUROPEAN", 'dd.mm.yy' => "GERMAN", ); $self->{dbh}->do("set DateStyle to '".$date_setting{$self->{_user}->{dateformat}}."'"); #my $locale = LedgerSMB::Locale->get_handle($self->{_user}->{language}) # or $self->error(__FILE__.':'.__LINE__.": Locale not loaded: $!\n"); #$self->{_locale} = $locale; $self->{_locale}=LedgerSMB::Locale->get_handle($self->{_user}->{language}) or $self->error(__FILE__.':'.__LINE__.": Locale not loaded: $!\n"); $self->{stylesheet} = $self->{_user}->{stylesheet}; $logger->debug("End"); return $self; } sub open_form { my ($self, $args) = @_; if (!$ENV{GATEWAY_INTERFACE}){ return 1; } my @vars = $self->call_procedure(procname => 'form_open', args => [$self->{session_id}], continue_on_error => 1 ); if ($args->{commit}){ $self->{dbh}->commit; } $self->{form_id} = $vars[0]->{form_open}; } sub check_form { my ($self) = @_; if (!$ENV{GATEWAY_INTERFACE}){ return 1; } my @vars = $self->call_procedure(procname => 'form_check', args => [$self->{session_id}, $self->{form_id}] ); return $vars[0]->{form_check}; } sub close_form { my ($self) = @_; if (!$ENV{GATEWAY_INTERFACE}){ return 1; } my @vars = $self->call_procedure(procname => 'form_close', args => [$self->{session_id}, $self->{form_id}] ); delete $self->{form_id}; return $vars[0]->{form_close}; } sub get_user_info { my ($self) = @_; $self->{_user} = LedgerSMB::User->fetch_config($self); } #This function needs to be moved into the session handler. sub _get_password { my ($self) = shift @_; $self->{sessionexpired} = shift @_; LedgerSMB::Auth::credential_prompt(); die; } sub debug { my $self = shift @_; my $args = shift @_; my $file; if (scalar keys %$args){ $file = $args->{'file'}; } my $d = Data::Dumper->new( [$self] ); $d->Sortkeys(1); if ($file) { open( FH, '>', "$file" ) or die $!; print FH $d->Dump(); close(FH); } else { print "\n"; print $d->Dump(); } } sub escape { my $self = shift; my %args = @_; my $str = $args{string}; $str = "" unless defined $str; my $regex = qr/([^a-zA-Z0-9_.-])/; $str =~ s/$regex/sprintf("%%%02x", ord($1))/ge; return $str; } sub is_blank { my $self = shift @_; my %args = @_; my $name = $args{name}; my $rc; if (not defined $name){ $self->{_locale} = LedgerSMB::Locale->get_handle('en') unless defined $self->{_locale}; $self->error($self->{_locale}->text('Field \"Name\" Not Defined')); } if ( $self->{$name} =~ /^\s*$/ ) { $rc = 1; } else { $rc = 0; } $rc; } sub is_run_mode { my $self = shift @_; #avoid 'uninitialized' warnings in tests my $mode = shift @_; my $rc = 0; if(! $mode){return $rc;} $mode=lc $mode; if ( $mode eq 'cgi' && $ENV{GATEWAY_INTERFACE} ) { $rc = 1; } elsif ( $mode eq 'cli' && !( $ENV{GATEWAY_INTERFACE} || $ENV{MOD_PERL} ) ) { $rc = 1; } elsif ( $mode eq 'mod_perl' && $ENV{MOD_PERL} ) { $rc = 1; } $rc; } sub num_text_rows { my $self = shift @_; my %args = @_; my $string = $args{string}; my $cols = $args{cols}; my $maxrows = $args{max}; my $rows = 0; for ( split /\n/, $string ) { my $line = $_; while ( length($line) > $cols ) { my $fragment = substr( $line, 0, $cols + 1 ); $fragment =~ s/^(.*)\W.*$/$1/; $line =~ s/$fragment//; if ( $line eq $fragment ) { # No word breaks! $line = ""; } ++$rows; } ++$rows; } if ( !defined $maxrows ) { $maxrows = $rows; } return ( $rows > $maxrows ) ? $maxrows : $rows; } sub redirect { my $self = shift @_; my %args = @_; my $msg = $args{msg}; if ( $self->{callback} || !$msg ) { main::redirect(); die; } else { $self->info($msg); } } # TODO: Either we should have an amount class with formats and such attached # Or maybe we should move this into the user class... sub format_amount { # Based on SQL-Ledger's Form::format_amount my $self = shift @_; my %args = (ref($_[0]) eq 'HASH')? %{$_[0]}: @_; my $myconfig = $args{user} || $self->{_user}; my $amount = $args{amount}; my $places = $args{precision}; my $dash = $args{neg_format}; my $format = $args{format}; $dash = "" unless defined $dash; if (!defined $format){ $format = $myconfig->{numberformat} } if (!defined $amount){ return undef; } if (!defined $args{precision} and defined $args{money}){ $places = $LedgerSMB::Sysconfig::decimal_places; } my $negative; if (defined $amount and ! UNIVERSAL::isa($amount, 'Math::BigFloat' )) { #tshvr many numbers which should really be BigFloat, are not! # e.g. calculations in the template system are not BigFloat. # so string,but virtual bigfloat '270.94', comes out as '27.094' when going through parse_amount with numberformat 1.000,00 # so if we have a virtual BigFloat, we might consider not going through parse_amount my $test_bf=new Math::BigFloat($amount); if($test_bf->is_nan()) { $amount = $self->parse_amount( 'user' => $myconfig, 'amount' => $amount ); } else { $amount = $test_bf; } } $negative = ( $amount < 0 ); $amount->babs(); $places = "" unless defined $places; if ( $places =~ /\d+/ ) { #$places = 4 if $places == 2; $amount = $self->round_amount( $amount, $places ); } # is the amount negative # Parse $myconfig->{numberformat} my ( $ts, $ds ) = ( $1, $2 ); if (defined $amount) { if ( $format ) { my ( $whole, $dec ) = split /\./, "$amount"; $dec = "" unless defined $dec; $amount = join '', reverse split //, $whole; if ($places) { $dec .= "0" x $places; $dec = substr( $dec, 0, $places ); } if ( $format eq '1,000.00' ) { $amount =~ s/\d{3,}?/$&,/g; $amount =~ s/,$//; $amount = join '', reverse split //, $amount; $amount .= "\.$dec" if ( $dec ne "" ); } elsif ( $format eq '1 000.00' ) { $amount =~ s/\d{3,}?/$& /g; $amount =~ s/\s$//; $amount = join '', reverse split //, $amount; $amount .= "\.$dec" if ( $dec ne "" ); } elsif ( $format eq "1'000.00" ) { $amount =~ s/\d{3,}?/$&'/g; $amount =~ s/'$//; $amount = join '', reverse split //, $amount; $amount .= "\.$dec" if ( $dec ne "" ); } elsif ( $format eq '1.000,00' ) { $amount =~ s/\d{3,}?/$&./g; $amount =~ s/\.$//; $amount = join '', reverse split //, $amount; $amount .= ",$dec" if ( $dec ne "" ); } elsif ( $format eq '1000,00' ) { $amount = "$whole"; $amount .= ",$dec" if ( $dec ne "" ); } elsif ( $format eq '1000.00' ) { $amount = "$whole"; $amount .= ".$dec" if ( $dec ne "" ); } if ( $dash =~ /-/ ) { $amount = ($negative) ? "($amount)" : "$amount"; } elsif ( $dash =~ /DRCR/ ) { $amount = ($negative) ? "$amount DR" : "$amount CR"; } else { $amount = ($negative) ? "-$amount" : "$amount"; } } } else { if ( $dash eq "0" && $places ) { if ( $format =~ /0,00$/ ) { $amount = "0" . "," . "0" x $places; } else { $amount = "0" . "." . "0" x $places; } } else { $amount = ( $dash ne "" ) ? "$dash" : ""; } } $amount; } # This should probably go to the User object too. sub parse_amount { my $self = shift @_; my %args = @_; my $myconfig = $args{user} || $self->{_user}; my $amount = $args{amount}; if ( ! defined $amount or $amount eq '' ) { return Math::BigFloat->bzero(); } if ( UNIVERSAL::isa( $amount, 'Math::BigFloat' ) ) { #Avoiding double-parse issues return $amount; } my $numberformat = $myconfig->{numberformat}; $numberformat = "" unless defined $numberformat; if ( ( $numberformat eq '1.000,00' ) || ( $numberformat eq '1000,00' ) ) { $amount =~ s/\.//g; $amount =~ s/,/./; } elsif ( $numberformat eq '1 000.00' ) { $amount =~ s/\s//g; } elsif ( $numberformat eq "1'000.00" ) { $amount =~ s/'//g; } $amount =~ s/,//g; if ( $amount =~ s/\((\d*\.?\d*)\)/$1/ ) { $amount = $1 * -1; } elsif ( $amount =~ s/(\d*\.?\d*)\s?DR/$1/ ) { $amount = $1 * -1; } $amount =~ s/\s?CR//; $amount = new Math::BigFloat($amount); if ($amount->is_nan){ $self->error("Invalid number detected during parsing"); } return ( $amount * 1 ); } sub round_amount { my ( $self, $amount, $places ) = @_; # # We will grab the default value, if it isnt defined # if (!defined $places){ $places = ${LedgerSMB::Sysconfig::decimal_places}; } # These rounding rules follow from the previous implementation. # They should be changed to allow different rules for different accounts. if ($amount >= 0) { Math::BigFloat->round_mode('+inf'); } else { Math::BigFloat->round_mode('-inf'); } if ($places >= 0) { $amount = Math::BigFloat->new($amount)->ffround( -$places ); } else { $amount = Math::BigFloat->new($amount)->ffround( -( $places - 1 ) ); } $amount->precision(undef); return $amount; } sub call_procedure { my $self = shift @_; my %args = @_; my $procname = $args{procname}; my $schema = $args{schema}; my @call_args; my $dbh = $LedgerSMB::App_State::DBH; if (!$dbh){ $dbh = $self->{dbh}; } @call_args = @{ $args{args} } if defined $args{args}; my $order_by = $args{order_by}; my $query_rc; my $argstr = ""; my @results; if (!defined $procname){ $self->error('Undefined function in call_procedure.'); } $procname = $dbh->quote_identifier($procname); # Add the test for whether the schema is something useful. $logger->trace("\$procname=$procname"); $schema = $schema || $LedgerSMB::Sysconfig::db_namespace; $schema = $dbh->quote_identifier($schema); for ( 1 .. scalar @call_args ) { $argstr .= "?, "; } $argstr =~ s/\, $//; my $query = "SELECT * FROM $schema.$procname()"; if ($order_by){ $query .= " ORDER BY $order_by"; } $query =~ s/\(\)/($argstr)/; my $sth = $dbh->prepare($query); my $place = 1; # API Change here to support byteas: # If the argument is a hashref, allow it to define it's SQL type # for example PG_BYTEA, and use that to bind. The API supports the old # syntax (array of scalars and arrayrefs) but extends this so that hashrefs # now have special meaning. I expect this to be somewhat recursive in the # future if hashrefs to complex types are added, but we will have to put # that off for another day. --CT foreach my $carg (@call_args){ if (ref($carg) eq 'HASH'){ $sth->bind_param($place, $carg->{value}, { pg_type => $carg->{type} }); } else { $sth->bind_param($place, $carg); } ++$place; } $query_rc = $sth->execute(); if (!$query_rc){ if ($args{continue_on_error} and # only for plpgsql exceptions ($dbh->state =~ /^P/)){ $@ = $dbh->errstr; } else { $self->dberror($dbh->errstr . ": " . $query); } } my @types = @{$sth->{TYPE}}; my @names = @{$sth->{NAME_lc}}; while ( my $ref = $sth->fetchrow_hashref('NAME_lc') ) { for (0 .. $#names){ # numeric float4/real if ($types[$_] == 3 or $types[$_] == 2) { $ref->{$names[$_]} = Math::BigFloat->new($ref->{$names[$_]}); } } push @results, $ref; } return @results; } # Keeping this here due to common requirements sub is_allowed_role { my ($self, $args) = @_; my @roles = @{$args->{allowed_roles}}; for my $role (@roles){ $self->{_role_prefix} = "lsmb_$self->{company}__" unless defined $self->{_role_prefix}; my @roleset = grep m/^$self->{_role_prefix}$role$/, @{$self->{_roles}}; if (scalar @roleset){ return 1; } } return 0; } # This should probably be moved to User too... sub date_to_number { #based on SQL-Ledger's Form::datetonum my $self = shift @_; my %args = @_; my $myconfig = $args{user}; my $date = $args{date}; $date = "" unless defined $date; my ( $yy, $mm, $dd ); if ( $date ne "" && $date && $date =~ /\D/ ) { if ( $date =~ /^\d{4}-\d\d-\d\d$/ ) { ( $yy, $mm, $dd ) = split /\D/, $date; } elsif ( $myconfig->{dateformat} =~ /^yy/ ) { ( $yy, $mm, $dd ) = split /\D/, $date; } elsif ( $myconfig->{dateformat} =~ /^mm/ ) { ( $mm, $dd, $yy ) = split /\D/, $date; } elsif ( $myconfig->{dateformat} =~ /^dd/ ) { ( $dd, $mm, $yy ) = split /\D/, $date; } $dd *= 1; $mm *= 1; $yy += 2000 if length $yy == 2; $dd = substr( "0$dd", -2 ); $mm = substr( "0$mm", -2 ); $date = "$yy$mm$dd"; } $date; } sub sanitize_for_display { my $self = shift; my $var = shift; $self->error('Untested API'); if (!$var){ $var = $self; } for my $k (keys %$var){ my $type = ref($var); if (UNIVERSAL::isa($var->{$k}, 'Math::BigFloat')){ $var->{$k} = $self->format_amount({amount => $var->{$k}}); } elsif ($type == 'HASH'){ $self->sanitize_for_display($var->{$k}); } } } sub finalize_request { $logger->debug("throwing CancelFurtherProcessing()");#if trying to follow flow of request throw CancelFurtherProcessing(); } # To be replaced with a generic interface to an Error class sub error { my ( $self, $msg ) = @_; if ( $ENV{GATEWAY_INTERFACE} ) { $self->{msg} = $msg; $self->{format} = "html"; delete $self->{pre}; print qq|Content-Type: text/html; charset=utf-8\n\n|; print ""; $self->{msg} =~ s/\n/
\n/; print qq|

Error!

$self->{msg}|; die; } else { if ( $ENV{error_function} ) { &{ $ENV{error_function} }($msg); } die "Error: $msg\n"; } } # Database routines used throughout sub _db_init { my $self = shift @_; my %args = @_; (my $package,my $filename,my $line)=caller; if($self->{dbh}) { $logger->error("dbh already set \$self->{dbh}=$self->{dbh},called from $filename"); } my $creds = LedgerSMB::Auth::get_credentials(); $self->{login} = $creds->{login}; if (!$self->{company}){ $self->{company} = $LedgerSMB::Sysconfig::default_db; } my $dbname = $self->{company}; # Note that we have to request the login/password again if the db # connection fails since this probably means bad credentials are entered. # Just in case, however, I think it is a good idea to include the DBI # error string. CT $self->{dbh} = DBI->connect( "dbi:Pg:dbname=$dbname", "$creds->{login}", "$creds->{password}", { AutoCommit => 0 } ); $logger->debug("DBI->connect dbh=$self->{dbh}"); my $dbi_trace=$LedgerSMB::Sysconfig::DBI_TRACE; if($dbi_trace) { $logger->debug("\$dbi_trace=$dbi_trace"); $self->{dbh}->trace(split /=/,$dbi_trace,2);#http://search.cpan.org/~timb/DBI-1.616/DBI.pm#TRACING } if (($self->{script} eq 'login.pl') && ($self->{action} eq 'authenticate')){ if (!$self->{dbh}){ $self->{_auth_error} = $DBI::errstr; } return; } elsif (!$self->{dbh}){ $self->_get_password; } $self->{dbh}->{pg_server_prepare} = 0; $self->{dbh}->{pg_enable_utf8} = 1; $LedgerSMB::App_State::DBH = $self->{dbh}; $LedgerSMB::App_State::DBName = $dbname; # This is the general version check my $sth = $self->{dbh}->prepare(" SELECT value FROM defaults WHERE setting_key = 'version'"); $sth->execute; my ($dbversion) = $sth->fetchrow_array; $sth = $self->{dbh}->prepare(" SELECT value FROM defaults WHERE setting_key = 'role_prefix'"); $sth->execute; ($self->{_role_prefix}) = $sth->fetchrow_array; if ($dbversion ne $self->{dbversion}){ $self->error("Database is not the expected version. Was $dbversion, expected $self->{dbversion}. Please re-run setup.pl against this database to correct.setup.pl"); } $sth = $self->{dbh}->prepare('SELECT check_expiration()'); $sth->execute; ($self->{warn_expire}) = $sth->fetchrow_array; if ($self->{warn_expire}){ $sth = $self->{dbh}->prepare('SELECT user__check_my_expiration()'); $sth->execute; ($self->{pw_expires}) = $sth->fetchrow_array; } my $query = "SELECT t.extends, coalesce (t.table_name, 'custom_' || extends) || ':' || f.field_name as field_def FROM custom_table_catalog t JOIN custom_field_catalog f USING (table_id)"; $sth = $self->{dbh}->prepare($query); $sth->execute; my $ref; $self->{custom_db_fields} = {}; while ( $ref = $sth->fetchrow_hashref('NAME_lc') ) { push @{ $self->{custom_db_fields}->{ $ref->{extends} } }, $ref->{field_def}; } # Adding role list to self $self->{_roles} = []; $query = "select rolname from pg_roles where pg_has_role(SESSION_USER, 'USAGE')"; $sth = $self->{dbh}->prepare($query); $sth->execute(); while (my @roles = $sth->fetchrow_array){ push @{$self->{_roles}}, $roles[0]; } $LedgerSMB::App_State::Roles = @{$self->{_roles}}; $LedgerSMB::App_State::Role_Prefix = $self->{_role_prefix}; # @{$self->{_roles}} will eventually go away. --CT $sth->finish(); $logger->debug("end"); } #private, for db connection errors sub _on_connection_error { for (@_){ $logger->error("$_"); } } sub dberror{ my $self = shift @_; my $state_error = {}; my $locale = $LedgerSMB::App_State::Locale; my $dbh = $LedgerSMB::App_State::DBH; if ($locale){ $state_error = { '42883' => $locale->text('Internal Database Error'), '42501' => $locale->text('Access Denied'), '42401' => $locale->text('Access Denied'), '22008' => $locale->text('Invalid date/time entered'), '22012' => $locale->text('Division by 0 error'), '22004' => $locale->text('Required input not provided'), '23502' => $locale->text('Required input not provided'), '23505' => $locale->text('Conflict with Existing Data. Perhaps you already entered this?'), 'P0001' => $locale->text('Error from Function:') . "\n" . $dbh->errstr, }; } $logger->error("Logging SQL State ".$dbh->state.", error ". $dbh->err . ", string " .$dbh->errstr); if (defined $state_error->{$dbh->state}){ $self->error($state_error->{$dbh->state} . "\n" . $locale->text('More information has been reported in the error logs')); $dbh->rollback; die; } $self->error($dbh->state . ":" . $dbh->errstr); } sub redo_rows { my $self = shift @_; my %args = @_; my @flds = @{ $args{fields} }; my $count = $args{count}; my $index = ( $args{index} ) ? $args{index} : 'runningnumber'; my @rows; my $i; # increment counter use only for $i ( 1 .. $count ) { my $temphash = { _inc => $i }; for my $fld (@flds) { $temphash->{$fld} = $self->{ "$fld" . "_$i" }; } push @rows, $temphash; } $i = 1; for my $row ( sort { $a->{$index} <=> $b->{$index} } @rows ) { for my $fld (@flds) { $self->{ "$fld" . "_$i" } = $row->{$fld}; } ++$i; } } sub merge { (my $package,my $filename,my $line)=caller; my ( $self, $src ) = @_; $logger->debug("begin caller \$filename=$filename \$line=$line"); # Removed dbh from logging string since not used on this api call and # not initialized in test cases -CT for my $arg ( $self, $src ) { shift; } my %args = @_; my @keys; if (defined $args{keys}){ @keys = @{ $args{keys} }; } my $index = $args{index}; if ( !scalar @keys ) { @keys = keys %{$src}; } for my $arg ( @keys ) { my $dst_arg; if ($index) { $dst_arg = $arg . "_$index"; } else { $dst_arg = $arg; } if ( defined $dst_arg && defined $src->{$arg} ) { $logger->trace("LedgerSMB.pm: merge setting $dst_arg to $src->{$arg}"); } elsif ( !defined $dst_arg && defined $src->{$arg} ) { $logger->trace("LedgerSMB.pm: merge setting \$dst_arg is undefined \$src->{\$arg} is defined $src->{$arg}"); } elsif ( defined $dst_arg && !defined $src->{$arg} ) { $logger->trace("LedgerSMB.pm: merge setting \$dst_arg is defined $dst_arg \$src->{\$arg} is undefined"); } elsif ( !defined $dst_arg && !defined $src->{$arg} ) { $logger->trace("LedgerSMB.pm: merge setting \$dst_arg is undefined \$src->{\$arg} is undefined"); } $self->{$dst_arg} = $src->{$arg}; } $logger->debug("end caller \$filename=$filename \$line=$line"); } sub type { my $self = shift @_; if (!$ENV{REQUEST_METHOD} or ( !grep {$ENV{REQUEST_METHOD} eq $_} ("HEAD", "GET", "POST") ) ) { $self->error("Request method unset or set to unknown value"); } return $ENV{REQUEST_METHOD}; } sub DESTROY {} sub set { my $self = shift @_; my %args = @_; for my $arg (keys(%args)) { $self->{$arg} = $args{$arg}; } return 1; } sub remove_cgi_globals { my ($self) = @_; for my $key (keys %$self){ if ($key =~ /^\./){ delete $self->{key} } } } sub take_top_level { my ($self) = @_; my $return_hash = {}; for my $key (keys %$self){ if (!ref($self->{$key}) && $key !~ /^\./){ $return_hash->{$key} = $self->{$key} } } return $return_hash; } sub get_default_value_by_key { my ($self, $key) = @_; my $Settings = LedgerSMB::Setting->new({base => $self, copy => 'base'}); $Settings->{key} = $key; $Settings->get; $Settings->{value}; } 1; ledgersmb/COMPATIBILITY0000644000000000000000000000313511640705103013453 0ustar rootrootKnown versions of software incompatible with LedgerSMB: ------------------------------- Versions prior to PostgreSQL 8.2 do not support some features required by LedgerSMB 1.3 and higher - support for these PostgreSQL versions has been dropped. PostgreSQL version 8.2.2 is known to cause problems with LedgerSMB. PostgreSQL 8.2 will be supported on a best effort basis. You will need the tsearch2 compatibility libraries. Additionally, due to the changes in implicit casts, bugs may exist which cause database operations to abort. We do accept bug reports and will address them, however. ------------------------------- W3M does not handle the \n", 'print_button'); ## $form->like checks $form = new Form; is($form->like('hello world'), '%hello world%', 'like'); ## $form->redirect checks $form = new Form; ok(!defined $form->{callback}, 'redirect: No callback set'); @r = trap{$form->redirect}; is($trap->stdout, "redirected\n", 'redirect: No message or callback redirect'); @r = trap{$form->redirect('hello world')}; is($trap->stdout, "hello world\n", 'redirect: message, no callback redirect'); $form->{callback} = 1; @r = trap{$form->redirect}; is($trap->stdout, "redirected\n", 'redirect: callback, no message redirect'); @r = trap{$form->redirect("hello world\n")}; is($trap->stdout, "redirected\n", 'redirect: callback and message redirect'); ledgersmb/t/43-dbtest.t0000644000000000000000000000143211603255421013660 0ustar rootrootuse Test::More; use strict; if (!defined $ENV{LSMB_TEST_DB}){ plan skip_all => 'Skipping all. Told not to test db.'; } else { plan tests => 148; if (defined $ENV{LSMB_NEW_DB}){ $ENV{PGDATABASE} = $ENV{LSMB_NEW_DB}; } if (!defined $ENV{PGDATABASE}){ die "We were told to run tests, but no database specified!"; } } my @testscripts = qw(Account Reconciliation Business_type Company Draft Payment Session Voucher System Taxform); chdir 'sql/modules/test/'; for my $testscript (@testscripts){ open (TEST, '-|', "psql -f $testscript.sql"); my @testlines = grep /\|\s+(t|f)\s?$/, ; cmp_ok(scalar @testlines, '>', 0, "$testscript.sql returned test results"); for my $test (@testlines){ my @parts = split /\|/, $test; like($parts[1], qr/t\s?$/, $parts[0]); } } ledgersmb/t/03-date-handling.t0000644000000000000000000002777611763073266015125 0ustar rootroot#!/usr/bin/perl # # Note: This file assumes good dates, SL behaviour with bad dates is undefined # use strict; use warnings; use Test::More 'no_plan'; use Math::BigFloat; use LedgerSMB::Sysconfig; use LedgerSMB; use LedgerSMB::Form; use LedgerSMB::Locale; my $form = new Form; my $locale_en = LedgerSMB::Locale->get_handle('en_CA'); my $locale_es = LedgerSMB::Locale->get_handle('es'); my %myconfig; ok(defined $form); isa_ok($form, 'Form'); my $lsmb = new LedgerSMB; ok(defined $lsmb); isa_ok($lsmb, 'LedgerSMB'); $form->{dbh} = ${LedgerSMB::Sysconfig::GLOBALDBH}; my @formats = ( ['mm-dd-yy', '-', 2, '02-29-00', '03-01-00'], ['mm/dd/yy', '/', 2, '02/29/00', '03/01/00'], ['dd-mm-yy', '-', 2, '29-02-00', '01-03-00'], ['dd/mm/yy', '/', 2, '29/02/00', '01/03/00'], ['dd.mm.yy', '.', 2, '29.02.00', '01.03.00'], # ['yyyymmdd', '', 4, '20000229', '20000301'], ['yyyy-mm-dd', '-', 4, '2000-02-29', '2000-03-01']); my @months = ('January', 'February', 'March', 'April', 'May ', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); my @mon = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); my %month_num = ('01' => '31', '02' => '28', '03' => '31', '04' => '30', '05' => '31', '06' => '30', '07' => '31', '08' => '31', '09' => '30', '10' => '31', '11' => '30', '12' => '31'); my $today = `date +\%F`; chomp $today; my %today_parts; $today_parts{'yyyy'} = `date +\%Y`; $today_parts{'yy'} = $today_parts{'yyyy'}; $today_parts{'yy'} =~ s/^..//; $today_parts{'mm'} = `date +\%m`; $today_parts{'dd'} = `date +\%d`; chomp $today_parts{'yyyy'}; chomp $today_parts{'yy'}; chomp $today_parts{'mm'}; chomp $today_parts{'dd'}; # $locale->date checks # Note that $locale->date assumes the year range 2000-2099 # Note that $locale->date does not perform language-specific long forms # Note that $locale->date also takes in yyyymmdd foreach my $format (0 .. $#formats) { %myconfig = (dateformat => $formats[$format][0]); my $fmt = $formats[$format][0]; my $sep = $formats[$format][1]; my $yearcount = $formats[$format][2]; my $result = $formats[$format][3]; $result =~ s/^(.*)(20)?00(.*)$/${1}2000${3}/ if $yearcount == 2; cmp_ok($locale_en->date(\%myconfig), 'eq', '', "date, $fmt: empty string"); cmp_ok($locale_en->date(\%myconfig, $formats[$format][3]), 'eq', $result, "date, $fmt: short"); cmp_ok($locale_en->date(\%myconfig, '20000229'), 'eq', $result, "date, $fmt: chopped"); for my $mm (1 .. 12) { my $start = $fmt; my $temp = sprintf('%02d', $mm); my $month_en = $locale_en->text($months[$mm - 1]); my $month_en_2 = $locale_en->text($mon[$mm - 1]); my $month_es = $locale_es->text($months[$mm - 1]); $start =~ s/dd/29/; $start =~ s/yyyy/2000/; $start =~ s/yy/00/; $start =~ s/mm/$temp/; cmp_ok($locale_es->date(\%myconfig, $start, 1), 'eq', "$month_es 29 2000", "date, $start, $fmt: long, es"); cmp_ok($locale_en->date(\%myconfig, $start, 1), 'eq', "$month_en 29 2000", "date, $start, $fmt: long, en"); cmp_ok($locale_en->date(\%myconfig, $start, ''), 'eq', "$month_en_2 29 2000", "date, $start, $fmt: '', en") if $start !~ /^\d{4}\D/; # Ack... special case } cmp_ok($locale_en->date(\%myconfig, '2007-05-18', ''), 'eq', "2007-05-18", "date, 2007-05-18, $fmt: '', en"); } foreach my $format (0 .. $#formats) { %myconfig = (dateformat => $formats[$format][0]); my $fmt = $formats[$format][0]; my $sep = $formats[$format][1]; my $yearcount = $formats[$format][2]; cmp_ok($form->datetonum(\%myconfig, $formats[$format][3]), 'eq', '20000229', "form: datetonum, $fmt"); cmp_ok($lsmb->date_to_number('user' => \%myconfig, 'date' => $formats[$format][3]), 'eq', '20000229', "lsmb: date_to_number, $fmt"); } cmp_ok($form->datetonum(\%myconfig), 'eq', '', "form: datetonum, empty string"); cmp_ok($form->datetonum(\%myconfig, '1234'), 'eq', '1234', "form: datetonum, 1234"); cmp_ok($lsmb->date_to_number('user' => \%myconfig), 'eq', '', "lsmb: date_to_number, empty date"); cmp_ok($lsmb->date_to_number('user' => \%myconfig, 'date' => '1234'), 'eq', '1234', "lsmb: date_to_number, 1234"); # $form->split_date checks # Note that $form->split_date assumes the year range 2000-2099 # Note that $form->split_date only outputs two digit years # Note that $form->split_date if a date provided without non-digit, identity foreach my $format (0 .. $#formats) { %myconfig = (dateformat => $formats[$format][0]); my $fmt = $formats[$format][0]; my $sep = $formats[$format][1]; my $yearcount = $formats[$format][2]; my @output = $form->split_date($fmt, $formats[$format][3]); my $rv = $fmt; $rv =~ s/\Q$sep\E//g; $rv =~ s/(yy)?yy/$output[1]/; $rv =~ s/mm/$output[2]/; $rv =~ s/dd/$output[3]/; cmp_ok($output[1], 'eq', '00', "split_date specified, year"); cmp_ok($output[2], 'eq', '02', "split_date specified, month"); cmp_ok($output[3], 'eq', '29', "split_date specified, day"); cmp_ok($output[0], 'eq', $rv, "split_date specified, unit"); @output = $form->split_date($fmt); $rv = $fmt; $rv =~ s/\Q$sep\E//g; $rv =~ s/(yy)?yy/$output[1]/; $rv =~ s/mm/$output[2]/; $rv =~ s/dd/$output[3]/; my $tv = $fmt; $tv =~ s/\Q$sep\E//g; $tv =~ s/(yy)?yy/$today_parts{'yy'}/; $tv =~ s/mm/$today_parts{'mm'}/; $tv =~ s/dd/$today_parts{'dd'}/; cmp_ok($output[1], 'eq', $today_parts{'yy'}, "split_date unspecified, year"); cmp_ok($output[2], 'eq', $today_parts{'mm'}, "split_date unspecified, month"); cmp_ok($output[3], 'eq', $today_parts{'dd'}, "split_date unspecified, day"); @output = $form->split_date($fmt, '12345'); cmp_ok($output[0], 'eq', '12345', 'split_date, 12345'); } # $form->format_date checks # Note that $form->format_date always outputs four digit years foreach my $format (0 .. $#formats) { $form->{db_dateformat} = $formats[$format][0]; my $fmt = $formats[$format][0]; my $sep = $formats[$format][1]; my $yearcount = $formats[$format][2]; my $results = $fmt; $results =~ s/(yy)?yy/2000/; $results =~ s/mm/02/; $results =~ s/dd/29/; cmp_ok($form->format_date('2000-02-29'), 'eq', $results, "format_date, $fmt, ISO"); cmp_ok($form->format_date($formats[$format][3]), 'eq', $formats[$format][3], "format_date, $fmt, non-ISO"); } # $form->from_to checks # Note that $form->from_to requires $form->format_date # Note that $form->from_to outputs four digit years # Note that $form->from_to outputs 1999-12-31 (formatted) if no input given # Note that $form->from_to outputs the last day of the previous year if only year given # Note that $form->from_to outputs the last day of the chosen month if month given # Note that $form->from_to $interval of 0 is current day # Note that $form->from_to $interval is an integral quantity of months # Note that $form->from_to will fail if ($interval + $month) > 22 # (2 + 23), 25 - 12, 13 - 1, 12 foreach my $format (0 .. $#formats) { $form->{db_dateformat} = $formats[$format][0]; my $fmt = 'yyyy-mm-dd'; my $sep = '-'; my $yearcount = $formats[$format][2]; my $results = $fmt; $results =~ s/(yy)?yy/1999/; $results =~ s/mm/12/; $results =~ s/dd/31/; cmp_ok($form->from_to(), 'eq', $results, "from_to, $fmt, unspecified"); $results =~ s/1999/2006/; cmp_ok($form->from_to('07'), 'eq', $results, "from_to, $fmt, 07"); cmp_ok($form->from_to('2007'), 'eq', $results, "from_to, $fmt, 2007"); $results =~ s/2006/2007/; $results =~ s/12/05/; cmp_ok($form->from_to('07', '05'), 'eq', $results, "from_to, $fmt, 07-05"); cmp_ok($form->from_to('2007', '05'), 'eq', $results, "from_to, $fmt, 2007-05"); $results =~ s/05/02/; $results =~ s/31/28/; cmp_ok($form->from_to('07', '02'), 'eq', $results, "from_to, $fmt, 07-02"); cmp_ok($form->from_to('2007', '02'), 'eq', $results, "from_to, $fmt, 2007-02"); $results =~ s/2007/2000/; $results =~ s/28/29/; cmp_ok($form->from_to('00', '02'), 'eq', $results, "from_to, $fmt, 00-02 leap day"); cmp_ok($form->from_to('2000', '02'), 'eq', $results, "from_to, $fmt, 2000-02 leap day"); $results =~ s/29/31/; $results =~ s/02/01/; cmp_ok($form->from_to('00', '01'), 'eq', $results, "from_to, $fmt, 00-01 year edge"); cmp_ok($form->from_to('2000', '01'), 'eq', $results, "from_to, $fmt, 2000-01 year edge"); $results =~ s/01/12/; cmp_ok($form->from_to('00', '12'), 'eq', $results, "from_to, $fmt, 00-12 year edge"); cmp_ok($form->from_to('2000', '12'), 'eq', $results, "from_to, $fmt, 2000-12 year edge"); $results =~ s/12/02/; $results =~ s/31/29/; cmp_ok($form->from_to('00', '02', '1'), 'eq', $results, "from_to, $fmt, 00-02, 1 interval"); cmp_ok($form->from_to('2000', '02', '1'), 'eq', $results, "from_to, $fmt, 2000-02, 1 interval"); $results =~ s/29/28/; my $month; my $lastmonth; for (2 .. 11) { $month = sprintf '%02d', $_ + 1; $lastmonth = sprintf '%02d', $_; $results =~ s/$lastmonth/$month/; $results =~ s/$month_num{$lastmonth}/$month_num{$month}/; cmp_ok($form->from_to('00', '02', $_), 'eq', $results, "from_to, $fmt, 00-02, $_ interval"); cmp_ok($form->from_to('2000', '02', $_), 'eq', $results, "from_to, $fmt, 2000-02, $_ interval"); } $results =~ s/2000/2001/; for (0 .. 10) { $month = sprintf '%02d', $_ + 1; $lastmonth = sprintf '%02d', $_; $lastmonth = '12' if $lastmonth eq '00'; $results =~ s/([^0])$lastmonth/${1}$month/; $results =~ s/^$lastmonth/$month/; $results =~ s/$month_num{$lastmonth}/$month_num{$month}/; cmp_ok($form->from_to('00', '02', $_ + 12), 'eq', $results, "from_to, $fmt, 00-02, $_ + 12 interval"); cmp_ok($form->from_to('2000', '02', $_ + 12), 'eq', $results, "from_to, $fmt, 2000-02, $_ + 12 interval"); } $results =~ s/11/$today_parts{'mm'}/; $results =~ s/30/$today_parts{'dd'}/; $results =~ s/2001/$today_parts{'yyyy'}/; cmp_ok($form->from_to('00', '02', '0'), 'eq', $results, "from_to, $fmt, 00-02, 0 interval (today)"); cmp_ok($form->from_to('2000', '02', '0'), 'eq', $results, "from_to, $fmt, 2000-02, 0 interval (today)"); } # $form->add_date checks # returns undef if no date passed # valid units: days, weeks, months, years # all uses in LSMB use days unit # has no error handling capabilities foreach my $format (0 .. $#formats) { $form->{db_dateformat} = $formats[$format][0]; %myconfig = (dateformat => $formats[$format][0]); my $fmt = $formats[$format][0]; my $sep = $formats[$format][1]; my $yearcount = $formats[$format][2]; my $start = $fmt; $start =~ s/(yy)?yy/2000/; $start =~ s/mm/01/; $start =~ s/dd/29/; my $results = $start; $results =~ s/29/30/; cmp_ok($form->add_date(\%myconfig, $start, 1, 'days'), 'eq', $results, "add_date, $fmt, 1 days, 2000-01-29"); $results =~ s/30/31/; cmp_ok($form->add_date(\%myconfig, $start, 2, 'days'), 'eq', $results, "add_date, $fmt, 2 days, 2000-01-29"); $results =~ s/31/05/; $results =~ s/01/02/; cmp_ok($form->add_date(\%myconfig, $start, 1, 'weeks'), 'eq', $results, "add_date, $fmt, 1 weeks, 2000-01-29"); $results =~ s/05/12/; cmp_ok($form->add_date(\%myconfig, $start, 2, 'weeks'), 'eq', $results, "add_date, $fmt, 2 weeks, 2000-01-29"); $results =~ s/12/29/; cmp_ok($form->add_date(\%myconfig, $start, 1, 'months'), 'eq', $results, "add_date, $fmt, 1 months, 2000-01-29"); $results =~ s/02/03/; cmp_ok($form->add_date(\%myconfig, $start, 2, 'months'), 'eq', $results, "add_date, $fmt, 2 months, 2000-01-29"); $results = $start; $results =~ s/01/11/; cmp_ok($form->add_date(\%myconfig, $start, 10, 'months'), 'eq', $results, "add_date, $fmt, 10 months, 2000-01-29"); $results = $start; $results =~ s/01/12/; cmp_ok($form->add_date(\%myconfig, $start, 11, 'months'), 'eq', $results, "add_date, $fmt, 11 months, 2000-01-29"); $results = $start; $results =~ s/2000/2001/; cmp_ok($form->add_date(\%myconfig, $start, 12, 'months'), 'eq', $results, "add_date, $fmt, 12 months, 2000-01-29"); cmp_ok($form->add_date(\%myconfig, $start, 1, 'years'), 'eq', $results, "add_date, $fmt, 1 years, 2000-01-29"); $results =~ s/2001/2002/; cmp_ok($form->add_date(\%myconfig, $start, 2, 'years'), 'eq', $results, "add_date, $fmt, 2 years, 2000-01-29"); } cmp_ok($form->add_date(\%myconfig, '20000129', 2, 'years'), 'eq', '20020129', 'add_date, yyyymmdd, 2 years, 20000129'); ok(!defined $form->add_date(\%myconfig), 'add_date, undef if no date'); ledgersmb/t/02-number-handling.t0000644000000000000000000004226512054072421015447 0ustar rootroot#!/usr/bin/perl use strict; use warnings; $ENV{TMPDIR} = 't/var'; #use Test::More 'no_plan'; use Test::More tests => 1172; use Test::Trap qw(trap $trap); use Math::BigFloat; use LedgerSMB; use LedgerSMB::Form; my $lsmb_nan_message = "Content-Type: text/html; charset=utf-8\n\n

Error!

Invalid number detected during parsing"; my $form_nan_message = '

Error!

Invalid number detected during parsing'; my @r; my $form = new Form; my %myconfig; ok(defined $form); isa_ok($form, 'Form'); my $lsmb = new LedgerSMB; ok(defined $lsmb); isa_ok($lsmb, 'LedgerSMB'); my $expected; foreach my $value ('0.01', '0.05', '0.015', '0.025', '1.1', '1.5', '1.9', '10.01', '4', '5', '5.1', '5.4', '5.5', '5.6', '6', '0', '0.000', '10.155', '55', '0.001', '14.5', '15.5', '4.5') { foreach my $places ('3', '2', '1', '0') { Math::BigFloat->round_mode('+inf'); $expected = Math::BigFloat->new($value)->ffround(-$places); $expected->precision(undef); is($form->round_amount($value, $places), $expected, "form: $value to $places decimal places - $expected"); is($lsmb->round_amount($value, $places), $expected, "lsmb: $value to $places decimal places - $expected"); Math::BigFloat->round_mode('-inf'); $expected = Math::BigFloat->new(-$value)->ffround(-$places); $expected->precision(undef); is($form->round_amount(-$value, $places), $expected, "form: -$value to $places decimal places - $expected"); is($lsmb->round_amount(-$value, $places), $expected, "lsmb: -$value to $places decimal places - $expected"); } foreach my $places ('-1', '-2') { Math::BigFloat->round_mode('+inf'); $expected = Math::BigFloat->new($value)->ffround(-($places-1)); is($form->round_amount($value, $places), $expected, "form: $value to $places decimal places - $expected"); is($lsmb->round_amount($value, $places), $expected, "lsmb: $value to $places decimal places - $expected"); Math::BigFloat->round_mode('-inf'); $expected = Math::BigFloat->new(-$value)->ffround(-($places-1)); is($form->round_amount(-$value, $places), $expected, "form: -$value to $places decimal places - $expected"); is($lsmb->round_amount(-$value, $places), $expected, "lsmb: -$value to $places decimal places - $expected"); } } # TODO Number formatting still needs work for l10n my @formats = (['1,000.00', ',', '.'], ["1'000.00", "'", '.'], ['1.000,00', '.', ','], ['1000,00', '', ','], ['1000.00', '', '.'], ['1 000.00', ' ', '.']); my %myfooconfig = (numberformat => '1000.00'); foreach my $format (0 .. $#formats) { %myconfig = (numberformat => $formats[$format][0]); my $thou = $formats[$format][1]; my $dec = $formats[$format][2]; foreach my $rawValue ('10t000d00', '9t999d99', '333d33', '7t777t777d77', '-12d34', '0d00') { $expected = $rawValue; $expected =~ s/t/$thou/gx; $expected =~ s/d/$dec/gx; my $value = $rawValue; $value =~ s/t//gx; $value =~ s/d/\./gx; ##$value = Math::BigFloat->new($value); $value = $form->parse_amount(\%myfooconfig,$value); is($form->format_amount(\%myconfig, $value, 2, '0'), $expected, "form: $value formatted as $formats[$format][0] - $expected"); is($lsmb->format_amount('user' => \%myconfig, 'amount' => $value, 'precision' => 2, 'neg_format' => '0'), $expected, "lsmb: $value formatted as $formats[$format][0] - $expected"); } } foreach my $format (0 .. $#formats) { %myconfig = (numberformat => $formats[$format][0]); my $thou = $formats[$format][1]; my $dec = $formats[$format][2]; foreach my $rawValue ('10t000d00', '9t999d99', '333d33', '7t777t777d77', '-12d34', '0d00', '0') { $expected = $rawValue; if ($expected eq '0'){ $expected = '0d00'; } $expected =~ s/t/$thou/gx; $expected =~ s/d/$dec/gx; my $value = $rawValue; $value =~ s/t//gx; $value =~ s/d/\./gx; ##$value = Math::BigFloat->new($value); $LedgerSMB::Sysconfig::decimal_places = 2; $value = $lsmb->parse_amount(user =>\%myfooconfig, amount =>$value); is($form->format_amount(\%myconfig, $value, 2, '0'), $expected, "form: $value formatted as $formats[$format][0] - $expected"); is($lsmb->format_amount('user' => \%myconfig, 'amount' => $value, 'money' => 1, 'neg_format' => '0'), $expected, "lsmb(money): $value formatted as $formats[$format][0] - $expected"); } } foreach my $format (0 .. $#formats) { %myconfig = (numberformat => $formats[$format][0]); my $thou = $formats[$format][1]; my $dec = $formats[$format][2]; foreach my $rawValue ('10t000d00', '9t999d99', '333d33', '7t777t777d77', '-12d34', '0d00') { $expected = $rawValue; $expected =~ s/t/$thou/gx; $expected =~ s/d/$dec/gx; my $value = $rawValue; $value =~ s/t//gx; $value =~ s/d/\./gx; my $val2 = $value; ##$value = Math::BigFloat->new($value); $value = $form->parse_amount(\%myfooconfig,$value); my $value2 = $lsmb->parse_amount(user => \%myfooconfig, amount => $val2); is($form->format_amount(\%myconfig, $value, 2, '0'), $expected, "form: $value formatted as $formats[$format][0] - $expected"); is($lsmb->format_amount('user' => \%myconfig, 'amount' => $value2, 'precision' => 2, 'neg_format' => '0'), $expected, "lsmb: $value formatted as $formats[$format][0] - $expected"); } } foreach my $format (0 .. $#formats) { %myconfig = (numberformat => $formats[$format][0]); my $thou = $formats[$format][1]; my $dec = $formats[$format][2]; my $rawValue = '6d00'; $expected = $rawValue; $expected =~ s/d/$dec/gx; my $value = $form->parse_amount(\%myfooconfig, '6'); is($form->format_amount(\%myconfig, $value, 2, '0'), $expected, "form: $value formatted as $formats[$format][0] - $expected"); is($lsmb->format_amount('user' => \%myconfig, 'amount' => $value, 'precision' => 2, 'neg_format' => '0'), $expected, "lsmb: $value formatted as $formats[$format][0] - $expected"); } $expected = $form->parse_amount({'numberformat' => '1000.00'}, '0.00'); is($form->format_amount({'numberformat' => '1000.00'} , $expected, 2, 'x'), 'x', "form: 0.00 with dash x"); is($lsmb->format_amount('user' => {'numberformat' => '1000.00'}, 'amount' => $expected, 'precision' => 2, 'neg_format' => 'x'), '0.00', "lsmb: 0.00 with dash x"); is($form->format_amount({'numberformat' => '1000.00'} , $expected, 2, ''), '', "form: 0.00 with dash ''"); is($lsmb->format_amount('user' => {'numberformat' => '1000.00'}, 'amount' => $expected, 'precision' => 2, 'neg_format' => ''), '0.00', "lsmb: 0.00 with dash ''"); is($form->format_amount({'numberformat' => '1000.00'} , $expected, 2), '', "form: 0.00 with undef dash"); is($lsmb->format_amount('user' => {'numberformat' => '1000.00'}, 'amount' => $expected, 'precision' => 2), '0.00', "lsmb: 0.00 with undef dash"); $ENV{GATEWAY_INTERFACE} = 'yes'; $form->{pre} = 'Blah'; $form->{header} = 'Blah'; @r = trap{$form->format_amount({'apples' => '1000.00'}, 'foo', 2)}; is($trap->exit, undef, 'form: No numberformat set, invalid amount (NaN check)'); is($trap->stdout, $form_nan_message, 'form: No numberformat set, invalid amount message (NaN check)'); @r = trap{$lsmb->format_amount('user' => {'apples' => '1000.00'}, 'amount' => 'foo', 'precision' => 2)}; is($trap->exit, undef, 'lsmb: No numberformat set, invalid amount (NaN check)'); is($trap->stdout, $lsmb_nan_message, 'lsmb: No numberformat set, invalid amount message (NaN check)'); cmp_ok($form->format_amount({'apples' => '1000.00'} , '1.00', 2), '==', 1, "form: No numberformat set, valid amount"); cmp_ok($lsmb->format_amount('user' => {'apples' => '1000.00'}, 'amount' => '1.00', 'precision' => 2), '==', 1, "lsmb: No numberformat set, valid amount"); is($form->format_amount({'numberformat' => '1000.00'} , '-1.00', 2, '-'), '(1.00)', "form: -1.00 with dash '-'"); is($lsmb->format_amount('user' => {'numberformat' => '1000.00'}, 'amount' => '-1.00', 'precision' => 2, 'neg_format' => '-'), '(1.00)', "lsmb: -1.00 with dash '-'"); is($form->format_amount({'numberformat' => '1000.00'} , '1.00', 2, '-'), '1.00', "form: 1.00 with dash '-'"); is($lsmb->format_amount('user' => {'numberformat' => '1000.00'}, 'amount' => '1.00', 'precision' => 2, 'neg_format' => '-'), '1.00', "lsmb: 1.00 with dash '-'"); is($form->format_amount({'numberformat' => '1000.00'} , '-1.00', 2, 'DRCR'), '1.00 DR', "form: -1.00 with dash DRCR"); is($lsmb->format_amount('user' => {'numberformat' => '1000.00'}, 'amount' => '-1.00', 'precision' => 2, 'neg_format' => 'DRCR'), '1.00 DR', "lsmb: -1.00 with dash DRCR"); is($form->format_amount({'numberformat' => '1000.00'} , '1.00', 2, 'DRCR'), '1.00 CR', "form: 1.00 with dash DRCR"); is($lsmb->format_amount('user' => {'numberformat' => '1000.00'}, 'amount' => '1.00', 'precision' => 2, 'neg_format' => 'DRCR'), '1.00 CR', "lsmb: 1.00 with dash DRCR"); is($form->format_amount({'numberformat' => '1000.00'} , '-1.00', 2, 'x'), '-1.00', "form: -1.00 with dash 'x'"); is($lsmb->format_amount('user' => {'numberformat' => '1000.00'}, 'amount' => '-1.00', 'precision' => 2, 'neg_format' => 'x'), '-1.00', "lsmb: -1.00 with dash 'x'"); is($form->format_amount({'numberformat' => '1000.00'} , '1.00', 2, 'x'), '1.00', "form: 1.00 with dash 'x'"); is($lsmb->format_amount('user' => {'numberformat' => '1000.00'}, 'amount' => '1.00', 'precision' => 2, 'neg_format' => 'x'), '1.00', "lsmb: 1.00 with dash 'x'"); # Triggers the $amount .= "\.$dec" if ($dec ne ""); check to false is($form->format_amount({'numberformat' => '1000.00'} , '1.00'), '1', "form: 1.00 with no precision or dash (1000.00)"); is($lsmb->format_amount('user' => {'numberformat' => '1000.00'}, 'amount' => '1.00'), '1', "lsmb: 1.00 with no precision or dash (1000.00)"); is($form->format_amount({'numberformat' => '1,000.00'} , '1.00'), '1', "form: 1.00 with no precision or dash (1,000.00)"); is($lsmb->format_amount('user' => {'numberformat' => '1,000.00'}, 'amount' => '1.00'), '1', "lsmb: 1.00 with no precision or dash (1,000.00)"); is($form->format_amount({'numberformat' => '1 000.00'} , '1.00'), '1', "form: 1.00 with no precision or dash (1 000.00)"); is($lsmb->format_amount('user' => {'numberformat' => '1 000.00'}, 'amount' => '1.00'), '1', "lsmb: 1.00 with no precision or dash (1 000.00)"); is($form->format_amount({'numberformat' => '1\'000.00'} , '1.00'), '1', "form: 1.00 with no precision or dash (1'000.00)"); is($lsmb->format_amount('user' => {'numberformat' => '1\'000.00'}, 'amount' => '1.00'), '1', "lsmb: 1.00 with no precision or dash (1'000.00)"); is($form->format_amount({'numberformat' => '1.000,00'} , '1,00'), '1', "form: 1,00 with no precision or dash (1.000,00)"); is($lsmb->format_amount('user' => {'numberformat' => '1.000,00'}, 'amount' => '1,00'), '1', "lsmb: 1,00 with no precision or dash (1.000,00)"); is($form->format_amount({'numberformat' => '1000,00'} , '1,00'), '1', "form: 1,00 with no precision or dash (1000,00)"); is($lsmb->format_amount('user' => {'numberformat' => '1000,00'}, 'amount' => '1,00'), '1', "lsmb: 1,00 with no precision or dash (1000,00)"); is($form->format_amount({'numberformat' => '1000.00'} , '1.50'), '1.5', "form: 1.50 with no precision or dash"); is($lsmb->format_amount('user' => {'numberformat' => '1000.00'}, 'amount' => '1.50'), '1.5', "lsmb: 1.50 with no precision or dash"); is($form->format_amount({'numberformat' => '1000.00'} , '0.0', undef, '0'), '0', "form: 0.0 with no precision, dash '0'"); is($lsmb->format_amount('user' => {'numberformat' => '1000.00'}, 'amount' => '0.0', 'neg_format' => '0'), '0', "lsmb: 0.0 with no precision, dash '0'"); foreach my $format (0 .. $#formats) { %myconfig = (numberformat => $formats[$format][0]); my $thou = $formats[$format][1]; my $dec = $formats[$format][2]; foreach my $rawValue ('10t000d00', '9t999d99', '333d33', '7t777t777d77', '-12d34') { $expected = $rawValue; $expected =~ s/t/$thou/gx; $expected =~ s/d/$dec/gx; my $value = $rawValue; $value =~ s/t//gx; $value =~ s/d/\./gx; #my $ovalue = $value; $value = $form->parse_amount(\%myfooconfig,$value); #$value = $form->parse_amount(\%myconfig,$value); is($form->format_amount(\%myconfig, $form->format_amount(\%myconfig, $value, 2, 'x'), 2, 'x'), $expected, "form: Double formatting of $value as $formats[$format][0] - $expected"); is($lsmb->format_amount('user' => \%myconfig, 'amount' => $lsmb->format_amount('user' => \%myconfig, 'amount' => $value, 'precision' => 2, 'neg_format' => 'x'), 'precision' => 2, 'neg_format' => 'x'), $expected, "lsmb: Double formatting of $value as $formats[$format][0] - $expected"); } } foreach my $format (0 .. $#formats) { %myconfig = ('numberformat' => $formats[$format][0]); my $thou = $formats[$format][1]; my $dec = $formats[$format][2]; foreach my $rawValue ('10t000d00', '9t999d99', '333d33', '7t777t777d77', '-12d34', '(76t543d21)') { $expected = $rawValue; $expected =~ s/t/$thou/gx; $expected =~ s/d/$dec/gx; my $value = $rawValue; $value =~ s/t//gx; $value =~ s/d/\./gx; if ($value =~ m/^\(/gx) { $value = Math::BigFloat->new('-'.substr($value, 1, -1)); } else { $value = Math::BigFloat->new($value); } cmp_ok($form->parse_amount(\%myconfig, $expected), '==', $value, "form: $expected parsed as $formats[$format][0] - $value"); cmp_ok($lsmb->parse_amount('user' => \%myconfig, 'amount' => $expected), '==', $value, "lsmb: $expected parsed as $formats[$format][0] - $value"); } $expected = '12 CR'; my $value = Math::BigFloat->new('12'); cmp_ok($form->parse_amount(\%myconfig, $expected), '==', $value, "form: $expected parsed as $formats[$format][0] - $value"); cmp_ok($lsmb->parse_amount('user' => \%myconfig, 'amount' => $expected), '==', $value, "lsmb: $expected parsed as $formats[$format][0] - $value"); $expected = '21 DR'; $value = Math::BigFloat->new('-21'); cmp_ok($form->parse_amount(\%myconfig, $expected), '==', $value, "form: $expected parsed as $formats[$format][0] - $value"); cmp_ok($lsmb->parse_amount('user' => \%myconfig, 'amount' => $expected), '==', $value, "lsmb: $expected parsed as $formats[$format][0] - $value"); cmp_ok($form->parse_amount(\%myconfig, ''), '==', 0, "form: Empty string returns 0"); @r = trap{$form->parse_amount(\%myconfig, 'foo')}; is($trap->exit, undef, 'form: Invalid string does not exit'); is($trap->stdout, $form_nan_message, 'form: Invalid string gives NaN message'); cmp_ok($lsmb->parse_amount('user' => \%myconfig, 'amount' => ''), '==', 0, "lsmb: Empty string returns 0"); @r = trap{$lsmb->parse_amount('user' => \%myconfig, 'amount' => 'foo')}; is($trap->exit, undef, 'lsmb: Invalid string gives NaN exit'); is($trap->stdout, $lsmb_nan_message, 'lsmb: Invalid string gives NaN message'); } foreach my $format (0 .. $#formats) { %myconfig = ('numberformat' => $formats[$format][0]); my $thou = $formats[$format][1]; my $dec = $formats[$format][2]; foreach my $rawValue ('10t000d00', '9t999d99', '333d33', '7t777t777d77', '-12d34', '(76t543d21)') { $expected = $rawValue; $expected =~ s/t/$thou/gx; $expected =~ s/d/$dec/gx; my $value = $rawValue; $value =~ s/t//gx; $value =~ s/d/\./gx; if ($value =~ m/^\(/gx) { $value = Math::BigFloat->new('-'.substr($value, 1, -1)); } else { $value = Math::BigFloat->new($value); } cmp_ok($form->parse_amount(\%myconfig, $form->parse_amount(\%myconfig, $expected)), '==', $value, "form: $expected parsed as $formats[$format][0] - $value"); cmp_ok($lsmb->parse_amount('user' => \%myconfig, 'amount' => $lsmb->parse_amount('user' => \%myconfig, 'amount' => $expected)), '==', $value, "lsmb: $expected parsed as $formats[$format][0] - $value"); } $expected = '12 CR'; my $value = Math::BigFloat->new('12'); cmp_ok($form->parse_amount(\%myconfig, $form->parse_amount(\%myconfig, $expected)), '==', $value, "form: $expected parsed as $formats[$format][0] - $value"); cmp_ok($lsmb->parse_amount('user' => \%myconfig, 'amount' => $lsmb->parse_amount('user' => \%myconfig, 'amount' => $expected)), '==', $value, "lsmb: $expected parsed as $formats[$format][0] - $value"); $expected = '21 DR'; $value = Math::BigFloat->new('-21'); cmp_ok($form->parse_amount(\%myconfig, $form->parse_amount(\%myconfig, $expected)), '==', $value, "form: $expected parsed as $formats[$format][0] - $value"); cmp_ok($lsmb->parse_amount('user' => \%myconfig, 'amount' => $lsmb->parse_amount('user' => \%myconfig, 'amount' => $expected)), '==', $value, "lsmb: $expected parsed as $formats[$format][0] - $value"); cmp_ok($form->parse_amount(\%myconfig, ''), '==', 0, "form: Empty string returns 0"); cmp_ok($form->parse_amount(\%myconfig), '==', 0, "form: undef string returns 0"); @r = trap{$form->parse_amount(\%myconfig, 'foo')}; is($trap->exit, undef, 'form: Invalid string gives NaN exit'); is($trap->stdout, $form_nan_message, 'form: Invalid string gives NaN message'); cmp_ok($lsmb->parse_amount('user' => \%myconfig), '==', 0, "lsmb: undef string returns 0"); cmp_ok($lsmb->parse_amount('user' => \%myconfig, 'amount' => ''), '==', 0, "lsmb: Empty string returns 0"); @r = trap{$lsmb->parse_amount('user' => \%myconfig, 'amount' => 'foo')}; is($trap->exit, undef, 'lsmb: Invalid string gives NaN exit'); is($trap->stdout, $lsmb_nan_message, 'lsmb: Invalid string gives NaN message'); } ledgersmb/t/42-dbobject.t0000644000000000000000000000366011477242357014170 0ustar rootrootuse LedgerSMB::DBObject; use Test::More tests => 25; # Array parsing tests my $test = '{test,"test2\"\",",test3,"test4"}'; my @test_dbarrays = ( '{{1268133,9648645,2010-06-30,49753.500,0.000,0.00000000000000000000,49753.50000000000000000000,1,0},{1302678,9648659,2010-06-30,850.000,0.000,0.00000000000000000000,850.00000000000000000000,1,0},{1397340,9648659,2010-06-30,-850,0,0.00000000000000000000,-850.00000000000000000000,1,0},{1397341,9648645,2010-06-30,-49753.5,0.0,0.00000000000000000000,-49753.50000000000000000000,1,0}}', '{{1410396,PD-060810,2010-06-08,150,0,0.00000000000000000000,150.00000000000000000000,1,0}}', '{{1410389,ABCD*10K,2010-06-01,331.46,0.00,0.00000000000000000000,331.46000000000000000000,1,0}}', '{{1415588,T/D#QA2GG9-0980,2010-06-16,61033.33,0.00,0.00000000000000000000,61033.33000000000000000000,1,0}}', ); for my $t (@test_dbarrays){ my @r = LedgerSMB::DBObject->_parse_array($t); is($r[0]->[8], '0', "$r[0]->[0] passed"); } my @vals = ('test', 'test2"",', 'test3', 'test4'); my @vals2 = ('test', 'test2"",', 'test3', 'test4'); is(LedgerSMB::DBObject->_db_array_scalars(@vals2), '{test,"test2\"\"\,",test3,test4}', '_db_array_scalars creates correct array'); my $passes = 0; for (LedgerSMB::DBObject->_parse_array($test)){ is($_, shift @vals, "pass $passes, array parse test"); } my $test2 = '{{1,1,1,1},{1,2,2,2},{1,3,3,4}}'; my @test_arry2_c = ( [1,1,1,1], [1,2,2,2], [1,3,3,4]); my @test_arry2 = LedgerSMB::DBObject->_parse_array($test2); is(scalar @test_arry2, 3, 'Compount array with proper element count'); is(scalar @{$test_arry2[0]}, 4, 'Subarray 1 has correct element count'); is(scalar @{$test_arry2[1]}, 4, 'Subarray 2 has correct element count'); is(scalar @{$test_arry2[2]}, 4, 'Subarray 3 has correct element count'); for my $outer(0 .. 2){ for my $inner(0 .. 3) { is ($test_arry2[$outer]->[$inner], $test_arry2_c[$outer]->[$inner], "Compound array $outer/$inner correct"); } } ledgersmb/t/var/0000755000000000000000000000000012060044551012550 5ustar rootrootledgersmb/t/var/ensure_checkout0000644000000000000000000000000011616560320015652 0ustar rootrootledgersmb/t/01-load.t0000644000000000000000000000425411650222342013307 0ustar rootroot#!/usr/bin/perl use strict; use warnings; use Test::More tests => 55; use_ok('LedgerSMB::Sysconfig') || BAIL_OUT('System Configuration could be loaded!'); use_ok('LedgerSMB'); use_ok('LedgerSMB::AA'); use_ok('LedgerSMB::AM'); use_ok('LedgerSMB::Auth'); use_ok('LedgerSMB::BP'); use_ok('LedgerSMB::CA'); use_ok('LedgerSMB::CP'); use_ok('LedgerSMB::DBObject'); use_ok('LedgerSMB::DBObject::Account'); use_ok('LedgerSMB::DBObject::Admin'); use_ok('LedgerSMB::DBObject::Company'); use_ok('LedgerSMB::DBObject::Customer'); use_ok('LedgerSMB::DBObject::Date'); use_ok('LedgerSMB::DBObject::Draft'); use_ok('LedgerSMB::DBObject::Employee'); use_ok('LedgerSMB::DBObject::EOY'); use_ok('LedgerSMB::DBObject::Location'); use_ok('LedgerSMB::DBObject::Menu'); use_ok('LedgerSMB::DBObject::Payment'); use_ok('LedgerSMB::DBObject::Reconciliation'); use_ok('LedgerSMB::DBObject::TaxForm'); use_ok('LedgerSMB::DBObject::User'); use_ok('LedgerSMB::DBObject::Vendor'); use_ok('LedgerSMB::Form'); use_ok('LedgerSMB::GL'); use_ok('LedgerSMB::IC'); use_ok('LedgerSMB::IR'); use_ok('LedgerSMB::IS'); use_ok('LedgerSMB::JC'); use_ok('LedgerSMB::Locale'); use_ok('LedgerSMB::Log'); use_ok('LedgerSMB::Mailer'); use_ok('LedgerSMB::Num2text'); use_ok('LedgerSMB::OE'); use_ok('LedgerSMB::PE'); use_ok('LedgerSMB::PriceMatrix'); use_ok('LedgerSMB::RP'); use_ok('LedgerSMB::Auth'); use_ok('LedgerSMB::DBObject::Reconciliation'); use_ok('LedgerSMB::Tax'); use_ok('LedgerSMB::Template'); use_ok('LedgerSMB::Template::Elements'); use_ok('LedgerSMB::Template::CSV'); use_ok('LedgerSMB::Template::HTML'); use_ok('LedgerSMB::File'); use_ok('LedgerSMB::File::Transaction'); use_ok('LedgerSMB::File::Order'); use_ok('LedgerSMB::DBObject::Asset'); use_ok('LedgerSMB::DBObject::Asset_Report'); use_ok('LedgerSMB::DBObject::Asset_Class'); SKIP: { eval{ require Template::Plugin::Latex} || skip 'Template::Plugin::Latex not installed'; eval{ require Template::Latex} || skip 'Template::Latex not installed'; use_ok('LedgerSMB::Template::LaTeX'); } use_ok('LedgerSMB::Template::TXT'); use_ok('LedgerSMB::User'); SKIP: { eval { require Net::TCLink }; skip 'Net::TCLink not installed', 1 if $@; use_ok('LedgerSMB::CreditCard'); } ledgersmb/t/40-dbsetup.t0000644000000000000000000001000612007101511014020 0ustar rootroot# Database setup tests. use Test::More; use LedgerSMB::Database; use LedgerSMB; use LedgerSMB::Sysconfig; use LedgerSMB::DBObject::Admin; use strict; use DBI; if ($ENV{LSMB_INSTALL_DB} && !$ENV{LSMB_NEW_DB}){ BAIL_OUT('Told to install db, but no LSMB_NEW_DB set. HINT: Set LSMB_NEW_DB environment variable and try running again.'); } my $temp = $ENV{TEMP} || '/tmp/'; my $run_tests = 1; for my $log (qw(dblog dblog_stderr dblog_stdout)){ unlink "$LedgerSMB::Sysconfig::tempdir/$log"; } for my $evar (qw(LSMB_NEW_DB LSMB_TEST_DB PG_CONTRIB_DIR)){ if (!defined $ENV{$evar}){ $run_tests = 0; plan skip_all => "$evar not set"; } } if ($run_tests){ plan tests => 11; $ENV{PGDATABASE} = $ENV{LSMB_NEW_DB}; } my $db = LedgerSMB::Database->new({ countrycode => $ENV{LSMB_COUNTRY_CODE}, chart_name => $ENV{LSMB_LOAD_COA}, chart_gifi => $ENV{LSMB_LOAD_GIFI}, company_name => $ENV{LSMB_NEW_DB}, username => $ENV{PGUSER}, password => $ENV{PGPASSWORD}, contrib_dir => $ENV{PG_CONTRIB_DIR}, source_dir => $ENV{LSMB_SOURCE_DIR} }); # Manual tests my $rc = $db->create; ok($rc, 'Database Created') || BAIL_OUT('Database could not be created! ' . $rc); ok($db->load_modules('LOADORDER'), 'Modules loaded'); if (!$ENV{LSMB_INSTALL_DB}){ open (DBLOCK, '>', "$temp/LSMB_TEST_DB"); print DBLOCK $ENV{LSMB_NEW_DB}; close (DBLOCK); } is($db->process_roles('Roles.sql'), 2, 'Roles processed'); #Changed the COA and GIFI loading to use this, and move admin user to #Database.pm --CT SKIP: { skip 'No admin info', 5 if (!defined $ENV{LSMB_ADMIN_USERNAME} or !defined $ENV{LSMB_ADMIN_PASSWORD} or !defined $ENV{LSMB_COUNTRY_CODE} or !defined $ENV{LSMB_ADMIN_FNAME} or !defined $ENV{LSMB_ADMIN_LNAME}); # Move to LedgerSMB::DBObject::Admin calls. my $lsmb = new LedgerSMB; ok(defined $lsmb, '$lsmb defined'); isa_ok($lsmb, 'LedgerSMB'); $lsmb->{dbh} = DBI->connect("dbi:Pg:dbname=$ENV{PGDATABASE}", undef, undef, { AutoCommit => 0 }); my $dbh = $lsmb->{dbh}; ok($dbh, 'Connected to new database'); my $sth = $dbh->prepare("select id from country where short_name ilike ?"); $sth->execute($ENV{LSMB_COUNTRY_CODE}); my ($id) = $sth->fetchrow_array(); $sth->finish; $lsmb->merge({username => $ENV{LSMB_ADMIN_USERNAME}, password => $ENV{LSMB_ADMIN_PASSWORD}, first_name => $ENV{LSMB_ADMIN_FNAME}, last_name => $ENV{LSMB_ADMIN_LNAME}, country_id => $id, import => 't', }); my $user = LedgerSMB::DBObject::Admin->new({base => $lsmb}); ok($user->save_user, 'User saved'); $sth = $dbh->prepare("SELECT admin__add_user_to_role(?, ?)"); my $rolename = "lsmb_" . $ENV{PGDATABASE} . "__users_manage"; ok($sth->execute($ENV{LSMB_ADMIN_USERNAME}, $rolename), 'Admin user assigned rights'); $sth->finish; $dbh->commit; }; open my $log, "< $LedgerSMB::Sysconfig::tempdir/dblog"; my $passed_no_errs = 1; while (my $line = <$log>){ last if $line =~ /Fixes/i; # Fixes roll back! $passed_no_errs = 0 if $line =~ /Rollback/i; } is($passed_no_errs, 1, 'No rollbacks in db scripts'); SKIP: { skip 'No COA specified', 1 if !defined $ENV{LSMB_LOAD_COA}; is($db->exec_script({script => 'sql/coa/' . lc($ENV{LSMB_COUNTRY_CODE}) ."/chart/$ENV{LSMB_LOAD_COA}.sql" }), 0, 'Ran Chart of Accounts Script'); } SKIP: { skip 'No GIFI specified', 1 if !defined $ENV{LSMB_LOAD_GIFI}; is($db->exec_script({script => 'sql/coa/' . lc($ENV{LSMB_COUNTRY_CODE}) ."/gifi/$ENV{LSMB_LOAD_GIFI}.sql" }), 0, 'Ran GIFI Script'); } ledgersmb/t/97-pod.t0000644000000000000000000000037710622720002013165 0ustar rootroot#!/usr/bin/perl # # t/97-pod.t # # Checks POD syntax. # use strict; use warnings; use Test::More; eval "use Test::Pod 1.00"; plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; all_pod_files_ok('LedgerSMB.pm', all_pod_files('LedgerSMB')); ledgersmb/t/62-api.t0000644000000000000000000001061711616307175013162 0ustar rootrootBEGIN { use LedgerSMB; use Test::More; use LedgerSMB::Template; use LedgerSMB::Sysconfig; use LedgerSMB::DBTest; } # TODO: FIXME # This is a hack, and it's very bad! # This is here because the subroutines _http_output, # render, and error are redefined in here. # This isn't ideal in the least. The subroutines should # be refactored to provide different renderings based on # whether or not they are being called in a test # or regularly in the code. # LedgerSMB::Template contains render and _http_output # LedgerSMB contains error no warnings 'redefine'; if (defined $ENV{LSMB_TEST_DB}){ if (defined $ENV{LSMB_NEW_DB}){ $ENV{PGDATABASE} = $ENV{LSMB_NEW_DB}; } if (!defined $ENV{PGDATABASE}){ die "Oops... LSMB_TEST_DB set but no db selected!"; } plan 'no_plan'; } else { plan skip_all => 'Skipping, LSMB_TEST_DB environment variable not set.'; } @test_request_data = do { 't/data/62-request-data' } ; # Import test case hashes for (qw( drafts.pl login.pl payment.pl employee.pl menu.pl vendor.pl customer.pl inventory.pl vouchers.pl recon.pl menu.pl) ){ ok(eval { require "scripts/$_" }, "Importing $_"); if ($@){ print STDERR "Error: $@\n"; } } # Import new code namespaces my $dbh = LedgerSMB::DBTest->connect("dbi:Pg:dbname=$ENV{PGDATABASE}", undef, undef); my $locale = LedgerSMB::Locale->get_handle( ${LedgerSMB::Sysconfig::language} ); for my $test (@$test_request_data){ my $argstr=""; my $module=""; for my $key (keys %$test) { # scan both key and value for _$GLOBAL$. # replace _$GLOBAL$:varname with the value from the %GLOBAL{varname} if ( ( defined $key ) && ( $key =~ /_\$GLOBAL\$:(.*)$/ ) ) { my $newkey = $GLOBAL{$1}; $key = $newkey; } if ( ( defined $key ) && ( defined $test->{$key} ) && ( $test->{$key} =~ /_\$GLOBAL\$:(.*)$/ ) ) { my $val = $GLOBAL{$1}; $test->{$key} = $val; } if ( ( defined $key ) && ( $key eq 'module' ) ){ $module = $test->{"$key"} } elsif ( ( defined $test->{"$key"} ) && ( defined $key ) && ( $key !~ /^\_/ ) ){ $argstr .= "&" . "$key=".$test->{"$key"}; } } if (ref $test->{'_pre_test_sub'} eq 'CODE'){ $test->{'_pre_test_sub'}(); } my $request = LedgerSMB->new(); if (lc $test->{_codebase} eq 'old'){ next; # skip old codebase tests for now #old_code_test::_load_script($test->{module}); #my $qstring = "$test->{module}?"; #for $key (keys(%$test)){ #if ($key !~ /^_/){ #$qstring .= qq|$key=$test->{"$key"}&|; #} #} #$qstring =~ s/&$//; #$old_code_test::form = Form->new($qstring); #for (keys (%$test)){ #$form->{$_} = $test->{$_}; #} #is('old_code_test'->can($test->{action}), 0, #"$test->{_test_id}: Action Successful"); } else { $request->merge($test); $request->{_locale} = $locale; my $script = $test->{module}; if (!$request->{action}){ $request->{action} = '__default'; } $request->{dbh} = $dbh; if (ref $test->{_api_test} eq 'CODE'){ $request->{_test_cases} = $test->{_api_test}; } $script =~ s/\.pl$//; is(ref "LedgerSMB::Scripts::$script"->can($request->{action}), 'CODE', "$test->{_test_id}: Action ($request->{action}) Defined"); ok("LedgerSMB::Scripts::$script"->can($request->{action})->($request), "$test->{_test_id}: Action Successful"); } if (ref $test->{_api_test} eq 'CODE'){ $request->{_test_cases} = $test->{_api_test}; } ok($dbh->rollback, "$test->{_test_id}: rollback"); } package LedgerSMB::Template; use Test::More; # Don't render templates. Just return so we can run tests on data structures. sub render { my ($self, $data) = @_; if (ref $data->{_test_cases} eq 'CODE'){ $data->{_test_cases}($data); } if ($data->{_error_test}){ cmp_ok($data->{_died}, '==', '1', "$data->{_test_id} died as expected"); } else { ok(!defined $data->{_died}, "$data->{_test_id} did not error"); } return 1; } sub _http_output { return 1; } package old_code_test; # Keeps old code isolated in a different namespace, and provides for reasonable # reload facilities. our $form; sub _load_script { do "bin/arapprn.pl"; do "bin/arap.pl"; do "bin/io.pl"; do "bin/$1[0]"; } package LedgerSMB; sub error { my $self = shift; $self->{_error} = shift; $self->{_died} = 1; } ledgersmb/t/63-lwp.t0000644000000000000000000000602411451210306013173 0ustar rootrootuse Test::More; use LWP; use LedgerSMB::Sysconfig; use HTTP::Cookies; if (!$ENV{'LSMB_TEST_LWP'}){ plan 'skip_all' => 'LWP Test not enabled!'; } elsif ($ENV{'LSMB_INSTALL_DB'}){ plan 'skip_all' => 'Tests not save for production db'; } else { plan 'no_plan'; } my $host = $ENV{LSMB_BASE_URL} || 'http://localhost/ledgersmb/'; if ($host !~ /\/$/){ $host .= "/"; }; $host =~ /https?:\/\/([^\/]+)\//; $hostname = $1; my $db = $ENV{LSMB_NEW_DB} || $ENV{PGDATABASE}; #my $test_request_data = use { 't/data/62-request-data' }; do 't/data/62-request-data'; my $browser = LWP::UserAgent->new( ); if ($host !~ /https?:.+:/){ if ($host =~ /http:/){ $hport = 80; } elsif ($host =~ /https:/){ $hport = 443; } $hostport = "$hostname:$hport"; } else { $hostport = "$hostname"; } my $cookie = HTTP::Cookies->new; $browser->credentials("$hostport", 'LedgerSMB', $ENV{LSMB_USER} => $ENV{LSMB_PASS}); my $login_url = "${host}login.pl?action=authenticate&company=$db"; my $response = $browser->get($login_url); ok($response->is_success(), "Login cookie received"); $cookie->extract_cookies($response); $browser->cookie_jar($cookie); for my $test (@$test_request_data){ next if $test->{_skip_lwp}; my $argstr = ""; my $module = ""; for $key (keys %$test){ # scan both key and value for _$GLOBAL$. # replace _$GLOBAL$:varname with the value from the %GLOBAL{varname} if ( ( defined $key ) && $key =~ /_\$GLOBAL\$:(.*)$/) { my $newkey = $GLOBAL{$1}; $test->{$newkey} = $test->{$key}; $key = $newkey; } if ( ( defined $key ) && ( defined $test->{$key} ) && ($test->{$key} =~ /_\$GLOBAL\$:(.*)$/ ) ) { my $val = $GLOBAL{$1}; $test->{$key} = $val; } if ( ( defined $key ) && ( $key eq 'module' ) ){ $module = $test->{"$key"} } elsif ( ( defined $test->{"key"} ) && ( defined $key ) && ( $key !~ /^\_/ ) ){ $argstr .= "&" . "$key=".$test->{"$key"}; } } $argstr =~ s/^&//; my $url="$host$module?$argstr&company=$db"; my $response = $browser->get($url); my $retstr = ""; if ( defined $test->{_test_id} ) { $retstr = "$test->{_test_id} RESPONSE 200" } else { $retstr="\$test->{_test_id} is undefined. RESPONSE 200" } ok($response->is_success(), $retstr) || print STDERR "# " .$response->status_line() . ":$url\n"; if ( ( defined $test->{format} ) && ($test->{format} eq 'PDF' and defined $test->{form_id}) ){ cmp_ok($response->header('content-type'), 'eq', 'application/pdf', "$test->{_test_id} PDF sent"); } else { if ( defined $test->{_test_id} ) { $retstr = "$test->{_test_id} HTML sent" } else { $retstr="\$test->{_test_id} is undefined. HTML sent" } like($response->header('content-type'), qr/^text\/html/, $retstr); } if (ref($test->{_lwp_tests}) eq 'CODE'){ $test->{_lwp_tests}($response); } #cmp_ok(($response->content =~ /Error/), 'eq', "$test->{_lwp_error}", "No Error on Request $test->{_test_id}"); #if ($response->content =~ /Error/){ # print STDERR $response->content; #} } ledgersmb/t/data/0000755000000000000000000000000012060044551012671 5ustar rootrootledgersmb/t/data/04-gettext.html0000644000000000000000000000021410637016470015470 0ustar rootrootI am a . Look at me . ledgersmb/t/data/04-template.html0000644000000000000000000000005510623705740015622 0ustar rootrootI am a template. Look at me . ledgersmb/t/data/62.d/0000755000000000000000000000000012060044550013341 5ustar rootrootledgersmb/t/data/04-gettext.tex0000644000000000000000000000046710637016470015336 0ustar rootroot \documentclass{scrartcl} \usepackage[utf8]{inputenc} \font\han="STSong" at 16pt \font\rom="Gentium" at 16pt \begin{document} I am a . test: {\han .} Foo \rom \end{document} ledgersmb/t/data/62-request-data0000644000000000000000000003262411477242357015466 0ustar rootrootuse Test::More; our $lwp_tests = {}; # Added to support the entity ID test. our %GLOBAL; # our $test_request_data = [ # AR/AP Transaction Screen Tests { '_test_id' => 'AR Transaction Screen', '_codebase' => 'old', 'module' => 'ar.pl', 'action' => 'add', '_api_test' => sub { my $request = shift; ok($request->{batch_number}, 'Batch Number is Defined'); }, }, { '_test_id' => 'AP Transaction Screen', '_codebase' => 'old', 'module' => 'ap.pl', 'action' => 'add' }, # Tests adding a new customer/vendor. #https://127.0.0.1/ledgersmb/vendor.pl?login=aurynn_lsmb&module=vendor.pl&action=add&db=vendor& { "_test_id" => "AP Add Vendor", "_codebase" => "new", "action" => "save", "module" => "vendor.pl", "control_code" => "TestAddVendorObj", "name" => "TestObj", "country_id_t" => 232, "account_class" => 1, "created_as_class" => 1, "db" => "vendor", "_script_handle" => "LedgerSMB::Scripts::vendor", "_lwp_tests" => sub { # Catch the entity ID, and pass it forwards. # Res is the full LWP response object. # ~A my $res = shift @_; ($GLOBAL{"entity_id"}) = \ ($res->content =~ m/\/); return 1; }, }, { "_test_id" => "AP Save Vendor", "_codebase" => "new", "module" => "vendor.pl", "action" => "save", "pay_to_name" => "TestEntity", "entity_id" => '_$GLOBAL$:entity_id', "control_code" => "TestAddVendorObj", "ar_ap_account_id" => 10, "cash_account_id" => 1, "country_id_t" => 232, "account_class" => 1, "created_as_class" => 1, "db" => "vendor", "name" => "TestObj", "_script_handle" => "LedgerSMB::Scripts::vendor", "_lwp_tests" => sub { my $res = shift @_; ($GLOBAL{"vendor_id"}) = \ ($res->content =~ m/\/); }, }, { "_test_id" => "AP Add Transaction", "_codebase" => "old", "module" => "ap.pl", "action" => "post", "vendor" => "TestObj", "currency" => "USD", "amount_1" => "5", "AP_amount_1" => "5010--Purchases", "AP" => "2100--Accounts Payable", "transdate" => "2009-12-08", "AP_paid_1" => "1060--Checking Account" }, # Create Batch Screens { '_test_id' => 'AR Transaction Voucher Screen', '_codebase' => 'new', 'action' => 'create_batch', 'batch_type' => 'recievable', 'module' => 'vouchers.pl', }, { '_test_id' => 'AP Transaction Voucher Screen', '_codebase' => 'new', 'action' => 'create_batch', 'batch_type' => 'payable', 'module' => 'vouchers.pl', '_api_test' => sub { my $request = shift; ok($request->{batch_number}, 'Batch Number is Defined'); } }, { '_test_id' => 'Payment Transaction Voucher Screen', '_codebase' => 'new', 'action' => 'create_batch', 'batch_type' => 'payment', 'module' => 'vouchers.pl', '_api_test' => sub { my $request = shift; ok($request->{batch_number}, 'Batch Number is Defined'); }, }, { '_test_id' => 'Payment Reversal Transaction Voucher Screen', '_codebase' => 'new', 'action' => 'create_batch', 'batch_type' => 'payment_reversal', 'module' => 'vouchers.pl', '_api_test' => sub { my $request = shift; ok($request->{batch_number}, 'Batch Number is Defined'); }, }, { '_test_id' => 'Income Statement Search Screen', '_codebase' => 'old', 'action' => 'report', 'report' => 'income_statement', 'module' => 'rp.pl', }, { '_test_id' => 'Balance sheet search Screen', '_codebase' => 'old', 'action' => 'report', 'report' => 'balance_sheet', 'module' => 'rp.pl', }, { '_test_id' => 'GL Transaction Voucher Screen', '_codebase' => 'new', 'action' => 'create_batch', 'batch_type' => 'gl', 'module' => 'vouchers.pl', '_api_test' => sub { my $request = shift; ok($request->{batch_number}, 'Batch Number is Defined'); }, }, { '_test_id' => 'Payment source start error', '_codebase' => 'new', '_error_test' => 1, 'account_class' => 1, 'module' => 'payment.pl', 'action' => 'display_payments', 'approved' => 0, 'currency' => 'USD', 'datepaid' => '2008-07-22', '_api_test' => sub { my $self = shift; cmp_ok($self->{_error}, 'eq', 'No source start defined!', "Payment source start error: error correct"); } }, { '_test_id' => 'Payment source numbering', '_codebase' => 'new', '_error_test' => 1, 'account_class' => 1, 'start_source' => 1, 'module' => 'payment.pl', 'action' => 'update_payments', 'approved' => 0, 'currency' => 'USD', 'datepaid' => '2008-07-22', 'id_1' => 1, 'id_3' => 3, '_exec_override' => { 'payment_get_all_contact_invoices' => sub { my $self = shift; $retval = [ { contact_id => 1, total_due => Math::BigFloat->new(1000), econtrol_code => 'TEST1', eca_description => 'test', contact_name => 'test', account_number => 'test', invoices => '{{"100","101","2009-01-01",1000,1000}}', has_vouchers => 0, } , { contact_id => 2, total_due => Math::BigFloat->new(1000), econtrol_code => 'TEST1', eca_description => 'test', contact_name => 'test', account_number => 'test', invoices => '{{101,101,2009-01-01,1000,1000}}', has_vouchers => 0, } , { contact_id => 3, total_due => Math::BigFloat->new(1000), econtrol_code => 'TEST1', eca_description => 'test', contact_name => 'test', account_number => 'test', invoices => '{{102,101,2009-01-01,1000,1000}}', has_vouchers => 0, } ]; $self->{contact_invoices} = $retval; $self->debug({'file' => '/tmp/test2'}); return @$retval; } }, '_user' => { numberformat => '1,000.00', dateformat => 'yyyy-mm-dd' }, '_api_test' => sub { my $self = shift; $self->debug({file => '/tmp/test'}); ok(defined $self->{source_1}, "$self->{_test_id} source 1 defined"); cmp_ok($self->{source_2}, 'eq', '',"$self->{_test_id} source 2 not found"); ok(defined $self->{source_3}, "$self->{_test_id} source 3 defined"); cmp_ok($self->{grand_total}, 'eq', '2,000.00',"Grand total formatting works"); }, }, { '_test_id' => 'Empty Recon Submission', '_codebase' => 'new', 'action' => 'submit_recon_set', 'module' => 'recon.pl', 'report_id' => '-100', 'their_total' => '0', '_exec_override' => { 'reconciliation__submit_set' => sub { my ($self) = @_; $self->_pre_save; is($self->{line_ids}, '{}', 'Empty recon set line ids ok'); is($self->{report_id}, -100, 'Recon set report id correct'); }, }, }, { '_test_id' => 'Payment search (OLD)', '_codebase' => 'old', 'account' => '1060--Checking Account', 'module' => 'rp.pl', 'action' => 'list_payments', }, { '_test_id' => 'Payment Search (NEW)', '_codebase' => 'new', module => 'payment.pl', account_class => 1, meta_number => 'TEST_VENDOR', cash_accno => '-111', date_reversed => '2009-12-01', action => 'get_search_results', }, { '_test_id' => 'Recon Search Screen', '_codebase' => 'new', 'module' => 'recon.pl', 'report' => '1', 'action' => 'search', }, { '_test_id' => 'Menu round trip', '_codebase' => 'new', 'module' => 'menu.pl', 'menu' => '1', 'id' => '4', 'open' => ':1:4:11', }, { '_test_id' => 'Payment print total', '_codebase' => 'new', 'action' => 'print', 'approved' => 0, 'currency' => 'USD', 'datepaid' => '2008-07-22', 'contact_1' => '25', 'id_25' => '25', 'paid_25' => 'all', 'payment_209' => '1000.00', 'invoice_25_1' => 209, 'net_209' => '1000.00', 'payment_210' => '-100.00', 'invoice_25_2' => '210', 'net_210' => '-100.00', 'payment_344' => '100000.00', 'invoice_25_3' => '344', 'net_344' => '100000.00', 'payment_352' => '1000.00', 'invoice_25_4' => '352', 'net_352' => '1000.00', 'payment_353' => '1000.00', 'invoice_25_5' => '353', 'net_353' => '1000.00', 'payment_354' => '1000.00', 'invoice_25_6' => '354', 'net_354' => '1000.00', 'payment_355' => '1000.00', 'invoice_25_7' => '355', 'net_355' => '1000.00', 'payment_356' => '1000.00', 'invoice_25_8' => '356', 'net_356' => '1000.00', 'invoice_count_25' => 8, 'contact_count' => 1, 'media' => 'screen', 'format' => 'PDF', 'module' => 'payment.pl', 'account_class' => 1, 'currency' => 'USD', 'multiple' => 1, '_pre_test_sub' => sub { $LedgerSMB::Sysconfig::check_max_invoices = 1; }, '_api_test' => sub { use strict; my $request = shift; cmp_ok($request->{invoice_count_25}, '>', $LedgerSMB::Sysconfig::check_max_invoices, 'Test is valid under current config'); cmp_ok(scalar @{$request->{checks}}, '==', $request->{contact_count}, 'Correct number of checks printed'); my $check = shift @{$request->{checks}}; cmp_ok( $request->format_amount({ amount => $check->{amount}, format => '1000.00', precision => 2 }), 'eq', '105900.00', 'Printed amount is correct'); }, }, # the following 4 tests check that it is possible to remove an empty batch { # access the batch creation screen "_skip_lwp" => 1, "_test_id" => "AP Voucher Screen", "_codebase" => "new", "action" => "create_batch", "module" => "vouchers.pl", "batch_type" => "ap", "company" => "test", "_lwp_tests" => sub { my $res = shift; delete $GLOBAL{form_id}; delete $GLOBAL{batch_no}; # save form_id and batch number for additional requests $GLOBAL{"form_id"} = $1 if ($res->content =~ m/input type=hidden name="form_id" value="(\d+)"/); $GLOBAL{"form_id"} = "" unless defined $GLOBAL{"form_id"}; ok($GLOBAL{form_id}, "Received form ID: ".$GLOBAL{form_id}); $GLOBAL{batch_no} = $1 if ($res->content =~ m/input name="batch_number" type="text" value="([A-Z]-\d+)"/); return 1; } }, { # create an empty batch "_test_id" => "Create Empty Batch", "_skip_lwp" => 1, "_codebase" => "new", "action" => "create_vouchers", "module" => "vouchers.pl", "batch_type" => "ap", "batch_date" => '2010-12-30', "batch_number" => '_$GLOBAL$:batch_no', "description" => "foo", "form_id" => '_$GLOBAL$:form_id', "_lwp_tests" => sub { my $res = shift; like($res->content, qr/\Add AP Transaction.*\<\/title\>/, 'Empty batch added'); return 1; } }, { # get the list of batches and save the first row of the list in GLOBAL "_test_id" => "List Empty Batches", "_skip_lwp" => 1, "_codebase" => "new", "action" => "list_batches", "empty" => 1, "class_id" => 1, "created_by_eid" => 0, "module" => "vouchers.pl", "_lwp_tests" => sub { my $res = shift; my $batch_no = $GLOBAL{batch_no}; my $batch_id = ""; $batch_no = "" unless defined $GLOBAL{batch_no}; delete @GLOBAL{ qw( form_id row_1 )}; $GLOBAL{"form_id"} = $1 if ($res->content =~ m/input id="form-id" type="hidden" name="form_id" value="(\d+)"\s+\/\>/); $batch_id = $1 if ($res->content =~ m/\$batch_no\<\/a\>/); $GLOBAL{"row_1"} = $batch_id if ($res->content =~ m//); $GLOBAL{"row_1"} = "" unless defined $GLOBAL{"row_1"}; $GLOBAL{batch_id} = "batch_".$batch_id; ok(exists $GLOBAL{"row_1"}, 'Received correct batch ID '.$GLOBAL{row_1}); return 1; }, }, { # remove first row of the list of empty batches (obtained from GLOBAL) "_test_id" => "Remove Empty Batches", "_skip_lwp" => 1, "_codebase" => "new", "module" => "vouchers.pl", "form_id" => '_$GLOBAL$:form_id', "rowcount" => 1, "empty" => 1, "class_id" => 1, "row_1" => '_$GLOBAL$:row_1', "action" => "list_batches_batch_delete", '_$GLOBAL$:batch_id' => 1, "_lwp_tests" => sub { my $res = shift; # check that we are at the 'batch selection' page, like($res->content, qr/\Batch Selection\<\/title\>/, "Empty batch removed"); return 1; } }, ]; our $api_test_cases = { 'AP Transaction Voucher Screen' => sub { }, }; opendir (D62, 't/data/62.d'); for my $testfile (readdir(D62)){ do "t/data/62.d/$testfile"; }; # Overridden methods in classes for tests. package LedgerSMB::DBObject::Payment; sub exec_method { my $self = shift; my %args = @_; my $funcname = $args{funcname}; if (ref $self->{_exec_override} eq 'HASH'){ if ($self->{_exec_override}->{"$funcname"}){ return $self->{_exec_override}->{"$args{funcname}"}($self); } } LedgerSMB::DBObject::exec_method($self, @_); } package LedgerSMB::DBObject::Reconciliation; sub exec_method { LedgerSMB::DBObject::Payment::exec_method(@_); } ledgersmb/t/data/04-complex_template.html0000644000000000000000000004112710760632552017360 0ustar rootroot

 


% /

[]   []
') # ' name = notes } ?>
ledgersmb/t/data/04-template.tex0000644000000000000000000000061010630374501015446 0ustar rootroot \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{tabularx} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont I am a template. Look at me . \end{document} ledgersmb/t/data/04-template.txt0000644000000000000000000000005510631133310015460 0ustar rootrootI am a template. Look at me . ledgersmb/t/04-template-handling.t0000644000000000000000000005560312007101511015763 0ustar rootroot#!/usr/bin/perl use strict; use warnings; # Absolute directory name required to not trip up Template::Latex $ENV{TMPDIR} = "$ENV{PWD}/t/var"; use Test::More 'no_plan'; use Test::Trap qw(trap $trap); use Test::Exception; use Error qw(:try :warndie); use LedgerSMB::AM; use LedgerSMB::Form; use LedgerSMB::Sysconfig; use LedgerSMB::Locale; use LedgerSMB::Template; use LedgerSMB::Template::Elements; use LedgerSMB::Template::CSV; use LedgerSMB::Template::HTML; my $has_latex = 0; ( eval {require LedgerSMB::Template::LaTeX } && eval {require Template::Latex} && eval {require Template::Plugins::Latex} ) || ($has_latex = 1) ; use LedgerSMB::Template::TXT; $LedgerSMB::Sysconfig::tempdir = 't/var'; my @r; my $temp; my $form; my $myconfig; my $template; my $FH; my $locale; $locale = LedgerSMB::Locale->get_handle('fr'); ############## ## AM tests ## ############## my $expStackTrace = 0; if ( $ENV{PERL5OPT}=~/.*?Devel::SimpleTrace.*/ || $ENV{PERL5OPT}=~/.*?Carp::Always.*/ ) { $expStackTrace = 1; } # AM->check_template_name checks # check_template operates by calling $form->error if the checks fail $form = new Form; $myconfig = {'templates' => 'test'}; for my $ext ('css', 'tex', 'txt', 'html', 'xml') { $form->{file} = "test/apples.${ext}"; @r = trap{AM->check_template_name($myconfig, $form)}; ok(!defined $trap->die, "AM, check_template_name: Template directory, ${ext}"); } $form->{file} = 'test2/apples.txt'; @r = trap{AM->check_template_name($myconfig, $form)}; if ( $expStackTrace == 0 ) { is($trap->die, "Error: Not in a whitelisted directory: test2/apples.txt\n", 'AM, check_template_name: Invalid directory, non-css denial'); } else { my $trapmsg=""; if ($trap->die =~/(Error: Not in a whitelisted directory: test2\/apples.txt\n).*/) { $trapmsg = $1; } is($trapmsg, "Error: Not in a whitelisted directory: test2/apples.txt\n", 'AM, check_template_name: Invalid directory, non-css denial'); } $form->{file} = 'test/apples.exe'; @r = trap{AM->check_template_name($myconfig, $form)}; if ( $expStackTrace == 0 ) { is($trap->die, "Error: Error: File is of type that is not allowed.\n", 'AM, check_template_name: Disallowed type denial'); } else { my $trapmsg=""; if ($trap->die =~/(Error: Error: File is of type that is not allowed.\n).*/) { $trapmsg = $1; } is($trapmsg, "Error: Error: File is of type that is not allowed.\n", 'AM, check_template_name: Disallowed type denial'); } # adjusting backuppath to avoid triggering directory traversal detection $temp = ${LedgerSMB::Sysconfig::backuppath}; ${LedgerSMB::Sysconfig::backuppath} = "foo"; $form->{file} = "${LedgerSMB::Sysconfig::backuppath}/apples.txt"; @r = trap{AM->check_template_name($myconfig, $form)}; if ( $expStackTrace == 0 ) { is($trap->die, "Error: Not allowed to access foo/ with this method\n", 'AM, check_template_name: Backup path denial'); } else { my $trapmsg=""; if ($trap->die =~/(Error: Not allowed to access foo\/ with this method\n).*/) { $trapmsg = $1; } is($trapmsg, "Error: Not allowed to access foo/ with this method\n", 'AM, check_template_name: Backup path denial'); } ${LedgerSMB::Sysconfig::backuppath} = $temp; $form->{file} = "css/../apples.txt"; @r = trap{AM->check_template_name($myconfig, $form)}; if ( $expStackTrace == 0 ) { is($trap->die, "Error: Directory transversal not allowed.\n", 'AM, check_template_name: Directory transversal denial 1'); } else { my $trapmsg=""; if ($trap->die =~/(Error: Directory transversal not allowed.\n).*/) { $trapmsg = $1; } is($trapmsg, "Error: Directory transversal not allowed.\n", 'AM, check_template_name: Directory transversal denial 1'); } $form->{file} = "/tmp/apples.txt"; @r = trap{AM->check_template_name($myconfig, $form)}; if ( $expStackTrace == 0 ) { is($trap->die, "Error: Not in a whitelisted directory: /tmp/apples.txt\n", 'AM, check_template_name: Directory transversal denial 2'); } else { my $trapmsg=""; if ($trap->die =~/(Error: Directory transversal not allowed.\n).*/) { $trapmsg = $1; } is($trapmsg, "Error: Directory transversal not allowed.\n", 'AM, check_template_name: Directory transversal denial 2'); } $form->{file} = "test/apples.txt:evil"; @r = trap{AM->check_template_name($myconfig, $form)}; if ( $expStackTrace == 0 ) { is($trap->die, "Error: Directory transversal not allowed.\n", 'AM, check_template_name: Directory transversal denial 3'); } else { my $trapmsg=""; if ($trap->die =~/(Error: Directory transversal not allowed.\n).*/) { $trapmsg = $1; } is($trapmsg, "Error: Directory transversal not allowed.\n", 'AM, check_template_name: Directory transversal denial 3'); } $form->{file} = "c:\\evil.txt"; @r = trap{AM->check_template_name($myconfig, $form)}; if ( $expStackTrace == 0 ) { is($trap->die, "Error: Directory transversal not allowed.\n", 'AM, check_template_name: Directory transversal denial 4'); } else { my $trapmsg=""; if ($trap->die =~/(Error: Directory transversal not allowed.\n).*/) { $trapmsg = $1; } is($trapmsg, "Error: Directory transversal not allowed.\n", 'AM, check_template_name: Directory transversal denial 4'); } # AM->load_template checks # load_template takes its file name from form $form = new Form; $myconfig = {'templates' => 't/data'}; $form->{file} = 't/data/04-not-there.txt'; @r = trap{AM->load_template($myconfig, $form)}; if ( $expStackTrace == 0 ) { is($trap->die, 'Error: Template not found: t/data/04-not-there.txt '); } else { my $trapmsg=""; if ($trap->die =~/(Error: t\/data\/04-not-there.txt : No such file or directory\n).*/) { $trapmsg = $1; } is($trapmsg, "Error: t/data/04-not-there.txt : No such file or directory\n", 'AM, load_template: Die on non-existent file'); } $form->{file} = 't/data/04-template.html'; AM->load_template($myconfig, $form); is($form->{body}, "I am a template.\nLook at me .\n", 'AM, load_template: Read existing file'); # AM->save_template checks $form = new Form; $myconfig = {'templates' => 't/var/not here'}; $form->{body} = "I am a template.\nLook at me.\n"; $form->{file} = "$myconfig->{templates}/test.txt"; @r = trap{AM->save_template($myconfig, $form)}; if ( $expStackTrace == 0 ) { is($trap->die, "Error: t/var/not here/test.txt : No such file or directory\n", 'AM, save_template: Die on unwritable file'); } else { my $trapmsg=""; if ($trap->die =~/(Error: t\/var\/not here\/test.txt : No such file or directory\n).*/) { $trapmsg = $1; } is($trapmsg, "Error: t/var/not here/test.txt : No such file or directory\n", 'AM, save_template: Die on unwritable file'); } $myconfig = {'templates' => 't/var'}; $form->{body} = "I am a template.\nLook at me."; $form->{file} = "$myconfig->{templates}/04-template-save-test-$$.txt"; ok(!-e $form->{file}, 'AM, save_template: Environment clean'); AM->save_template($myconfig, $form); ok(-e $form->{file}, 'AM, save_template: File created'); open($FH, '<', $form->{file}); @r = <$FH>; close($FH); chomp(@r); is(join("\n", @r), $form->{body}, 'AM, save_template: Good save'); is(unlink($form->{file}), 1, 'AM, save_template: removing testfile'); ok(!-e $form->{file}, 'AM, save_template: testfile removed'); ###################################### ## LedgerSMB::Template::HTML checks ## ###################################### is(LedgerSMB::Template::HTML::get_template('04-template'), '04-template.html', 'HTML, get_template: Returned correct template file name'); is(LedgerSMB::Template::HTML::preprocess('04-template'), '04-template', 'HTML, preprocess: Returned simple string unchanged'); is(LedgerSMB::Template::HTML::preprocess('14 > 12'), '14 > 12', 'HTML, preprocess: Returned properly escaped string'); is_deeply(LedgerSMB::Template::HTML::preprocess([0, 'apple', 'mango&durian']), [0, 'apple', 'mango&durian'], 'HTML, preprocess: Returned properly escaped array ref contents'); is_deeply(LedgerSMB::Template::HTML::preprocess({'fruit' => '&veggies', 'test' => 1}), {'fruit' => '&veggies', 'test' => 1}, 'HTML, preprocess: Returned properly escaped hash ref contents'); is_deeply(LedgerSMB::Template::HTML::preprocess({'fruit' => '&veggies', 'test' => ['nest', 'bird', '0 < 15', 1]}), {'fruit' => '&veggies', 'test' => ['nest', 'bird', '0 < 15', 1]}, 'HTML, preprocess: Returned properly escaped nested contents'); is(LedgerSMB::Template::HTML::postprocess({outputfile => '04-template'}), '04-template.html', 'HTML, postprocess: Return output filename'); #################### ## Template tests ## #################### # Template->new $myconfig = {'templates' => 't/data'}; throws_ok{new LedgerSMB::Template('user' => $myconfig, 'language' => 'x/0', 'format' => 'HTML')} qr/Invalid language/, 'Template, new: Invalid language caught 1'; throws_ok{new LedgerSMB::Template('user' => $myconfig, 'language' => '1\\2', 'format' => 'HTML')} qr/Invalid language/, 'Template, new: Invalid language caught 2'; throws_ok{new LedgerSMB::Template('user' => $myconfig, 'language' => '1:2', 'format' => 'HTML')} qr/Invalid language/, 'Template, new: Invalid language caught 3'; throws_ok{new LedgerSMB::Template('user' => $myconfig, 'language' => '..', 'format' => 'HTML')} qr/Invalid language/, 'Template, new: Invalid language caught 4'; throws_ok{new LedgerSMB::Template('user' => $myconfig, 'language' => '.svn', 'format' => 'HTML')} qr/Invalid language/, 'Template, new: Invalid language caught 5'; $template = undef; $template = new LedgerSMB::Template('user' => $myconfig, 'language' => 'de', 'format' => 'HTML'); ok(defined $template, 'Template, new: Object creation with valid language'); isa_ok($template, 'LedgerSMB::Template', 'Template, new: Object creation with valid language'); is($template->{include_path_lang}, 't/data/de', 'Template, new: Object creation with valid language has good include_path'); $template = undef; $template = new LedgerSMB::Template('user' => $myconfig, 'language' => 'de', 'path' => 't/data', 'output_file' => 'test', 'format' => 'HTML'); ok(defined $template, 'Template, new: Object creation with valid language and path'); isa_ok($template, 'LedgerSMB::Template', 'Template, new: Object creation with valid language and path'); is($template->{include_path}, 't/data', 'Template, new: Object creation with valid path overrides language'); is($template->{outputfile}, 't/var/test', 'Template, new: Object creation with filename is correct'); $template = undef; $template = new LedgerSMB::Template('user' => $myconfig, 'format' => 'HTML', 'template' => '04-template', 'locale' => $locale); ok(defined $template, 'Template, new: Object creation with locale'); isa_ok($template, 'LedgerSMB::Template', 'Template, new: Object creation with locale'); $template = undef; $template = new LedgerSMB::Template('user' => $myconfig, 'format' => 'HTML', 'template' => '04-template-2', 'no_auto_output' => 1); ok(defined $template, 'Template, new: Object creation with non-existent template'); throws_ok{$template->render({'login' => 'foo'})} qr/not found/, 'Template, render: File not found caught'; $template = undef; $template = new LedgerSMB::Template('user' => $myconfig, 'format' => 'TODO', 'template' => '04-template', 'no_auto_output' => 1); ok(defined $template, 'Template, new: Object creation with non-existent format'); throws_ok{$template->render({'login' => 'foo'})} qr/Can't locate/, 'Template, render: Invalid format caught'; ##################### ## Rendering tests ## ##################### SKIP: { skip "LaTeX modules not installed" unless $has_latex; $template = undef; $template = new LedgerSMB::Template('user' => $myconfig, 'format' => 'PDF', 'template' => '04-template', 'no_auto_output' => 1); ok(defined $template, 'Template, new (PDF): Object creation with format and template'); isa_ok($template, 'LedgerSMB::Template', 'Template, new (PDF): Object creation with format and template'); is($template->{include_path}, 't/data', 'Template, new (PDF): Object creation with format and template'); is($template->render({'login' => 'foo&bar'}), "t/var/04-template-output-$$.pdf", 'Template, render (PDF): Simple PDF template, default filename'); ok(-e "t/var/04-template-output-$$.pdf", 'Template, render (PDF): File created'); is(unlink("t/var/04-template-output-$$.pdf"), 1, 'Template, render (PDF): removing testfile'); ok(!-e "t/var/04-template-output-$$.pdf", 'Template, render (PDF): testfile removed'); $template = undef; $template = new LedgerSMB::Template('user' => $myconfig, 'format' => 'PS', 'template' => '04-template', 'no_auto_output' => 1); ok(defined $template, 'Template, new (PS): Object creation with format and template'); isa_ok($template, 'LedgerSMB::Template', 'Template, new (PS): Object creation with format and template'); is($template->{include_path}, 't/data', 'Template, new (PS): Object creation with format and template'); is($template->render({'login' => 'foo\&bar'}), "t/var/04-template-output-$$.ps", 'Template, render (PS): Simple Postscript template, default filename'); ok(-e "t/var/04-template-output-$$.ps", 'Template, render (PS): File created'); is(unlink("t/var/04-template-output-$$.ps"), 1, 'Template, render (PS): removing testfile'); ok(!-e "t/var/04-template-output-$$.ps", 'Template, render (PS): testfile removed'); } $template = undef; $template = new LedgerSMB::Template('user' => $myconfig, 'format' => 'TXT', 'template' => '04-template', 'no_auto_output' => 1); ok(defined $template, 'Template, new (TXT): Object creation with format and template'); isa_ok($template, 'LedgerSMB::Template', 'Template, new (TXT): Object creation with format and template'); is($template->{include_path}, 't/data', 'Template, new (TXT): Object creation with format and template'); is($template->render({'login' => 'foo&bar'}), '04-template.txt', 'Template, render: Simple text template, no filename'); is($template->{output}, "I am a template.\nLook at me foo&bar.\n", 'Template, render (TXT): Simple TXT template, correct output'); $template = undef; $template = new LedgerSMB::Template('user' => $myconfig, 'format' => 'HTML', 'template' => '04-template', 'no_auto_output' => 1); ok(defined $template, 'Template, new (HTML): Object creation with format and template'); isa_ok($template, 'LedgerSMB::Template', 'Template, new (HTML): Object creation with format and template'); is($template->{include_path}, 't/data', 'Template, new (HTML): Object creation with format and template'); is($template->render({'login' => 'foo&bar'}), undef, 'Template, render (HTML): Simple HTML template, no file'); is($template->{output}, "I am a template.\nLook at me foo&bar.", 'Template, render (HTML): Simple HTML template, correct output'); $template = undef; $template = new LedgerSMB::Template('user' => $myconfig, 'format' => 'HTML', 'template' => \'Look at me .', 'no_auto_output' => 1); ok(defined $template, 'Template, new (HTML): Object creation with string template'); isa_ok($template, 'LedgerSMB::Template', 'Template, new (HTML): Object creation with string template'); is($template->{include_path}, 't/data', 'Template, new (HTML): Object creation with string template'); is($template->render({'login' => 'foo&bar'}), undef, 'Template, render (HTML): Simple HTML string template, no file'); is($template->{output}, "Look at me foo&bar.", 'Template, render (HTML): Simple HTML string template, correct output'); $template = undef; $template = new LedgerSMB::Template('user' => $myconfig, 'format' => 'HTML', 'template' => '04-gettext', 'output_file' => '04-gettext', 'no_auto_output' => 1); ok(defined $template, 'Template, new (HTML): Object creation with outputfile'); isa_ok($template, 'LedgerSMB::Template', 'Template, new (HTML): Object creation with outputfile'); is($template->{include_path}, 't/data', 'Template, new (HTML): Object creation with outputfile'); is($template->render({'month' => 'June', 'login' => 'foo&bar', 'fr' => $locale}), 't/var/04-gettext.html', 'Template, render (HTML): Gettext HTML template'); ok(-e "t/var/04-gettext.html", 'Template, render (HTML): File created'); open($FH, '<', "t/var/04-gettext.html"); @r = <$FH>; close($FH); chomp(@r); is(join("\n", @r), "I am a foo&bar.\nLook at me Juin.\njuni\nAan foo&bar", 'Template, render (HTML): Gettext HTML template, correct output'); is(unlink("t/var/04-gettext.html"), 1, 'Template, render (HTML): removing testfile'); ok(!-e "t/var/04-gettext.html", 'Template, render (HTML): testfile removed'); ## XeTeX test, requires PDFLATEX to be xelatex and modified Template::Latex SKIP: { skip 'XeTeX and modified Template::Latex requiring PDF tests'; $template = undef; $template = new LedgerSMB::Template('user' => $myconfig, 'format' => 'PDF', 'template' => '04-gettext', 'no_auto_output' => 1); ok(defined $template, 'Template, new (PDF): XeTeX template creation'); isa_ok($template, 'LedgerSMB::Template', 'Template, new (PDF): XeTeX template creation'); is($template->{include_path}, 't/data', 'Template, new (PDF): XeTeX template creation'); is($template->render({'login' => 'foo&bar'}), "t/var/04-gettext-output-$$.pdf", 'Template, render (PDF): XeTeX PDF template, default filename'); ok(-e "t/var/04-gettext-output-$$.pdf", 'Template, render (PDF): File created'); is(unlink("t/var/04-gettext-output-$$.pdf"), 1, 'Template, render (PDF): removing testfile'); ok(!-e "t/var/04-gettext-output-$$.pdf", 'Template, render (PDF): testfile removed'); } ######################################### ## LedgerSMB::Template private methods ## ######################################### use Math::BigFloat; $template = undef; $template = new LedgerSMB::Template('user' => {numberformat => '1.000,00'}, 'format' => 'HTML', 'template' => '04-template', 'no_auto_output' => 1); ok(defined $template, 'Template, private (_preprocess): Object creation with format and template'); isa_ok($template, 'LedgerSMB::Template', 'Template, private (_preprocess): Object creation with format and template'); my $number = Math::BigFloat->new(17.5); isa_ok($number, 'Math::BigFloat', 'Template, private (_preprocess): number'); ## Commending out the one below because it is not valid when Math::BigInt::GMP is loaded # $template->_preprocess($number); ## Commenting out these tests since currently the functionality is known broken ## and unused #cmp_ok($number, 'eq', '17,50', # 'Template, private (_preprocess): Math::BigFloat conversion'); #$number = [Math::BigFloat->new(1008.51), 'hello']; #$template->_preprocess($number); # #cmp_ok($number->[0], 'eq', '1.008,51', # 'Template, private (_preprocess): Math::BigFloat conversion (array)'); #cmp_ok($number->[1], 'eq', 'hello', # 'Template, private (_preprocess): no conversion (array)'); ################################### ## LedgerSMB::Template::Elements ## ################################### $template = undef; $form = undef; my $lsmb = LedgerSMB->new(); $locale = LedgerSMB::Locale->get_handle( ${LedgerSMB::Sysconfig::language} ) or $lsmb->error( __FILE__ . ':' . __LINE__ . ": Locale not loaded: $!\n" ); $template = new LedgerSMB::Template('user' => {numberformat => '1.000,00'}, 'format' => 'HTML', path => 't/data', locale => $locale, 'template' => '04-complex_template', 'no_auto_output' => 1); $template->render({}); my $contact_request = { entity_id => 1, control_code => 'test1', meta_number => 'test1', credit_id => '1', entity_class => 1, default_country => 4, credit_list => [{ entity_class => 1, meta_number => 'test1', }], contacts => [{contact => 'ctest1', description => 'dtest1', contact_class => '1'}], business_id => 1000, business_types => [{ id => 1, description => 'test1' }, { id => 1000, description => 'test2' }], country_list => [{id => 1, name => 'country1'}, {id => 2, name => 'country2'}, {id => 3, name => 'country3'}, {id => 4, name => 'country4'}, {id => 5, name => 'country5'}, {id => 6, name => 'country6'}, ] }; # Company with Credit Accounts and business types. my $contact_template = LedgerSMB::Template->new( path => 'UI/Contact', template => 'contact', format => 'HTML', no_auto_output => 1, output_file => 'contact_test1' ); $contact_template->render($contact_request); my @output = get_output_line_array($contact_template); is(grep (/value="1" selected="selected"/, @output), 0, 'Select box Value 1 unselected'); is(grep (/value="1000" selected="selected"/, @output), 1, 'Select box Value 1000 selected'); is(grep (/dtest1/, @output), 1, 'Contact description shows'); is(grep (/value="4"\s+selected="selected">country4/, @output), 2, 'Default Country Set'); # bulk payment template tests my $payment = LedgerSMB->new(); $payment->merge({ contact_1 => 1, source_1 => 1, action=>'dispay_payments', id_1 => 1, id_1_1 => 1, contact_invoices => [{contact_id => 1, invoices =>[[101, 101, "2009-01-01", 1000, 0, 0, 1000, 0, 'test']]}]}); my $payment_template = LedgerSMB::Template->new( path => 'UI/payments', template => 'payments_detail', format => 'HTML', no_auto_output => 1, output_file => 'payment_test1' ); $payment_template->render($payment); @output = get_output_line_array($payment_template); cmp_ok(grep(/101<\/td>/, @output), '>', 0, 'Invoice row exists'); is(grep(/name="payment_101"/, @output), 0, 'Invoice locked'); is(grep(/Locked by/, @output), 1, 'Invoice locked label shown'); # LPR PRinting Tests use LedgerSMB::Sysconfig; %LedgerSMB::Sysconfig::printer = ('test' => 'cat > t/var/04-lpr-test'); $template = new LedgerSMB::Template('user' => $myconfig, 'format' => 'PDF', 'template' => '04-template', 'locale' => $locale, no_auto_output => 1); $template->render({media => 'test'}); $template->output(media => 'test'); ok (open (LPR_TEST, '<', 't/var/04-lpr-test'), 'LedgerSMB::Template::_output_lpr output file opened successfully'); my $line1 = ; like($line1, qr/^%PDF/, 'output file is pdf'); $template = LedgerSMB::Template->new( path => 'UI', template => 'rp-payments', format => 'HTML', no_auto_output => 1, output_file => 'rp_payment_test1' ); $lsmb = {columns => ['test']}; $template->render($lsmb); @output = get_output_line_array($template); cmp_ok(grep(/^\s*<\s*th\s+class="listtop"\s*>\s*$/, @output), '>', 0, 'th tags properly finish'); # Functions sub get_output_line_array { my $FH; my ($template) = @_; open($FH, '<:bytes', $template->{rendered}) or throw Error::Simple 'Unable to open rendered file'; my @lines = <$FH>; close $FH; delete $template->{rendered}; return @lines; } ledgersmb/t/89-dropdb.t0000644000000000000000000000244111604037146013663 0ustar rootrootuse Test::More; use strict; use DBI; my $temp = $ENV{TEMP} || '/tmp/'; my $run_tests = 6; for my $evar (qw(LSMB_NEW_DB LSMB_TEST_DB PG_CONTRIB_DIR)){ if (!defined $ENV{$evar}){ $run_tests = 0; plan skip_all => "$evar not set"; } } if ($ENV{LSMB_INSTALL_DB}){ $run_tests = 0; plan skip_all => 'LSMB_INSTALL_DB SET'; } if ($run_tests){ plan tests => $run_tests; $ENV{PGDATABASE} = $ENV{LSMB_NEW_DB}; } ok(open (DBLOCK, '<', "$temp/LSMB_TEST_DB"), 'Opened db lock file'); my $db = ; chomp($db); cmp_ok($db, 'eq', $ENV{LSMB_NEW_DB}, 'Got expected db name out') && ok(!system ("dropdb $ENV{LSMB_NEW_DB}"), 'dropped db'); ok(close (DBLOCK), 'Closed db lock file'); ok(unlink ("$temp/LSMB_TEST_DB"), 'Removed test db lockfile'); my $dbh = DBI->connect("dbi:Pg:dbname=template1", undef, undef, { AutoCommit => 0 }); my $sth_getroles = $dbh->prepare( "select quote_ident(rolname) as role FROM pg_roles WHERE rolname LIKE ?"); $sth_getroles->execute("lsmb_$ENV{LSMB_NEW_DB}__%"); my $rc = 0; while (my $ref = $sth_getroles->fetchrow_hashref('NAME_lc')){ $dbh->do("drop role ".$ref->{role}) || ++$rc; } $dbh->commit; is($rc, 0, 'Roles dropped'); ledgersmb/t/11-ledgersmb.t0000644000000000000000000002554511636025611014347 0ustar rootroot#!/usr/bin/perl use strict; use warnings; $ENV{TMPDIR} = 't/var'; use Test::More; use Test::Exception; use Test::Trap qw(trap $trap); use Math::BigFloat; use LedgerSMB::Sysconfig; use LedgerSMB; my $lsmb; if ($ENV{PGDATABASE}){ plan tests => 96; } else { plan tests => 92; } sub redirect { print "redirected\n"; } sub lsmb_error_func { print $_[0]; } ##line subroutine ##108 new ##235 redirect ##254 format_amount ##364 parse_amount ##408 round_amount ##423 call_procedure ##454 date_to_number ##490 db_init ##522 redo_rows ##547 merge $lsmb = LedgerSMB->new(); my %myconfig; my $utfstr; my @r; ok(defined $lsmb); isa_ok($lsmb, 'LedgerSMB'); # $lsmb->escape checks $lsmb = LedgerSMB->new(); $utfstr = "\xd8\xad"; utf8::decode($utfstr); ok(!$lsmb->escape, 'escape: (undef)'); ok(!$lsmb->escape('foo' => 'bar'), 'escape: (invalid args)'); cmp_ok($lsmb->escape('string' => ' '), 'eq', '%20', 'escape: \' \''); cmp_ok($lsmb->escape('string' => 'foo'), 'eq', 'foo', 'escape: foo'); cmp_ok($lsmb->escape('string' => 'foo bar'), 'eq', 'foo%20bar', 'escape: foo bar'); TODO: { local $TODO = 'Fun with Unicode'; cmp_ok($lsmb->escape('string' => $utfstr), 'eq', '%d8%ad', 'escape: U+D8AD'); } # $lsmb->is_blank checks $lsmb = LedgerSMB->new(); $lsmb->{blank} = ' '; $lsmb->{notblank} = ' d '; TODO: { local $TODO = 'Errors should be thrown'; throws_ok{$lsmb->is_blank} 'Error::Simple', 'is_blank: (undef)'; throws_ok{$lsmb->is_blank('foo' => 'bar')} 'Error::Simple', 'is_blank: (invalid args)'; } is($lsmb->is_blank('name' => 'notblank'), 0, 'is_blank: notblank'); is($lsmb->is_blank('name' => 'blank'), 1, 'is_blank: blank'); # $lsmb->is_run_mode checks $lsmb = LedgerSMB->new(); $ENV{GATEWAY_INTERFACE} = 'foo'; is($lsmb->is_run_mode('cgi'), 1, 'is_run_mode: CGI - CGI'); is($lsmb->is_run_mode('cli'), 0, 'is_run_mode: CGI - CLI'); is($lsmb->is_run_mode('mod_perl'), 0, 'is_run_mode: CGI - mod_perl'); is($lsmb->is_run_mode('foo'), 0, 'is_run_mode: CGI - (bad mode)'); is($lsmb->is_run_mode, 0, 'is_run_mode: CGI - (unknown mode)'); $ENV{MOD_PERL} = 'foo'; is($lsmb->is_run_mode('cgi'), 1, 'is_run_mode: CGI/mod_perl - CGI'); is($lsmb->is_run_mode('cli'), 0, 'is_run_mode: CGI/mod_perl - CLI'); is($lsmb->is_run_mode('mod_perl'), 1, 'is_run_mode: CGI/mod_perl - mod_perl'); is($lsmb->is_run_mode('foo'), 0, 'is_run_mode: CGI/mod_perl - (bad mode)'); is($lsmb->is_run_mode, 0, 'is_run_mode: CGI/mod_perl - (unknown mode)'); delete $ENV{GATEWAY_INTERFACE}; is($lsmb->is_run_mode('cgi'), 0, 'is_run_mode: mod_perl - CGI'); is($lsmb->is_run_mode('cli'), 0, 'is_run_mode: mod_perl - CLI'); is($lsmb->is_run_mode('mod_perl'), 1, 'is_run_mode: mod_perl - mod_perl'); is($lsmb->is_run_mode('foo'), 0, 'is_run_mode: mod_perl - (bad mode)'); is($lsmb->is_run_mode, 0, 'is_run_mode: mod_perl - (unknown mode)'); delete $ENV{MOD_PERL}; is($lsmb->is_run_mode('cgi'), 0, 'is_run_mode: CLI - CGI'); is($lsmb->is_run_mode('cli'), 1, 'is_run_mode: CLI - CLI'); is($lsmb->is_run_mode('mod_perl'), 0, 'is_run_mode: CLI - mod_perl'); is($lsmb->is_run_mode('foo'), 0, 'is_run_mode: CLI - (bad mode)'); is($lsmb->is_run_mode, 0, 'is_run_mode: CLI - (unknown mode)'); # $lsmb->num_text_rows checks $lsmb = LedgerSMB->new(); is($lsmb->num_text_rows('string' => "apple\npear", 'cols' => 10, 'max' => 5), 2, 'num_text_rows: 2 rows, no column breakage, max 5 rows'); is($lsmb->num_text_rows('string' => "apple\npear", 'cols' => 10, 'max' => 1), 1, 'num_text_rows: 2 rows, no column breakage, max 1 row'); is($lsmb->num_text_rows('string' => "apple\npear", 'cols' => 10, 'max' => 2), 2, 'num_text_rows: 2 rows, no column breakage, max 2 rows'); is($lsmb->num_text_rows('string' => "apple\npear", 'cols' => 10), 2, 'num_text_rows: 2 rows, no column breakage, no max row count'); is($lsmb->num_text_rows('string' => "01234567890123456789", 'cols' => 10), 2, 'num_text_rows: 2 rows, non-word column breakage, no max row count'); is($lsmb->num_text_rows('string' => "012345 67890123 456789", 'cols' => 10), 3, 'num_text_rows: 3 rows, word column breakage, no max row count'); is($lsmb->num_text_rows('string' => "0123456789", 'cols' => 10), 1, 'num_text_rows: 1 rows, no breakage, max cols, no max row count'); is($lsmb->num_text_rows('string' => "01234567890", 'cols' => 10), 2, 'num_text_rows: 2 rows, no breakage, max cols+1, no max row count'); is($lsmb->num_text_rows('string' => "1\n\n2", 'cols' => 10), 3, 'num_text_rows: 3 rows, no breakage, blank line, no max row count'); is($lsmb->num_text_rows('string' => "012345 67890123456789", 'cols' => 10), 3, 'num_text_rows: 3 rows, word and non column breakage, no max row count'); # $lsmb->debug checks $lsmb = LedgerSMB->new(); @r = trap{$lsmb->debug()}; #SKIP: {like($trap->stdout, qr|\n\$VAR1 = bless\( {[\n\s]+'action' => '',[\n\s]+'dbversion' => '\d+\.\d+\.\d+',[\n\s]+'path' => 'bin/mozilla',[\n\s]+'version' => '$lsmb->{version}'[\n\s]+}, 'LedgerSMB' \);|, # 'debug: $lsmb->debug'); #} SKIP: { skip 'Environment for file test not clean' if -f "t/var/lsmb-11.$$"; $lsmb->{file} = "t/var/lsmb-11.$$"; $lsmb->debug({'file' => $lsmb->{file}}); ok(-f "t/var/lsmb-11.$$", "debug: output file t/var/lsmb-11.$$ created"); open(my $FH, '<', "t/var/lsmb-11.$$"); my @str = <$FH>; close($FH); chomp(@str); cmp_ok(grep (/\s?\$VAR1\s=\sbless/, @str), '>', 0, 'Debug Contents, var1 type'); cmp_ok(grep (/'action' => ''/, @str), '>', 0, 'Debug contents, blank action'); cmp_ok(grep (/'dbversion' => '\d+\.\d+\.\d+'/, @str), '>', 0, 'Debug contents, dbversion format'); cmp_ok(grep (/'path' => 'bin\/mozilla'/, @str), '>', 0, 'Debug contents, path'); cmp_ok(grep (/'version' => '$lsmb->{version}'/, @str), '>', 0, 'Debug contents, version match'); cmp_ok(grep (/'file' => 't\/var\/lsmb-11.$$'/, @str), '>', 0, 'Debug contents file attribute match'); is(unlink("t/var/lsmb-11.$$"), 1, "debug: removing t/var/lsmb-11.$$"); ok(!-e "t/var/lsmb-11.$$", "debug: t/var/lsmb-11.$$ removed"); }; $lsmb->{file} = 't/this is a bad directory, I do not exist/foo'; @r = trap {$lsmb->debug({'file' => $lsmb->{file}, $lsmb})}; like($trap->die, qr/No such file or directory/, "debug: open failure causes death"); ok(!-e $lsmb->{file}, "debug: file creation failed"); # $lsmb->new checks $lsmb = LedgerSMB->new(); ok(defined $lsmb, 'new: blank, defined'); isa_ok($lsmb, 'LedgerSMB', 'new: blank, correct type'); ok(defined $lsmb->{action}, 'new: blank, action defined'); ok(defined $lsmb->{dbversion}, 'new: blank, dbversion defined'); ok(defined $lsmb->{path}, 'new: blank, path defined'); ok(defined $lsmb->{version}, 'new: blank, version defined'); $lsmb = LedgerSMB->new('path=bin/lynx'); #$lsmb = LedgerSMB->new(); #$lsmb->{path} = "bin/lynx"; ok(defined $lsmb, 'new: lynx, defined'); isa_ok($lsmb, 'LedgerSMB', 'new: lynx, correct type'); ok(defined $lsmb->{action}, 'new: lynx, action defined'); ok(defined $lsmb->{dbversion}, 'new: lynx, dbversion defined'); ok(defined $lsmb->{path}, 'new: lynx, path defined'); is($lsmb->{path}, 'bin/lynx', 'new: lynx, path carried through'); ok(defined $lsmb->{lynx}, 'new: lynx, lynx defined'); is($lsmb->{lynx}, 1, 'new: lynx, lynx enabled'); ok(defined $lsmb->{menubar}, 'new: lynx, menubar defined (deprecated)'); is($lsmb->{menubar}, 1, 'new: lynx, menubar enabled (deprecated)'); ok(defined $lsmb->{version}, 'new: lynx, version defined'); # $lsmb->redirect checks $lsmb = LedgerSMB->new(); ok(!defined $lsmb->{callback}, 'redirect: No callback set'); @r = trap{$lsmb->redirect}; is($trap->stdout, "redirected\n", 'redirect: No message or callback redirect'); #TODO: { #local $TODO = '$lsmb->info for LedgerSMB'; #@r = trap{$lsmb->redirect('msg' => 'hello world')}; #is($trap->stdout, "hello world\n", # 'redirect: message, no callback redirect'); #} $lsmb->{callback} = 1; @r = trap{$lsmb->redirect}; is($trap->stdout, "redirected\n", 'redirect: callback, no message redirect'); @r = trap{$lsmb->redirect('msg' => "hello world\n")}; is($trap->stdout, "redirected\n", 'redirect: callback and message redirect'); # $lsmb->call_procedure checks SKIP: { skip 'Skipping call_procedure tests, no db specified' if !defined $ENV{PGDATABASE}; $lsmb = LedgerSMB->new(); $lsmb->{dbh} = DBI->connect("dbi:Pg:dbname=$ENV{PGDATABASE}", undef, undef, {AutoCommit => 0 }); @r = $lsmb->call_procedure('procname' => 'character_length', 'args' => ['month'], 'schema'=>"pg_catalog"); is($#r, 0, 'call_procedure: correct return length (one row)'); is($r[0]->{'character_length'}, 5, 'call_procedure: single arg, non-numeric return'); @r = $lsmb->call_procedure('procname' => 'trunc', 'args' => [57.1, 0], 'schema' => 'pg_catalog'); is($r[0]->{'trunc'}, Math::BigFloat->new('57'), 'call_procedure: two args, numeric return'); @r = $lsmb->call_procedure('procname' => 'pi', 'args' => [], 'schema'=>'pg_catalog'); like($r[0]->{'pi'}, qr/^3.14/, 'call_procedure: empty arg list, non-numeric return'); @r = $lsmb->call_procedure('procname' => 'pi', 'schema'=>'pg_catalog'); like($r[0]->{'pi'}, qr/^3.14/, 'call_procedure: no args, non-numeric return'); $lsmb->{dbh}->rollback(); $lsmb->{dbh}->disconnect; } # $lsmb->merge checks $lsmb = LedgerSMB->new(); $lsmb->merge({'apple' => 1, 'pear' => 2, 'peach' => 3}, 'keys' => ['apple', 'pear']); ok(!defined $lsmb->{peach}, 'merge: Did not add unselected key'); is($lsmb->{apple}, 1, 'merge: Added unselected key apple'); is($lsmb->{pear}, 2, 'merge: Added unselected key pear'); like($lsmb->{path}, qr#bin/(lynx|mozilla)#, 'merge: left existing key'); $lsmb = LedgerSMB->new(); $lsmb->merge({'apple' => 1, 'pear' => 2, 'peach' => 3}); is($lsmb->{apple}, 1, 'merge: No key, added apple'); is($lsmb->{pear}, 2, 'merge: No key, added pear'); is($lsmb->{peach}, 3, 'merge: No key, added peach'); like($lsmb->{path}, qr#bin/(lynx|mozilla)#, 'merge: No key, left existing key'); $lsmb = LedgerSMB->new(); $lsmb->merge({'apple' => 1, 'pear' => 2, 'peach' => 3}, 'index' => 1); is($lsmb->{apple_1}, 1, 'merge: Index 1, added apple as apple_1'); is($lsmb->{pear_1}, 2, 'merge: Index 1, added pear as pear_1'); is($lsmb->{peach_1}, 3, 'merge: Index 1, added peach as peach_1'); like($lsmb->{path}, qr#bin/(lynx|mozilla)#, 'merge: Index 1, left existing key'); # $lsmb->is_allowed_role checks, no prefix $lsmb = LedgerSMB->new(); $lsmb->{_role_prefix} = '1_'; $lsmb->{_roles} = ['1_apple', '1_pear']; is($lsmb->is_allowed_role({allowed_roles => ['pear']}), 1, 'is_allowed_role: allowed role'); $lsmb->{_roles} = ['apple', 'pear']; is($lsmb->is_allowed_role({allowed_roles => ['peach']}), 0, 'is_allowed_role: disallowed role'); is($lsmb->is_allowed_role({'allowed_roles' => []}), 0, 'is_allowed_role: no allowable roles'); delete $lsmb->{_roles}; is($lsmb->is_allowed_role({'allowed_roles' => ['apple']}), 0, 'is_allowed_role: no roles for user'); # $lsmb->is_allowed_role checks, prefix $lsmb = LedgerSMB->new(); $lsmb->{_role_prefix} = 'test__'; $lsmb->{_roles} = ['test__apple', 'test__pear']; is($lsmb->is_allowed_role({allowed_roles => ['pear']}), 1, 'is_allowed_role: allowed role with prefix'); ledgersmb/t/13-log.t0000644000000000000000000000417411610452661013162 0ustar rootroot#!/usr/bin/perl use strict; use warnings; $ENV{TMPDIR} = 't/var'; #use Test::More tests => 13; use Test::More; plan skip_all => 'Disabled because we have moved to Log4perl and the predefined methods in the LedgerSMB::Log package nto currently recommended'; use Test::Trap qw(trap $trap); use Data::Dumper; use LedgerSMB::Sysconfig; use LedgerSMB::Log; my @r; $LedgerSMB::Sysconfig::logging = 0; @r = trap{LedgerSMB::Log->print('test', 'message')}; #is(LedgerSMB::Log->print('test', 'message'), 0); ok(!$trap->stderr, 'print: Unsetting LedgerSMB::Sysconfig::logging disables printing'); $LedgerSMB::Sysconfig::logging = 1; @r = trap{LedgerSMB::Log->print('test', 'message')}; ok($trap->stderr, 'print: Setting LedgerSMB::Sysconfig::logging enables printing'); like($trap->stderr, qr/^\[.*?\] \[test\] $$ message/, 'print: Outputs correct message'); @r = trap{LedgerSMB::Log->emerg('test')}; like($trap->stderr, qr/^\[.*?\] \[emerg\] $$ test/, 'emerg: Outputs correct grouping'); @r = trap{LedgerSMB::Log->alert('test')}; like($trap->stderr, qr/^\[.*?\] \[alert\] $$ test/, 'alert: Outputs correct grouping'); @r = trap{LedgerSMB::Log->crit('test')}; like($trap->stderr, qr/^\[.*?\] \[crit\] $$ test/, 'crit: Outputs correct grouping'); @r = trap{LedgerSMB::Log->error('test')}; like($trap->stderr, qr/^\[.*?\] \[error\] $$ test/, 'error: Outputs correct grouping'); @r = trap{LedgerSMB::Log->warn('test')}; like($trap->stderr, qr/^\[.*?\] \[warn\] $$ test/, 'warn: Outputs correct grouping'); @r = trap{LedgerSMB::Log->notice('test')}; like($trap->stderr, qr/^\[.*?\] \[notice\] $$ test/, 'notice: Outputs correct grouping'); @r = trap{LedgerSMB::Log->info('test')}; like($trap->stderr, qr/^\[.*?\] \[info\] $$ test/, 'info: Outputs correct grouping'); @r = trap{LedgerSMB::Log->debug('test')}; like($trap->stderr, qr/^\[.*?\] \[debug\] $$ test/, 'debug: Outputs correct grouping'); @r = trap{LedgerSMB::Log->dump('test')}; like($trap->stderr, qr/^\[.*?\] \[debug\] $$ \$VAR1 = 'test'/, 'dump: Simple dump correct'); @r = trap{LedgerSMB::Log->longmess('test')}; like($trap->stderr, qr/^\[.*?\] \[debug\] $$ test at /, 'longmess: Outputs correct data'); ledgersmb/t/98-pod-coverage.t0000644000000000000000000000321711615061347014770 0ustar rootroot#!/usr/bin/perl # # t/98-pod-coverage.t # # Checks POD coverage. # use strict; use warnings; use Test::More; eval "use Test::Pod::Coverage"; if ($@){ plan skip_all => "Test::Pod::Coverage required for testing POD coverage"; } else { plan tests => 31; } pod_coverage_ok("LedgerSMB"); pod_coverage_ok("LedgerSMB::Form"); pod_coverage_ok("LedgerSMB::AM"); pod_coverage_ok("LedgerSMB::Database"); pod_coverage_ok("LedgerSMB::Locale"); pod_coverage_ok("LedgerSMB::Log"); pod_coverage_ok("LedgerSMB::Mailer"); pod_coverage_ok("LedgerSMB::Template"); pod_coverage_ok("LedgerSMB::Template::CSV"); pod_coverage_ok("LedgerSMB::Template::HTML"); pod_coverage_ok("LedgerSMB::Template::LaTeX"); pod_coverage_ok("LedgerSMB::Template::ODS"); pod_coverage_ok("LedgerSMB::Template::TXT"); pod_coverage_ok("LedgerSMB::Template::XLS"); pod_coverage_ok("LedgerSMB::User"); pod_coverage_ok("LedgerSMB::DBObject::Date"); pod_coverage_ok("LedgerSMB::DBObject::Draft"); pod_coverage_ok("LedgerSMB::DBObject::Company"); pod_coverage_ok("LedgerSMB::Company_Config"); pod_coverage_ok("LedgerSMB::DBObject::Admin"); pod_coverage_ok("LedgerSMB::ScriptLib::Company"); pod_coverage_ok("LedgerSMB::DBObject::Employee"); pod_coverage_ok("LedgerSMB::File"); pod_coverage_ok("LedgerSMB::DBObject"); pod_coverage_ok("LedgerSMB::Batch"); pod_coverage_ok("LedgerSMB::DBObject::Payment", {also_private => [qr/^(format_ten_|num2text_)/]} ); pod_coverage_ok("LedgerSMB::DBObject::Reconciliation"); pod_coverage_ok("LedgerSMB::DBObject::TaxForm"); pod_coverage_ok("LedgerSMB::CancelFurtherProcessing"); pod_coverage_ok("LedgerSMB::DBObject::Menu"); pod_coverage_ok("LedgerSMB::DBObject::EOY"); ledgersmb/t/99-versioning.t0000644000000000000000000000407311632475005014601 0ustar rootroot#!/usr/bin/perl use strict; use warnings; use Test::More tests => 17; use LedgerSMB; use LedgerSMB::Form; my $lsmb = new LedgerSMB; ok(defined $lsmb, 'lsmb: defined'); isa_ok($lsmb, 'LedgerSMB', 'lsmb: correct type'); ok(defined $lsmb->{version}, 'lsmb: version set'); ok(defined $lsmb->{dbversion}, 'lsmb: dbversion set'); my $form = new Form; ok(defined $form, 'form: defined'); isa_ok($form, 'Form', 'form: correct type'); ok(defined $form->{version}, 'form: version set'); ok(defined $form->{dbversion}, 'form: dbversion set'); is($lsmb->{version}, $form->{version}, 'LedgerSMB and Form versions match'); is($lsmb->{dbversion}, $form->{dbversion}, 'LedgerSMB and Form dbversions match'); ok(-e 'VERSION', 'VERSION exists'); ok(-s 'VERSION', 'VERSION non-empty'); ok(-r 'VERSION', 'VERSION readable'); open(my $FH, '<', 'VERSION'); my $ver = readline $FH; close $FH; chomp $ver; is($lsmb->{version}, $ver, 'LedgerSMB version matches VERSION'); is($form->{version}, $ver, 'Form version matches VERSION'); my @dparts; my @lparts; my $age; SKIP: { skip 'LedgerSMB is trunk', 1 if $lsmb->{version} =~ /trunk$/i; $lsmb->{version} =~ s/(\d+\.\d+\.\d+)\D.*/$1/; $lsmb->{dbversion} =~ s/(\d+\.\d+\.\d+)\D.*/$1/; @dparts = split /\./, $lsmb->{dbversion}; @lparts = split /\./, $lsmb->{version}; $age = 0; foreach my $dpart (@dparts) { my $lpart = shift @lparts; if (!defined $lpart) { $age = 1; last; } elsif ($lpart > $dpart) { last; } elsif ($dpart > $lpart) { $age = 1; last; } } ok($age == 0, 'lsmb: version >= dbversion'); } SKIP: { skip 'Form is trunk', 1 if $form->{version} =~ /trunk$/i; $form->{version} =~ s/(\d+\.\d+\.\d+)\D.*/$1/; $form->{dbversion} =~ s/(\d+\.\d+\.\d+)\D.*/$1/; @dparts = split /\./, $form->{dbversion}; @lparts = split /\./, $form->{version}; $age = 0; foreach my $dpart (@dparts) { my $lpart = shift @lparts; if (!defined $lpart) { $age = 1; last; } elsif ($lpart > $dpart) { last; } elsif ($dpart > $lpart) { $age = 1; last; } } ok($age == 0, 'form: version >= dbversion'); } ledgersmb/old-handler.pl0000755000000000000000000001405312051677553014267 0ustar rootroot#!/usr/bin/perl # ###################################################################### # LedgerSMB Accounting and ERP # http://www.ledgersmb.org/ # # Copyright (C) 2006 # This work contains copyrighted information from a number of sources all used # with permission. # # This file contains source code included with or based on SQL-Ledger which # is Copyright Dieter Simader and DWS Systems Inc. 2000-2005 and licensed # under the GNU General Public License version 2 or, at your option, any later # version. For a full list including contact information of contributors, # maintainers, and copyright holders, see the CONTRIBUTORS file. # # Original Copyright Notice from SQL-Ledger 2.6.17 (before the fork): # Copyright (C) 2001 # # Author: Dieter Simader # Email: dsimader@sql-ledger.org # Web: http://www.sql-ledger.org # # Contributors: # # # # 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 2 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, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ####################################################################### # # this script is the frontend called from bin/$terminal/$script # all the accounting modules are linked to this script which in # turn execute the same script in bin/$terminal/ # ####################################################################### use LedgerSMB::Sysconfig; use Digest::MD5; use LedgerSMB::App_State; $| = 1; binmode (STDIN, ':utf8'); binmode (STDOUT, ':utf8'); use LedgerSMB::User; use LedgerSMB::Form; use LedgerSMB::Locale; use LedgerSMB::Auth; use LedgerSMB::CancelFurtherProcessing; use LedgerSMB::App_State; use Error qw(:try); use Data::Dumper; our $logger=Log::Log4perl->get_logger('old-handler-chain');#make logger available to other old programs require "common.pl"; # for custom preprocessing logic eval { require "custom.pl"; }; $form = new Form; # name of this script my $script; if ($ENV{GATEWAY_INTERFACE} =~ /^CGI/){ $uri = $ENV{REQUEST_URI}; $uri =~ s/\?.*//; $ENV{SCRIPT_NAME} = $uri; $ENV{SCRIPT_NAME} =~ m/([^\/\\]*.pl)\?*.*$/; $script = $1; } else { $0 =~ tr/\\/\//; $pos = rindex $0, '/'; $script = substr( $0, $pos + 1 ); } $locale = LedgerSMB::Locale->get_handle( ${LedgerSMB::Sysconfig::language} ) or $form->error( __FILE__ . ':' . __LINE__ . ": Locale not loaded: $!\n" ); # we use $script for the language module $form->{script} = $script; # strip .pl for translation files $script =~ s/\.pl//; # pull in DBI use DBI qw(:sql_types); # send warnings to browser # $SIG{__WARN__} = sub { $form->info( $_[0] ) }; # send errors to browser #$SIG{__DIE__} = # sub { print STDERR __FILE__ . ':' . __LINE__ . ': ' . $_[0]; }; ## did sysadmin lock us out #if (-f "${LedgerSMB::Sysconfig::userspath}/nologin") { # $locale = LedgerSMB::Locale->get_handle(${LedgerSMB::Sysconfig::language}) or # $form->error(__FILE__.':'.__LINE__.": Locale not loaded: $!\n"); # $form->{charset} = 'UTF-8'; # $locale->encoding('UTF-8'); # # $form->{callback} = ""; # $form->error(__FILE__.':'.__LINE__.': '.$locale->text('System currently down for maintenance!')); #} # grab user config. This is ugly and unecessary if/when # locale messages #$form->{charset} = $locale->encoding; $form->{charset} = 'UTF-8'; $locale->encoding('UTF-8'); if ($@) { $form->{callback} = ""; $msg1 = $locale->text('You are logged out!'); $msg2 = $locale->text('Login'); $form->redirect( "$msg1

$msg2

"); } $form->db_init( \%myconfig ); &check_password; # we get rid of myconfig and use User as a real object %myconfig = %{ LedgerSMB::User->fetch_config( $form ) }; map { $form->{$_} = $myconfig{$_} } qw(stylesheet timeout) unless ( $form->{type} eq 'preferences' ); if ($myconfig{language}){ $locale = LedgerSMB::Locale->get_handle( $myconfig{language} ) or $form->error( __FILE__ . ':' . __LINE__ . ": Locale not loaded: $!\n" ); } $LedgerSMB::App_State::Locale = $locale; # pull in the main code $logger->trace("trying script=bin/$form->{script} action=$form->{action}");#trace flow try { require "bin/$form->{script}"; # customized scripts if ( -f "bin/custom/$form->{script}" ) { eval { require "bin/custom/$form->{script}"; }; } # customized scripts for login if ( -f "bin/custom/$form->{login}_$form->{script}" ) { eval { require "bin/custom/$form->{login}_$form->{script}"; }; } if ( $form->{action} ) { binmode STDOUT, ':utf8'; binmode STDERR, ':utf8'; # window title bar, user info $form->{titlebar} = "LedgerSMB " . $locale->text('Version') . " $form->{version} - $myconfig{name} - $myconfig{dbname}"; &{ $form->{action} }; LedgerSMB::App_State::cleanup(); } else { $form->error( __FILE__ . ':' . __LINE__ . ': ' . $locale->text('action not defined!')); } } catch CancelFurtherProcessing with { my $ex = shift; }; $logger->trace("leaving after script=bin/$form->{script} action=$form->{action}");#trace flow 1; $form->{dbh}->disconnect() if defined $form->{dbh}; # end sub check_password { require "bin/pw.pl"; if ( $ENV{GATEWAY_INTERFACE} ) { $ENV{HTTP_COOKIE} =~ s/;\s*/;/g; @cookies = split /;/, $ENV{HTTP_COOKIE}; foreach (@cookies) { ( $name, $value ) = split /=/, $_, 2; $cookie{$name} = $value; } #check for valid session if ( !LedgerSMB::Auth::session_check( $cookie{${LedgerSMB::Sysconfig::cookie_name}}, $form ) ) { &getpassword(1); return; } } else { return; } } ledgersmb/common.pl0000644000000000000000000000436512054032530013347 0ustar rootroot# ###################################################################### # LedgerSMB Accounting and ERP # http://www.ledgersmb.org/ # # Copyright (C) 2006 # This work contains copyrighted information from a number of sources all used # with permission. # # This file contains source code included with or based on SQL-Ledger which # is Copyright Dieter Simader and DWS Systems Inc. 2000-2005 and licensed # under the GNU General Public License version 2 or, at your option, any later # version. For a full list including contact information of contributors, # maintainers, and copyright holders, see the CONTRIBUTORS file. # ##################################################################### # # Common script handling routines for menu.pl, admin.pl, login.pl # ##################################################################### use LedgerSMB::Sysconfig; sub redirect { use List::Util qw(first); my ( $script, $argv ) = split( /\?/, $form->{callback} ); my @common_attrs = qw( dbh login favicon stylesheet titlebar password custom_db_fields vc header ); if ( !$script ) { # http redirect to login.pl if called w/no args print "Location: login.pl\n"; print "Content-type: text/html\n\n"; return; } #if (first { $_ eq $script } @{LedgerSMB::Sysconfig::newscripts}){ print "Location: $form->{callback}\n"; print "Content-type: text/html\n\n"; return; #} $form->error( $locale->text( __FILE__ . ':' . __LINE__ . ':' . $script . ':' . "Invalid Redirect" ) ) unless first { $_ eq $script } @{LedgerSMB::Sysconfig::scripts}; my %temphash; for (@common_attrs) { $temphash{$_} = $form->{$_}; } $temphash{action} = $form->{action}; undef $form; $form = new Form($argv); for (@common_attrs) { $form->{$_} = $temphash{$_}; } $form->{action} ||= $temphash{action}; # default to old action if not set $form->{script} = $script; if ( !%myconfig ) { # needed for login %myconfig = %{ LedgerSMB::User->fetch_config( $form ) }; } if ( !$form->{dbh} and ( $script ne 'admin.pl' ) ) { $form->db_init( \%myconfig ); } require "bin/$script"; &{ $form->{action} }; } 1; ledgersmb/images/0000755000000000000000000000000012060044553012764 5ustar rootrootledgersmb/images/ledgersmb.eps0000644000000000000000000010033010600666341015441 0ustar rootroot%!PS-Adobe-3.0 EPSF-3.0 %%Creator: GIMP PostScript file plugin V 1.17 by Peter Kirchgessner %%Title: ledger-smb.eps %%CreationDate: Sun Sep 3 22:39:01 2006 %%DocumentData: Clean7Bit %%LanguageLevel: 2 %%Pages: 1 %%BoundingBox: 14 14 215 115 %%EndComments %%BeginProlog % Use own dictionary to avoid conflicts 10 dict begin %%EndProlog %%Page: 1 1 % Translate for offset 14.173228346456694 14.173228346456694 translate % Translate to begin of first scanline 0 99.999999999999986 translate 199.99999999999997 -99.999999999999986 scale % Image geometry 200 100 8 % Transformation matrix [ 200 0 0 100 0 0 ] % Strings to hold RGB-samples per scanline /rstr 200 string def /gstr 200 string def /bstr 200 string def {currentfile /ASCII85Decode filter /RunLengthDecode filter rstr readstring pop} {currentfile /ASCII85Decode filter /RunLengthDecode filter gstr readstring pop} {currentfile /ASCII85Decode filter /RunLengthDecode filter bstr readstring pop} true 3 %%BeginData: 31949 ASCII Bytes colorimage Q2^j`VZ2/~> Q2^j`VZ2/~> Q2^j`VZ2/~> S,Wcno[U1(Am=9mW;hA~> S,Wcno[U1(Am=9mW;hA~> S,Wcno[U1(Am=9mW;hA~> iVroWp&>$kbl7k)ITeZK#Q=]).C/KBs*t~> iVroWp&>$kbl7k)ITeZK#Q=]).C/KBs*t~> iVroWp&>$kbl7k)ITeZK#Q=]).C/KBs*t~> ir9+F76a!47Kl(C6qG>pcMn$o;F`_Sr;ZmgZM:BuJ,~> ir9+F76a!47Kl(C6qG>pcMn$o;F`_Sr;ZmgZM:BuJ,~> ir9+F76a!47Kl(C6qG>pcMn$o;F`_Sr;ZmgZM:BuJ,~> ir9,!L0Z,%!!O-(?>?S,c2S+Hh;!tj!!!+9bGYAj~> ir9,!L0Z,%!!O-(?>?S,c2S+Hh;!tj!!!+9bGYAj~> ir9,!L0Z,%!!O-(?>?S,c2S+Hh;!tj!!!+9bGYAj~> iVs#Rldn)n!!YNA^"MK/prraDrr9S2!!!moihug,~> iVs#Rldn)n!!YNA^"MK/prraDrr9S2!!!moihug,~> iVs#Rldn)n!!YNA^"MK/prraDrr9S2!!!moihug,~> hZ!Rqr;ZpDLWfM5rrAJd!!5*Xo;DV=~> hZ!Rqr;ZpDLWfM5rrAJd!!5*Xo;DV=~> hZ!Rqr;ZpDLWfM5rrAJd!!5*Xo;DV=~> hZ!RYr;Zms[.hT?!W,.]!!6B@rMT[G~> hZ!RYr;Zms[.hT?!W,.]!!6B@rMT[G~> hZ!RYr;Zms[.hT?!W,.]!!6B@rMT[G~> hu<`Q.fKDL%=?XErs%$W!!!IVfr"e"~> hu<`Q.fKDL%=?XErs%$W!!!IVfr"e"~> hu<`Q.fKDL%=?XErs%$W!!!IVfr"e"~> hu<`,"o\K'/=c(GrrB/"!!4X?mABo6~> hu<`,"o\K'/=c(GrrB/"!!4X?mABo6~> hu<`,"o\K'/=c(GrrB/"!!4X?mABo6~> hu<\>r;Zmo\bjAG!-%o;!_TruVZ2/~> hu<\>r;Zmo\bjAG!-%o;!_TruVZ2/~> hu<\>r;Zmo\bjAG!-%o;!_TruVZ2/~> hu<[RrW!!(F4%u,#3lm&!!I5dV>l&~> hu<[RrW!!(F4%u,#3lm&!!I5dV>l&~> hu<[RrW!!(F4%u,#3lm&!!I5dV>l&~> i;WiF(&e17*g,U(rrBh5!!4.#je`!-~> i;WiF(&e17*g,U(rrBh5!!4.#je`!-~> i;WiF(&e17*g,U(rrBh5!!4.#je`!-~> i;Wear;Zm^Y4]d6!1*Ta!^!IUV>l&~> i;Wear;Zm^Y4]d6!1*Ta!^!IUV>l&~> i;Wear;Zm^Y4]d6!1*Ta!^!IUV>l&~> i;We%r;Zn)_u7UT!W,Fe!!6BArMBOE~> i;We%r;Zn)_u7UT!W,Fe!!6BArMBOE~> i;We%r;Zn)_u7UT!W,Fe!!6BArMBOE~> iVrrU0)bhP&VAg#rs7&7?U?tG@[l`Trt"FlAjJUXO6HVo!rr<4J_U##$KnC1:d7-1>(t0!mf*R[ Y'!H&6;W!Jq>U]pkJNj6A)dFbrrg>P7u-[%s*t~> iVrrU0)bhP&VAg#rs7&7?U?tG@[l`Trt"FlAjJUXO6HVo!rr<4J_U##$KnC1:d7-1>(t0!mf*R[ Y'!H&6;W!Jq>U]pkJNj6A)dFbrrg>P7u-[%s*t~> iVrrU0)bhP&VAg#rs7&7?U?tG@[l`Trt"FlAjJUXO6HVo!rr<4J_U##$KnC1:d7-1>(t0!mf*R[ Y'!H&6;W!Jq>U]pkJNj6A)dFbrrg>P7u-[%s*t~> iVrr,"o\K'/tqe!rs/Fu5QUp'.N\Qh!A;=`rsRt9(]Y'p-3XAt`M`\8!\U/6qu7,TC)?pN'.5+6 !!!3q[f+VUdEq:Uru]m6(]Xgf.1#tS#BoY;s8&$q74/QH!!".GnGiOcH3jKM!Kcm>s*t~> iVrr,"o\K'/tqe!rs/Fu5QUp'.N\Qh!A;=`rsRt9(]Y'p-3XAt`M`\8!\U/6qu7,TC)?pN'.5+6 !!!3q[f+VUdEq:Uru]m6(]Xgf.1#tS#BoY;s8&$q74/QH!!".GnGiOcH3jKM!Kcm>s*t~> iVrr,"o\K'/tqe!rs/Fu5QUp'.N\Qh!A;=`rsRt9(]Y'p-3XAt`M`\8!\U/6qu7,TC)?pN'.5+6 !!!3q[f+VUdEq:Uru]m6(]Xgf.1#tS#BoY;s8&$q74/QH!!".GnGiOcH3jKM!Kcm>s*t~> iVrn>r;Zmq])1dm&&^X3!'GV']uQ!9!!"UtrqQL%SKInPA!XOA\PrPM3;rmZ:V-H%rs\dX&c_nQ BUQBL]4qBG! iVrn>r;Zmq])1dm&&^X3!'GV']uQ!9!!"UtrqQL%SKInPA!XOA\PrPM3;rmZ:V-H%rs\dX&c_nQ BUQBL]4qBG! iVrn>r;Zmq])1dm&&^X3!'GV']uQ!9!!"UtrqQL%SKInPA!XOA\PrPM3;rmZ:V-H%rs\dX&c_nQ BUQBL]4qBG! iVrmQrW!!)FOTOT$]>;k(M'5bmem+`7K*8fL[P$=%-LXk!'#\Bj7rWRnNd$Q!X<_orVlol=8i1* +F:Z`qu6WmEqo\:"bYV.ru]fT!!#0:\`!5]s0Vk-!&Vgss8Cg-V?R##!Fs1MnjrWX!FsRFs*t~> iVrmQrW!!)FOTOT$]>;k(M'5bmem+`7K*8fL[P$=%-LXk!'#\Bj7rWRnNd$Q!X<_orVlol=8i1* +F:Z`qu6WmEqo\:"bYV.ru]fT!!#0:\`!5]s0Vk-!&Vgss8Cg-V?R##!Fs1MnjrWX!FsRFs*t~> iVrmQrW!!)FOTOT$]>;k(M'5bmem+`7K*8fL[P$=%-LXk!'#\Bj7rWRnNd$Q!X<_orVlol=8i1* +F:Z`qu6WmEqo\:"bYV.ru]fT!!#0:\`!5]s0Vk-!&Vgss8Cg-V?R##!Fs1MnjrWX!FsRFs*t~> ir9&E'E.t5+HksTrs/F8!!"-`Z02&b!*9(!!H-`jrs-n'!!#3CanGZ4!1Nid!Z-p]rVlk)rW!$1 CV0<!(p\k*r`rZ5@.^/XGrsR<\!!!Xaiqu[S5;iE?!XsM3 mJh\~> ir9&E'E.t5+HksTrs/F8!!"-`Z02&b!*9(!!H-`jrs-n'!!#3CanGZ4!1Nid!Z-p]rVlk)rW!$1 CV0<!(p\k*r`rZ5@.^/XGrsR<\!!!Xaiqu[S5;iE?!XsM3 mJh\~> ir9&E'E.t5+HksTrs/F8!!"-`Z02&b!*9(!!H-`jrs-n'!!#3CanGZ4!1Nid!Z-p]rVlk)rW!$1 CV0<!(p\k*r`rZ5@.^/XGrsR<\!!!Xaiqu[S5;iE?!XsM3 mJh\~> ir9"^r;Zm`YP7D`#&!u:)0ECXr;Quo,6.]KHeeQ!#Ke"d!&KPYqtpBnXSi,#/$AXGrrAPe!!5`f m/-e`r\j`U#",/u]Y2klrr35I'`\8)R+VB8rrA8^!!50dq#13mW;Zc+0;JGf!*c2'#QOiaTC)%G J,~> ir9"^r;Zm`YP7D`#&!u:)0ECXr;Quo,6.]KHeeQ!#Ke"d!&KPYqtpBnXSi,#/$AXGrrAPe!!5`f m/-e`r\j`U#",/u]Y2klrr35I'`\8)R+VB8rrA8^!!50dq#13mW;Zc+0;JGf!*c2'#QOiaTC)%G J,~> ir9"^r;Zm`YP7D`#&!u:)0ECXr;Quo,6.]KHeeQ!#Ke"d!&KPYqtpBnXSi,#/$AXGrrAPe!!5`f m/-e`r\j`U#",/u]Y2klrr35I'`\8)R+VB8rrA8^!!50dq#13mW;Zc+0;JGf!*c2'#QOiaTC)%G J,~> ir9!rrW!$$AB4]:rs"5Y!"!2?nb`=dS,NBh.$j,rrs.$n!!"-k`r#W4!2'5j#6@lIrr<#f+T;?B (Ojg/rrN'XrW!*U]_h^,rr2p&jbP@Di'Brr@*=!"DfKScD]\f):FO0R_+B mJh\~> ir9!rrW!$$AB4]:rs"5Y!"!2?nb`=dS,NBh.$j,rrs.$n!!"-k`r#W4!2'5j#6@lIrr<#f+T;?B (Ojg/rrN'XrW!*U]_h^,rr2p&jbP@Di'Brr@*=!"DfKScD]\f):FO0R_+B mJh\~> ir9!rrW!$$AB4]:rs"5Y!"!2?nb`=dS,NBh.$j,rrs.$n!!"-k`r#W4!2'5j#6@lIrr<#f+T;?B (Ojg/rrN'XrW!*U]_h^,rr2p&jbP@Di'Brr@*=!"DfKScD]\f):FO0R_+B mJh\~> j8T/V/H,VN'8><1rs$4A!!#6Rk55/`hAZFp#\CUDrr35j0)tt\C:Em3rr@?D!!3XZhZ!NTV#:8p 7&fbRrrM^1rW!!KYPS1s#Q7Bt!"a4gqtpBnH2[dF0TtDnrt5/a!!!7QXUIC\cMdeCd'h-im/MS~> j8T/V/H,VN'8><1rs$4A!!#6Rk55/`hAZFp#\CUDrr35j0)tt\C:Em3rr@?D!!3XZhZ!NTV#:8p 7&fbRrrM^1rW!!KYPS1s#Q7Bt!"a4gqtpBnH2[dF0TtDnrt5/a!!!7QXUIC\cMdeCd'h-im/MS~> j8T/V/H,VN'8><1rs$4A!!#6Rk55/`hAZFp#\CUDrr35j0)tt\C:Em3rr@?D!!3XZhZ!NTV#:8p 7&fbRrrM^1rW!!KYPS1s#Q7Bt!"a4gqtpBnH2[dF0TtDnrt5/a!!!7QXUIC\cMdeCd'h-im/MS~> j8T/*"TAB&0V\+)rrtgj!#'\&rqud$j"p`9"AbZQrVlk&rW!!kU?_OR!'U;]![3m!rr2t5rW!$$ @*&?DrrL1CrW!!QY4qko!1a#g!_&sRqu6na!<<*BHH#d[rsI9\!!"7./K^(kq>L j8T/*"TAB&0V\+)rrtgj!#'\&rqud$j"p`9"AbZQrVlk&rW!!kU?_OR!'U;]![3m!rr2t5rW!$$ @*&?DrrL1CrW!!QY4qko!1a#g!_&sRqu6na!<<*BHH#d[rsI9\!!"7./K^(kq>L j8T/*"TAB&0V\+)rrtgj!#'\&rqud$j"p`9"AbZQrVlk&rW!!kU?_OR!'U;]![3m!rr2t5rW!$$ @*&?DrrL1CrW!!QY4qko!1a#g!_&sRqu6na!<<*BHH#d[rsI9\!!"7./K^(kq>L j8T+ j8T+ j8T+ j8T*OrW!!*G1>s[#6%*m!!mMcrVm2aF9hjH+D.J,rr2p&n0J&7"'i8.q#:>9rW!!)Dp&%Y!*0!u !X4GFq>UFZrW!!'DpA4[!.t1M!]?Y=rVm/02ZNga6&3;Jqu6q!!!!3t#$e(dj8XW~> j8T*OrW!!*G1>s[#6%*m!!mMcrVm2aF9hjH+D.J,rr2p&n0J&7"'i8.q#:>9rW!!)Dp&%Y!*0!u !X4GFq>UFZrW!!'DpA4[!.t1M!]?Y=rVm/02ZNga6&3;Jqu6q!!!!3t#$e(dj8XW~> j8T*OrW!!*G1>s[#6%*m!!mMcrVm2aF9hjH+D.J,rr2p&n0J&7"'i8.q#:>9rW!!)Dp&%Y!*0!u !X4GFq>UFZrW!!'DpA4[!.t1M!]?Y=rVm/02ZNga6&3;Jqu6q!!!!3t#$e(dj8XW~> jSo8F')hk4,*hE\rtV#W$CqebT+B$1/H-!#HG'Ra:uns*t~> jSo8F')hk4,*hE\rtV#W$CqebT+B$1/H-!#HG'Ra:uns*t~> jSo8F')hk4,*hE\rtV#W$CqebT+B$1/H-!#HG'Ra:uns*t~> jSo4]r;ZmbZ1m\d!*oL'%6&Wi?6oRO$8>eH\DI&ZrrM^9rW!!t[J9Os!-8# jSo4]r;ZmbZ1m\d!*oL'%6&Wi?6oRO$8>eH\DI&ZrrM^9rW!!t[J9Os!-8# jSo4]r;ZmbZ1m\d!*oL'%6&Wi?6oRO$8>eH\DI&ZrrM^9rW!!t[J9Os!-8# jSo4*r;Zn+`W#K/!;c]p!TFC]!!`o\:O\bBg%>.@!4r.0!XX%tq#:BT&H)S1;nMr*rrN*jrVusg g\_!NM#IAV$!O1or;Qb8q#CX;2en;OaQWQsrr@HF!!5*IhVnKb~> jSo4*r;Zn+`W#K/!;c]p!TFC]!!`o\:O\bBg%>.@!4r.0!XX%tq#:BT&H)S1;nMr*rrN*jrVusg g\_!NM#IAV$!O1or;Qb8q#CX;2en;OaQWQsrr@HF!!5*IhVnKb~> jSo4*r;Zn+`W#K/!;c]p!TFC]!!`o\:O\bBg%>.@!4r.0!XX%tq#:BT&H)S1;nMr*rrN*jrVusg g\_!NM#IAV$!O1or;Qb8q#CX;2en;OaQWQsrr@HF!!5*IhVnKb~> jSo3OrW!!5K\c8""e\rUqZ!Gl!"&m"BnD\P^X:p*q=ssi@f??/-^j;rrrMmar;Zm0IF\5p'&YtS !!-'Ks8W&>=9&='0P[`Pr;Qfp2?!R_,[>JOTsVtpk4JWHrrN!QrW!$6G/sL=s*t~> jSo3OrW!!5K\c8""e\rUqZ!Gl!"&m"BnD\P^X:p*q=ssi@f??/-^j;rrrMmar;Zm0IF\5p'&YtS !!-'Ks8W&>=9&='0P[`Pr;Qfp2?!R_,[>JOTsVtpk4JWHrrN!QrW!$6G/sL=s*t~> jSo3OrW!!5K\c8""e\rUqZ!Gl!"&m"BnD\P^X:p*q=ssi@f??/-^j;rrrMmar;Zm0IF\5p'&YtS !!-'Ks8W&>=9&='0P[`Pr;Qfp2?!R_,[>JOTsVtpk4JWHrrN!QrW!$6G/sL=s*t~> jo5AQ)u]g=18OI4rs%a&8%eKoIf9($lI/j`U!!4F7m/$_nlt$S* !#JL91B7C^04^Qmo)&Ffm1B6s"\,rboD&=UrrLONrW!!jWU\pHJ,~> jo5AQ)u]g=18OI4rs%a&8%eKoIf9($lI/j`U!!4F7m/$_nlt$S* !#JL91B7C^04^Qmo)&Ffm1B6s"\,rboD&=UrrLONrW!!jWU\pHJ,~> jo5AQ)u]g=18OI4rs%a&8%eKoIf9($lI/j`U!!4F7m/$_nlt$S* !#JL91B7C^04^Qmo)&Ffm1B6s"\,rboD&=UrrLONrW!!jWU\pHJ,~> jo5A$!r`0$<5&5%rs!9>Fi41XE;fh=&Wc;KrrLgZrW!!u`W#`6"18+U,Q7ZE7CDsdrsd.Z"onWD 1JDG:W6+9$qYpTT$N:#+9#pB"!0@*Z!Y0J%huA3~> jo5A$!r`0$<5&5%rs!9>Fi41XE;fh=&Wc;KrrLgZrW!!u`W#`6"18+U,Q7ZE7CDsdrsd.Z"onWD 1JDG:W6+9$qYpTT$N:#+9#pB"!0@*Z!Y0J%huA3~> jo5A$!r`0$<5&5%rs!9>Fi41XE;fh=&Wc;KrrLgZrW!!u`W#`6"18+U,Q7ZE7CDsdrsd.Z"onWD 1JDG:W6+9$qYpTT$N:#+9#pB"!0@*Z!Y0J%huA3~> jo5='rW!!+Gh)Hd#JgN]No'g9E;fh=$'"9Drrqfes8U">rVut'd/*bKeJ/a0#ljr6FO0a^%.&iu +A7'[`6[)to`"Xc!T=@a!!,F-p&>'lmJQta9`>"n1S='ls*t~> jo5='rW!!+Gh)Hd#JgN]No'g9E;fh=$'"9Drrqfes8U">rVut'd/*bKeJ/a0#ljr6FO0a^%.&iu +A7'[`6[)to`"Xc!T=@a!!,F-p&>'lmJQta9`>"n1S='ls*t~> jo5='rW!!+Gh)Hd#JgN]No'g9E;fh=$'"9Drrqfes8U">rVut'd/*bKeJ/a0#ljr6FO0a^%.&iu +A7'[`6[)to`"Xc!T=@a!!,F-p&>'lmJQta9`>"n1S='ls*t~> k5PJC')hk4-C=#jrs8-H!'mRUs8R`M!!-ispAY>m-+EXK_uou=!EmkJrrhC4!cVKF!!=X5h k5PJC')hk4-C=#jrs8-H!'mRUs8R`M!!-ispAY>m-+EXK_uou=!EmkJrrhC4!cVKF!!=X5h k5PJC')hk4-C=#jrs8-H!'mRUs8R`M!!-ispAY>m-+EXK_uou=!EmkJrrhC4!cVKF!!=X5h k5PFJr;Zmf[.s@p$1CXi!bTIOs8T_0!!+1Uq#:WaA,oH'k5Wg3rVus_cM[\GgG8h2VFLOb"\-%[ 45p/:rs$.C!"=Y)o^Mk]r^ctf!Gh3"rs5hO(PKg)s8T;%!!3skh;80^~> k5PFJr;Zmf[.s@p$1CXi!bTIOs8T_0!!+1Uq#:WaA,oH'k5Wg3rVus_cM[\GgG8h2VFLOb"\-%[ 45p/:rs$.C!"=Y)o^Mk]r^ctf!Gh3"rs5hO(PKg)s8T;%!!3skh;80^~> k5PFJr;Zmf[.s@p$1CXi!bTIOs8T_0!!+1Uq#:WaA,oH'k5Wg3rVus_cM[\GgG8h2VFLOb"\-%[ 45p/:rs$.C!"=Y)o^Mk]r^ctf!Gh3"rs5hO(PKg)s8T;%!!3skh;80^~> k5PEBr;Zk.cM%8B`Adht)iESQrrMphr;Zj\e,0.PqP,88=e k5PEBr;Zk.cM%8B`Adht)iESQrrMphr;Zj\e,0.PqP,88=e k5PEBr;Zk.cM%8B`Adht)iESQrrMphr;Zj\e,0.PqP,88=e kPkOZqu?acbkqDDrUo$F=9ea)!^EdZrVloO&cD\=-'-^JlcP8I!"ik kPkOZqu?acbkqDDrUo$F=9ea)!^EdZrVloO&cD\=-'-^JlcP8I!"ik kPkOZqu?acbkqDDrUo$F=9ea)!^EdZrVloO&cD\=-'-^JlcP8I!"ik lMgtbn!k$f!!+E:r_iqn7Q_h#qu?g$BZU2NrrAJa!!rrB%KZV1146=dr;QfL(&7h>$<3GCs3q/O !!*?SU;Zj*rrN!hq#CO36$'$cp&>'8&c2P7%1`aF!"iA$an>W4#0[,K!"=>2h>`!~> lMgtbn!ase!!+E:r_iqn7Q_h#qu?g$BZU2NrrAJa!!rrB%KZV1146=dr;QfL(&7h>$<3GCs3q/O !!*?SU;Zj*rrN!hq#CO36$'$cp&>'8&c2P7%1`aF!"iA$an>W4#0[,K!"450h>`!~> lMgtbn!apd!!suB;H$Lf7Q_h#qu?g$BZU2NrrAJa!!rrB%KZV1146=dr;QfL(&7h>$<3GCs3q/O !!*?SU;Zj*rrN!hq#CO36$'$cp&>'8&c2P7%1`aF!"iA$an>W4#0[,K!"450h>`!~> m/I1T;*Gub!!4."iqiZUEs2=>"U6JiT?[*+rrKYLqZ$jKCo6%fs6LI!!!=Np](,[t!O)b$!! m/I1S;*Gra!!4."iqiZUEs2=>"U$;dT$6m(rrKVIqZ$jKCo6%fs6LI!!!=Np](,[t!O)_#!! mf*@\W'p7X%gO(2;Ij]iFDu)5Ch\.'pA4e%ql*I>"on]903$NL;8(+rO7VTJ&oo^Ltl^oV6))\aPl CN+TYUqu'cjSs`~> mf*Oe^iLb?*$6:#*rd;n*[#lt;J1gQ!Aea`>/o*Y?&6P0S2 **ecHmJ[%hT-"tALUlmPrs7u0Ii'4p1)L,f!!FdGe&q(Srup-?(^C mf*Oge!ET`1c@8f1_2N39jD7FDf0B,C2.F-\+][u%f<5',Rakc*&qDgZeG'HqXt9p\jmJC%O>AF _sRF&#+ltU7u+YDrVm/sd=2rV7Q).epAb=GVVg/!qYq_nFs.;&%2gj"Ju[,aqYBmVl/1$]@7*1R K<_r!`R*N2qW.[,~> n,EE_0^o&N":ZYKDjS,dgtq,SnFuqjma?%a!!!-,$OmUXr=8l>rXT;H'+b9H!"jt n,E[,BL>-[6pX('r]q2_5!D8"6UF79>]l.1a4]>-jlZ(,rsS8AJhnu54[`"B;bp%U8Obs2 rB:NN5Xe=DBS`hHr9402~> n,E^AQ@""1GB@nGEW0nXEH;#!%!?lLQDqRDgu.2Rk4&-F$gu<$<)?_0E.!@rM#E)/M#N/9Ll?mr =&`Ifebf7D"OjNaf_57C%#YYs,#2`kAl:]9&-Mb/"9hkUYj)#a,km1%<)H_,EdW\(O,f6WL4k)* J9u nc&XO;u?V&%4FSHC2n<5?9fA&!!N]E-S:e`o`#'g`IUf)n,NS"6$fa$q>UKlqtpBqHisEamf3G, I^8,3rrhVmKjle-!!**&rWE3'q#CL%5*Y6qs*t~> nc'a!KL8*u84ZHVA9**NKnF\dd?@]3Fq>UKl qtpC)Hia9i/2p'k8kDN>3\Vfr%/^)-)hGU`f\ nc'a'W-`l@JUi,nI=mH=P*1l_Jpr3#JUi5uI"@$1PEj&Zo`#-kc(BrFI=:a:#(V8NF+ga`q>UKl qtpC)HiX3o8n<:!J:;icA5bW?'`7q5*/(WZq>Ucj]Uk7 o)Aa@/H#PY)c;3c`Rj,4lK[Wi_MUGK!!-$Ho)Amfl,o)T"S;Zt(M]ktnGVqX#*T#e)g@&do`+sq rW!$9U@A-Vrrr8kmb=9Wp](a80MZ;.MNjBlOagh$%f-/,++rkFs*t~> o)BKaB0Ss[85X#RV8:X%r8:OdMT+R#cZ.:IIZE8k;<8 >b^TOs*t~> o)BKjP^%\.J9c?oUqP13j5oC]f>O\KI=;'Es*k0#I=$^koD]'oo&IopO+)NNJ-LROG+[4PrUTt% P5kS%FdS):J:N3%Jq8DuF_FPcrW!$7T^_sUrs&8gkgm5#IJJBtI<^0oO-Z:7SIM$NLOX]#J:N,r HAf?%m/MS~> oD\jY./j2N!^;:IhXpdBrr`5^Rk=C8!_C?1nG`Uhl)-H5!!<7(Xm>KV#jE$'!(sHjeJn5_#:*t' !!!_)p@A4ab8^6W#$@_Fh<=:srUU0Zh7%AGq>^OHXmQ.=~> oD\m_AjH>f"^Qbgh=U[Arrr5YXCFUgqapr\A\nB8rri2\ZY2l'8cqXuWU''R$0`-(!(sHfgKR2F 9)hNi8QKRH!!!_)p@A4bdoo6<8d@q%T#]RIm-t#F#Oq!2]8Tl[8H)3a76tFtrU0]9~> oD]3lP^.e0Irp:Jh":R@rrr/U[u5W`qg\cuHG9CJrri,W]oIR9J-1:CVS!!!_)p@J:drRm'Vqg\p$G+->$jm2C7nH\LEf>!u4H[l$F"FYTWb51Q+J,~> o`"sg@/U'-30DP^oD\mMB`\&1!_LH3mJd4O9D8Df%"?jtrs6+7!!-`Ys5Xad!!ipHa`7@])kcin rrA2W!!-TYp&>-id:NOY!!3:Ko^Dg1~> o`#6qO$?6/86_%uq"+Lfi/C/qr(7&]B#=Q7rr_G16V7,H"%c1:fC/_G\,ZL0B@$VE<_)sX#Y]6X EW?(YT_.dS!O"lf8chP*d.RDAp!\ah7f>p]6V*U7n,In~> o`#6rY^(bLJTQ^nq"4Rhr84B"If+]uIs\s0mf*Cgjd^_nJ-((KfC/_G\,ZL0B@$VKLjo2N$%[MJ `,YhX)kcinrrL&bqg\`rJ'I]e"oe)BU4.RiJ-11JY4(iZJ,~> o`"oSr;Zp4H-#pRrrW.c%/U#+7`PGorrZg4%0HA+!YC=Tn,EBgrW!%6h#EZ6!!k6Iq.fs14h(:X rrM6nq>^P+fCT"Dr14Jr!!-ZunGe"~> o`#3&5Y4R>:3sqXnc&^eX\M=`8cqOo_Z&p%!g,]BqFUi]9oeH+rrB,!!![,ls0P*a8c)*d86D5S CB+>t\,,Xp!ps#Yr(7#]FO]p^"8K0!7K#g\7mi*unGe"~> o`#3=H%1?qH[<[0nc&^b^4C_2J-1:K^AdL!"0m-"J,4ZsHB@@ZrrB,!!!Hujs3#cbJ-gdLPPJto !'Rgfnc&[]Ljo8P!e#UIoD\pb^k7(6J-1:JU$2"GJ,~> p&>'Z)uTa<2P]a/rrK/1qu?da_u9!&"TCgi4"'k)!X=MHn,EC0rW!-[dJlQ6!Y+u+#>NFZ&HEYr f'iV=4o,-ZA(L2M!O*%0!!-m)nc++~> p&>@V#Y8RK _@ZbbIFdle!Hgd-8chP*e+*G>_,!T"8cqUOMX9m5J,~> p&>qg\s%Gf@N3 !#U.8n,EE[I/JKrI=T`8rrUJtIf4d!Is[mRnc++~> p&>#Squ?dq^]!R"!N-2$!!5C$rU'Ugp`oi p&>&t5lO@X88#U6mJdI)8k2KG7q'+0mJd@dA4(-h8c)*]7t'=arrMparW!.+^f=!.?:k)gs%N`: G81)kA[1strrJ'Dr(7#]FOTaZ!jb p&>'6H2` pAY0l55YB]@F4??!0-pW!]n-pmJd@Q$NOJP2>R:R4jNKq!T#d7!!N]0!)RY^R:_# pAY3nG!c1#!_@=Uli.3i6qL!??b?7'rs%mi7;p+_7/TXY7V'[0rrLt8rW!QC-TY^f:.e,M7QMq2 !!"cpXm5?S!LZ1M8chP*e+!A=rI[E68cqOa_>Np)J,~> pAY3nT6gKes*Xmjli.4)I"-ZsHFNh>rs&+NI!if!I/JKrIt>Z.rrLt8rW!QI6=t+pKReT%G[s2Y !!"cpXm5?S!Om=OJ-(.LdI@/;r2+fEj(J,~> pAY0S%/^)+ACg)H!W?4$!!5'kr9aLfaTDN\j.cAM!Y2%#mf*CQG9?td!!3KM"8`'%""IuR_sd!m !.F\D!Fs^LrrLRUq>^P/kk"h)~> pAY3[;b6m[!_@F^li.4gLd=X&?+0[urs%.M7sNk&6i9OY8PZ/Vmf*CQG9I"d!"K>Z()%>k"98E( .VP pAY3aL49,P!e#UIli.4fWHj#EH*dG9rs%S;H[j\oHi& pAY-(qZ$Y&f'<8>jWFO'0XgiFrs#M(#Ctn/-i*fDAEN:Z#lW@m!!!61"TnQ$">5SSl20iI!/:7L !Fs^Krr>ml!!4L]rUg,?~> pAY3>8P/nR!_7:[lMh(R?:@@fZMX%h#K'#'KAuZ<7/TXY7XX1^rtG@]Go7,"#R(5/!~> pAY3MJ:IQK!e,^IlMh(WNI?>&Ykmbe#M+?ML#;`jI/JKrI?!+NrtG@]JLqiN#Qt,-!=0;[011Q< l20iI!Q'*ZJ-(.LdI.#8VL&/j"+Pd3r:L#>~> pAY,cqZ$XbcKY?4U&Y0BY5.Jb#)rTsNTpJ(q>^RC_#E^##&O>C:5,DrqZ$[`_Z&j#!0-gT!Fs^K rrAD^!!3Chnauj3~> pAY3+6qRAM!_-eDl2Lq!6q:=[q!J(dY!5[Akl7hPr(7&]=hXe#rstDW5?3?0:an"N1cd[&^AdEt !Nn]c8chP*e*d5;[6dI`8cqXWR.0bJJ,~> pAY3@I"2-Gs*k$gl2Lq3I"6LBq!J(da*N#kkPrPJqg\`t]`%3s&%$=j>(NA[92AJi@qfknrp'La `d.K4!e#UHmf*=2HM`3oI%9Zts*t~> pAY,]qZ$[8Yl!_c"oLXd+f=u#rs*HB+e/!$ll5g%!WduDmJdF[)ZV.FhY^^W!!57#rp'L`NVWVU A(L)J!Q>0;!!-rro`'F~> pAY3'6V78L"%Z@pqWe(ar-1J+V=j6U#b!kSRdg@H>t+Z`!_AF?mJdai?:7bQh><*n84ZKrrU_E8Gl']7t'=fs*t~> pAY3=H[l!E!e%9JlMh%cSpG^Yp$Mbb[s3.cn,N$>IJeTsI@BNirt+pcIs6k-qPnXaI"$QqID#RE rrL,br."isJC3fb!oec\r."isMVe"*J,~> pAY,]q>^P,m-4NQ]Dr\:oBlP_;#i8MpAb/@q>^O]eF!8@U&Y0l[eg#TqZ$[K[JT7h!0-gT!Fs^K rrLp_q>^Oseb&ll~> pAY3(6V75K!_%V%l2Ln37SfTGmJdHF5$=fWs8SfYr(7#ZB@-&G&A:D$B!_=5Va!gI8kMTVZMNkd !Nn]c8chP*e*d5;k#"YH8chM#dIdHh~> pAY3=H[l!E!e$6ll2Ln@IX.LSmJdHjHZu:Ys8T`Wr."itK[&oa#gn!KFKkT@_0Q!1"+Y^%qWe(] `d.K4!e#UHmf*@VKmrrM!e,^Go`'F~> pAY,kq>^R)RJuLO"TCXdOm_Z;$2ZIX5.LIhs5+Cb!!3V(p[8%e7K=0SfDkli"T/6$*N&SrrrA&T !!-T\mf*=J$i0i(9?d&.J,~> pAY317S3PN"%Z.aqWe(`rcgYlmI'u]r,"`+Zhj_%kZ(.O8cqUYVY9HX$%,!7J_'l$eP&R68cqU_ V=s3S!Nn]c8chP*e*d5;lV^7N8chLra7TC^~> pAY3DI=M0F!e.BIlMh"dTlQIcmf*XmR='4_qZ$T`LOT/O!e%'Amf*TgH[11ns8V&/J,Om!HDU?# rrL,br."isJC3fb!qD"or."iuIDkdXJ,~> pAY0<"Sr*!&YJ=f"1p^XkjJHSnItss_uBZ8!,)-.!FOmUrs@*X!(!RSs8Va2qu?d/QLO2>!0-gT !Fs^KrrLdZq>^Ofa7TC^~> pAY3K9M#(R"%Q1lqs+1`c"iO+mf*I`=@?c9rr2ouPt4fc"%c4S n*9oRY!DnW!_@F^mf*@L;+LOV!_6k?o`'F~> pAY3VJq*]K"+Gg5q!.k]gl7W^mf*IcMgTc^rr2ouZ$H7t!e$$`n,EaZK7A!:o)JacNICbU!dgC) lMgn)H2N0oI=T`5rrVP@If+]tIs\s&s*t~> pAY0a(\n%3%]8Lj!ntEWmf*FF#67oMrVll5q>^RH`W#B,$&8K`BuU)Os8"GI!!3:ZlK\BLNVWVU A(L)J!QG6 pAY3e>"8B]"%?%prp'LbftZtCrrhI\7W$6FrrUS<8c;6`7U3e/nG`iq5>#q5rr<#rCde7ps%*6O l0A9LY!DnW!_@F^mf*@>9M#(R!_6tBo`'F~> pAY3hMgbJQ"+Gg:qWe(^fY?kBrrh_CI!`m3rrV&+J,FfuJ%tsOrsHYiI p&>"sp](@&HKjbq!rVfkmf*F*! p&>&N5PdtS7ST<:li.%ap\jO["O]n4Fj^0f!rI")rC[)]!LWEIrrr=<5u`m)rVlnG6N'LX8:]X` rrK8fr(7#]FOT[X!l%,pr(7#]E6InRJ,~> p&>&pH2<$nIY"`hli.%ap\jO["Q+cXIaJ&n!rSO7r."isTC;=M"oOd9G)PAYrrJmArI=rtM;IOt !QKE_J-(.LdI.#8dX:qB!e#F;o`'F~> p&>'A%efr)-@k+-rrehl"b#8*rrKJ-qZ$X]ddd>@W;m$-^&.d.!+bs,!E[k;rrA&T!!-T\mf*8k q>^R/KAQ8#J,~> p&>*N;+:=R"@kgeTB=c*"LpciJ_g8(!m*o'rCR,\B@$,J"i3PtCqKTCrrJ6HrCR,]Dq""O!Nn]c 8chP*e*d5:Ma724"%Z.>h=U_t~> p&>*VKmifJ"FkcW\*;NE"O;@@K\ZM*!n_pNrI>!!K?X>crrpl!I o`"oOo`,%6JC`ER"FC+]MWap;!W>.X!!3Isp@J:fr]U<.OlH<=!/ULP!C4clrrA&T!!-T\n,EFG &,H8-4Jq]As*t~> o`"up6V.#F"@YU\T\\<$"JItRN9:'bU`\s*t~> o`#!1H[kjA"FYQP\Du9B"MT,,NTL* o`"skIImL@%W'YLrrcU-*L?*irrAkk!!-3\oD]!6!WZ90q>C6ndKf[M!\ChYli-sEq>^P+f'iV= CAIo4$Za>fo`'F~> o`#$mT0c-E8d%RL:m0Yhrre9E;3pVHrrKf#r(7#ZFklTg"kH78B=%F3rrV(Q8H)3`7p<=tli.!g 5l=4U89E>LrrJBMr(7)`9QnJUo`'F~> o`#$l\9`Z"J-::IK oD\je>Oqgs%9^.6hu)5QulrrA&T!!-T\ nG`Nm"o83#8>>JBs*t~> oD\pgL-\B)8d.^N:kZpahu oD\pgVL!adJ-CCJK;R/mhZ!_NI!;4Squ6`mPC3:Y!e%NSo`#'!H?k.qqu6`oO+$tW!d^[8li."* H2N0oI=T`7rrUi'J,=`tEh)Ogs*t~> o)AaaC[hB+1lC,Jrrr*=!&UtUqYpPNq>^P@m.LA^jpqG^XRuDi!W4tU!!3Iimd'lQNVWVUA_6JP !O`X;!!4m4eai`j~> o)AgcO@2S38d.^N7r,'aiVs)V?pe/#q"k!kWBpGS!_8+3p&>3`<^^Aoo_\XirGk=*8cqXXPjRf: !Nn]c8chP+eFEP?b>Uk-8cqUdLt)"qJ,~> o)AgbX*fBiJ-CCJI[.\4iVs)YOFDDQq"k!k_0Ps/!dp9rp&>3eLjjHAo_\Xirg\B7J-(+bm-FZP `d.K4!e#UHnc&[FL4/uM"+bQJeFNWi~> nc&[iOV70a!Y]%]j8T;C$NNK*r;-EojV.Lk!]A4$pAY8o!"=+uq>UFmqu?d!Gie8k!0-gT!F=RR rrVtP#l4N'/qV.?o)F4~> nc&agWDPuRp.>N\6U=\0dJi5,"m]&T@(6(1rrVOg7f>p]7UaFUJK6N'LX8;#sg rrK8fr(7#]ES0m_"8]#k7K#g^8Oup6`qo9+J,~> nc&^d\q>A&J-LLNHA8HSr8dk]nV2L:[/Be#!qD+rrI>!"J]@]_rrgi!H@4!5rrK*FrI=rsN8a+& !QKE_J-(1Me+'&J96:[qXXZ:~> n,EF+7.:0X"]E.trrp=C!)LT5q>UG0qZ$[%QLsqO"nahT2k]R6rr?j3!!-E[li-sEq>^U,>ep"+ rrVYc3Vi^Y#== n,EL6E^W@g8d%XM97P4JrrpqH7VK[UJ\5lF:W8P>WGp\tElF$X$#mJ6b_Q9Y=?!_7@ali.!g 5l=4W8PXo`p@nRio=f018,c*b8OuH[LrT2Zs*t~> nG`XidZo3.oRI*oH@VaAr9""_iduT(^]+'/!OI(LJ-(+no(W.fqON"VR-j_L!O[1NJ-(1QeEd,8 `d.H3"+R#tp\4[jpX5OWIf4d#JUMTo`V8p&J,~> mf*@VP:>u$!X;rXkPk[_!!$^[/2Jo2=qXFN8~> mf*FVVdDe\oL]6W5tZmbkPk\#77V:>q#:EN9h>4T!_.1`p\tEE6qVI9rqZQpW^$GS"%HqErp9Xc Y!DkV&P#/ZAW!D!c.(:oafpb46pjQE8d.spFe7+ZnGe"~> mf*FT[Y]?[oRI'oH@VmMkPk\6I=6Lbq#:EXJq*`L!e,sVp\tERI=-7SrqZQp`-M<3s*k'grp9Xc `d.E2%t&khXME3 m/I.BINn7]!Y^7Xl2LmC!!-rfp\t4eqZ$[7ZMXIt"oVR(-^3ZerrB8"!!4gcq<\+]NV`\W!Z)(. !!=EY]_:dnJ,~> mJdCigmD8577m/E"@tgWU%.CI"KO^WGguKf!J!K78cqU_ZMOCs"oa?DM5 mJd@egoH0VIe8-nIsQgXnEKrU`-Hc]deEbBV0`&i!e%ENq>UWtXF,2NjS8`Vf7&5JJ-()*q!A"] `d.H3#CLrHH?a[^J,Y!/IX69fIt2urIt3&pK=^R?s*t~> li.(de:9(=!!,C2lMh!$!!I]+p\t6!q>^P:lhUPac2[iH\G>q"!S.JQ!!4.;na-8UNV`\]!F:e, 74B#[!rW*(!Xfhp4]Pf(rW!$%0pD(ps*t~> li.1ceX0`66qHuC"%GUteE[&:Ps.cjh"UgMa$iSu8chJ9kP>,]gdt"M[JBUt!oZpGr^m8`;l9*O rrK8fqaq*1Q&9E`;G9X[7h/*a;-7:FG#^q&8P3["nF-C-~> li.1`eu=IQI=Lp?"FbZ`g&C=;"LWK%K\Q8$!S;btJ-(._jn\o[k(%o'ZMF:q!pYDfrI=rqV=%X`VLH@16uK7&3"JWn"An,In~> l2LnbgQY)a9'Vjia*MMdF\UU.qgjMa%T!!+^OnGe"~> l2Lt`g8&X`6q6lB"A(p_]`%3s"Frd3Lue=1!r?Y!rCR/]?H)p?rrerY:4q6orrVq#7fH!^8P>?3 m/I*h5l=4\89E5LhT31+TU5YA& l2Lt]fs-TgI"(a="+,dBqX"4bVL!THj7iQTqj)X.J-1:P_uBN4"MB&,K\?,"!r7k*rI=rrQfdZ7 !QKE_J-gXTc0sE.\?2Qurg==bS><@%bhLL.H[pWpHBH>Enc++~> k5PPI^hb%_!!3_,rpKdiqCVabOmD`@!0R-Y!X4_Xqu6iS$32l^o_8@dr^-M_!WdN$m/I'Fq>^P+ fDbdQrqc?\nc&"[o(MqZrr3#Z7/HrbAa&^bJ,~> kPkebjhlpV6q']A8cqLYZMO"h"oE%%:Qk#:rrK>irCR/`8t#8IrrqO^6s?M\p\t kPkb_j2R^DI"(d>"+>a6q!S.cr0MhWP3Vc@!QKE_J-(.lnGE4hm=g%5V"FB\!MOl=J-(.Wg$J_> `d.K4!e#UIrr3-!q"4+Erp9gWp%nXdrrVDQHN&EsI!qmUo)F4~> jSo>Uc%%;9!!3\/rU9aim1KCASFQ=Q!U(9q!!,dIqu6e[!!mDdp&>#)qZ$Y$cg:Z3NVWVUA(L)J !TlE>!!,=8oDa=~> jSoGUc^/!-77m8H"%H(mqX=FfnlA1XS+64P!ps,[rCR,\DV+dc"Kt'_F3O=W!L#bH8chM'bO#60 Y!DnW!_@F^mf*@QDaOFq"%Y^sg%55o~> jSoDPd&;bJIJ86oI=]'+n,ERbM10] ir9,ZgPmiY!!4+Qrp]pkd09S$W:fi`!,DB2!Yhd5rVm&Y('#PBm.LAYNr&eX6, ir92XgRr"D7efRX79@>(nG`[L:.86\p%A=cPX,1>"%Z:lq>L!O"ce8cqOn]D_-s !Nn]c8chP*e*[/:ia5+P8ch=nf(Aum~> ir92Ufrp9\Ie\EqIY5T9nG`[UK7A*>p%A=cZ[)J!!e% hu'8"T&0"D!:it"aL(M i;WuYhORk<8GPjZ6Yb6BrrpM879ctjp&>*G8kJtR!_._$rVm%o5=oLpr:U'kb=P;)8cqRdWqPi[ !Nn]c8chP*e*R)9b">5'8ch>%i:[,#~> i;WuVh6)N[J,+TrI>c\Grrq,+Is7sgp&>*RJ:INJ!e$0irVm&6H%0q@r:U'kg4+VNJ-(%pp?hk\ `d.K4!e#UHm/I. h>[Q,Ad.o/!IsY0rrnVe!'e*mp&>'l62LWh/&hMfs61@#(PLH5rrLm\qu?d7Qga>A!0-gT!Fs^H rr?g1!!.WApA]X~> hZ!`Vf83*gqFUi]7Zm-/rro_p7UW_'p&>*mGXD@$$V+I=rr<#f>=;8>fC](Ej\SMI8cqU\R-sAA !Nn]c8chP*e*I#7P"%bqGn+Qd3~> hZ!`SfV@rrW1lHi&="_#FB6oSe6EK%KYp!ptYjrI=rqR-sAA!QKE_ J-(.LdHgf5Z?lG!!dp^/pA]X~> h#@HRW?M$:!\DFlo)Al:!!#X/rq-3jT_e]r",laMs,$dV4K.iCrrMg:qu?d%J*$(t!0-gT!Fs^H rrLpdqZ$[>_>X-.J,~> h#@KO\Q_Ds8cqOg`r>Q/"eInJA\S09rrK`!rC[)]$'t&[s/\IV?)7&`rrW")7fH!^8P4`tmJd3i 5l=4U89E>HrrV=^8,Z$^7p*S)p]#a~> h#@KK`//j;J-1:P`;T9,"hSu.H+X(JrrLDlr.#-&SaQOX`HcuVU%7jU!rJ(-rI=rrMrO.(!QKE_ J-(.LdHgf6m"U#gJ-1:O^\mj+J,~> q#:E?UAa6S!Rj.+!!3:co()e`=TAG%b4GW6mMl$'#tEPHo-+/CFNXUSrr>Rd!!-'PmJd0Gq>^P+ f'<88 q#:EN^&-sl!n_BWqapr^8so,=rre0E88H6:rrVdu7f>pd7VgNRpL?TbGKBdTrrIO7rCR,\E7O@U !Nn]c8chP*e*?r6LI(i1!_/"1p]#a~> q#:EXd/)o)!o0&fqLAWpT'u7M"KZltHc5OU!qqV%rI>6(L!]krOaVS%a8Y]1!Mk&?J-(1Qdd@&8 `d.K4!e#UHlMgmbHMi9pI$Eggs*t~> q#:G8!2oSRrrM7Oq#CG&ht-jOrB(&[?d\HE!,hZ6#S^OVbkM-f~> q#:Gb5dL%ErrVG/6Mj@V7X*VYrrrCD6V)4Bo)A`W5lF:]85H8c\3WVbQ0@f=!LZ1N8chIi`9mR* Y!DnW!_@F^lMgmm6MsFX7UjL=q#>j~> q#:H+GeHSJrrrCnI"$Lfo)A`uH2N0uI'!:lH%C.%kjn`S[s7k%!e5a:mJd4, H2N0oI=T`1rrL;hr."m!J]@]as*t~> q#:Gn!%uUZrrM@Aq>^O[b4GW:oc=)5CY&(V!QYB?!!d5r0)u,[]DM1!!1!E]![P&Jmf*9Hq>^P+ f'<89^]OB5!Z%^.q#>j~> q#:H25@;[srrVM&6i9OX7UsI0rrr1)7S.gRo)AdD8kJtR#Y'="CdUd/\GPjs!OG,k8cqRbYkmef !Nn]c8chP*e*?r7dS!.08cqX^W;$)eJ,~> q#:KFH@sE?k5PMMQ$iIZ!IhoWrrr7[I=6Xoo)AdNJ:INJ#^qfhR='I+[eoXq!Qo`dJ-(,%qq#>j~> q#:KP#68u q#:KY:IC*.jo5D5:ItFV"%QM$qt0mll;:&CIG48l!r[1-rCR;b@>[WHGrrV+S8Gu0\8HFk;q#>j~> q#:KaKR93Rjo5D=Jq*]K!d_-Ko`#*aL4=T'g%,.ErLA64J-L[sJ:Vlsg@>1Eh11"RJ-((gna?DX `d.K4!e#UHlMgqMK7<`K!dp3sq#>j~> q#:No/-$KqqW7_W?i'g),cUP1rrp=C!!Rl2nc&TOqZ$g)%0-B)Wq5c\!TFLb!!3=XkO/?MNVWVU A(KrF!RqAN!!-lnq#>j~> q#:NqBgG\/q;qVWN'R>6"%ZFjp@S@geOrG*KAZ5!!O+lf8d7sb8P*KjoC;h^l;C1P8cqXWMWX@, !Nn]c8chP*e*?r7i(loA8chP2h>%##~> q#:NqQ@".opuVMVY'Kqq!dU[:o`#*RJU`'%hsp^Ia*RW5s*k-$FJSNurrV\DIf4cuH]I1TrrL,b r."isJC3Z^!pPAer."isLth_)J,~> p\tA(!!#[Gjo5@g!W2p!+f+f'rro;#!""A@nc&XL&,?2-&Uhk%nc&Xb./NuF=5<6D!0-gT!Fs^G rrL4Eq>^P"f(f8q~> p\tAU5X]VBjo5D(7nN\P"%ZCdo^r.e^dUdeLue++!pWcUrC[&\"&= Y!DnW!_@F^lMgq=9h>1S!_77Zq#>j~> p\tB#H%(_"jo5D8IXhrrL,b r."isJC3Z^!p"r_r."itJ^F2lJ,~> p\tD\!!!(Bp?)AUl4gk!!+stmf*9Hq>^P+f'<88 ZhXS%;pY7=J,~> p\tE&5tOP(o&frRmo;mW8cqU`U@e*X"fsp[9T80(rrIg=qapr]>Ft*JrrI[;rCR,\@)VL5!Nn]c 8chP*e*?r7a[eu#8chLubP;*f~> p\tE=H@UC5n)jWOo8%koJ-'tho^r.e`Hcu[Nooj2!NCDBJ-1@ES*BDA!N1;CJ-(4N_=%=(`d.K4 !e#UHlMgq=It.BH!e,R=q#>j~> p\tE:!WW35]]T4ppa>t>!\1/Ao`#)1!!!RjlL=fRWVQSs"D>[Mn,EB(qZ$[AYPmqi!0-gT!Fs^G rrA/V!!,s@q#>j~> p\tHK91_WN^]!?q!r?Isr^m8_=/GT^rrn]Q8PP<2nG`O*7/BLWEPhVArrJEMrCR/^hrrK8f r(7#]FOTOT!O+id8chLtaS>dc~> p\tHXJU`0"_>NKr!rJ10rI=rnV"Fj~> p\t9a)#aL96f7),!VnAG!!5-dq"4Ri8cSi&O6c<8!U^p(!!4=)j6lpIK)5NL&=W=]rrA#S!!-T\ lMgiiq#CFtc1q p\tHj>=M4QDVO@S!rHb$r^m8_>d*qprrmm=8PP?4nG`R\>t4cb"%Z=KipQgIVEXrN"%c7Wp$_n] X[)eV!_@F^lMgmD5l4.T88ZNEs*t~> p\tHmN.-;*NS3Lp!rSC4rI=rnX8)>e"f6NqHB[U_rrVnRIJnZuJTm%3mf*=(Gl3'nH^s`srrL,b r."isJC3Z^!Np_FJ-(1Ia8#[b~> pAY+_r;Zk4nEBlQpaQ+@!`$Q0p&>6l-NF,UNpH06!+u*.!_T`lmf*9GqZ$[!HgL5$!.t%I!Fs^H rrM^3q#CG.e+irn~> pAY>E6:sg;L[=7)!r?Otr^m8`B"\*8rs&=377g17lL4`RP!Jt<"%Zq(p[8%^Y!DnW!_A%1n,EEc 4o@nR89E>HrrVn$7f,dZ89N;Ss*t~> pAY>lH[pWpSE]8;!rS:1rdY*#GId\Frs&CcI=Q[.l0nWQZ?c@u!d(L;mf*=-H2N0oI#[CZrrKr[ r."isJC3]_!r7n*qge]p!71H?J,~> pAY,Bj9kqf#)MO4rrBP+!!3LNd-^i5QMLR^8`9(;!."D@!Fs^H rrB"n!!3OXh>%##~> pAYAi5>"O=8=T;:rrVgq7f>p[G0fg\#4,8Z8P4s)n,E[:7S-3E8PFHVmJd6q6:q,J!_$n[n,EE] 4o@nR89E>HrrKr(qapr^9S2'ps*t~> pAY0+GlE3pIB)l&rrVqPIf=j!I!a-1rs&%KIXlg,k3rj~> pAY,lqu?d)PlBtJ!Q5' pAYE87S-3E7n]`TlMh.?8kDWI85bK/o`#-D91_]GKAuA"#kqgt8kMTTQKml;!kCZirCR,\?,l@5 !L5nI8chP*e*R)9r,P1%8cqR`QgFMIJ,~> pAY0CIK"a!It"`tlMh.LJ:E*"JTd"5o`#-RJ:E)sMW+%(#l9[3J:N2nPNqQ8!mZ.BrI=s!JAq!W !OR.MJ-(.LdHpl7rLA63J-1@GQ0e;GJ,~> pAY0G#Q+Q'$^^kYrr@-^R2XSVGd!*/jq!Fs^I rrA#Q!!695qY:)@~> pAY3S:ItIW"%Gt`q pAY3\K7ElNs*k'Xp?V_Z\U"1)"+PBnq"4RjaEiAeI>-;@rs,rWJ:N,l[JT@k!Q]Q`J-(,$q=+Cb Wd=Sn!e#UHm/I+,Hhr6pIrr'oq#>j~> pAY0f,PqHB$B+fKrrM$lr;ZmAL"Gts!W4qU!!,I6mf*9urW!!2Ib3rd!-%c7!WduBnc&Xf0_tbM A(L&I!ON40!!4U.h"Ui!~> pAY3i@n-Dh"%GqXp[.tdkuL;H8k;j5fC](JrGk7t8k*F9mf*L97nH9HJ(Eud!Lc7N9)hH`NpH68 !rZq'r(7#]FOTXW!m=;.qapr] pAY3kP(!:Z"+Ga+o^2YamtlLDJ:Vorf(AtIrg\=cJ:E*jmf*LHIXcopJCa)e!P!COJ-(+alLFlU rKr!1J-(.LdI$r8g4FeNJ-1@FLtqb)J,~> p&>"fq>^QtC@(Eh!W,Ui!! p&>&E6MsFX7n/L(n,E^lJ3lk#8P~> p&>&jHMi9qIsn3Zn,E^mVL!cCJUMXFp[nId`I%Q6!e%6In,EUgOaVe'RI9JB!rS@3qg\`tK[K>i !pbJgr."isJCErd!nN'Qqg\g#H$?psp]#a~> p&>#;p](=V_=@O+o3V@q!s2,ek4JZSS-8]h!En[Trrm3=!*R&6mJd0Pp](@%Pl:1Q!-7l8!@k>C rrVM/"Si$"&nS67pA]X~> p&>&c55RqS84%1:nc&piN'^-/8P*B\k4JZT\Ofl8cqXXT_S*X !LuIQ8chOe\FBM#nXW6?qapu^9l6s"pA]X~> p&>'*Gl*!oIs[C/rUTspqQ>-pJ:W2iQfdr?!mQ4DrI=ruO5KC*"grW*G.@J;rrL;jq1&NpW:f`] !P*ORJ-1:O^]*d'"806TI/AEsJU2F;n+Qd3~> p&>#dpAb7'ESg?f!PCGk!!EBoQ.c01rrVV2!Vuct"b-78rrfb1%Y*1!rrK,0pAb43Vt9ohZ3g:+ ":\J1iVWBL"8pi),PV6@+Dn7Fp&BO~> p&>*,6qR5I"%,hJj7N?YcYu0A8kDT^P1fj.rr_k_7n3DKs%*6Vo^De_b=50Vf^8\?_GNi!8cqR` [Jogu!m+/-qFUo]:kZOGqtL*orT'ha5tLoG"\D6_F/nKts*t~> p&>'?I//9pH\/E`o`#9SRsKU8JUVU!g&C^F"89 p&>'8"SMft)0*O^qu6fog7:e9r;Zs2<12D;p\t p&>9M9h7iH84cDP8d.^O=d@D*qu7-%jgfe26:sg?9P'L@rV-%HV9ONRbme$O0~> p&>*SJq!NG#(CoUZ.npMr;R6'mEVJVH[pWtHZPA%rV- p&>6_#65)J('s^9#m)#:C2n6,:b2qN!!NKZEie3uqYp]QTmoH9nc/eE@u-u/o`###?GHC0rri"j J6+#b!"(8dNkkVn^m9%-$Jkae!?+FUXP!=>s*t~> p&?9,:dRiQ;+sJJ77Tp@7R9XNI?^.gPCmOF6U=777nQm-W8R[Ors%SqV0c$&5kd_Q76a:WOK6%N o`##RFhIYErs/>6UkrVQ5"5-6%n&TQC6,LFr;Y3OSU+-r6hs4O8,c$_7RKF)6:UrF"@b[@6V%,I #tRQV8PilHW7Uh9s*t~> p&?90KR8&lI!pBjIXcluIX6O&U9h>,tKt7-Rrs/DK_6&rQH@GO:%t8hTQa"Hdr;Y]t];(.-IJA p&>ErH=qi&XJCSW3Z/%i!!NihBqQ=nc++~> p&>m+Sq)QgXf7V6AlM>k6q'R65sIOs5=%\,r^R,c>'$+QnG*"g`+W4O>?tTEq-j\>?X?o8:/F]; h>R'I!o:TFoD]-dGZI[B=^59@@JF:A?s[,A;b]l%chNT+Zk**:J=>N84Q/I7K,aa 7n?3E;-IUZQ*o68nc++~> p&?36\<;]AY,n:ZLOX`"I=?WnH?ja[H$XjeJ:N)qGC5^rnG*"cerkT2rdFispOEO!I oD]?\ht-^@p[-\LSodgc)[QQC!!r`=,'c p[\=in&W#L]tq\/bP99lbK%T<]t(MSbkh"V]YVS0qofSoaMbg&ZDs[eN.H4mCL^`L?3t1_J o`#L#hVRl"q=Nq'^o!!1@8ookrC72c8PN2mEJg^a-]",5Vf)54@ !VQ6Yrs8)7\$rr__SjLha:?/*^V%+bZHW1=bdtR+`qmad`PK6tZE0ppQB$cRIsZG o`#O"gthPsq"!Os_5s)aKR\DtI/\QoHjG(FH@LmMam/m"rs/Pe_md4k^r5ud#f49h]",8Wf)54@ !VH0Xrs8,7\$ii[^VRk_`=Bc#^:Un`ZHW1>bdkF&_tq=^_n`ppZ`^7$SX>Y(O,StnM$T'%Q_L_$ fB`8$s*t~> lMhLooB4T8Wf_XNF)u_dRB"'Ojn83E"9&/rrq$0irWE,sqYT:P"o\AsrVlffs8W)urVu`orr`2r rVlQk%0$5'qtTmVnEoQ+kN)O""m,% lMhLmnD_j.Y*t<(KS5/CS#O'HjRr*Drqlcqo`+sj"TA8qq>91O"oS8qrVlfgs8W)urtqZ$Tm qu-Kgs8W'+rVZNdo^_G8kN1a^qqhP:kjJ*>li2J~> li.:jq!Htb]s+5uP5^OIPan\_c/\Kfs8Vrtr;HWfrs&K$rVZQgqr7VZr;6BhrVlHh%0$5(r;6(qt]sWnEfB#j5Abjg]ZTumI^8@s*t~> jo5G\p@.DIl3$DDp\f[Ci;\<~> k5Phgqt0=?kND'pnb k5PhfqXa(9jlPXinFlg3s5 JcE:\J,~> JcE:\J,~> JcE:\J,~> JcE:\J,~> JcE:\J,~> JcE:\J,~> %%EndData showpage %%Trailer end %%EOF ledgersmb/images/logo.eps0000644000000000000000000003611210600665536014450 0ustar rootroot%!PS-Adobe-3.0 EPSF-3.0 %%Creator: GIMP PostScript file plugin V 1.17 by Peter Kirchgessner %%Title: ledger-smb.eps %%CreationDate: Mon Aug 28 22:43:40 2006 %%DocumentData: Clean7Bit %%LanguageLevel: 2 %%Pages: 1 %%BoundingBox: 14 14 219 151 %%EndComments %%BeginProlog % Use own dictionary to avoid conflicts 10 dict begin %%EndProlog %%Page: 1 1 % Translate for offset 14.173228346456694 14.173228346456694 translate % Translate to begin of first scanline 0 135.98300212473441 translate 203.97450318710162 -135.98300212473441 scale % Image geometry 204 136 8 % Transformation matrix [ 204 0 0 136 0 0 ] % Strings to hold RGB-samples per scanline /rstr 204 string def /gstr 204 string def /bstr 204 string def {currentfile /ASCII85Decode filter /RunLengthDecode filter rstr readstring pop} {currentfile /ASCII85Decode filter /RunLengthDecode filter gstr readstring pop} {currentfile /ASCII85Decode filter /RunLengthDecode filter bstr readstring pop} true 3 %%BeginData: 14399 ASCII Bytes colorimage JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> TDnn7r]-JJJ,~> TDnn0r\'c@J,~> TDnn]rc"A,J,~> g&M%3!-ZQc!-\?%S,\!~> g&M%)!,p'\!,qiiS,\!~> g&M%j!1_74!1a%-S,\!~> g&M%3!-ZQc!-\?%S,\!~> g&M%)!,p'\!,qiiS,\!~> g&M%j!1_74!1a%-S,\!~> g&M%3!-ZQc!-\?%S,\!~> g&M%)!,p'\!,qiiS,\!~> g&M%j!1_74!1a%-S,\!~> g&M%3!-ZQc!-\?%S,\!~> g&M%)!,p'\!,qiiS,\!~> g&M%j!1_74!1a%-S,\!~> g&M%3!-ZQc!-\?%S,\!~> g&M%)!,p'\!,qiiS,\!~> g&M%j!1_74!1a%-S,\!~> g&M%3!-ZQc!-\?%S,\!~> g&M%)!,p'\!,qiiS,\!~> g&M%j!1_74!1a%-S,\!~> g&M%3!-ZQc!-\?%S,\!~> g&M%)!,p'\!,qiiS,\!~> g&M%j!1_74!1a%-S,\!~> g&M%3!-[].#3EOqT;B0]nc&dEZ_F\Eq#:9nG5aMqrs&JPZD+SEq g&M%)!,q3'#3<@iR\71Onc&dCYFVc5q#:9nDuME`rs&JMY+;Z5q!J(cjLV(STXa(Nrrr5BWLKO+ iW"E~> g&M%j!1`BT#40[N\\?AUnc&dPaLoOEqYpKpSGmL$rs&J\a1TFDqsFCfm*EGW^ g&M%3!-[f1!rT6*qDeR`^%MC+^/Y"j"@\FEs*"B%p\t9#:]*3U7[3cLG5aMrrrW,%>5C5[?bQ46 r](+)s7V^HrAak.iW"E~> g&M%)!,q<*!rT)sqC_kN](Q((\kN#T"?_S6s)7lip\t8t7f4nB4c]@ g&M%j!1`KW!r^)oqJZInch7;=d"M=9"F73Fs.'(-p\t98JGa?hHF!GJSGmL%rrW/ g&M%3!-[i2!TIDY3<=F#q>UKpM>0(4=R:513Vi[Ur-A&t!b(J>r]0cR!TIDY3<=F#q>^FS!d g&M%)!,q?+!T@&P0*-+gq>UKpKD7)$;!W'!0DYVKr,_Wd!a4l.r\+'H!T@&P0*-+gq>^FI!cR=" q_%qpiW"E~> g&M%j!1`NX!U>R9DulR,q>UKpWq^N7L@Lf5E;BM7rL`k(!fcc@rc%Z4!U>R9DulR,q>^G5!hAb8 qeuP1iW"E~> g&M%3!-[l3!T$EI3UGFrAb-bMjfQ*3B;#$ r]0fS!T$EI3i/_~> g&M%)!,qB,!Sfs>0*XIRN0]<+0`E^+B`.`,!07"2#YK`6Jk7UK?#BQoq>UG@r@\FOKp@?e0/$sV r\+*I!Sfs>0*XIRN0]<+0`E^+B`.`,r\"Rn<\H*rI?Th4JDpNY~> g&M%j!1`QY!U"k0E!CQUYd^csEW0nXQi6d\!3uKA#_T.cWIf).O.6,fq>UGjrGW$rX1#'_E,_/6 rc%]5!U"k0E!CQUYd^csEW0nXQi6d\rbr13Mf g&M%3!-[o4#4thS3C0P:r;QfQ@/`.dTDSWmcoO0I4g"__rri>&4?5V)3VraU^]$4o6+Qpn"1UWW 55mS=rs&*o3B9C&p\b$lggL+A!2',fr](*C3C1%OrVllpiW"E~> g&M%)!,qE-#4tM@0/oX"r;QfO=T0rRRf!*hc7gn)1TCBQrri>"1+tK`0Db\K]DaGa2n&Ya"1:'@ 2?#9*rs&*f0/#8Yp\b$lg0">-!1Ncar\"C/0/p-7rVllpiW"E~> g&M%j!1`TZ#5=Ec?+!E;KS7d/ItbG0Tsb"3bq- FT-7Urs&4ME,^!8q>C6nk)B:Y!4ht+rbr![E-BA&rVllqiW"E~> g&M%3!-[o4"HGK&6.>Z0"nl4^3C<96rr?R.3<6MarrBA&3W&gWr`9"Y!64m8!64psqYp\Y3B9CS q>UWl>rao3nb`@b3<;4cgAc[~> g&M%)!,qE-"Gncb2pqI$"nkqL00&J!rr?:&0*&UWl g&M%j!1`TZ"Kl]_G2N,q"o4$pE-CpPrrA)YDue&WrrC+;E;TY9re:>j!7q#H!7q'eqYp]$E,^!X q>UWoMK!NXp&"dfDujt4gAc[~> g&M%3!-[r5"ReN73McEL!7Lj,!3?(u!8@E4!,qZ4!,VToqu6Z?r]'t,q#:>BrAjcT"ReN73McEL !7Lj,!3?"srAak7g&HR~> g&M%)!,qH."Re3$0;/(>!7:]u!2oeq!8.9(!,)*,!+l*^qu6Z;r@e'J"Re3$0;/(> !7:]u!2o_or@\/'g&HR~> g&M%j!1`W["S?eTE4u#G!8d]o!5e^7!9F,u!13K\!1!M%qu6ZMrbqk2q#:>frG_Z6"S?eTE4u#G !8d]o!5eX5rGVb:g&HR~> g&M%3!-[r5"Ka[E5P4[L"&M!QCkrrA8^3<7D#rrCCD3W&gZXZ8C+o_/:e :cUOZqu?UT!8H3,J,~> g&M%)!,qH."K=%-2Y?_C"%P!tDuK\9Qi8W<^\Ig/^AT_^rrA)Y0*'5krrC:A0DkbPW@on_o_/:e 7kZN6qu?UJ!86'*J,~> g&M%j!1`W["N57uFSGM/"+bE1SGiHf\,L=He+iqCdf".^rrB>'Due\grrCjQE;TY<`,K[;p\+Uh JT,Ruqu?V6!9Mo6J,~> g&M%3!-[r5"*lmeAG,s)D)jUTrVm"?3B94uq#:Bj4T7A g&M%)!,qH."*6+K?1n4"AhPf0rVm"80/#*Vq#:Bi1B&s(rrca`0/rk)rrN'Vr\+0K"*6+K?1n4" AhPf0qu?XK!'f-9J,~> g&M%j!1`W[".sOOO7iMTQ>geqrVm"fE,]jpq#:BlErL%TrreL(E-D6UrrN(@rc%c7".sOOO7iMT Q>geqqu?Y7!.3AuJ,~> g&M%3!-[r5"'7KC3qYQ:3]T2crVlst3B:=;rr?7%3W&gY:,t=CpAY,"r]0lU"'7KC3qYQ:3]T2c qu?XU!+sm`J,~> g&M%)!,qH."&:L&0_I.&0J>(;rVlsk0/$8trr>pq0DkbO75$;spAY+or\+0K"&:L&0_I.&0J>(; qu?XK!++=XJ,~> g&M%j!1`W[",1]5EV4>SEH#l>rVltOE,^[-rr@lSE;TY;IrK@dpAY,Nrc%c7",1]5EV4>SEH#l> qu?Y7!0Pq6J,~> g&M%3!-[r5!(-*6rVlsg3B:pLrr?j63W&gY69.&EpAY,1r]0lU!(-*6qu?XU!-6`lJ,~> g&M%)!,qH.!'0I#rVls]0/$o1rr?R.0DkbO3%lptpAY,)r\+0K!'0I#qu?XK!,L6eJ,~> g&M%j!1`W[!-djMrVltEE,_*9rrA;_E;TY;G&VDepAY,Yrc%c7!-djMqu?Y7!1MR?J,~> g&M%3!-[r5!'BU/rVls]3B;3Trr@->3W&gY4?5ECpAY,6r]0lU!'BU/qu?XU!-[#pJ,~> g&M%)!,qH.!& g&M%j!1`W[!-.FGrVlt?E,_udpAY,]rc%c7!-.FGqu?Y7!1_^AJ,~> g&M%3!-[r5"$S_*E:*Z-76*AEpAY,.r]0lU"%P@3C%hQ,B`:$hrrYGF3H4 g&M%)!,qH."#V_bC$kp&4"i6upAY,&r\+0K"$S@k@eTg%@K%qWrrY,3059bPr\"7if`-I~> g&M%j!1`W["*AL$R-jnUG]7VepAY,Wrc%c7"+"p*PP5"VP5]Ftrr[@^E1#tkrbqk-f`-I~> g&M%3!-[r5"&M!<@I='s;E6aApAY+rr]0lU"'7KC;>1"i;#WKPrrZ(X3FV7Rr]'t%f`-I~> g&M%)!,qH."%P!t=mc4k8M;_qpAY+ir\+0K"&:L&8G<&`8,b1=rrYbE03RW@r\"7if`-I~> g&M%j!1`W["+Y?0NU?`JJoG[cpAY,Krc%c7",1]5JbK*DJc9Wcrr[djE/j2`rbqk-f`-I~> g&M%3!-[r5"E6@]55FXH"E?F^4o4sR!VnkW3W&gVIJu5,n+cn_meo0Crrd:$3Bm9*s8G"YG1chF~> g&M%)!,qH."DKMB2>HV>"DTSC1\phG!VeGL0DkbLG5a,pmeHe^mJS^8rrd$h0/`Oks8FYODqP)?~> g&M%j!1`W["IO.IFSkM+"IO.IF8Pb4!W-p:E;TY8U&K!2oD&=coDNY*rre^.E-2!Ds8Hs;SCmjl~> g&M%3!-[r5!2KNR!5\+'!1a$K!5nU3!5e[pqu6Yrr]'t[q#:>prAjcT!2KNR!5\%%r]'t%f`-I~> g&M%)!,qH.!2'6D!5@n$!13[lr@e'J!2'6D!5@h"r\"7if`-I~> g&M%j!1`W[!58AN!7L<8!4VrH!7^fD!7Umcqu6Z4rbqkTq#:?2rG_Z6!58AN!7L66rbqk-f`-I~> g&M%3!-[r5"mA$.3FD[PrrCaO3<4$nrr?p73W&g[m6*Hi;"jbc!VT=f3W&g[kW:db?i06jr]'t% f`-I~> g&M%)!,qH."m7Tn03A&>rrC[M0*#_]rr?[00DkbQln^:J8+ufZ!VT"]0DkbQk:nVC=8VCbr\"7i f`-I~> g&M%j!1`W["n$DME/XY_rrD-ZDuc:#rrAA`E;TY=noJbhJGK'A!Vq9EE;TY=mW*8cMu;uBrbqk- f`-I~> g&M%3!-[o4!/:D4!JLFFrrCCBrr?R.3<6ScrrBG(3VraUK)Rb2GPh= g&M%)!,qE-!.Xu$!Ik"@rrC:?rr?:&0*&EVrrB>%0Db\KI/Yc"E;TS5!W-g50Db\KJ,V)%If9!? !6k<>r\"7if`-I~> g&M%j!1`TZ!2og8!N,hhrrCjOrrA)YDue,YrrC1=E;KS7V>bE7Sc&Ec!W8JcE;KS7VuCW9VZ$5g !8RGNrbqk-f`-I~> g&M%3!-[o4!V'"c3<WG,U r]0iT!V'"c3< g&M%)!,qE-!UrVY0*,M/qYpZdY$E^XrrpY$0/#/_rVm$"W\Z:br\+-J!UW,N0*tUfmeuR`<%g72 r\+-J!UrVY0*,M/qYpZdY$E^Ws8FYODqP)?~> g&M%j!1`TZ!VM!BDul-[qYpZia,b3:rrq4uE,]m;rVm$"`H-!>rc%`6!V:[;E!_BHoD\@,M/[Zq rc%`6!VM!BDul-[qYpZia,b39s8Hs;SCmjl~> g&M%3!'9a6!1 g&M%)!&4%"!0dE^!S]p=0*b4!OI2&Q;_e8)qYpPUr@\FLKU%0^0/$OHr\+*I!R!Fr0*JY#0/#'U rrLk?r@\CMI#s_UGZ-?r0Db_J0*#qCs*t~> g&M%j!-.XO!4;b*!Tne.E!M)nZad<8M/iN6qYpQ#rGW$pWj\p[E,^i,rc%]5!S_elE!4@SE,]jn rrM80rGW!qV6d\;U5 g&LP%!1!N_!Tdnb3<28>rrN+Tpc/CWlZW7fq#:BB<;JTZ6b`S=3B9S(rrM4moJln8qZ$OT!-[#p J,~> g&LOp!0I0Z!T[PY0*!j*rrN+Npb)\Dl>QYTq#:B@9_pCH3kG?(0/#K`rrM1doIg2$qZ$OJ!,pNi J,~> g&LP\!42Y(!UPp?DuatUrrN+upi$:gn=9Jsq#:BOK_fWlGL6AVE,^-urrMJJoPaeOqZ$P6!1_^A J,~> g&LP%!1!K^"9,oG48Lr>5]3[nq#:B.;uAWY7#gg8Gjs'RiI;YU1nrjui* qDeXCDQNC)s8G"YG1chF~> g&LOp!0I-Y"9,f=1&b13\s&^p-8b`5erjZAk qC_q/AuP4qs8FYODqP)?~> g&LP\!42V'"9-T/EVaVVFdBrSGmL%rsnqGQ[a()O1b&`s,:o9K(o9Irm$[H qJZOZQG`Cls8Hs;SCmjl~> ^]+T.a/tu+Wk7!]oD]!EZD"JApu_SZq`d)$DY3r7n&MQ&T;oNWqTAhg~> ^]+T.`2T5qV7>1RoD]!CY+2Q1pu_SZq_g)\B(Z*/n&22pS#*XIq9&_f~> ^]+T3f>P83_9V-=oD]!Qa1K=AqW@e\r,cmsQLt1_o[h$m]"u\Qqo\qh~> L]7@kr]'tE[/YX~> L]7@hr\"86[/YX~> L]7A'rbqkD[/YX~> M#RMQ@K&7ed'Wh'~> M#RMQ=oL&ScF!V%~> M#RMRNW*ksh6d34~> P5bO'q>UKlJ,VG.>-n6Z~> P5bO$q>UKkGlB>r;7$:Q~> P5bO6q>UKmUAf*3LpR,3~> P5bhKAus\Yrq>3J;uScX3m4l0J,~> P5bhA?DuKJrq>-C9E$RF0Z^U#J,~> P5bi-Oi-8TrqY`nKDofjES7\uJ,~> P5k/7!2-XtJ,~> P5k/-!1U:oJ,~> P5k/n!5#Q:J,~> P5bMIpGi7J\?Z'a~> P5bM?pFcP7[B]a^~> P5bN)pM^.]bd%1u~> P5bp`]SgAr5W_G:J$f!Ts*t~> P5bp_\V4?X2DI?iGd-tIs*t~> P5bpbc`<1XF`Me^U<389s*t~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> OoPI\rVZlus8W)sYlB4~> P5bpgY#-&>$o)tOpno.:s*t~> P5bpgY#-&>$o)tOpno.:s*t~> P5bU_rVc]orVZ`qqu6_R;&]BF!3c%p!W,4^&HWtMq#13oLJA]_!!NB5/Ru PQ(pV7fa*:Uof7orW*!qqu6`5Ukeo#!7g`A!WAPeJc^b(qu-NrLJA]_!!NB5/Ru PQ(pV7fa*:Uof7orW*!qqu6_W=XF"d!4)7s!W,Og*!.Nkpsf=o~> PQ(^`rVcWn"9/8trqZQpj;@k.!1*9W!0I-k!E/UdrrMd4rW!6Z\BV^@(]XOtj6?So~> PlCma63/+`rVm#p;um#Qq>UKcL&QZ(aRoK4`VkAhV#'oe!VIH3!!tBic+SfJ!!#+@l2Q8~> PlCma63/+`rVm#p;um#Qq>UKW,5rP^Re6U[Q2M['>4p>DJ,~> PlCjbrVc`ls8W#trqZQpq\fAF!.4D=!SJ=g&HL2Prr>7^!!'5$rrq[3!!">9lMlA~> PlCi\!rIP%3p\t4WrVur%rVm&d+ohTho'67*~> PlCi\!YgcdJn^~> PlCgarVcQl!WN&mrrC"9&HH85rrW*d)#b*J0)kVF" PlChS! PlChS! PlLa]q>UKprV6BrIM"1E&P)Qp!g4..rXf-Lp\t6[rVupSqu6ZXrVupLlMlA~> PlCh!! PlCh!! PlLa]q>^Koq#:L\1h%%//bf8Ig)+(=rXf.8p\t5mrVuq?qu6ZorVup'lMlA~> PlCgf! PlCgf! PlLa]!<2fo!<2fo#O)h@Hk?r*r;$?ur'hgm2\?W7me?_]A,ZH.[ep()oDS^i"mZ,<~> PlCh%!U]kK!i1AJqX.!rri=mMY!/5JcPN=rr?R.!!'J)rrDZi!!!2fs*t~> PlCh%!U]b*-m,U*$G1Trs8Nu.d95=*$+Lps*t~> PlCa_rquirnc&]h&[@Z$&HM%jrr\MuVWRji!(-G["o]MB!!DfhrrC7A!!"P7s*t~> PlC_grW*"lnc&^=K%A$BJcPE PlC_grW*"lnc&]l*4247*!#7!rr\]0Wos@$!)(Z PQ1U[!<2Qh"(`,4Z2P=8cMIPDg_a#iVZ%/-K_PKHfDYaM3;WXTHN!mEJa38c~> PlCp;"p"`.[IX>"Y(HAurdk.3qYp]bL8Fpsrdk-ap\t6FrVupXqYpPArVuqLlMlA~> PlCp;"p"`.[IX>"C`VrNrYtpbqYp]S,@(5JrYtopci8L~> PQ(X^rVZ`qo`#'m,s_LRrXf.:qu6it80$[iBDrJC`:s93Oo>=\HMd^Gi=,be-hHX'J,~> PQ(WHrW*$*]Cc++rf!?HjSj`2fDGROrh##9s0)ER!9!VO!0R6\!.+PB"lTmj!%7C's*t~> PQ(WHrW*$*]Cc++r@^bBc2J[_\,61/r)"j&s).fU!6 P5bO]rVcBg"O@[0s5j4l!1E`a$'l0ps8FAX&KCQ?rr>^k!!'Y/rrq7/!!"t?l2Q8~> PQ([_DZ0Y;$GuK9"Qk^k!!'Y/rrq7/!!"t?l2Q8~> PQ([_DZ0Y;$GuK9"O\9Ds5s;#!1s)f$(Dp/s8F_m*%(O.s*t~> OoGF\rVcEh#`TG1s8*HA&V'`Y"l'tirVtIJ&HGl+rt"l4!!!2qs8D)jCC'tuT)7aOJ,~> P5bR]?iC',%aXkK#fD8Ms8@S%K"V$]"mq& P5bR]?iC',%aXkK#a-1Ds8*iW*/4=j"l:M)rVtOL)us OT,=[rVcHi#YQ!-s8OM[&S:q@#5q.3hZ*VArXf-rp\t6-rW!$%((UNH!!+Utjo9i~> OoGIY9`>%n)Wg_n#bZnJs8S.3K!,(P#6(9Mmf3=.rdk-kp\t6-rW!$%((UNH!!+Utjo9i~> OoGIY9`>%n)Wg_n#ZDo?s8Okp*,PTR#5qFFi;`hGrYtp-cMrC~> O8o.Vq#:Ed'i"]-"%*Y49E"klQk>Y`rr?+!&HLGWrr@ OT,@S4T5?^5lLNY!r.GBrr3(jJqBZorrU;oaSu2>VZ)/IlM(;YGl@[MVY]lB^j$(a&!-_Qs*t~> OT,@S4T5?^5lLNY!qRO7rr3'o*#qoUrrS`2Rf< NrT(V!<2fo!jrVurr3(,&J6bsrsR[%7K!2cq&9nX.K9)A!&FNR!9a:["iLTF!+u5os*t~> O8f7L/cGbNVYU5nfRh!>rr]9QJs636$LW\?rr<#rLOt,=pAY+JrVur]r;Qr="onX8rojB4~> O8f7L/cGbNVYU5n\K$b2rrZgP*'4*!$fE=+r;Zfn-6+!]rm(Oo~> NW9"V!<2fo!cnsrrr3:L&J5iYs8>V-g&D!O`VpGLCA7`.lM^b`/,K8GFT)7?Wp'J5~> NrK7=&-2euq>UN(K&ck1$+PS=L&_2PTnVh3rrD$WJcN(MrrD?`!!"PGrr@0?!!'%_s*t~> NrK7=&-2euq>UMA*6eE^$%)ut!'s*t~> Qi@'bq#:?nrr)Zm!\k_mrr2t]rXf;!s-jU\rVlkPrXf.1p\t5jrVuq R/[3JV"jrlMZEhhq>UM[M#I>Q!65"i"SMf R/[3JV"jrlMZEhhq>ULW./X#D!13[)"RQ/]*0^@$!/pgr!3XTHJ,~> R/d3cp](6kqYpWR&R#)4!3H/3"OZ-H5Pk?Y!(Hl!!:'=Y!+>d+!4r%,!;QNn!"J/lJ,~> R/[2mBDDK/i;ir_qYpWbJuJYJ!7Uq!"R#6/Rf33b!1j+@!;-$c!+>d+!4r%,!;QNn!"J/lJ,~> R/[2mBDDK/i;ir_qYpWT*+AgG!3lGB"Ol?W8GiAc!)EM5!:.o0J,~> R/d3cp](6kqYpVe&X`Os!65!M"1:l=df'1KnIlKH4SSjZrYbb:$MXDs!;HHm!!DHbJ,~> R/[2F;>C.nq>gU8qYpW?K$!uk!9*p/"5'?$kPbD`pk+0MRJ6^brYbb:$MXDs!;HHm!!DHbJ,~> R/[2F;>C.nq>gU8qYpVj*1d'.!6P3["1_GTeG]CMnfAbj7Ekd^~> R/[3drV-?lr;cinrrQ@9fDY^Lhu42h64ntMrrBG*&HI7RrrCOI!!#XerrC^N!!")(s*t~> R/[4u)#a:1"69I`:\t(mW.O=5rrDKdJc_En^\n*3f`$I&]D)=*e,B=I9)8Jef_tjN*pEWS~> R/[4u)#a:1"69I`:\t(m@3!u!rrD$W*!/_PMu R/d3b!<2fo"9/8trql]tp_tU[rVllmr=K&jq#(-lFoDsQ^A%X-NW&nXO88eUPl:X_@Hd`A~> R/[4N!O;J#".]GnU\k&mqhL40rrDrpJcV59r;Qc*rdk.+p\t5QrVuqZq>UGZrVuq,kl6/~> R/[4N!O;J#".]GnU\k&npa.`prVllmr>Yi)q>C6mHi=ub_9Dq0~> R/d0aq>^HmqYpW.&S:k>"=4Wl'@$FS">g]&)#!_(!(["g!71NA"o0GE!!1C/s*t~> R/[7'!@%"0rrhm R/[7'!@%"0rrhm R/d-`qu6`srVcQl!bW+9qu6a_&J9HgrrD$W&HGArrrr'$!!!E)qu6]rCAn25HKY RK!9RrW*$Uh>R?Vl9YL_fD>LKYCb!qrr\^AK"Lp[!:To=!2'#c"n`-$!"8`%rrN+6rVuqEkPp&~> RK!9RrW*$Uh>R?Vl9YL_fD>LKDB,DJrrYe3*/".g!9=%u!)^r>J,~> R/[UQ[(_OLZrrZC91\U_G!/1=`!,)'+!2oer!>PJ0rrM=arVut>rTF32~> RK!`8#[9Rt#[*4RB+G"leb]:JnqD\Oqu6bsJs?-/rrBe4JcN"KrrAtr!!*f3r;Qf] RK!`8#[9Rt#[*4RB+G"leb]:JkTV"_qu6b,*'Erlrr@oT)usm"s*t~> RK*UTk<"T_'qu6_=&]XbK!r]29rXf0$qYC-li[+O'$ RK!\eMuWhBP!fi`(eUCrqYp]pV1O<;qu6`*K&QY-!rgZ%rdk0BrV?Hoi[+O'$ RK!\eMuWhBP!fi`(eUCrqYp]l>T=`Jqu6_C*6J-Y!r]>GrYtr8qoo(j~> LAq:4-N+MX6=p)orrJ+%rVlrs=Xj4[![LR4rVlra3X#3X"U#W'F2@k:s*t~> LAq:kNW"G1S?DkjrrL$GrVlruW/ph-!fWktrVlra3X#3X"U#W'F2@k:s*t~> LAq::0`;sm95OP*rrJ:0rVlrs@5Id#!\RQKcMrC~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> JcE.XJ,~> %%EndData showpage %%Trailer end %%EOF ledgersmb/images/ledgersmb.gif0000644000000000000000000000172410600666341015426 0ustar rootrootGIF89a9/p!Created with The GIMP! ,H0I8ͻ`(dihlp,tmx|pH,Ȥrl:ШtJZجvzxL.zn|N~l=<:8 6 42P ɽ̉´ƿӥڠ޾TΡ !<ع㷰 ƒ:!ڶ]F.ĉ}̄\Ɋ< R-UeK#4XѥȞ<eVMl'n94hћ7$%GB4Ӫ&D+YJyk[ڰkF(M۵WnUwؾj˄~rbB.seV:{f6z1>ЯEiR w*x.É#?1rc-݇سkνËO+ҫ_ < `.z ~!A X\z@~P( `H߅o8!+*`¨I x؀8 X |x`~.Bc'nH##7E>pSBdPڷbZd_reMv@QJU8fexi a\Iu"yffY_F`vn獋2jbm>$hTI@zJxN(lJjChbZh"J륃Yl:,::,,zyP뀷jk^j-[j)J;-ʶ[m>:c{.kb Ckg'"?lgw ,$l(,o$;ledgersmb/images/logo_small.png0000644000000000000000000001455311733650474015645 0ustar rootrootPNG  IHDRd2%WgAMAOX2tEXtSoftwareAdobe ImageReadyqe<IDATxb? @'ϟ^qㆸ`p@ѣGvzlooow-z <]jݻ\66H++_RMLLLƃ! @iTn:ތO> Xx1 UU+W ˗/I`4;vIAR)q@.g-?H H,`) HRRFZ3`5xi !D&0cM" S1Cqq!& sJ/1FJZK) {_kB8PJG2K)1r2@UtsF||ji=:1 E`2g  Sr ;X{"m6Vo03x50GZk?a{J)\sBsu],"]B2uA ۶Yki~ޔ%QcB@9xy}Z11q:wP@hWJn26(pB *Ѓ(D-40CGftۻ5f1.JD!sɽwc{R=:gB`)%BRZAZk}Dy~B\kQ9eZhJ)6b5ƈ18(stsSJv @iٛ@xn 8X2@J/dQ)|de`J"BVH>H9sΉɪZ8s<Ƹp/ꉐA$nP RIB2ߟM ga]&VaFp KUُ|RJzzh!-ZS#{{P}eB'nZ Kt;zΉY!^(\t'el0 GAKGN&J(l7,`䜹 ~sjE:Z+\C,C(FLq箵qR"".˔tJ @u\$cff*ISv @y@A0, (K'z@H|aX8K{ 9k-1Cs 5,#RkJJe)! ^i ^Jc{37ʐ~'et@ }t !t{(q?g)Ә`q=ݨ>|5a=ݪ'S󣉊#`jsf`jf&mCj齙UA_ Z#jgxc\cMA!-i'ibLrT, ZUcdfK*12&x#F  6CgMIER;H  ٳ .<<"f5Ȥ~WQ*c mJ/3DKb,-f\R" e<Gn%źbe¹k-,+揟Gh$HA)t@ĔA/$'IwD c`lkwuT`]r'x)8ۜSJ1P[{&>s"SisFVZFad1F'}! SU3a~u?GΆ?~qD9̛;cv`Ky XATV[Y.YP9s'(hEKK30@r:+LD\6ctirraa,kFf TY2OwwUeƆwo߀_pSDz  |5.8Ik31pK3H30p˫jh:ں:9"]]]*OGƧ;|×|$2CXBR...PˁX`9_miiCtځGA^:{νJ`WՄZ/v7?}wsWRib/?x,b59_?ۯ |; ?P.~|T)*9߾xy~}A:/\:1,`R 5;ȯ?b  .(WVY~W]{'&`$qr:?Yf/#L @I YkH{zqqυ=ݶ&,:6:b3'S_|+V1 3qs:emmIfw l,Dϯ*?o8޺u#jiݻk^ϝ׏ -%xƙKh( 0O{.=|O? U$*­ @a >ط,2LeyelVn]u-V 89UHM^2s j?#)@w>`QmaapnaW (ރ|B`{ol<,Wd+CVЅ;EskNxԖʆ=ڰgݱ732xIZXa<'eS&ÿ334M믚+_gYF—.]Zzӆw$@- &6yzzBq`#tvF 4@ gՉ@Bwo?7lSc`.aX7c6bd{⳯wj KMaǝnd۰Xtb`ea3Jg)QIYެl&!\ ?~F~v4З_ Gz/fj!Tm'zamtA>. 1߯>dKDp55'+9Xjy()0tկ9OLeX_Ӿ/6֖X_?Gٟ !'$mm5'|xXn[fKrN /&8PѭtCeI?b۷0z` r2]zտib 6g~/+l0[k(IܣOK\ \E6'(3wԝ`ca_>c6 Rgc颣͋v}N73ǯ~Yct~ga kzo+Vzڠ>)h5HDRA՛w~;btwMYQf`;? ^|bH jPWWKDDS@aS=B-~g=-g:{2\sE%#)P_}%}ӺŒn6 IEJ 0M!E0qө_223ejŋ@X Xp{ٳ06 钅73vJ]w]e2x?A\j:Y{Wд\|jߙk*r{^vYa^p3ћ/?l5&l<Ѹh(0p2|˳sqj@aoF1117%[K6.>x Pf&Q6p6o˙{/z+XX/? r"vż/?0o|@aBO4^{*i.P}Y|y`J ?z潴qP Ҽzݱt_2Zſ'ϵ%'.ngo'("0R ֤:D:8yuա/>48~7i w/* Y|zZ/?`Е&s\-և%|87f|,ʃr?{/&4dy8ZO}݇00V!aQc*28V^3w˿?J`k= Q yAWPuɶ Wn`[[.b g_5a)= V;s,LJԲ#ݗ}BV(L`ڑJ`"}ɻwoh0{Z V^UWuaNюzB?w6p P1n?}m2Ą1#˵ƅ% ɆxY~#qgqG_+#|\L,7=y'#Oӷ2'E 'J@%,nYX6Z`o?hLL0FKuPoo 19y<*`Cz,7^~}gOPjefoOKw6QDIXr"|.#S#s  htv_' 4VfhƁ;, c|kp?y Jq4<~f ?9 0Y4DA#-;Wu,zsM_a`̜ŋ2ן処?r3˲\YoPVZ_[{ uFHja0U>}yދ*kovo|7+=O-]h'n<=yCW.]}* s'Yjʩʈhˉ13DՌ']9^pc`3p  UIJJ 8[hYk131w{9L%#Al?p*H ;@ۿ|u^ SIn>VV5@a k_;{VUF__7ן~733 rX( YX #%У'OX9 J&& !GQԾ/> #-LN\fۡ߾qr322!i ĎfJJ˶ +8O%d_|ӷ_ ".#ĥ#+h΅c oW^o.6f)1ai q6.\{wU$NFfs_Xb'&1DOtll ,:15 Qm<ΠIENDB`ledgersmb/images/ledgersmb.png0000644000000000000000000016561110600666341015453 0ustar rootrootPNG  IHDRdL\ pHYs  tIME,׫ IDATx~     .&$!                    eYWm_H   } $)      $&#(*%*       >8)   %~|Ο .2,g\W ka^&&& ⴴ ONAdYPȣ  {n   0}x^ Ʃ  휧" \N2  #2& 4+ !# 74(& PM;$)+h_bD:) 28RV8.<0{) ,   :. '4+$&*ۇFG       ד|&(lln ..-}qRm{^ `UYP?)𑎏  qvw,* ZY]  ĽҒ  }yw .*)rN^_ʊ*%篻\L3      !#R\]G=9            𛍆'      oaK쒢ƙ ,)&A=;<9)    ت       ߆|u      ʽEH;9p~:6'    ]\aן@=7NJH% Θ*-1367'&(       0/!-38"&&  񵶸½ffg89M 'ᙘ9rts쁉  #'(󖘜MHDkbR  }!&NOT:;=鮰      ]^\ \8VZP 012Z^M  ؃wt_tvwjtz   0/-;=@`[]ڰ}xLC,   JMPILN     $'* *()222VL*  ǚ2_U.}~=>Affg    e`B`cd    ?;8xxհirw53tql5+~JNS@CH񪬰 6.)n `f{ɡ& lljSCᑙ$!{ Ԣljh {)'ϲ  JFE,**ᦣ'$b\ZIE.  ㉍ djn"    ! 笯Û   )#      /    SWX󯯰 30% ~ !#'Y\^橫    !        !   nohȝ 3.*k  ox~ 8;=UW[     LJI B;6h  es} HJK6:=     SON)%# F?9f   mtzhgl    URQ620fa]  =82t]   NNR E IDAT ࣧwru춹eZB ^k036TVW  $ KHDxrn yD9#!wuu  TPN  &   `ae NMG >85=86  #!"//1%&)459 rxVVV   ZM+ F@9 #"%u{v70   8;;" " !&, *,)##      eUP!  .&?2     msutpk  @?B   ]SITUP&  *@࣫      **$," 72/ BNS $   GA=&    #'   &&$CIK螰dP2 WX[   6/%fc\0' )# +DI+Ί#     +(' TPNz!  IEC  @=8G: ය!#!    LLN横YN2"$%>@B  zqdn2%      aV2 ˿     $"FA'          >95'%!       L@ bSF=        ;;=SVV  󙑄D:.      &z& ɾ    $ RJE WOJ.*&        zYpbV   9:= ;:?"!# hdZ6*   .    [UG  ' 9/-*&    L@6  <<= /01    VPHWL:  "⑂sbx    79- D>6"  eeY       ]XR+/2  +**CDA/," 79= !  b]T 喩% <81FA:-"  ! '#!!!!      LD? KF5     sjQ%%%:7:  JFE  gc[   !!$&hb\UM8  kjhep|   20,  A<(,&"HMT  aXQ  '&"      z  &!!  lhdflp  0Y IDAT (''UH0%'(    651{.6="*/ -*)φaZB   C@;!  MJH3.*UNHC;- # :40"&% %%%   2';BK$%' &,94 Ѐ"#642   LHE#&+   6/-&,,,    .9@,""~5+ C@=?    &"))' !!>:7  TMG  ($#     /)% "$#  ;;; 'gyj^㝔     %&#OLJ     4-".*)    C@= &)(      9;=zlV  WJ;VJ;͓"38<9=@   70:3.8:<  jXK  *$#   !!槤jea       eee0+'PA/F>3A>3򑚡456666('  !! .+" YTPit|ǽNJIC0'  /('   𪨦40-nvqC=0 󵻽okk    PPD% ,!  m642QNLF@?ٸ$l@93$"![WT   [Y IDATEA> 魱5*'A  " +3,2-U%!)%   #:>>   iZ  ^^^krx)     |kPvkPʠvp???TTT ݺdhk CA?UQN zsnиyqn   7624  ͍                       \el    [J6|yyy#($  <:8 PNM  '.(+"@1 '!     W]k%%%                      -26u IC5876""     MJG   YRM  %        oinr o[VR  !!! >A@ VRO  MF="$('')2,)   31(kgepj~    !~~~_]^kig|} rfQwol #!"FFF&((/+'''PLH   QRU.//     YN:~z؍ [VH`YTiiiy}   \P>spo %%%SSS ^^^ TKE"66+!""     J>,    $    jcUc^UӼÑLJIIGE&%   c\Lē~} )&(B>% <~i<<4dd[ JB=$  ptw  /23u   ><:1.% >8)pjk%%%%%&   &&&       A>-{{jMRV`mw  {{} 236 SWZ HJL OFA<=9%%%/10   %),"+2 +4"-5*2' `hn`gs    kib缼    &&& :   ngQYYQ"    FDC.0/     [9>YW>nh` YYT1-"$$$)  IGA B8!% de\^VQ kmlRUY@>?   h[B|pi<4-^ZW  MKH 541 MHB  HHHTOM M>3!! *  Y_c>??$( ,#&"         */3  "'#|xtWVU    ''%HD@ KIH:40$!)#   !     XYJ?AB ,% 1+                ec`   +++ (! 5.#666 D8F=6  MHD *+(***            cb^    730  :/&   !     ~~~$%%)&%  ]][ d_[[RK MG9!--- ,'&"!  /+(  LB: Wr IDAT [ivgm{ '%,,,  )(& .,!"MH9;500$ OLJ "%$"/.+% ;0'    ꌎHISLNP +++-)&" ^_a  YQMUNI NJG !!!  GC@  KE? 2㟤%(-//,¹F?0    YYY#  JH1*j\J aXQ 𵳲VQM /-+ &"!C   #+ =96QKD _acҌPE,$51,   &$"   PPP $ WPJ ! 9=> 862% HC>   ࠧ|G@2  E>8   # 1-FC? C>:#*''0/-  :;; *('     (+- jeFVQK@CD  (((  4/(-+)  ^\Z .-*NLJ  URN    ! QSR422e\U- YMC&    +/*  [WU   DB@ #!'&$/+)YUR <8/$#        oozb`a ,,*   57<,'!NF=naR !)   %$! GE&#{yszsHJLig\ 󑐏 KKJ *($% \\\noq/' JA$"&) %$"xvu "#oki<<<  񝛞     JECNE@ hYKζ'-2#(KG<  JE8 &')nprXXP#    )) "-h  WWW #$%&///Ϭ  C?;       44461    #)%)*c_\   pjd4t_D>0  PLJDB5 si^UQO ?=;%%%# ַZ\k  (%$  OPT$ UQI    5&,,," +*'   Ε  DMV ~uo   .$vmgOA(  QOHǒ%, "53$#   c]@100CBE >;1&A .)#%   &$     吏MNM1-  behHDB[Q.  G.!`C s+; mpo x~|  jyӕ*(%630    "XUQ ȼ~kW      %       ehs128sqh;DIKE>>BBB10.* jjjIC-È   XSJo`N Q`r(+2~u\LL`\XXa\H hh    轥 ek| +('===652 ⲽ/CFԹ C>:oid& n{ *eee MD9( ݣ1+/ '''WUV?:# [U9 ΃    1'%@'    "    ߿ 49>C=9j  p{!&;:7FA<;3-62#     =9,    gkpKHI m    !&+֪nhdXK/   І .+'JEA%& !   }0.   ߷  3*&~t  { ///1**  LJI     pl0$  ܪ#!, ,/.PPPH?'      621B@A00 ݸ    <765./71&   #$!   ԣ IDATx(IENDB`ledgersmb/images/ledgersmb_small.png0000644000000000000000000016561111733651137016650 0ustar rootrootPNG  IHDRdL\ pHYs  tIME,׫ IDATx~     .&$!                    eYWm_H   } $)      $&#(*%*       >8)   %~|Ο .2,g\W ka^&&& ⴴ ONAdYPȣ  {n   0}x^ Ʃ  휧" \N2  #2& 4+ !# 74(& PM;$)+h_bD:) 28RV8.<0{) ,   :. '4+$&*ۇFG       ד|&(lln ..-}qRm{^ `UYP?)𑎏  qvw,* ZY]  ĽҒ  }yw .*)rN^_ʊ*%篻\L3      !#R\]G=9            𛍆'      oaK쒢ƙ ,)&A=;<9)    ت       ߆|u      ʽEH;9p~:6'    ]\aן@=7NJH% Θ*-1367'&(       0/!-38"&&  񵶸½ffg89M 'ᙘ9rts쁉  #'(󖘜MHDkbR  }!&NOT:;=鮰      ]^\ \8VZP 012Z^M  ؃wt_tvwjtz   0/-;=@`[]ڰ}xLC,   JMPILN     $'* *()222VL*  ǚ2_U.}~=>Affg    e`B`cd    ?;8xxհirw53tql5+~JNS@CH񪬰 6.)n `f{ɡ& lljSCᑙ$!{ Ԣljh {)'ϲ  JFE,**ᦣ'$b\ZIE.  ㉍ djn"    ! 笯Û   )#      /    SWX󯯰 30% ~ !#'Y\^橫    !        !   nohȝ 3.*k  ox~ 8;=UW[     LJI B;6h  es} HJK6:=     SON)%# F?9f   mtzhgl    URQ620fa]  =82t]   NNR E IDAT ࣧwru춹eZB ^k036TVW  $ KHDxrn yD9#!wuu  TPN  &   `ae NMG >85=86  #!"//1%&)459 rxVVV   ZM+ F@9 #"%u{v70   8;;" " !&, *,)##      eUP!  .&?2     msutpk  @?B   ]SITUP&  *@࣫      **$," 72/ BNS $   GA=&    #'   &&$CIK螰dP2 WX[   6/%fc\0' )# +DI+Ί#     +(' TPNz!  IEC  @=8G: ය!#!    LLN横YN2"$%>@B  zqdn2%      aV2 ˿     $"FA'          >95'%!       L@ bSF=        ;;=SVV  󙑄D:.      &z& ɾ    $ RJE WOJ.*&        zYpbV   9:= ;:?"!# hdZ6*   .    [UG  ' 9/-*&    L@6  <<= /01    VPHWL:  "⑂sbx    79- D>6"  eeY       ]XR+/2  +**CDA/," 79= !  b]T 喩% <81FA:-"  ! '#!!!!      LD? KF5     sjQ%%%:7:  JFE  gc[   !!$&hb\UM8  kjhep|   20,  A<(,&"HMT  aXQ  '&"      z  &!!  lhdflp  0Y IDAT (''UH0%'(    651{.6="*/ -*)φaZB   C@;!  MJH3.*UNHC;- # :40"&% %%%   2';BK$%' &,94 Ѐ"#642   LHE#&+   6/-&,,,    .9@,""~5+ C@=?    &"))' !!>:7  TMG  ($#     /)% "$#  ;;; 'gyj^㝔     %&#OLJ     4-".*)    C@= &)(      9;=zlV  WJ;VJ;͓"38<9=@   70:3.8:<  jXK  *$#   !!槤jea       eee0+'PA/F>3A>3򑚡456666('  !! .+" YTPit|ǽNJIC0'  /('   𪨦40-nvqC=0 󵻽okk    PPD% ,!  m642QNLF@?ٸ$l@93$"![WT   [Y IDATEA> 魱5*'A  " +3,2-U%!)%   #:>>   iZ  ^^^krx)     |kPvkPʠvp???TTT ݺdhk CA?UQN zsnиyqn   7624  ͍                       \el    [J6|yyy#($  <:8 PNM  '.(+"@1 '!     W]k%%%                      -26u IC5876""     MJG   YRM  %        oinr o[VR  !!! >A@ VRO  MF="$('')2,)   31(kgepj~    !~~~_]^kig|} rfQwol #!"FFF&((/+'''PLH   QRU.//     YN:~z؍ [VH`YTiiiy}   \P>spo %%%SSS ^^^ TKE"66+!""     J>,    $    jcUc^UӼÑLJIIGE&%   c\Lē~} )&(B>% <~i<<4dd[ JB=$  ptw  /23u   ><:1.% >8)pjk%%%%%&   &&&       A>-{{jMRV`mw  {{} 236 SWZ HJL OFA<=9%%%/10   %),"+2 +4"-5*2' `hn`gs    kib缼    &&& :   ngQYYQ"    FDC.0/     [9>YW>nh` YYT1-"$$$)  IGA B8!% de\^VQ kmlRUY@>?   h[B|pi<4-^ZW  MKH 541 MHB  HHHTOM M>3!! *  Y_c>??$( ,#&"         */3  "'#|xtWVU    ''%HD@ KIH:40$!)#   !     XYJ?AB ,% 1+                ec`   +++ (! 5.#666 D8F=6  MHD *+(***            cb^    730  :/&   !     ~~~$%%)&%  ]][ d_[[RK MG9!--- ,'&"!  /+(  LB: Wr IDAT [ivgm{ '%,,,  )(& .,!"MH9;500$ OLJ "%$"/.+% ;0'    ꌎHISLNP +++-)&" ^_a  YQMUNI NJG !!!  GC@  KE? 2㟤%(-//,¹F?0    YYY#  JH1*j\J aXQ 𵳲VQM /-+ &"!C   #+ =96QKD _acҌPE,$51,   &$"   PPP $ WPJ ! 9=> 862% HC>   ࠧ|G@2  E>8   # 1-FC? C>:#*''0/-  :;; *('     (+- jeFVQK@CD  (((  4/(-+)  ^\Z .-*NLJ  URN    ! QSR422e\U- YMC&    +/*  [WU   DB@ #!'&$/+)YUR <8/$#        oozb`a ,,*   57<,'!NF=naR !)   %$! GE&#{yszsHJLig\ 󑐏 KKJ *($% \\\noq/' JA$"&) %$"xvu "#oki<<<  񝛞     JECNE@ hYKζ'-2#(KG<  JE8 &')nprXXP#    )) "-h  WWW #$%&///Ϭ  C?;       44461    #)%)*c_\   pjd4t_D>0  PLJDB5 si^UQO ?=;%%%# ַZ\k  (%$  OPT$ UQI    5&,,," +*'   Ε  DMV ~uo   .$vmgOA(  QOHǒ%, "53$#   c]@100CBE >;1&A .)#%   &$     吏MNM1-  behHDB[Q.  G.!`C s+; mpo x~|  jyӕ*(%630    "XUQ ȼ~kW      %       ehs128sqh;DIKE>>BBB10.* jjjIC-È   XSJo`N Q`r(+2~u\LL`\XXa\H hh    轥 ek| +('===652 ⲽ/CFԹ C>:oid& n{ *eee MD9( ݣ1+/ '''WUV?:# [U9 ΃    1'%@'    "    ߿ 49>C=9j  p{!&;:7FA<;3-62#     =9,    gkpKHI m    !&+֪nhdXK/   І .+'JEA%& !   }0.   ߷  3*&~t  { ///1**  LJI     pl0$  ܪ#!, ,/.PPPH?'      621B@A00 ݸ    <765./71&   #$!   ԣ IDATx(IENDB`ledgersmb/images/logo.png0000644000000000000000000003707010600665536014451 0ustar rootrootPNG  IHDRdL\gAMAOX2tEXtSoftwareAdobe ImageReadyqe<=IDATxb?( Ðq4@۷o> _~moobff  Ayݹsݻ?~ϟ?!R.\MR@MXSNݸq_醃S߿R,`PWWgjj d ΐÕ+W OU@ ++ $GmcӧOׯ_?qT && Dxxx={{QQR+VU-%%%)SQQMX h͛7 'OD311*aeeUTTVzzzyCAAA\\|41!y """VVV KII IlllC% {{r` ((8@1ͦ/^Ւ:::C(UA?/_BA..Ą N ~x" I-A#G=,z%$$hbBD@nSm\v Xh@+єN k߾}Fn`(`]ZZXn$4@tJX*UUU`1hׯ_/Yaax[MIh 葰޽{ˁ1F *իo޼{X&#L@HXǏftЭ_d  KP6mB1=B@,tm۶v$/_vΟ?[r200PXXxs5ݮ]<굳[n޽ XPȋ/:t;w2% =܌ɞt6-7n#X>>>---j' @pͷoף-8o<`988dggS#@@Q4Di 7ђ/ae-5Wվ !dNE?@x~+޶kkmW\6e!`&pOYI]UI3 ǯ8w]p0Y%P#*WJo!mu7$uBRRJ!D-{&_5MS۶MsZ뜻Y Ƙx7< U 0|WnV&X,-Mfr w\ ;wxE$IS}E,_k̔#taYdG`9˲&s#Jύp[u·%Zi"jpP==68}߫rJS1 {&kf]WTr< Ram 4MLwJ6ǁh,n`'4tIawM\*/#μNu]>zɬG*D#1b!/wI1}GwaRma0Dh i= s4{c 0u2I)6Xη}'e 8{ι*e@R.N&0 $A{%ILoz @0QYKPQ! x`$"]2-;cIT{S?9hRJ5F45ye%GY*&@&l:3k}߯#Ev;h@y6mۖe1Z?xkw:@Aߘ|+ٮsH^p$D]i:6!x{`w/B`8V/V3 h*G5pUt](d_2l8mN.ƼfV,"iACJ"BU9e[)IEl%Q`El:ƈ2A}rg" O9w1wi$] -=,&BOBRaR4iI[kD=x%V"ۈ4Xkև_#fl0 CIhX(ى=r% JE2pjO}sVTfҊ' ޻~ॵf⢱TUyeg-j%PEut{ РV1Fmz X$)TJ1gI0p|4Z!JDݧH/s ЖЪG<X$,+M/ӣ9gڴQyߨ{i B$R";52IJ6* A8 (p?p@A@vTr lkeU4ot쒼qsx Cc /Q.2jjxy#vx! Cx.a:@\~\ E8.,5? :W- bA0RuU`uFzYxc<`UJLUri{gB OhM*1klƂTkM~Ή ClDE\4uvi59ZXc)vpB! aB)']%;D%3o*KniʕM8t<N9l cS7 iSR(ʪXK{޵h ~77j2ԡǘ23  Iuv安ȀsN֜|4ZrW~ @ @~s!XPDIv4R|hX;~]7|.[xA Cdc&ſ(?ֳZͨDk>!]XMd\L9VEv^.ôgZ"mJ=Y@@ AmDl:#;3b,̭h@G=DKZkHj@A| mB+--o-,_Zk`j"/pXa O{t䕏| M;AgFs1XBq":9ڿ%,OSk%K>ћ̈́` xv1W׳: ǶDyijO_CJ)dCJ vק)$*wOk-J!řW5Q~m(Q!fp0CY8Woޜ!-0 9Xh wb|r@kn {d "i }vQݧ_C5k ArUz)EDjHX[A9BH)1r$"a#:-He xz\k]R/qS^`Κ}$+A@B[ğo tJʜ?4DN`a<~}:8ǺjB'O0Ȃ-1GY&95L7Tġ5ٳNߚRQys!T]n'0b ^D1\ʃGijR~~,$y9hb$TyخY7Qhg ˲Ƅ?0tр|883T%uSdZ*&jacm; qw˱ֲ7(v0/ybX( ZJ9mfM~qz|rcqJQ^pVA_KpqdуxdUA@ąe'!:˿"?4RԓQL\Hb* gV 1͠ ԁK+QC5~N/œXQqS˾5gciBXJVBgWCW1d߫/ mHr-{U)ӳDT0#/gl0DH(,Ar qjtϝ `7i Z .GyLڌByNNyq1&XkG>f3ʝі#$P 2TuE/B)eeP$IlhAuz: ^)@&o^Pi ش@  FzjysϞ9&ܱ]ZRS;=7@B7oހ$0 6dLǬ,^vsN8psuiinںeGGτ3&Ofg`ebcfX4Ώ/虰㸿96c` " 5.;+(? ('7',퀕9`YK;o.'#>`N{}瞽{ܹ߿cbp4V= 444 $%,;V~yfΜƭ݇ϞyV-*Q61`Ob ?f&> IqUUm/xӷ7=|񣯞>뗀+; 0 +ʯ(. &F'̄xߥG/~ 5V28%$& ̌ L*!")&-!+*%$!,XUO`уyxӯ? ,,<\,1+Yo墬Y+D`%lZrϪvޟ> _2|}3l(OV)(RPKœϟw`a`e&#N~fN.ffVvpF߿/`_`o_Aw`iiS?0XYu,ԤtĀAG@$'gMߺveHd+"&L%1ч_7^|(2A,J1Yd`cdKp7fe'j~_.^sҹo>_`7j004i$hmkgku+0\mmmG[E^0pK130B~g{/aD" i C=ccI}cn>~g`#(+X񷭡]Lϔ)S=|(iE?_TpO CWm|g\~d+[UJCu?w>~ƫW^/(} _^Z0M/TT@$$w[̻q)(US<nj|&FjZbx&ի'M~򃏠ń{qu cп?߼yOmvPGC;'72{ꕶ6d?rO|ǤE! DVwuuEDDߙ+w7>}w_S5MM!aQn^6`&gaA˿~G/v]|Ӈ?xt ?D luq)7x`}`hjidb㐔Kv5\s|0B ٫ϘX$e"|L4&ozjn?jzFxyHM_ʼ\̿ܤćFpq1:mGMtBlǖqss뜊I*;Y}Ihs6̠W RzIu#79@Dl?cۙO2pA!_lVz,cbLKs`e& f;^V`ci,>Ca㉛;10T506WRR'P;=a^p KS0qhO$͊,3>[8}ӻ7/""*asQP'Tx~i(kj13<)ƙ0?ߋ 3 Z) O LzT1` o244g~;v+e N< pppv68iRRWW^ *%>p^gN_P  l,}nΏo_B"*Y,=pנFҼL2r a q2'= Ob `Q9PKad?# #Oz/88xj uB.ɺn{&&&8J,raO3(@ik;7IG p #MDOZ+\_~>عba1Q`Wxׯ^g9s&|Foɲa~.mgH 0@@goYmݯ_622𰴴${/X4e z? L9Yd%r}y<¨/sCM}VQQqƍ+Wz/a߮ b2%Rշ ~9_AK$쌍544ttt(Y21G9l;s(OYps/~1 W(Q&$7Y0.QovBl (F[]bd_ "`m-9 2\wcxGvn!y)}msDŽ$??? q13P{2OELov&y*d@Kgo?PF57xFJT)!s=/Ï_+GJ,x9rsqpfxNڂb>xӭ;$dɭAhi5fP]죹Bcn>03 E6a%6 3c`*8܍T71T?z硱g>~@P`€abߣ/ED9;(1/㏟-'76^|F_=_=y6`/WMUYF4f:ddfO/ KB2^~" جbf^~gN8(;)l-/? <<$7#Q>93g?];X)KOWQY]X6h>bXq6ןDpRbacEMfbbŅێ<Pk[i`D o#|Oj5qp`_Yˏ߼|Nu:p 4w[]YAZF:Х$!.ȃ݅_>ELz`1߿DTddfzocw`r/)dc'~ bxٙ98QvE2bO? ^JNWt[>~ga!,+?lm8O߾5O`)̘30 x] -kl8+ӧoS՛7JIYZ7~,8@ YJKR[# ;uϟH߿\ ~jȊ)(1+3jbdէd_X?!vFvw `yz :^׿UmK6.9Ey`+;7a,ᶌ,L(#[?.^?13]= IdYYQ~Ƨ|&=l;s41 Q"v1@:  1vk؂Xza! w^d2`Je baΖxY)`ZL_u($8+i`RB'JNܜ4fl+@SYEC 0fg2k%radWWٖ^yWx@X\,9[z뇙ɧ/._Ƣ/[]YQZZKpH >bziLL!n?s'go`̢Mc4!llj!,L]DZ3krT;!nVPх N^@ln=^}/Uʟ 4ōkkkzϼƛh|c(ɡf&Fn(%֏ +? ,$DV j\t3 ?jr9"ʞ漱@ 4IP*fv` {Ǽm7.;xWq0qrs]J KF\|ԕ߾~!88aI`g5dpԓD A ӳ?~LtŴ;ȇ/?X6|u|Is\UL6ƺ$>3mO>G%r^ZICX|̜7Ku7ߟirh1#矌K^r잦0{m|ǽ}~Oނww!;sI&SM c3KUm$"yhNڢ=}Wl+0y1jp+/3 3\,,(K+o9xTY#5=z]YeV6svc_Y𗶼 .- &9FW_~{_TY)\b[/_6P6~ęKs% w6w127%3j-Ռ, raϾ6BϚ^|Лd@i~#8 Ms7r#&\~`iFD^,?pP俪*qua6V`#v L?7 \y?!w88b+$WS۽.;fG=~rv63rhkij(D;=yƆ>.[ OZNJvt4!{{$b;7c}Uɋ7Ha{%E+_cKA[_IE-91~Q>/? W~0~o|T*Qֿ&JJo߼y>~/m<N6N>n!Po?| `) ,y{k,AIDC 8UTTC_޸xͱ=y'S?2B>y=i߾G{X3]X8,In3 /Wefω+wtuy0j;M6YYx(H: go_gタhg+ D*EZrZiM{<@[/}޵eϹqNX!GE2KXvelmђb<ų2'g;M￞,8Xssrn#*!2L>˴RIEUa"OUJԦAvY9y خIU #)$ROWX31~%c[N Zu#`d_䷱&7XO46gX㷿%K8~?rfw^T$+7^z0a74 h{.~TQ+Xi$ ZjkF_ +߹u+`fad!X%L o2kYϾzD䯲q X3?Yi^l>#rLqtc@pff6Ex5inLq1q鮓޿%}t(22r e"V5i[=y|{Ny+_z2|JjDއ.%Ύ4 :nSdwSO#,[/@Ls,3%nb<;nmyg]q%.߿ A E]_>z߂ۿǮ;pOAmpU?*RD*%')ȃ6w ,(oE&GxC>_?عܬ7[HaO[̌7>y֗O-{ k%,6&vNǵ,4P،$ l¿xˏ3xX~[H(zثWA3櫯~~a0',%Iawc̉l=qxߥA:TKbv"5 !'82(aj^3Rs!ͩ'/^4{+``f,');>ܗ1"q"÷>xpl=@KXfR מq:ZRLtqI|{;~cJSQM^}޽[N, _S**B8*B?oQk/';zg_?_ &,5ivKO~ӻ7Tw,O.6t32ͻ/{ۛO@[U!Ji`|ї k^U :lo}c0',a>.V.zg %,9q~U)! ?=vo[2T a -a\W?ߜ ҏȚ W_{1(dSPP$y\MZ} /~`NXpU~o>@KX&*ˏlMZ>Vc/T00gcU@+M~e d+ɭJKbܠ3+`_?ן#mg|7@XU4pʴYNL0SCt>?)=~?hA&d +j}z/Uyy2Q -_};֫_qOpD(aH1yޱ'^QGU!?;`yI|$FGM&FuLL䔝6ZXc0cVRQ"Ϗr{ ~ڄu{P ( x]@($̌>m_hc'U+rFFv6M@ٙ"HoWCeiIA9c4Eɾ_?~ gGA9bD aq+CÚy]kS"xFKb\ |D/(o?Ё䆸 /*Ɓ5*)*Wh|FW}%scŷx-&ׁю ?#B"+2?|@ ׿oiQA~|;%ؑ~03~X Op/ z½ nOtY^&*i 2((* RtcW`3/?os#MN^&`?@NXb2"(,_/^tw??({ -u \?LU5I+]A`3'5SQ89~ͻjR|D-T{^RRRPf} e݁7_/>P9wFˠL7_|gJK{@GZTTTi[}%#f< ? |e`[wad!x֋O/}~.6n6k`[Lδm[], BЕ \CTX;  V%@0LcD"|66Z\hsL?y+̝?w U򇫁6>{wcɂPs +SMRmr4JCh={,u/󏋝9N#@E O||#߾g&=70qI iȊ(JH psF<ӷo?}{ `ۇ/  $oGU>3S#S3" Oߤ~>f?_Fȵ%?LlJ₠×;O}o oD?:|?٬ L,䰖U,uʣ{o>?ށd۠EWYLMZUZXVWGILOQ- ?nbL侌o?;O_w 1NL at-7,3=|uG` 8yɷ7K{q/v 4A pQj|W/PHG^3 ld#\[_CYG;&nJ"*aanI}ߣ_n?K Pe ?>ֿj|L%YMԤt 5i%{;3+r'AG~t)|]K|xGQVJEEȠ|kt[ _lLn6_`PE7ICS;{Ǝ#@7`d A@ ?2MNod|-9;b 2L*",! g0 kamC11B.'yAl\rrr!;ZZǪISSR4le;WϪ{Y| @7VBlo2e&'S KUkv)0F=`ȇ/W;[(5=<͎i#<8A?֣c\w ӈmȇsu@?9֐a'+(b~O Zӻa TBH[$A(.Yvo>.0 0JxqB(,o ^O޼w>?էo~da`ńED?#< Up>YeXtQ8(EȑmR)qS΅, 삃h Till: Phone#: Cashier: Inv #/Date: / Printed: Qty Description Amount @ / Number of items: --------------- Total: ------------ Subtotal: @ %: Paid: Change: Balance Due: % Discount applied Thank you for your valued business! Taxes are included in price. ledgersmb/templates/xedemo/work_order.html0000644000000000000000000001023411770535774020062 0ustar rootroot <?lsmb text('Work Order') ?>
 

 



,








,





 
   
 
 
.

 

ledgersmb/templates/xedemo/lv/0000755000000000000000000000000012060044550015414 5ustar rootrootledgersmb/templates/xedemo/sales_quotation.tex0000644000000000000000000000602411770535774020755 0ustar rootroot \documentclass{scrartcl} \usepackage{xltxtra} \setmainfont{Verdana} \usepackage{tabularx} \usepackage{longtable} \setlength\LTleft{0pt} \setlength\LTright{0pt} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \newsavebox{\ftr} \sbox{\ftr}{ \parbox{\textwidth}{ \tiny \rule[1.5em]{\textwidth}{0.5pt} } } \markboth{\hfill }{\hfill } \vspace*{0.5cm} \parbox[t]{.5\textwidth}{ \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} ?> } \vspace{1cm} \textbf{\MakeUppercase{}} \hfill \vspace{1cm} \begin{tabularx}{\textwidth}{*{6}{|X}|} \hline \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ [0.5ex] \hline & & & & & \\ \hline \end{tabularx} \vspace{1cm} \begin{longtable}{@{\extracolsep{\fill}}llrlrrr@{\extracolsep{0pt}}} \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \endhead & & & & & & \\ \end{longtable} \parbox{\textwidth}{ \rule{\textwidth}{2pt} \vspace{0.2cm} \hfill \begin{tabularx}{7cm}{Xr@{\hspace{1cm}}r@{}} & Subtotal & \\ & on & \\ \hline & Total & \\ \end{tabularx} \vspace{0.3cm} \hfill \vspace{12pt} \medskip } \vfill \hfill \parbox{7cm}{X \rule{6.5cm}{0.5pt}} \rule{\textwidth}{0.5pt} \usebox{\ftr} \end{document} ledgersmb/templates/xedemo/check.tex0000644000000000000000000000060711661150340016576 0ustar rootroot \documentclass{scrartcl} \usepackage{xltxtra} \setmainfont{Verdana} \usepackage{tabularx} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \end{document} ledgersmb/templates/xedemo/es_VE/0000755000000000000000000000000012060044550015774 5ustar rootrootledgersmb/templates/xedemo/es_PY/0000755000000000000000000000000012060044550016012 5ustar rootrootledgersmb/templates/xedemo/cs/0000755000000000000000000000000012060044550015400 5ustar rootrootledgersmb/templates/xedemo/ar_transaction.html0000644000000000000000000001251411770535774020717 0ustar rootroot <?lsmb text('AR Transaction') ?>
 

 



,







 
 
 
 
     
   
@ %  
 
  ***** /100
 

 

 
 
 
ledgersmb/templates/xedemo/ru/0000755000000000000000000000000012060044550015421 5ustar rootrootledgersmb/templates/xedemo/ap_transaction.tex0000644000000000000000000000547011770535774020554 0ustar rootroot \documentclass{scrartcl} \usepackage{xltxtra} \setmainfont{Verdana} \usepackage{tabularx} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \setlength{\parindent}{0pt} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \centerline{\MakeUppercase{\textbf{}}} \vspace*{0.5cm} \parbox[t]{.5\textwidth}{ \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} Tel: Fax: Tax Number: } \hfill \begin{tabular}[t]{ll} \textbf{} & \\ \textbf{} & \\ \textbf{} & \\ \textbf{} & \\ \textbf{} & \\ \textbf{} & \\ \end{tabular} \vspace{1cm} \begin{tabularx}{\textwidth}[t]{@{}llrX@{\hspace{1cm}}l@{}} & & & & \\ \multicolumn{2}{r}{\textbf{Subtotal}} & & \\ \multicolumn{2}{r}{\textbf{ @ \%}} & & \\ \multicolumn{2}{r}{\textbf{Total}} & & \\ \end{tabularx} \vspace{0.3cm} ***** /100 \vspace{0.3cm} \medskip \vspace{0.3cm} \begin{tabular}{@{}llllr@{}} \multicolumn{5}{c}{\textbf{}} \\ \hline \textbf{} & & \textbf{} & \textbf{} & \textbf{} \\ & & & & \\ \end{tabular} \end{document} ledgersmb/templates/xedemo/work_order.tex0000644000000000000000000000561511770535774017725 0ustar rootroot \documentclass{scrartcl} \usepackage{xltxtra} \setmainfont{Verdana} \usepackage{tabularx} \usepackage{longtable} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} % Break old pagebreak directive % %\end{tabularx} % %\newpage % %\markboth{\hfill }{\hfill } % %\begin{tabularx}{\textwidth}{@{}rlXrll@{}} % \textbf{Item} & \textbf{Number} & \textbf{Description} & \textbf{Qt'y} & % & \textbf{Serial Number} \\ % \vspace*{0.5cm} \parbox[t]{.5\textwidth}{ \textbf{To} \vspace{0.3cm} \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} } \parbox[t]{.5\textwidth}{ \textbf{Ship To} \vspace{0.3cm} \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} } \hfill \vspace{1cm} \textbf{\MakeUppercase{}} \hfill \vspace{1cm} \begin{tabularx}{\textwidth}{*{6}{|X}|} \hline \textbf{Order \#} & \textbf{Order Date} & \textbf{Required by} & \textbf{Salesperson} & \textbf{Shipping Point} & \textbf{Ship Via} \\ [0.5em] \hline & & & & & \\ \hline \end{tabularx} \vspace{1cm} \begin{longtable}{@{\extracolsep{\fill}}rllrll@{}} \textbf{} & \textbf{} & \textbf{} & \textbf{} & & \textbf{} \\ & & & & & \\ \end{longtable} \parbox{\textwidth}{ \rule{\textwidth}{2pt} \vspace{12pt} \medskip } \vfill \end{document} ledgersmb/templates/xedemo/receipt.tex0000644000000000000000000000266611661150340017163 0ustar rootroot \documentclass{scrartcl} \usepackage{xltxtra} \setmainfont{Verdana} \usepackage{tabularx} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \parbox[t]{12cm}{ } \hfill \parbox[t]{6cm}{\hfill } \vspace*{0.6cm} \dotfill /100 \makebox[0.5cm]{\hfill} \vspace{0.5cm} \hfill \makebox[2cm]{\hfill} % different date format for datepaid % \vspace{0.5cm} \hspace{-0.1cm}, \vspace{1.8cm} \vspace{0.8cm} \vspace{0.5cm} \hfill \hfill \vspace{0.5cm} \begin{tabularx}{\textwidth}{lXrr@{}} \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ & \dotfill & & \\ \end{tabularx} \vspace{1cm} \vfill \end{document} ledgersmb/templates/xedemo/ap_transaction.csv0000644000000000000000000000034512054171776020535 0ustar rootrootaccount,amount,description,project ,,,, ledgersmb/templates/xedemo/es/0000755000000000000000000000000012060044550015402 5ustar rootrootledgersmb/templates/xedemo/fr_BE/0000755000000000000000000000000012060044550015750 5ustar rootrootledgersmb/templates/xedemo/invoice.html0000644000000000000000000002052611770535774017346 0ustar rootroot
 

 



,









,






 
       
 
   
.

on @ %
-
 
 
 

***** /100
 

 
 
X
 
 
ledgersmb/templates/xedemo/fi/0000755000000000000000000000000012060044550015371 5ustar rootrootledgersmb/templates/xedemo/es_PA/0000755000000000000000000000000012060044550015762 5ustar rootrootledgersmb/templates/xedemo/es_SV/0000755000000000000000000000000012060044550016012 5ustar rootrootledgersmb/templates/xedemo/pt_BR/0000755000000000000000000000000012060044550016001 5ustar rootrootledgersmb/templates/xedemo/lt/0000755000000000000000000000000012060044550015412 5ustar rootrootledgersmb/templates/xedemo/timecard.html0000644000000000000000000000527411770535774017505 0ustar rootroot <?lsmb text('Time Card') ?>
 

 
 
 

ledgersmb/templates/xedemo/de/0000755000000000000000000000000012060044550015363 5ustar rootrootledgersmb/templates/xedemo/statement.tex0000644000000000000000000000406411661150340017526 0ustar rootroot \documentclass{scrartcl} \usepackage{xltxtra} \setmainfont{Verdana} \usepackage{tabularx} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \parbox[t]{.5\textwidth}{ \hspace{-0.1cm}, } \parbox[t]{.5\textwidth}{ } \hfill \vspace{1cm} \textbf{\MakeUppercase{}} \hfill \textbf{} \vspace{2cm} \begin{tabular*}{\textwidth}{|ll@{\extracolsep\fill}ccrrrr|} \hline \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{30} & \textbf{60} & \textbf{90} \\ \hline & & & & & & & \\ \multicolumn{8}{|l|}{\mbox{}} \\ \hline \textbf{} & & & & & & & \\ \hline \end{tabular*} \vspace{0.5cm} \hfill \begin{tabularx}{\textwidth}{Xr@{\hspace{1cm}}r@{}} & \textbf{} & \textbf{} \end{tabularx} \vfill \pagebreak \end{document} ledgersmb/templates/xedemo/es_EC/0000755000000000000000000000000012060044550015751 5ustar rootrootledgersmb/templates/xedemo/bg/0000755000000000000000000000000012060044550015363 5ustar rootrootledgersmb/templates/xedemo/income_statement.html0000644000000000000000000001214610712715643021235 0ustar rootroot <?lsmb titlebar ?> ") ?>
    


') ?>























ledgersmb/templates/xedemo/sales_quotation.html0000644000000000000000000001145411770535774021124 0ustar rootroot <?lsmb text('Quotation') ?>
 

 



,





 
   
 
 

on @ %
 
 
 
 

 
X
ledgersmb/templates/xedemo/ar_EG/0000755000000000000000000000000012060044550015750 5ustar rootrootledgersmb/templates/xedemo/pt/0000755000000000000000000000000012060044550015416 5ustar rootrootledgersmb/templates/xedemo/nl_BE/0000755000000000000000000000000012060044550015752 5ustar rootrootledgersmb/templates/xedemo/tr/0000755000000000000000000000000012060044550015420 5ustar rootrootledgersmb/templates/xedemo/en_GB/0000755000000000000000000000000012060044550015745 5ustar rootrootledgersmb/templates/xedemo/purchase_order.html0000644000000000000000000001353511770535774020721 0ustar rootroot <?lsmb text('Purchase Order') ?>
 

 



,







,




 
   
 
.

on @ %
 
 
 

 
  X
ledgersmb/templates/xedemo/timecard.tex0000644000000000000000000000275211770535774017337 0ustar rootroot \documentclass{scrartcl} \usepackage{xltxtra} \setmainfont{Verdana} \usepackage{tabularx} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \centerline{\textbf{\MakeUppercase{}}} \vspace*{0.5cm} \begin{tabular}[t]{ll} \textbf{} & \\ \textbf{} & \\ \end{tabular} \hfill \begin{tabular}[t]{ll} \textbf{} & \\ \textbf{} & \\ \textbf{} & \\ \textbf{} & \\ \textbf{} & \\ \end{tabular} \vspace{1cm} \begin{tabular}[b]{ll} \textbf{} & \\ \textbf{} & \\ \textbf{} & \\ \textbf{} & \\ \end{tabular} \hfill \begin{tabular}[b]{lr} \textbf{} & \\ \textbf{} & \\ \end{tabular} \vspace{0.3cm} \medskip \end{document} ledgersmb/templates/xedemo/pick_list.html0000644000000000000000000000670611770535774017677 0ustar rootroot <?lsmb text('Pick List') ?>
 

 
 



,



 
           
 
 
[      ]
 
ledgersmb/templates/xedemo/invoice.tex0000644000000000000000000001172011770535774017176 0ustar rootroot \documentclass{scrartcl} \usepackage{tabularx} \usepackage{longtable} \setmainfont[]{Times} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \setlength\LTleft{0pt} \setlength\LTright{0pt} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \begin{minipage}{2in} \medskip \raggedright \end{minipage} \newsavebox{\ftr} \sbox{\ftr}{ \parbox{\textwidth}{ \tiny \rule[1.5em]{\textwidth}{0.5pt} } } \markboth{\hfill }{\hfill } \vspace*{0.5cm} \parbox[t]{.5\textwidth}{ \textbf{To} \vspace{0.3cm} \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} Tel: Fax: } \parbox[t]{.5\textwidth}{ \textbf{} \vspace{0.3cm} \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} Tel: Fax: } \hfill \vspace{1cm} \textbf{\MakeUppercase{}} \hfill \vspace{1cm} \begin{tabularx}{\textwidth}{*{7}{|X}|} \hline \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ [0.5em] \hline & & & & & & \\ \hline \end{tabularx} \vspace{1cm} \begin{longtable}{@{\extracolsep{\fill}}r|llcrlrr|r} \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \endhead & & & & & & & & \\ \hline \hline \multicolumn{8}{r|}{} & \\* \multicolumn{8}{r|}{ on } & \\* \multicolumn{8}{r|}{ } & - \\* \hline \hline \multicolumn{8}{r|}{} & \\ \end{longtable} \parbox{\textwidth}{ \vspace{0.2cm} \hfill \vspace{0.3cm} ***** /100 \hfill \vspace{12pt} \medskip } \vfill \begin{tabularx}{10cm}{@{}lXlr@{}} \textbf{} & & & \\ \hline \textbf{} & & \textbf{} & \textbf{} \\ & & & \\ \end{tabularx} \vspace{1cm} \centerline{\textbf{}} \rule{\textwidth}{0.5pt} \usebox{\ftr} \end{document} ledgersmb/templates/xedemo/packing_list.html0000644000000000000000000001064111770535774020356 0ustar rootroot <?lsmb text('Packing List') ?>
 

 
 



,



 
           
 
   
 
 
Notes

 
X
ledgersmb/templates/xedemo/es_CO/0000755000000000000000000000000012060044550015763 5ustar rootrootledgersmb/templates/xedemo/bin_list.tex0000644000000000000000000000534711753757701017352 0ustar rootroot \documentclass{scrartcl} \usepackage{xltxtra} \setmainfont{Verdana} \usepackage{tabularx} \usepackage{longtable} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} % Breaking old pagebreak directives % %\end{tabularx} % %\newpage % %\markboth{\hfill }{\hfill } % %\begin{tabularx}{\textwidth}{@{}rlXllrrll@{}} % \textbf{Item} & \textbf{Number} & \textbf{Description} & \textbf{Serial Number} & & \textbf{Qty} & \textbf{Recd} & & \textbf{Bin} \\ % \vspace*{0.5cm} \parbox[t]{.5\textwidth}{ \textbf{} \vspace{0.3cm} \hspace{-0.1cm}, } \parbox[t]{.5\textwidth}{ \textbf{} \vspace{0.3cm} \hspace{-0.1cm}, } \hfill \vspace{1cm} \textbf{\MakeUppercase{}} \hfill \vspace{1cm} \begin{tabularx}{\textwidth}{*{6}{|X}|} \hline \textbf{Order \#} & \textbf{Date} & \textbf{Contact} & \textbf{} & \textbf{} & \textbf{} \\ [0.5em] \hline & & & & & & \\ \hline \end{tabularx} \vspace{1cm} \begin{longtable}{@{\extracolsep{\fill}}rllllrrll@{}} \textbf{} & \textbf{} & \textbf{} & \textbf{} & & \textbf{} & \textbf{} & & \textbf{} \\ & & & & & & & & \\ \end{longtable} \rule{\textwidth}{2pt} \end{document} ledgersmb/templates/xedemo/en/0000755000000000000000000000000012060044550015375 5ustar rootrootledgersmb/templates/xedemo/hu/0000755000000000000000000000000012060044550015407 5ustar rootrootledgersmb/templates/xedemo/statement.html0000644000000000000000000000635211770535774017717 0ustar rootroot <?lsmb text('Statement') ?>
 

 
 



,




 

       
 
 
 
ledgersmb/templates/xedemo/en_CA/0000755000000000000000000000000012060044550015740 5ustar rootrootledgersmb/templates/xedemo/et/0000755000000000000000000000000012060044550015403 5ustar rootrootledgersmb/templates/xedemo/sv/0000755000000000000000000000000012060044550015423 5ustar rootrootledgersmb/templates/xedemo/it/0000755000000000000000000000000012060044550015407 5ustar rootrootledgersmb/templates/xedemo/ar_transaction.csv0000644000000000000000000000034512054171776020537 0ustar rootrootaccount,amount,description,project ,,,, ledgersmb/templates/xedemo/printPayment.html0000644000000000000000000001142411655775556020407 0ustar rootroot <?lsmb titlebar ?>
LOGO AREA

 
--
 
: :






___________________________________________
:
:
: 
: ____________________________
:
ledgersmb/templates/xedemo/is/0000755000000000000000000000000012060044550015406 5ustar rootrootledgersmb/templates/xedemo/purchase_order.tex0000644000000000000000000000646711770535774020563 0ustar rootroot \documentclass{scrartcl} \usepackage{xltxtra} \setmainfont{Verdana} \usepackage{tabularx} \usepackage{longtable} \setlength\LTleft{0pt} \setlength\LTright{0pt} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \markboth{\hfill }{\hfill } \vspace*{0.5cm} \parbox[t]{.5\textwidth}{ \textbf{To} \vspace{0.3cm} \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} } \parbox[t]{.5\textwidth}{ \textbf{Ship To} \vspace{0.3cm} \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} / } \hfill \vspace{1cm} \textbf{\MakeUppercase{}} \hfill \vspace{1cm} \begin{tabularx}{\textwidth}{*{6}{|X}|} \hline \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ [0.5ex] \hline & & & & & \\ \hline \end{tabularx} \vspace{1cm} \begin{longtable}{@{\extracolsep{\fill}}llrlrr@{\extracolsep{0pt}}} \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ \endhead & & & & & \\ \end{longtable} \parbox{\textwidth}{ \rule{\textwidth}{2pt} \vspace{0.2cm} \hfill \begin{tabularx}{7cm}{Xr@{\hspace{1cm}}r@{}} & Subtotal & \\ & on & \\ \hline & Total & \\ \end{tabularx} \vspace{0.3cm} \hfill \vspace{12pt} \medskip } %\renewcommand{\thefootnote}{\fnsymbol{footnote}} %\footnotetext[1]{\tiny } \end{document} ledgersmb/templates/xedemo/nl/0000755000000000000000000000000012060044550015404 5ustar rootrootledgersmb/templates/xedemo/sales_order.tex0000644000000000000000000000711311770535774020045 0ustar rootroot \documentclass{scrartcl} \usepackage{xltxtra} \setmainfont{Verdana} \usepackage{tabularx} \usepackage{longtable} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \setlength\LTleft{0pt} \setlength\LTright{0pt} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \markboth{\hfill }{\hfill } \vspace*{0.5cm} \parbox[t]{.5\textwidth}{ \textbf{To} \vspace{0.3cm} \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} } \parbox[t]{.5\textwidth}{ \textbf{Ship To} \vspace{0.3cm} \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} } \hfill \vspace{1cm} \textbf{\MakeUppercase{}} \hfill \vspace{1cm} \begin{tabularx}{\textwidth}{*{6}{|X}|} \hline \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ [0.5em] \hline & & & & & \\ \hline \end{tabularx} \vspace{1cm} \begin{longtable}{@{\extracolsep{\fill}}rlcrlrrr@{\extracolsep{0pt}}} \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \endhead & & & & & & & \\ \end{longtable} \parbox{\textwidth}{ \rule{\textwidth}{2pt} \vspace{0.2cm} \hfill \begin{tabularx}{7cm}{Xr@{\hspace{1cm}}r@{}} & Subtotal & \\ & on & \\ \hline & Total & \\ \end{tabularx} \vspace{0.3cm} ***** /100 \hfill \vspace{12pt} \medskip } \vfill \centerline{\textbf{}} \rule{\textwidth}{0.5pt} \end{document} ledgersmb/templates/xedemo/bin_list.html0000644000000000000000000001042011770535774017505 0ustar rootroot <?lsmb text('Bin List') ?>
 

 



,







,



 
       
 
   
 
ledgersmb/templates/xedemo/letterhead.html0000644000000000000000000000163611607707650020025 0ustar rootroot  




ledgersmb/templates/xedemo/pick_list.tex0000644000000000000000000000513011745305677017520 0ustar rootroot \documentclass{scrartcl} \usepackage{xltxtra} \setmainfont{Verdana} \usepackage{tabularx} \usepackage{longtable} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} % Breaking old pagebreak directive % %\end{tabularx} % %\newpage % %\markboth{\hfill }{\hfill } % %\begin{tabularx}{\textwidth}{@{}rlXrcll@{}} % \textbf{Item} & \textbf{Number} & \textbf{Description} & % \textbf{Qty} & \textbf{Ship} & & \textbf{Bin} \\ % % \vspace*{0.5cm} \parbox[t]{.5\textwidth}{ \textbf{Ship To} } \hfill \vspace{0.3cm} \parbox[t]{.5\textwidth}{ \hspace{-0.1cm}, } \parbox[t]{.5\textwidth}{ Tel: Fax: } \hfill \vspace{1cm} \textbf{\MakeUppercase{}} \hfill \vspace{1cm} \begin{tabularx}{\textwidth}{*{7}{|X}|} \hline \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ [0.5em] \hline & & & & & & & \\ \hline \end{tabularx} \vspace{1cm} \begin{longtable}{@{\extracolsep{\fill}}rllrcll@{}} \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & & \textbf{} \\ & & & & [\hspace{1cm}] & & \\ \end{longtable} \parbox{\textwidth}{ \rule{\textwidth}{2pt} } \end{document} ledgersmb/templates/xedemo/pl/0000755000000000000000000000000012060044550015406 5ustar rootrootledgersmb/templates/xedemo/request_quotation.html0000644000000000000000000001023411770535774021500 0ustar rootroot <?lsmb text('Request for Quotation') ?>
 

 



,







,




 
     
 
 
 
.

 

ledgersmb/templates/xedemo/id/0000755000000000000000000000000012060044550015367 5ustar rootrootledgersmb/templates/xedemo/de_CH/0000755000000000000000000000000012060044550015735 5ustar rootrootledgersmb/templates/xedemo/check_multiple.tex0000644000000000000000000000137111661150340020510 0ustar rootroot \documentclass{scrartcl} \usepackage{xltxtra} \setmainfont{Verdana} \usepackage{tabularx} \usepackage{graphicx} \usepackage{textpos} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \clearpage \end{document} ledgersmb/templates/xedemo/sales_order.html0000644000000000000000000001344711770535774020220 0ustar rootroot <?lsmb text('Sales Order') ?>
 

 



,








,





 
   
 
 
.

on @ %
 
***** /100
 
 

 
X
ledgersmb/templates/xedemo/el/0000755000000000000000000000000012060044550015373 5ustar rootrootledgersmb/templates/xedemo/ap_transaction.html0000644000000000000000000001215311770535774020714 0ustar rootroot <?lsmb text('AP Transaction') ?>
 

 



,






 
 
 
 
@ %
  ***** /100
 

 

 
 
ledgersmb/templates/xedemo/balance_sheet.html0000644000000000000000000001342711675716201020457 0ustar rootroot <?lsmb titlebar ?> ") ?>     


') ?>


























ledgersmb/templates/xedemo/letterhead.tex0000644000000000000000000000076711607764606017671 0ustar rootroot\parbox{\textwidth}{% \parbox[b]{.42\textwidth}{% } \parbox[b]{.2\textwidth}{ % If you want to use a logo uncomment this and set images to % an absolute path to the images, or set the path appropriately here. %\includegraphics[scale=0.3]{/logo} }\hfill \begin{tabular}[b]{rr@{}} & \\ & \end{tabular} \rule[1.5em]{\textwidth}{0.5pt} } ledgersmb/templates/xedemo/zh_TW/0000755000000000000000000000000012060044550016026 5ustar rootrootledgersmb/templates/xedemo/fr_CA/0000755000000000000000000000000012060044550015745 5ustar rootrootledgersmb/templates/xedemo/ar_transaction.tex0000644000000000000000000000635111770535774020555 0ustar rootroot \documentclass{scrartcl} \usepackage{xltxtra} \setmainfont{Verdana} \usepackage{tabularx} \usepackage[top=2cm,bottom=1.5cm,left=2cm,right=1cm]{geometry} \usepackage{graphicx} \setlength{\parindent}{0pt} \begin{document} \pagestyle{empty} \parbox{\textwidth}{% \parbox[b]{.42\textwidth}{% } %\parbox[b]{.2\textwidth}{ %\includegraphics[scale=0.3]{ledger-smb} %} \hfill \begin{tabular}[b]{rr@{}} & \\ & \end{tabular} \rule[1.5em]{\textwidth}{0.5pt} } \centerline{\MakeUppercase{}} \vspace*{0.5cm} \parbox[t]{.5\textwidth}{ , \vspace{0.3cm} \vspace{0.2cm} } \hfill \begin{tabular}[t]{ll} \textbf{} & \\ \textbf{} & \\ \textbf{} & \\ \textbf{PO \#} & \\ \textbf{} & \\ \textbf{} & \\ \end{tabular} \vspace{1cm} \begin{tabularx}{\textwidth}[t]{@{}llrX@{\hspace{1cm}}l@{}} & & & & \\ \multicolumn{2}{r}{\textbf{Subtotal}} & & \\ \multicolumn{2}{r}{\textbf{ @ \%}} & & \\ \multicolumn{2}{r}{\textbf{Total}} & & \\ \end{tabularx} \vspace{0.3cm} ***** /100 \vspace{0.3cm} \medskip \vspace{0.3cm} \begin{tabular}{@{}lllr@{}} \multicolumn{5}{c}{\textbf{}} \\ \hline \textbf{} & & \textbf{} & \textbf{} \\ & & & \\ \end{tabular} \vspace{0.5cm} \textbf{\scriptsize } \\ \end{document} ledgersmb/templates/xedemo/nb/0000755000000000000000000000000012060044550015372 5ustar rootrootledgersmb/templates/xedemo/packing_list.tex0000644000000000000000000000643111770535774020214 0ustar rootroot \documentclass{scrartcl} \usepackage{xltxtra} \setmainfont{Verdana} \usepackage{tabularx} \usepackage{longtable} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \newsavebox{\ftr} \sbox{\ftr}{ \parbox{\textwidth}{ \tiny \rule[1.5em]{\textwidth}{0.5pt} } } % Breaking old pagebreak directive % %\end{tabularx} % %\newpage % %\markboth{\hfill }{\hfill } % %\begin{tabularx}{\textwidth}{@{}rlXllrrl@{}} % \textbf{Item} & \textbf{Number} & \textbf{Description} & \textbf{Serial Number} & & \textbf{Qty} & \textbf{Ship} & \\ % \vspace*{0.5cm} \parbox[t]{.5\textwidth}{ \textbf{Ship To}} \hfill \vspace{0.3cm} \parbox[t]{.5\textwidth}{ \hspace{-0.1cm}, } \parbox[t]{.5\textwidth}{ Tel: Fax: } \hfill \vspace{1cm} \textbf{\MakeUppercase{}} \hfill \vspace{1cm} \begin{tabularx}{\textwidth}{*{7}{|X}|} \hline \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ [0.5em] \hline & & & & & & & \\ \hline \end{tabularx} \vspace{1cm} \begin{longtable}{@{\extracolsep{\fill}}rllllrrl@{}} \textbf{} & \textbf{} & \textbf{} & \textbf{} & & \textbf{} & \textbf{} & \\ & & & & & & & \\ \end{longtable} \parbox{\textwidth}{ \rule{\textwidth}{2pt} \vspace{12pt} \medskip } \vfill \rule{\textwidth}{0.5pt} \usebox{\ftr} \end{document} ledgersmb/templates/xedemo/check_base.tex0000644000000000000000000000237311607764606017612 0ustar rootroot \parbox[t]{12cm}{ } \hfill \parbox[t]{6cm}{\hfill } \vspace*{0.6cm} \dotfill /100 \makebox[0.5cm]{\hfill} \vspace{0.5cm} \hfill \makebox[2cm]{\hfill} % different date format for datepaid % \vspace{0.5cm} \hspace{-0.1cm}, \vspace{1.8cm} \vspace{0.8cm} \vspace{0.5cm} \hfill \hfill \vspace{0.5cm} \begin{tabularx}{\textwidth}{lXrr@{}} \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ & \dotfill & & \\ \end{tabularx} \vspace{1cm} \vfill ledgersmb/templates/xedemo/ca/0000755000000000000000000000000012060044550015356 5ustar rootrootledgersmb/templates/xedemo/request_quotation.tex0000644000000000000000000000556611770535774021350 0ustar rootroot \documentclass{scrartcl} \usepackage{xltxtra} \setmainfont{Verdana} \usepackage{tabularx} \usepackage{longtable} \setlength\LTleft{0pt} \setlength\LTright{0pt} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \markboth{\hfill }{\hfill } \vspace*{0.5cm} \parbox[t]{.5\textwidth}{ \textbf{} \vspace{0.3cm} \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} } \parbox[t]{.5\textwidth}{ \textbf{Ship To} \vspace{0.3cm} \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} } \hfill \vspace{1cm} \textbf{\MakeUppercase{}} \hfill \vspace{1cm} \begin{tabularx}{\textwidth}{*{6}{|X}|} \hline \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ [0.5ex] \hline & & & & & \\ \hline \end{tabularx} \vspace{1cm} \vspace{1cm} \begin{longtable}{@{\extracolsep{\fill}}lcrllrr@{\extracolsep{\fill}}} \textbf{} & \textbf{} & \textbf{} & & \textbf{} & \textbf{} & \textbf{} \endhead & & & \\ \end{longtable} \parbox{\textwidth}{ \rule{\textwidth}{2pt} \hfill \medskip } \end{document} ledgersmb/templates/xedemo/fr/0000755000000000000000000000000012060044550015402 5ustar rootrootledgersmb/templates/demo/0000755000000000000000000000000012060044550014436 5ustar rootrootledgersmb/templates/demo/uk/0000755000000000000000000000000012060044550015055 5ustar rootrootledgersmb/templates/demo/zh_CN/0000755000000000000000000000000012060044550015437 5ustar rootrootledgersmb/templates/demo/da/0000755000000000000000000000000012060044550015022 5ustar rootrootledgersmb/templates/demo/es_MX/0000755000000000000000000000000012060044550015451 5ustar rootrootledgersmb/templates/demo/pos_invoice.txt0000644000000000000000000000356311663567734017551 0ustar rootroot Till: Phone#: Cashier: Inv #/Date: / Printed: Qty Description Amount @ / Number of items: --------------- Total: ------------ Subtotal: @ %: Paid: Change: Balance Due: % Discount applied Thank you for your valued business! Taxes are included in price. ledgersmb/templates/demo/work_order.html0000644000000000000000000001023411770535774017525 0ustar rootroot <?lsmb text('Work Order') ?>
 

 



,








,





 
   
 
 
.

 

ledgersmb/templates/demo/lv/0000755000000000000000000000000012060044550015057 5ustar rootrootledgersmb/templates/demo/sales_quotation.tex0000644000000000000000000000612511770535774020422 0ustar rootroot \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{tabularx} \usepackage{longtable} \setlength\LTleft{0pt} \setlength\LTright{0pt} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont \newsavebox{\ftr} \sbox{\ftr}{ \parbox{\textwidth}{ \tiny \rule[1.5em]{\textwidth}{0.5pt} } } \markboth{\hfill }{\hfill } \vspace*{0.5cm} \parbox[t]{.5\textwidth}{ \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} ?> } \vspace{1cm} \textbf{\MakeUppercase{}} \hfill \vspace{1cm} \begin{tabularx}{\textwidth}{*{6}{|X}|} \hline \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ [0.5ex] \hline & & & & & \\ \hline \end{tabularx} \vspace{1cm} \begin{longtable}{@{\extracolsep{\fill}}llrlrr|r@{\extracolsep{0pt}}} \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \endhead & \begin{minipage}{4in} \raggedright \end{minipage}& & & & & \\ & & & & & \\ \hline \hline \multicolumn{6}{r|}{} & \\* \multicolumn{6}{r|}{ on } & \\* \end{longtable} \parbox{\textwidth}{ \rule{\textwidth}{2pt} \vspace{0.2cm} \hfill \vspace{12pt} \medskip } \vfill \hfill \parbox{7cm}{X \rule{6.5cm}{0.5pt}} \rule{\textwidth}{0.5pt} \usebox{\ftr} \end{document} ledgersmb/templates/demo/check.tex0000644000000000000000000000065111034452120016233 0ustar rootroot \documentclass{scrartcl} \usepackage[latin1]{inputenc} \usepackage{tabularx} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont \end{document} ledgersmb/templates/demo/es_VE/0000755000000000000000000000000012060044550015437 5ustar rootrootledgersmb/templates/demo/es_PY/0000755000000000000000000000000012060044550015455 5ustar rootrootledgersmb/templates/demo/cs/0000755000000000000000000000000012060044550015043 5ustar rootrootledgersmb/templates/demo/ar_transaction.html0000644000000000000000000001251411770535774020362 0ustar rootroot <?lsmb text('AR Transaction') ?>
 

 



,







 
 
 
 
     
   
@ %  
 
  ***** /100
 

 

 
 
 
ledgersmb/templates/demo/ru/0000755000000000000000000000000012060044550015064 5ustar rootrootledgersmb/templates/demo/ap_transaction.tex0000644000000000000000000000553211770535774020216 0ustar rootroot \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{tabularx} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \setlength{\parindent}{0pt} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont \centerline{\MakeUppercase{\textbf{}}} \vspace*{0.5cm} \parbox[t]{.5\textwidth}{ \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} Tel: Fax: Tax Number: } \hfill \begin{tabular}[t]{ll} \textbf{} & \\ \textbf{} & \\ \textbf{} & \\ \textbf{} & \\ \textbf{} & \\ \textbf{} & \\ \end{tabular} \vspace{1cm} \begin{tabularx}{\textwidth}[t]{@{}llrX@{\hspace{1cm}}l@{}} & & & & \\ \multicolumn{2}{r}{\textbf{Subtotal}} & & \\ \multicolumn{2}{r}{\textbf{ @ \%}} & & \\ \multicolumn{2}{r}{\textbf{Total}} & & \\ \end{tabularx} \vspace{0.3cm} ***** /100 \vspace{0.3cm} \medskip \vspace{0.3cm} \begin{tabular}{@{}llllr@{}} \multicolumn{5}{c}{\textbf{}} \\ \hline \textbf{} & & \textbf{} & \textbf{} & \textbf{} \\ & & & & \\ \end{tabular} \end{document} ledgersmb/templates/demo/work_order.tex0000644000000000000000000000565711770535774017376 0ustar rootroot \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{tabularx} \usepackage{longtable} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont % Break old pagebreak directive % %\end{tabularx} % %\newpage % %\markboth{\hfill }{\hfill } % %\begin{tabularx}{\textwidth}{@{}rlXrll@{}} % \textbf{Item} & \textbf{Number} & \textbf{Description} & \textbf{Qt'y} & % & \textbf{Serial Number} \\ % \vspace*{0.5cm} \parbox[t]{.5\textwidth}{ \textbf{To} \vspace{0.3cm} \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} } \parbox[t]{.5\textwidth}{ \textbf{Ship To} \vspace{0.3cm} \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} } \hfill \vspace{1cm} \textbf{\MakeUppercase{}} \hfill \vspace{1cm} \begin{tabularx}{\textwidth}{*{6}{|X}|} \hline \textbf{Order \#} & \textbf{Order Date} & \textbf{Required by} & \textbf{Salesperson} & \textbf{Shipping Point} & \textbf{Ship Via} \\ [0.5em] \hline & & & & & \\ \hline \end{tabularx} \vspace{1cm} \begin{longtable}{@{\extracolsep{\fill}}rllrll@{}} \textbf{} & \textbf{} & \textbf{} & \textbf{} & & \textbf{} \\ & & & & & \\ \end{longtable} \parbox{\textwidth}{ \rule{\textwidth}{2pt} \vspace{12pt} \medskip } \vfill \end{document} ledgersmb/templates/demo/receipt.tex0000644000000000000000000000272611607775174016645 0ustar rootroot \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{tabularx} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont \parbox[t]{12cm}{ } \hfill \parbox[t]{6cm}{\hfill } \vspace*{0.6cm} \dotfill /100 \makebox[0.5cm]{\hfill} \vspace{0.5cm} \hfill \makebox[2cm]{\hfill} % different date format for datepaid % \vspace{0.5cm} \hspace{-0.1cm}, \vspace{1.8cm} \vspace{0.8cm} \vspace{0.5cm} \hfill \hfill \vspace{0.5cm} \begin{tabularx}{\textwidth}{lXrr@{}} \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ & \dotfill & & \\ \end{tabularx} \vspace{1cm} \vfill \end{document} ledgersmb/templates/demo/ap_transaction.csv0000644000000000000000000000034512054171776020200 0ustar rootrootaccount,amount,description,project ,,,, ledgersmb/templates/demo/es/0000755000000000000000000000000012060044550015045 5ustar rootrootledgersmb/templates/demo/fr_BE/0000755000000000000000000000000012060044550015413 5ustar rootrootledgersmb/templates/demo/invoice.html0000644000000000000000000002052611770535774017011 0ustar rootroot
 

 



,









,






 
       
 
   
.

on @ %
-
 
 
 

***** /100
 

 
 
X
 
 
ledgersmb/templates/demo/fi/0000755000000000000000000000000012060044550015034 5ustar rootrootledgersmb/templates/demo/es_PA/0000755000000000000000000000000012060044550015425 5ustar rootrootledgersmb/templates/demo/es_SV/0000755000000000000000000000000012060044550015455 5ustar rootrootledgersmb/templates/demo/pt_BR/0000755000000000000000000000000012060044550015444 5ustar rootrootledgersmb/templates/demo/lt/0000755000000000000000000000000012060044550015055 5ustar rootrootledgersmb/templates/demo/timecard.html0000644000000000000000000000527411770535774017150 0ustar rootroot <?lsmb text('Time Card') ?>
 

 
 
 

ledgersmb/templates/demo/de/0000755000000000000000000000000012060044550015026 5ustar rootrootledgersmb/templates/demo/statement.tex0000644000000000000000000000412611625034701017172 0ustar rootroot \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{tabularx} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont \parbox[t]{.5\textwidth}{ \hspace{-0.1cm}, } \parbox[t]{.5\textwidth}{ } \hfill \vspace{1cm} \textbf{\MakeUppercase{}} \hfill \textbf{} \vspace{2cm} \begin{tabular*}{\textwidth}{|ll@{\extracolsep\fill}ccrrrr|} \hline \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{30} & \textbf{60} & \textbf{90} \\ \hline & & & & & & & \\ \multicolumn{8}{|l|}{\mbox{}} \\ \hline \textbf{} & & & & & & & \\ \hline \end{tabular*} \vspace{0.5cm} \hfill \begin{tabularx}{\textwidth}{Xr@{\hspace{1cm}}r@{}} & \textbf{} & \textbf{} \end{tabularx} \vfill \pagebreak \end{document} ledgersmb/templates/demo/es_EC/0000755000000000000000000000000012060044550015414 5ustar rootrootledgersmb/templates/demo/bg/0000755000000000000000000000000012060044550015026 5ustar rootrootledgersmb/templates/demo/income_statement.html0000644000000000000000000001233612000243236020663 0ustar rootroot <?lsmb titlebar ?> ") ?>
    


') ?>























ledgersmb/templates/demo/sales_quotation.html0000644000000000000000000001145411770535774020567 0ustar rootroot <?lsmb text('Quotation') ?>
 

 



,





 
   
 
 

on @ %
 
 
 
 

 
X
ledgersmb/templates/demo/ar_EG/0000755000000000000000000000000012060044550015413 5ustar rootrootledgersmb/templates/demo/pt/0000755000000000000000000000000012060044550015061 5ustar rootrootledgersmb/templates/demo/nl_BE/0000755000000000000000000000000012060044550015415 5ustar rootrootledgersmb/templates/demo/tr/0000755000000000000000000000000012060044550015063 5ustar rootrootledgersmb/templates/demo/en_GB/0000755000000000000000000000000012060044550015410 5ustar rootrootledgersmb/templates/demo/purchase_order.html0000644000000000000000000001353511770535774020364 0ustar rootroot <?lsmb text('Purchase Order') ?>
 

 



,







,




 
   
 
.

on @ %
 
 
 

 
  X
ledgersmb/templates/demo/timecard.tex0000644000000000000000000000301411770535774016772 0ustar rootroot \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{tabularx} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont \centerline{\textbf{\MakeUppercase{}}} \vspace*{0.5cm} \begin{tabular}[t]{ll} \textbf{} & \\ \textbf{} & \\ \end{tabular} \hfill \begin{tabular}[t]{ll} \textbf{} & \\ \textbf{} & \\ \textbf{} & \\ \textbf{} & \\ \textbf{} & \\ \end{tabular} \vspace{1cm} \begin{tabular}[b]{ll} \textbf{} & \\ \textbf{} & \\ \textbf{} & \\ \textbf{} & \\ \end{tabular} \hfill \begin{tabular}[b]{lr} \textbf{} & \\ \textbf{} & \\ \end{tabular} \vspace{0.3cm} \medskip \end{document} ledgersmb/templates/demo/pick_list.html0000644000000000000000000000670611742605605017330 0ustar rootroot <?lsmb text('Pick List') ?>
 

 
 



,



 
           
 
 
[      ]
 
ledgersmb/templates/demo/invoice.tex0000644000000000000000000001201011770535774016632 0ustar rootroot \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{tabularx} \usepackage{longtable} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \setlength\LTleft{0pt} \setlength\LTright{0pt} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont \begin{minipage}{2in} \medskip \raggedright \end{minipage} \newsavebox{\ftr} \sbox{\ftr}{ \parbox{\textwidth}{ \tiny \rule[1.5em]{\textwidth}{0.5pt} } } \markboth{\hfill }{\hfill } \vspace*{0.5cm} \parbox[t]{.5\textwidth}{ \textbf{To} \vspace{0.3cm} \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} Tel: Fax: } \parbox[t]{.5\textwidth}{ \textbf{} \vspace{0.3cm} \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} Tel: Fax: } \hfill \vspace{1cm} \textbf{\MakeUppercase{}} \hfill \vspace{1cm} \begin{tabularx}{\textwidth}{*{7}{|X}|} \hline \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ [0.5em] \hline & & & & & & \\ \hline \end{tabularx} \vspace{1cm} \begin{longtable}{@{\extracolsep{\fill}}r|llcrlrr|r} \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \endhead & & & & & & & & \\ \hline \hline \multicolumn{8}{r|}{} & \\* \multicolumn{8}{r|}{ on } & \\* \multicolumn{8}{r|}{ } & - \\* \hline \hline \multicolumn{8}{r|}{} & \\ \end{longtable} \parbox{\textwidth}{ \vspace{0.2cm} \hfill \vspace{0.3cm} ***** /100 \hfill \vspace{12pt} \medskip } \vfill \begin{tabularx}{10cm}{@{}lXlr@{}} \textbf{} & & & \\ \hline \textbf{} & & \textbf{} & \textbf{} \\ & & & \\ \end{tabularx} \vspace{1cm} \centerline{\textbf{}} \rule{\textwidth}{0.5pt} \usebox{\ftr} \end{document} ledgersmb/templates/demo/packing_list.html0000644000000000000000000001064111770535774020021 0ustar rootroot <?lsmb text('Packing List') ?>
 

 
 



,



 
           
 
   
 
 
Notes

 
X
ledgersmb/templates/demo/es_CO/0000755000000000000000000000000012060044550015426 5ustar rootrootledgersmb/templates/demo/bin_list.tex0000644000000000000000000000541111745313742016777 0ustar rootroot \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{tabularx} \usepackage{longtable} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont % Breaking old pagebreak directives % %\end{tabularx} % %\newpage % %\markboth{\hfill }{\hfill } % %\begin{tabularx}{\textwidth}{@{}rlXllrrll@{}} % \textbf{Item} & \textbf{Number} & \textbf{Description} & \textbf{Serial Number} & & \textbf{Qty} & \textbf{Recd} & & \textbf{Bin} \\ % \vspace*{0.5cm} \parbox[t]{.5\textwidth}{ \textbf{} \vspace{0.3cm} \hspace{-0.1cm}, } \parbox[t]{.5\textwidth}{ \textbf{} \vspace{0.3cm} \hspace{-0.1cm}, } \hfill \vspace{1cm} \textbf{\MakeUppercase{}} \hfill \vspace{1cm} \begin{tabularx}{\textwidth}{*{6}{|X}|} \hline \textbf{Order \#} & \textbf{Date} & \textbf{Contact} & \textbf{} & \textbf{} & \textbf{} \\ [0.5em] \hline & & & & & & \\ \hline \end{tabularx} \vspace{1cm} \begin{longtable}{@{\extracolsep{\fill}}rllllrrll@{}} \textbf{} & \textbf{} & \textbf{} & \textbf{} & & \textbf{} & \textbf{} & & \textbf{} \\ & & & & & & & & \\ \end{longtable} \rule{\textwidth}{2pt} \end{document} ledgersmb/templates/demo/en/0000755000000000000000000000000012060044550015040 5ustar rootrootledgersmb/templates/demo/hu/0000755000000000000000000000000012060044550015052 5ustar rootrootledgersmb/templates/demo/statement.html0000644000000000000000000000635211742605605017350 0ustar rootroot <?lsmb text('Statement') ?>
 

 
 



,




 

       
 
 
 
ledgersmb/templates/demo/en_CA/0000755000000000000000000000000012060044550015403 5ustar rootrootledgersmb/templates/demo/et/0000755000000000000000000000000012060044550015046 5ustar rootrootledgersmb/templates/demo/sv/0000755000000000000000000000000012060044550015066 5ustar rootrootledgersmb/templates/demo/it/0000755000000000000000000000000012060044550015052 5ustar rootrootledgersmb/templates/demo/ar_transaction.csv0000644000000000000000000000034512054171776020202 0ustar rootrootaccount,amount,description,project ,,,, ledgersmb/templates/demo/printPayment.html0000644000000000000000000001142411655775556020052 0ustar rootroot <?lsmb titlebar ?>
LOGO AREA

 
--
 
: :






___________________________________________
:
:
: 
: ____________________________
:
ledgersmb/templates/demo/is/0000755000000000000000000000000012060044550015051 5ustar rootrootledgersmb/templates/demo/purchase_order.tex0000644000000000000000000000653111770535774020216 0ustar rootroot \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{tabularx} \usepackage{longtable} \setlength\LTleft{0pt} \setlength\LTright{0pt} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont \markboth{\hfill }{\hfill } \vspace*{0.5cm} \parbox[t]{.5\textwidth}{ \textbf{To} \vspace{0.3cm} \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} } \parbox[t]{.5\textwidth}{ \textbf{Ship To} \vspace{0.3cm} \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} / } \hfill \vspace{1cm} \textbf{\MakeUppercase{}} \hfill \vspace{1cm} \begin{tabularx}{\textwidth}{*{6}{|X}|} \hline \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ [0.5ex] \hline & & & & & \\ \hline \end{tabularx} \vspace{1cm} \begin{longtable}{@{\extracolsep{\fill}}llrlrr@{\extracolsep{0pt}}} \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ \endhead & & & & & \\ \end{longtable} \parbox{\textwidth}{ \rule{\textwidth}{2pt} \vspace{0.2cm} \hfill \begin{tabularx}{7cm}{Xr@{\hspace{1cm}}r@{}} & Subtotal & \\ & on & \\ \hline & Total & \\ \end{tabularx} \vspace{0.3cm} \hfill \vspace{12pt} \medskip } %\renewcommand{\thefootnote}{\fnsymbol{footnote}} %\footnotetext[1]{\tiny } \end{document} ledgersmb/templates/demo/nl/0000755000000000000000000000000012060044550015047 5ustar rootrootledgersmb/templates/demo/sales_order.tex0000644000000000000000000000715511770535774017516 0ustar rootroot \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{tabularx} \usepackage{longtable} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \setlength\LTleft{0pt} \setlength\LTright{0pt} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont \markboth{\hfill }{\hfill } \vspace*{0.5cm} \parbox[t]{.5\textwidth}{ \textbf{To} \vspace{0.3cm} \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} } \parbox[t]{.5\textwidth}{ \textbf{Ship To} \vspace{0.3cm} \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} } \hfill \vspace{1cm} \textbf{\MakeUppercase{}} \hfill \vspace{1cm} \begin{tabularx}{\textwidth}{*{6}{|X}|} \hline \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ [0.5em] \hline & & & & & \\ \hline \end{tabularx} \vspace{1cm} \begin{longtable}{@{\extracolsep{\fill}}rlcrlrrr@{\extracolsep{0pt}}} \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \endhead & & & & & & & \\ \end{longtable} \parbox{\textwidth}{ \rule{\textwidth}{2pt} \vspace{0.2cm} \hfill \begin{tabularx}{7cm}{Xr@{\hspace{1cm}}r@{}} & Subtotal & \\ & on & \\ \hline & Total & \\ \end{tabularx} \vspace{0.3cm} ***** /100 \hfill \vspace{12pt} \medskip } \vfill \centerline{\textbf{}} \rule{\textwidth}{0.5pt} \end{document} ledgersmb/templates/demo/bin_list.html0000644000000000000000000001042011742605605017136 0ustar rootroot <?lsmb text('Bin List') ?>
 

 



,







,



 
       
 
   
 
ledgersmb/templates/demo/letterhead.html0000644000000000000000000000163611607707650017470 0ustar rootroot  




ledgersmb/templates/demo/pick_list.tex0000644000000000000000000000517211745305677017171 0ustar rootroot \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{tabularx} \usepackage{longtable} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont % Breaking old pagebreak directive % %\end{tabularx} % %\newpage % %\markboth{\hfill }{\hfill } % %\begin{tabularx}{\textwidth}{@{}rlXrcll@{}} % \textbf{Item} & \textbf{Number} & \textbf{Description} & % \textbf{Qty} & \textbf{Ship} & & \textbf{Bin} \\ % % \vspace*{0.5cm} \parbox[t]{.5\textwidth}{ \textbf{Ship To} } \hfill \vspace{0.3cm} \parbox[t]{.5\textwidth}{ \hspace{-0.1cm}, } \parbox[t]{.5\textwidth}{ Tel: Fax: } \hfill \vspace{1cm} \textbf{\MakeUppercase{}} \hfill \vspace{1cm} \begin{tabularx}{\textwidth}{*{7}{|X}|} \hline \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ [0.5em] \hline & & & & & & & \\ \hline \end{tabularx} \vspace{1cm} \begin{longtable}{@{\extracolsep{\fill}}rllrcll@{}} \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & & \textbf{} \\ & & & & [\hspace{1cm}] & & \\ \end{longtable} \parbox{\textwidth}{ \rule{\textwidth}{2pt} } \end{document} ledgersmb/templates/demo/pl/0000755000000000000000000000000012060044550015051 5ustar rootrootledgersmb/templates/demo/request_quotation.html0000644000000000000000000001023411770535774021143 0ustar rootroot <?lsmb text('Request for Quotation') ?>
 

 



,







,




 
     
 
 
 
.

 

ledgersmb/templates/demo/id/0000755000000000000000000000000012060044550015032 5ustar rootrootledgersmb/templates/demo/de_CH/0000755000000000000000000000000012060044550015400 5ustar rootrootledgersmb/templates/demo/check_multiple.tex0000644000000000000000000000143211112075712020151 0ustar rootroot \documentclass{scrartcl} \usepackage[latin1]{inputenc} \usepackage{tabularx} \usepackage{graphicx} \usepackage{textpos} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont \clearpage \end{document} ledgersmb/templates/demo/sales_order.html0000644000000000000000000001344711770535774017663 0ustar rootroot <?lsmb text('Sales Order') ?>
 

 



,








,





 
   
 
 
.

on @ %
 
***** /100
 
 

 
X
ledgersmb/templates/demo/el/0000755000000000000000000000000012060044550015036 5ustar rootrootledgersmb/templates/demo/ap_transaction.html0000644000000000000000000001215311770535774020357 0ustar rootroot <?lsmb text('AP Transaction') ?>
 

 



,






 
 
 
 
@ %
  ***** /100
 

 

 
 
ledgersmb/templates/demo/balance_sheet.html0000644000000000000000000001333312000243236020100 0ustar rootroot <?lsmb titlebar ?> ") ?>     


') ?>


























ledgersmb/templates/demo/letterhead.tex0000644000000000000000000000076711607764606017334 0ustar rootroot\parbox{\textwidth}{% \parbox[b]{.42\textwidth}{% } \parbox[b]{.2\textwidth}{ % If you want to use a logo uncomment this and set images to % an absolute path to the images, or set the path appropriately here. %\includegraphics[scale=0.3]{/logo} }\hfill \begin{tabular}[b]{rr@{}} & \\ & \end{tabular} \rule[1.5em]{\textwidth}{0.5pt} } ledgersmb/templates/demo/zh_TW/0000755000000000000000000000000012060044550015471 5ustar rootrootledgersmb/templates/demo/fr_CA/0000755000000000000000000000000012060044550015410 5ustar rootrootledgersmb/templates/demo/ar_transaction.tex0000644000000000000000000000641311770535774020217 0ustar rootroot \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{tabularx} \usepackage[top=2cm,bottom=1.5cm,left=2cm,right=1cm]{geometry} \usepackage{graphicx} \setlength{\parindent}{0pt} \begin{document} \pagestyle{empty} \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont \parbox{\textwidth}{% \parbox[b]{.42\textwidth}{% } %\parbox[b]{.2\textwidth}{ %\includegraphics[scale=0.3]{ledger-smb} %} \hfill \begin{tabular}[b]{rr@{}} & \\ & \end{tabular} \rule[1.5em]{\textwidth}{0.5pt} } \centerline{\MakeUppercase{}} \vspace*{0.5cm} \parbox[t]{.5\textwidth}{ , \vspace{0.3cm} \vspace{0.2cm} } \hfill \begin{tabular}[t]{ll} \textbf{} & \\ \textbf{} & \\ \textbf{} & \\ \textbf{PO \#} & \\ \textbf{} & \\ \textbf{} & \\ \end{tabular} \vspace{1cm} \begin{tabularx}{\textwidth}[t]{@{}llrX@{\hspace{1cm}}l@{}} & & & & \\ \multicolumn{2}{r}{\textbf{Subtotal}} & & \\ \multicolumn{2}{r}{\textbf{ @ \%}} & & \\ \multicolumn{2}{r}{\textbf{Total}} & & \\ \end{tabularx} \vspace{0.3cm} ***** /100 \vspace{0.3cm} \medskip \vspace{0.3cm} \begin{tabular}{@{}lllr@{}} \multicolumn{5}{c}{\textbf{}} \\ \hline \textbf{} & & \textbf{} & \textbf{} \\ & & & \\ \end{tabular} \vspace{0.5cm} \textbf{\scriptsize } \\ \end{document} ledgersmb/templates/demo/nb/0000755000000000000000000000000012060044550015035 5ustar rootrootledgersmb/templates/demo/packing_list.tex0000644000000000000000000000647311770535774017665 0ustar rootroot \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{tabularx} \usepackage{longtable} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont \newsavebox{\ftr} \sbox{\ftr}{ \parbox{\textwidth}{ \tiny \rule[1.5em]{\textwidth}{0.5pt} } } % Breaking old pagebreak directive % %\end{tabularx} % %\newpage % %\markboth{\hfill }{\hfill } % %\begin{tabularx}{\textwidth}{@{}rlXllrrl@{}} % \textbf{Item} & \textbf{Number} & \textbf{Description} & \textbf{Serial Number} & & \textbf{Qty} & \textbf{Ship} & \\ % \vspace*{0.5cm} \parbox[t]{.5\textwidth}{ \textbf{Ship To}} \hfill \vspace{0.3cm} \parbox[t]{.5\textwidth}{ \hspace{-0.1cm}, } \parbox[t]{.5\textwidth}{ Tel: Fax: } \hfill \vspace{1cm} \textbf{\MakeUppercase{}} \hfill \vspace{1cm} \begin{tabularx}{\textwidth}{*{7}{|X}|} \hline \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ [0.5em] \hline & & & & & & & \\ \hline \end{tabularx} \vspace{1cm} \begin{longtable}{@{\extracolsep{\fill}}rllllrrl@{}} \textbf{} & \textbf{} & \textbf{} & \textbf{} & & \textbf{} & \textbf{} & \\ & & & & & & & \\ \end{longtable} \parbox{\textwidth}{ \rule{\textwidth}{2pt} \vspace{12pt} \medskip } \vfill \rule{\textwidth}{0.5pt} \usebox{\ftr} \end{document} ledgersmb/templates/demo/check_base.tex0000644000000000000000000000240012037225517017233 0ustar rootroot \parbox[t]{12cm}{ } \hfill \parbox[t]{6cm}{\hfill } \vspace*{0.6cm} \dotfill /100 \makebox[0.5cm]{\hfill} \vspace{0.5cm} \hfill \makebox[2cm]{\hfill} % different date format for datepaid % \vspace{0.5cm} \hspace{-0.1cm}, \vspace{1.8cm} \vspace{0.8cm} \vspace{0.5cm} \hfill \hfill \vspace{0.5cm} \begin{tabularx}{\textwidth}{lXrr@{}} \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ & \dotfill & & \\ \end{tabularx} \vspace{1cm} \vfill ledgersmb/templates/demo/ca/0000755000000000000000000000000012060044550015021 5ustar rootrootledgersmb/templates/demo/request_quotation.tex0000644000000000000000000000563011770535774021003 0ustar rootroot \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{tabularx} \usepackage{longtable} \setlength\LTleft{0pt} \setlength\LTright{0pt} \usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry} \usepackage{graphicx} \begin{document} \pagestyle{myheadings} \thispagestyle{empty} \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont \markboth{\hfill }{\hfill } \vspace*{0.5cm} \parbox[t]{.5\textwidth}{ \textbf{} \vspace{0.3cm} \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} } \parbox[t]{.5\textwidth}{ \textbf{Ship To} \vspace{0.3cm} \hspace{-0.1cm}, \vspace{0.3cm} \vspace{0.2cm} } \hfill \vspace{1cm} \textbf{\MakeUppercase{}} \hfill \vspace{1cm} \begin{tabularx}{\textwidth}{*{6}{|X}|} \hline \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} & \textbf{} \\ [0.5ex] \hline & & & & & \\ \hline \end{tabularx} \vspace{1cm} \vspace{1cm} \begin{longtable}{@{\extracolsep{\fill}}lcrllrr@{\extracolsep{\fill}}} \textbf{} & \textbf{} & \textbf{} & & \textbf{} & \textbf{} & \textbf{} \endhead & & & \\ \end{longtable} \parbox{\textwidth}{ \rule{\textwidth}{2pt} \hfill \medskip } \end{document} ledgersmb/templates/demo/fr/0000755000000000000000000000000012060044550015045 5ustar rootrootledgersmb/ar.pl0000755000000000000000000000016511577731667012510 0ustar rootroot#!/usr/bin/perl use FindBin; BEGIN { lib->import($FindBin::Bin) unless $ENV{mod_perl} } require "old-handler.pl"; ledgersmb/install.sh0000644000000000000000000000134311663402150013521 0ustar rootroot#!/bin/sh #./install.sh myLsmb13_test CWD=`pwd` APACHE_ALIAS='ledgersmb' if [ $# -eq 1 ] then APACHE_ALIAS=$1 echo "setting apache alias to $APACHE_ALIAS" fi echo "Installing Perl Modules" cpan Module::Install perl Makefile.PL make echo "Configuring Apache" #sed "s|WORKING_DIR|$CWD|" ledgersmb-httpd.conf.template > ledgersmb-httpd.conf sed "s|/ledgersmb|/$APACHE_ALIAS|g;s|WORKING_DIR|$CWD|g" ledgersmb-httpd.conf.template > ledgersmb-httpd.conf echo "Which user does your web server run as?" read username chown $username spool templates css echo "Where do we copy the ledgersmb-httpd.conf file to?" read location cp ledgersmb-httpd.conf $location echo "Please restart your web server for the changes to take effect." ledgersmb/file.pl0000755000000000000000000000016711647132134013005 0ustar rootroot#!/usr/bin/perl use FindBin; BEGIN { lib->import($FindBin::Bin) unless $ENV{mod_perl} } require 'lsmb-request.pl'; ledgersmb/LedgerSMB/0000755000000000000000000000000012060044551013261 5ustar rootrootledgersmb/LedgerSMB/Num2text.pm0000644000000000000000000007523011606533762015370 0ustar rootroot#===================================================================== # LedgerSMB # Small Medium Business Accounting software # http://www.ledgersmb.org/ # # Copyright (C) 2006 # This work contains copyrighted information from a number of sources all used # with permission. # # This file contains source code included with or based on SQL-Ledger which # is Copyright Dieter Simader and DWS Systems Inc. 2000-2005 and licensed # under the GNU General Public License version 2 or, at your option, any later # version. For a full list including contact information of contributors, # maintainers, and copyright holders, see the CONTRIBUTORS file. # # Original Copyright Notice from SQL-Ledger 2.6.17 (before the fork): # Copyright (C) 2002 # # Author: DWS Systems Inc. # Web: http://www.sql-ledger.org # # Contributors: # #====================================================================== # # This file has undergone whitespace cleanup. # #====================================================================== # # this is the default code for the Check package # #===================================================================== # The conversion routines can be tested with for example: # perl <new('da'); # $c->init; # for(0 .. 202, 999 .. 1002, 1999 .. 2002, 999999 .. 1000002, 999999999 .. 1000000002) # {print $_.":".$c->num2text($_)."\n";};' # EOF use utf8; sub init { my $self = shift; my $locale = $self->{'locale'} || $self->{'_locale'}; my $langtag = substr( $locale->language_tag, 0, 2 ); $self->{'numrules'} = 'en'; $self->{'numrules'} = $langtag if grep { /$langtag/ } (qw/ca de es et fr hu it nl ru da/); $self->{'numrules'} = 'es' if $self->{'numrules'} eq 'ca'; $self->{'numrules'} = 'de' if $self->{'numrules'} eq 'ru'; %{ $self->{numbername} } = ( 0 => $locale->text('Zero'), 1 => $locale->text('One'), '1o' => $locale->text('One-o'), 2 => $locale->text('Two'), 3 => $locale->text('Three'), 4 => $locale->text('Four'), 5 => $locale->text('Five'), 6 => $locale->text('Six'), 7 => $locale->text('Seven'), 8 => $locale->text('Eight'), 9 => $locale->text('Nine'), 10 => $locale->text('Ten'), 11 => $locale->text('Eleven'), '11o' => $locale->text('Eleven-o'), 12 => $locale->text('Twelve'), 13 => $locale->text('Thirteen'), 14 => $locale->text('Fourteen'), 15 => $locale->text('Fifteen'), 16 => $locale->text('Sixteen'), 17 => $locale->text('Seventeen'), 18 => $locale->text('Eighteen'), 19 => $locale->text('Nineteen'), 20 => $locale->text('Twenty'), 21 => $locale->text('Twenty One'), '21o' => $locale->text('Twenty One-o'), 22 => $locale->text('Twenty Two'), 23 => $locale->text('Twenty Three'), 24 => $locale->text('Twenty Four'), 25 => $locale->text('Twenty Five'), 26 => $locale->text('Twenty Six'), 27 => $locale->text('Twenty Seven'), 28 => $locale->text('Twenty Eight'), 29 => $locale->text('Twenty Nine'), 30 => $locale->text('Thirty'), 40 => $locale->text('Forty'), 50 => $locale->text('Fifty'), 60 => $locale->text('Sixty'), 70 => $locale->text('Seventy'), 80 => $locale->text('Eighty'), 90 => $locale->text('Ninety'), 10**2 => $locale->text('Hundred'), 500 => $locale->text('Five Hundred'), 700 => $locale->text('Seven Hundred'), 900 => $locale->text('Nine Hundred'), 10**3 => $locale->text('Thousand'), 10**6 => $locale->text('Million'), 10**9 => $locale->text('Billion'), 10**12 => $locale->text('Trillion'), ); } sub num2text { my ( $self, $amount ) = @_; return $self->num2text_de($amount) if $self->{'numrules'} eq 'de'; return $self->num2text_es($amount) if $self->{'numrules'} eq 'es'; return $self->num2text_nl($amount) if $self->{'numrules'} eq 'nl'; return $self->num2text_hu($amount) if $self->{'numrules'} eq 'hu'; return $self->num2text_et($amount) if $self->{'numrules'} eq 'et'; return $self->num2text_fr($amount) if $self->{'numrules'} eq 'fr'; return $self->num2text_it($amount) if $self->{'numrules'} eq 'it'; return $self->num2text_da($amount) if $self->{'numrules'} eq 'da'; return $self->num2text_en($amount); } sub num2text_en { my ( $self, $amount ) = @_; return $self->{numbername}{0} unless $amount; my @textnumber = (); # split amount into chunks of 3 my @num = reverse split //, abs($amount); my @numblock = (); my @a; my $i; while (@num) { @a = (); for ( 1 .. 3 ) { push @a, shift @num; } push @numblock, join / /, reverse @a; } while (@numblock) { $i = $#numblock; @num = split //, $numblock[$i]; if ( $numblock[$i] == 0 ) { pop @numblock; next; } if ( $numblock[$i] > 99 ) { # the one from hundreds push @textnumber, $self->{numbername}{ $num[0] }; # add hundred designation push @textnumber, $self->{numbername}{ 10**2 }; # reduce numblock $numblock[$i] -= $num[0] * 100; } $numblock[$i] *= 1; if ( $numblock[$i] > 9 ) { # tens push @textnumber, $self->format_ten_en( $numblock[$i] ); } elsif ( $numblock[$i] > 0 ) { # ones push @textnumber, $self->{numbername}{ $numblock[$i] }; } # add thousand, million if ($i) { $num = 10**( $i * 3 ); push @textnumber, $self->{numbername}{$num}; } pop @numblock; } join ' ', @textnumber; } sub format_ten_en { my ( $self, $amount ) = @_; my $textnumber = ""; my @num = split //, $amount; if ( $amount > 20 ) { $textnumber = $self->{numbername}{ $num[0] * 10 }; $amount = $num[1]; } else { $textnumber = $self->{numbername}{$amount}; $amount = 0; } $textnumber .= " " . $self->{numbername}{$amount} if $amount; $textnumber; } sub num2text_de { my ( $self, $amount ) = @_; return $self->{numbername}{0} unless $amount; my @textnumber = (); # split amount into chunks of 3 my @num = reverse split //, abs($amount); my @numblock = (); my ( $i, $appendn ); my @a = (); while (@num) { @a = (); for ( 1 .. 3 ) { push @a, shift @num; } push @numblock, join / /, reverse @a; } my $belowhundred = !$#numblock; while (@numblock) { $i = $#numblock; @num = split //, $numblock[$i]; $appendn = ""; $numblock[$i] *= 1; if ( $numblock[$i] == 0 ) { pop @numblock; next; } if ( $numblock[$i] > 99 ) { # the one from hundreds push @textnumber, $self->{numbername}{ $num[0] }; # add hundred designation push @textnumber, $self->{numbername}{ 10**2 }; # reduce numblock $numblock[$i] -= $num[0] * 100; } $appendn = 'en' if ( $i == 2 ); $appendn = 'n' if ( $i > 2 ); if ( $numblock[$i] > 9 ) { # tens push @textnumber, $self->format_ten_de( $numblock[$i], $belowhundred ); } elsif ( $numblock[$i] > 1 ) { # ones push @textnumber, $self->{numbername}{ $numblock[$i] }; } elsif ( $numblock[$i] == 1 ) { if ( $i == 0 ) { push @textnumber, $self->{numbername}{ $numblock[$i] } . 's'; } else { if ( $i >= 2 ) { push @textnumber, $self->{numbername}{ $numblock[$i] } . 'e'; } else { push @textnumber, $self->{numbername}{ $numblock[$i] }; } } $appendn = ""; } # add thousand, million if ($i) { $amount = 10**( $i * 3 ); push @textnumber, $self->{numbername}{$amount} . $appendn; } pop @numblock; } join '', @textnumber; } sub format_ten_de { my ( $self, $amount, $belowhundred ) = @_; my $textnumber = ""; my @num = split //, $amount; if ( $amount > 20 ) { if ( $num[1] == 0 ) { $textnumber = $self->{numbername}{$amount}; } else { if ($belowhundred) { $amount = $num[0] * 10; $textnumber = $self->{numbername}{ $num[1] } . 'und' . $self->{numbername}{$amount}; } else { $amount = $num[0] * 10; $textnumber = $self->{numbername}{$amount} . $self->{numbername}{ $num[1] }; $textnumber .= 's' if ( $num[1] == 1 ); } } } else { $textnumber = $self->{numbername}{$amount}; } $textnumber; } sub num2text_et { my ( $self, $amount ) = @_; return $self->{numbername}{0} unless $amount; my @textnumber = (); # split amount into chunks of 3 my @num = reverse split //, abs($amount); my @numblock = (); my ( $i, $appendit ); my @a = (); while (@num) { @a = (); for ( 1 .. 3 ) { push @a, shift @num; } push @numblock, join / /, reverse @a; } while (@numblock) { $i = $#numblock; $numblock[$i] *= 1; @num = split //, $numblock[$i]; $appendit = "it"; $hundred = 0; if ( $numblock[$i] == 0 ) { pop @numblock; next; } if ( $numblock[$i] > 99 ) { # the one from hundreds push @textnumber, "$self->{numbername}{$num[0]}$self->{numbername}{10**2}"; # reduce numblock $numblock[$i] -= $num[0] * 100; @num = split //, $numblock[$i]; $hundred = 1; } if ( $numblock[$i] > 19 ) { # 20 - 99 push @textnumber, "$self->{numbername}{$num[0]}kümmend"; @num = split //, $numblock[$i]; push @textnumber, $self->{numbername}{ $num[1] } if $num[1] > 0; } elsif ( $numblock[$i] > 10 ) { # 11 - 19 if ($hundred) { @num = split //, $numblock[$i]; } $num = $num[1]; push @textnumber, "$self->{numbername}{$num}teist"; } elsif ( $numblock[$i] > 1 ) { # ones push @textnumber, $self->{numbername}{ $numblock[$i] }; } elsif ( $numblock[$i] == 1 ) { push @textnumber, $self->{numbername}{ $num[0] }; $appendit = ""; } # add thousand, million if ($i) { $amount = 10**( $i * 3 ); $appendit = ( $i == 1 ) ? "" : $appendit; push @textnumber, "$self->{numbername}{$amount}$appendit"; } pop @numblock; } join ' ', @textnumber; } sub num2text_es { my ( $self, $amount ) = @_; return $self->{numbername}{0} unless $amount; my @textnumber = (); # split amount into chunks of 3 my @num = reverse split //, abs($amount); my @numblock = (); my $stripun = 0; my @a = (); my $i; while (@num) { @a = (); for ( 1 .. 3 ) { push @a, shift @num; } push @numblock, join / /, reverse @a; } # special case for 1000 if ( $numblock[1] eq '1' && $numblock[0] gt '000' ) { # remove first array element from textnumber $stripun = 1; } while (@numblock) { $i = $#numblock; @num = split //, $numblock[$i]; $numblock[$i] *= 1; if ( $numblock[$i] == 0 ) { pop @numblock; next; } if ( $numblock[$i] > 99 ) { if ( $num[0] == 1 ) { push @textnumber, $self->{numbername}{ 10**2 }; } else { # special case for 500, 700, 900 if ( grep /$num[0]/, ( 5, 7, 9 ) ) { push @textnumber, $self->{numbername}{"${num[0]}00"}; } else { # the one from hundreds, append cientos push @textnumber, $self->{numbername}{ $num[0] } . $self->{numbername}{ 10**2 } . 's'; } } # reduce numblock $numblock[$i] -= $num[0] * 100; } if ( $numblock[$i] > 9 ) { # tens push @textnumber, $self->format_ten_es( $numblock[$i], $i ); } elsif ( $numblock[$i] > 0 ) { # ones $num = $numblock[$i]; $num .= 'o' if ( $num == 1 && $i == 0 ); push @textnumber, $self->{numbername}{$num}; } # add thousand, million if ($i) { $num = 10**( $i * 3 ); if ( $numblock[$i] > 1 ) { if ( $i == 2 || $i == 4 ) { $a = $self->{numbername}{$num} . "es"; $a =~ s/ó/o/; push @textnumber, $a; } elsif ( $i == 3 ) { $num = 10**( $i * 2 ); $a = "$self->{10**3} $self->{numbername}{$num}" . "es"; $a =~ s/ó/o/; push @textnumber, $a; } else { if ( $i == 1 ) { push @textnumber, $self->{numbername}{$num}; } else { push @textnumber, $self->{numbername}{$num} . 's'; } } } else { push @textnumber, $self->{numbername}{$num}; } } pop @numblock; } shift @textnumber if $stripun; join ' ', @textnumber; } sub format_ten_es { my ( $self, $amount, $i ) = @_; my $textnumber = ""; my @num = split //, $amount; if ( $amount > 30 ) { $textnumber = $self->{numbername}{ $num[0] * 10 }; $amount = $num[1]; } else { $amount .= 'o' if ( $num[1] == 1 && $i == 0 ); $textnumber = $self->{numbername}{$amount}; $amount = 0; } $textnumber .= " y " . $self->{numbername}{$amount} if $amount; $textnumber; } sub num2text_fr { my ( $self, $amount ) = @_; return $self->{numbername}{0} unless $amount; my @textnumber = (); # split amount into chunks of 3 my @num = reverse split //, abs($amount); my @numblock = (); my @a; my $i; while (@num) { @a = (); for ( 1 .. 3 ) { push @a, shift @num; } push @numblock, join / /, reverse @a; } my $cent = 0; while (@numblock) { $i = $#numblock; @num = split //, $numblock[$i]; if ( $numblock[$i] == 0 ) { pop @numblock; next; } if ( $numblock[$i] > 99 ) { $cent = 1; # the one from hundreds if ( $num[0] > 1 ) { push @textnumber, $self->{numbername}{ $num[0] }; } # reduce numblock $numblock[$i] -= $num[0] * 100; # add hundred designation if ( $num[0] > 1 ) { if ( $numblock[$i] > 0 ) { push @textnumber, $self->{numbername}{ 10**2 }; } else { push @textnumber, "$self->{numbername}{10**2}s"; } } else { push @textnumber, $self->{numbername}{ 10**2 }; } } $numblock[$i] *= 1; if ( $numblock[$i] > 9 ) { # tens push @textnumber, $self->format_ten_fr( $numblock[$i] ); } elsif ( $numblock[$i] > 0 ) { # ones if ( $i == 1 ) { if ( $cent == 1 ) { push @textnumber, $self->{numbername}{ $numblock[$i] }; } $cent = 0; } else { push @textnumber, $self->{numbername}{ $numblock[$i] }; } } # add thousand, million if ($i) { $num = 10**( $i * 3 ); if ( $i == 1 ) { push @textnumber, $self->{numbername}{$num}; } elsif ( $numblock[$i] > 1 ) { push @textnumber, "$self->{numbername}{$num}s"; } else { push @textnumber, "$self->{numbername}{$num}"; } } pop @numblock; } join ' ', @textnumber; } sub format_ten_fr { my ( $self, $amount ) = @_; my $textnumber = ""; my @num = split //, $amount; if ( $amount > 20 ) { if ( $num[0] == 8 ) { if ( $num[1] > 0 ) { $textnumber = $self->{numbername}{ $num[0] * 10 }; } else { $textnumber = "$self->{numbername}{$num[0]*10}s"; } $amount = $num[1]; } elsif ( $num[0] == 7 || $num[0] == 9 ) { if ( $num[1] > 0 ) { $textnumber = $self->{numbername}{ ( $num[0] - 1 ) * 10 }; $textnumber .= " et" if ( $num[1] == 1 && $num[0] == 7 ); $amount -= ( $num[0] - 1 ) * 10; } else { $textnumber = $self->{numbername}{ $num[0] * 10 }; $amount = $num[1]; } } else { $textnumber = $self->{numbername}{ $num[0] * 10 }; $textnumber .= " et" if ( $num[1] == 1 ); $amount = $num[1]; } } else { $textnumber = "$self->{numbername}{$amount}"; $amount = 0; } $textnumber .= " " . $self->{numbername}{$amount} if $amount; $textnumber; } sub num2text_hu { my ( $self, $amount ) = @_; return $self->{numbername}{0} unless $amount; my @textnumber = (); # split amount into chunks of 3 my @num = reverse split //, abs($amount); my @numblock = (); my @a; my $i; my $res; while (@num) { @a = (); for ( 1 .. 3 ) { push @a, shift @num; } push @numblock, join / /, reverse @a; } while (@numblock) { $i = $#numblock; @num = split //, $numblock[$i]; if ( $numblock[$i] == 0 ) { pop @numblock; next; } if ( $numblock[$i] > 99 ) { push @textnumber, $self->{numbername}{ $num[0] }; # add hundred designation push @textnumber, $self->{numbername}{ 10**2 }; # reduce numblock $numblock[$i] -= $num[0] * 100; } $numblock[$i] *= 1; if ( $numblock[$i] > 9 ) { # tens push @textnumber, $self->format_ten_hu( $numblock[$i] ); } elsif ( $numblock[$i] > 0 ) { # ones push @textnumber, $self->{numbername}{ $numblock[$i] }; } # add thousand, million if ($i) { if ( $i == 1 && $amount < 2000 ) { $num = 10**( $i * 3 ); push @textnumber, $self->{numbername}{$num}; } else { $num = 10**( $i * 3 ); push @textnumber, $self->{numbername}{$num} . "-"; } } pop @numblock; } $res = ucfirst join '', @textnumber; $res =~ s/(\-)$//; return $res; } sub format_ten_hu { my ( $self, $amount ) = @_; my $textnumber = ""; my @num = split //, $amount; if ( $amount > 30 ) { $textnumber = $self->{numbername}{ $num[0] * 10 }; $amount = $num[1]; } else { $textnumber = $self->{numbername}{$amount}; $amount = 0; } $textnumber .= "" . $self->{numbername}{$amount} if $amount; $textnumber; } sub num2text_nl { my ( $self, $amount ) = @_; return $self->{numbername}{0} unless $amount; my @textnumber = ('**'); # split amount into chunks of 3 my @num = reverse split //, abs($amount); my @numblock = (); my ( $i, $appendn ); my @a = (); while (@num) { @a = (); for ( 1 .. 3 ) { push @a, shift @num; } push @numblock, join / /, reverse @a; } while (@numblock) { $i = $#numblock; @num = split //, $numblock[$i]; $numblock[$i] *= 1; if ( $numblock[$i] == 0 ) { pop @numblock; next; } if ( $numblock[$i] > 99 ) { # the one from hundreds push @textnumber, $self->{numbername}{ $num[0] }; # add hundred designation push @textnumber, $self->{numbername}{ 10**2 }; # reduce numblock $numblock[$i] -= $num[0] * 100; } if ( $numblock[$i] > 9 ) { # tens push @textnumber, $self->format_ten_nl( $numblock[$i] ); } else { # ones push @textnumber, $self->{numbername}{ $numblock[$i] }; } # add thousand, million if ($i) { $amount = 10**( $i * 3 ); push @textnumber, $self->{numbername}{$amount}; } pop @numblock; } push @textnumber, '**'; join '', @textnumber; } sub format_ten_nl { my ( $self, $amount ) = @_; my $textnumber = ""; my @num = split //, $amount; if ( $amount > 20 ) { # reverse one and ten and glue together with 'en' $amount = $num[0] * 10; $textnumber = $self->{numbername}{ $num[1] } . 'en' . $self->{numbername}{$amount}; } else { $textnumber = $self->{numbername}{$amount}; } $textnumber; } sub num2text_it { my ( $self, $amount ) = @_; return $self->{numbername}{0} unless $amount; my @textnumber = (); # split amount into chunks of 3 my @num = reverse split //, abs($amount); my @numblock = (); my ( $i, $appendn ); my @a = (); while (@num) { @a = (); for ( 1 .. 3 ) { push @a, shift @num; } push @numblock, join / /, reverse @a; } while (@numblock) { $i = $#numblock; @num = split //, $numblock[$i]; $numblock[$i] *= 1; if ( $numblock[$i] == 0 ) { pop @numblock; next; } if ( $numblock[$i] > 99 ) { # the one from hundreds push @textnumber, $self->{numbername}{ $num[0] }; # add hundred designation push @textnumber, $self->{numbername}{ 10**2 }; # reduce numblock $numblock[$i] -= $num[0] * 100; } if ( $numblock[$i] > 9 ) { # tens push @textnumber, $self->format_ten_it( $numblock[$i] ); } elsif ( $numblock[$i] > 1 ) { # ones push @textnumber, $self->{numbername}{ $numblock[$i] }; } # add thousand, million if ($i) { $amount = 10**( $i * 3 ); push @textnumber, $self->{numbername}{$amount}; } pop @numblock; } join '', @textnumber; } sub format_ten_it { my ( $self, $amount ) = @_; my $textnumber = ""; my @num = split //, $amount; if ( $amount > 20 ) { if ( $num[1] == 0 ) { $textnumber = $self->{numbername}{$amount}; } else { $amount = $num[0] * 10; $textnumber = $self->{numbername}{$amount} . $self->{numbername}{ $num[1] }; } } else { $textnumber = $self->{numbername}{$amount}; } $textnumber; } # A special (swedish-like) spelling of danish check numbers sub num2text_da { my ( $self, $amount ) = @_; # Handle 0 return $self->{numbername}{0} unless $amount; # List of collected digits my @textnumber = (); # split amount into chunks of 3 my @num = reverse split //, abs($amount); my @numblock = (); my @a = (); while (@num) { @a = (); for ( 1 .. 3 ) { push @a, shift @num; } push @numblock, join / /, reverse @a; } my $i; my $bigplural; while (@numblock) { $i = $#numblock; $numblock[$i] *= 1; if ( $numblock[$i] == 0 ) { pop @numblock; next; } # Plural suffix "er" for million and up, not for tusinde $bigpluralsuffix = ""; $bigpluralsuffix = "er" if ( $i > 1 && $numblock[$i] > 1 ); if ( $numblock[$i] > 99 ) { @num = split //, $numblock[$i]; # the one from hundreds push @textnumber, $self->{numbername}{ $num[0] }; # add hundred designation push @textnumber, $self->{numbername}{100}; # reduce numblock $numblock[$i] -= $num[0] * 100; } if ( $numblock[$i] > 9 ) { @num = split //, $numblock[$i]; # the one from tens push @textnumber, $self->{numbername}{ $num[0] }; # add ten designation push @textnumber, $self->{numbername}{10}; # reduce numblock $numblock[$i] -= $num[0] * 10; } if ( $numblock[$i] > 0 ) { # the ones left in the block if ( $numblock[$i] == 1 && $i != 1 ) { push @textnumber, $self->{numbername}{'1o'}; # Special case for "Et" tusinde } else { push @textnumber, $self->{numbername}{ $numblock[$i] }; } } # add thousand, million, etc if ($i) { $amount = 10**( $i * 3 ); push @textnumber, $self->{numbername}{$amount} . $bigpluralsuffix; } pop @numblock; } join '', @textnumber; } sub num2text_sl { my ($self, $amount) = @_; return $self->{numbername}{0} unless $amount; my @textnumber = (); # split amount into chunks of 3 my @num = reverse split //, abs($amount); my @numblock = (); my ($i, $appendn); my @a = (); my $skip1k = 0; my $skip1m = 0; my $skip1b = 0; my $checkvalue = abs($amount) % 10**6; $checkvalue /= 1000; if (1 <= $checkvalue && $checkvalue <= 2) { $skip1k = 1; } $checkvalue = abs($amount) % 10**9; $checkvalue /= 10**6; if (1 <= $checkvalue && $checkvalue <= 2) { $skip1m = 1; } $checkvalue = abs($amount) % 10**15; $checkvalue /= 10**12; if (1 <= $checkvalue && $checkvalue <= 2) { $skip1b = 1; } my $check1m = abs($amount) % 10**8; my $check1md = abs($amount) % 10**11; my $check1b = abs($amount) % 10**14; while (@num) { @a = (); for (1 .. 3) { push @a, shift @num; } push @numblock, join / /, reverse @a; } my $belowhundred = !$#numblock; while (@numblock) { $i = $#numblock; @num = split //, $numblock[$i]; $appendn = ""; $numblock[$i] *= 1; if ($numblock[$i] == 0) { pop @numblock; next; } if ($numblock[$i] > 99) { # the one from hundreds if ( $num[0] > 2 ) { push @textnumber, $self->{numbername}{$num[0]}; } elsif ( $num[0] > 1 ) { push @textnumber, 'dve'; } # add hundred designation push @textnumber, $self->{numbername}{10**2}; # reduce numblock $numblock[$i] -= $num[0] * 100; } # Appends, where for 1 they shall be eliminated later below: if ($i == 2) { if (2*10**6 <= $check1m && $check1m < 3*10**6) { $appendn = 'a'; } elsif (3*10**6 <= $check1m && $check1m < 5*10**6) { $appendn = 'e'; } else { $appendn = 'ov'; } } if ($i == 4) { if (2*10**12 <= $check1b && $check1b < 3*10**12) { $appendn = 'a'; } elsif (3*10**12 <= $check1b && $check1b < 5*10**12) { $appendn = 'e'; } else { $appendn = 'ov'; } } if ($numblock[$i] > 9) { # tens push @textnumber, $self->format_ten($numblock[$i], $belowhundred); } elsif ($numblock[$i] > 1) { # ones if (2*10**9 <= $check1md && $check1md < 3*10**9) { push @textnumber, 'dve'; } else { push @textnumber, $self->{numbername}{$numblock[$i]}; } } elsif ($numblock[$i] == 1) { if ($i == 0) { push @textnumber, $self->{numbername}{$numblock[$i]}; } else { if ($i >= 5) { push @textnumber, $self->{numbername}{$numblock[$i]}.'-!-too big number-!-?!'; } elsif ($i == 4) { if ($skip1b == 0) { push @textnumber, $self->{numbername}{$numblock[$i]}; } } elsif ($i == 3) { if (1*10**9 <= $check1md && $check1md < 2*10**9) { push @textnumber, 'ena'; } else { push @textnumber, $self->{numbername}{$numblock[$i]}; } } elsif ($i == 2) { if ($skip1m == 0) { push @textnumber, $self->{numbername}{$numblock[$i]}; } } elsif ($i == 1) { if ($skip1k == 0) { push @textnumber, $self->{numbername}{$numblock[$i]}; } } else { push @textnumber, $self->{numbername}{$numblock[$i]}; } } $appendn = ""; } # Appends, where also for 1 they shall be considered as below; # if specified above with the others, they would be eliminated # by a command just a few lines above... # if ($i == 3) { if (1*10**9 <= $check1md && $check1md < 2*10**9) { $appendn = 'a'; } elsif (2*10**9 <= $check1md && $check1md < 3*10**9) { $appendn = 'i'; } elsif (3*10**9 <= $check1md && $check1md < 5*10**9) { $appendn = 'e'; } } # add thousand, million if ($i) { $amount = 10**($i * 3); push @textnumber, $self->{numbername}{$amount}.$appendn; } pop @numblock; @textnumber = 'NAPAKA! ¿TEVILKA JE PREVELIKA!' if ($i > 4); } join '', @textnumber; } sub format_ten_sl { my ($self, $amount, $belowhundred) = @_; my $textnumber = ""; my @num = split //, $amount; if ($amount > 20) { if ($num[1] == 0) { $textnumber = $self->{numbername}{$amount}; } elsif ($num[1] == 1) { $amount = $num[0] * 10; $textnumber = $self->{numbername}{$num[1]}.'ain'.$self->{numbername}{$amount}; } else { $amount = $num[0] * 10; $textnumber = $self->{numbername}{$num[1]}.'in'.$self->{numbername}{$amount}; } } else { $textnumber = $self->{numbername}{$amount}; } $textnumber; } 1; ledgersmb/LedgerSMB/Mailer.pm0000644000000000000000000001245011733736346015052 0ustar rootroot=head1 NAME LedgerSMB::Mailer - Mail output for LedgerSMB =head1 SYNOPSIS =head1 COPYRIGHT #==================================================================== # LedgerSMB # Small Medium Business Accounting software # http://www.ledgersmb.org/ # # Copyright (C) 2006 # This work contains copyrighted information from a number of sources # all used with permission. # # This file contains source code included with or based on SQL-Ledger # which # is Copyright Dieter Simader and DWS Systems Inc. 2000-2005 # and licensed under the GNU General Public License version 2 or, at # your option, any later version. For a full list including contact # information of contributors, maintainers, and copyright holders, # see the CONTRIBUTORS file. # # Original Copyright Notice from SQL-Ledger 2.6.17 (before the fork): # Copyright (C) 2002 # # Author: DWS Systems Inc. # Web: http://www.sql-ledger.org # # Contributors: # # Original Author and copyright holder: # Dieter Simader dsmimader@sql-ledger.com #==================================================================== =head1 METHODS =cut package LedgerSMB::Mailer; use warnings; use strict; use Carp; use Encode; use MIME::Lite; use LedgerSMB::Sysconfig; our $VERSION = '0.13'; =head2 LedgerSMB::Mailer->new(...) Create a new Mailer object. If any arguments are passed in, a message that uses them will be automatically prepared but not sent. =cut sub new { my $type = shift; my $self = {}; bless $self, $type; $self->prepare_message(@_) if @_; $self; } =head2 $mail->prepare_message(to => $to, from => $from, ...) Prepares and encodes base message for sending or adding attachments. =head3 Arguments =over =item to, from, cc, bcc Address fields for the email. =item subject The subject for the email. =item message The message body for the email. =item contenttype The conttent type for the body of the message, not for any attachments. =item notify Sets the Disposition-Notification-To header (read receipt request) for the message. This header will only be added if a from address is set. =back =cut sub prepare_message { my $self = shift; my %args = @_; # Populate message fields for my $key (keys %args) { $self->{$key} = $args{$key}; } my $domain = $self->{from}; $domain =~ s/(.*?\@|>)//g; my $boundary = time; $boundary = "LSMB-$boundary"; my $msg_id = "<$boundary\@$domain>"; $self->{contenttype} = "text/plain" unless $self->{contenttype}; for (qw(from to cc bcc subject)) { next unless $self->{$_}; $self->{$_} =~ s/(\/|\\|\$)//g; $self->{$_} =~ s/([\n\r\f])/$1 /g; } $self->{_message} = MIME::Lite->new( 'From' => $self->{from}, 'To' => $self->{to}, 'Cc' => $self->{cc}, 'Bcc' => $self->{bcc}, 'Subject' => Encode::encode('MIME-Header', $self->{subject}), 'Type' => 'TEXT', 'Data' => Encode::encode_utf8($self->{message}), 'Encoding' => '8bit', 'Message-ID' => $msg_id, ); $self->{_message}->attr( 'Content-Type' => $self->{contenttype} ); $self->{_message}->attr( 'Content-Type.charset' => 'UTF-8' ) if $self->{contenttype} =~ m#^text/#; # Annoy people with read receipt requests $self->{_message}->add( 'Disposition-Notification-To' => $self->{from} ) if $self->{notify}; $self->{_message}->binmode(':utf8'); } =head2 $mail->attach(data => $data, file => $file, filename => $name, strip => $strip) Add an attachment to the prepared message. If $data is specified, use the value of that variable as the attachment value, otherwise attach the file given by $file. If both a file and data are given, the data is attached. filename must be given and is used to name the attachment. $strip is an optional string to remove from the filename send with the attachment. =cut sub attach { my $self = shift; my %args = @_; carp "Message not prepared" unless ref $self->{_message}; if (defined $args{file}) { if (!$args{file}){ carp "Invalid filename provided"; } elsif (!defined $args{data} and !(-f $args{file} and -r $args{file})){ carp "Cannot access file: $args{file}"; } } else { carp "No attachement supplied" unless defined $args{data}; } # strip path from output name my $filename; if ($args{filename}) { my $strip = quotemeta $args{strip}; $filename = $args{filename}; $filename =~ s/(.*\/|$strip)//g; } # handle both string and file types of input my @data; if (defined $args{data}) { @data = ('Data', $args{data}); } else { @data = ('Path', $args{file}); } $self->{_message}->attach( 'Type' => $args{mimetype}, 'Filename' => $filename, 'Disposition' => 'attachment', @data, ); } =head2 $mail->send Sends a prepared message using the method configured in ledgersmb.conf. =cut sub send { my $self = shift; carp "Message not prepared" unless ref $self->{_message}; # SC: Set the X-Mailer header here so that it will be the last # header set. This ensures that MIME::Lite will not rewrite # it during the preparation of the message. $self->{_message}->replace( 'X-Mailer' => "LedgerSMB::Mailer $VERSION" ); if ( ${LedgerSMB::Sysconfig::smtphost} ) { $self->{_message}->send( 'smtp', ${LedgerSMB::Sysconfig::smtphost}, Timeout => ${LedgerSMB::Sysconfig::smtptimeout} ) || return $!; } else { $self->{_message}->send( 'sendmail', ${LedgerSMB::Sysconfig::sendmail} ) || return $!; } } 1; ledgersmb/LedgerSMB/Template/0000755000000000000000000000000012060044551015034 5ustar rootrootledgersmb/LedgerSMB/Template/CSV.pm0000755000000000000000000000641412032735067016045 0ustar rootroot =head1 NAME LedgerSMB::Template::CSV - Template support module for LedgerSMB =head1 METHODS =over =item get_template ($name) Returns the appropriate template filename for this format. =item preprocess ($vars) Returns $vars. =item process ($parent, $cleanvars) Processes the template for text. =item postprocess ($parent) Returns the output filename. =back =head1 Copyright (C) 2007, The LedgerSMB core team. This work contains copyrighted information from a number of sources all used with permission. It is released under the GNU General Public License Version 2 or, at your option, any later version. See COPYRIGHT file for details. For a full list including contact information of contributors, maintainers, and copyright holders, see the CONTRIBUTORS file. =cut package LedgerSMB::Template::CSV; use warnings; use strict; use Error qw(:try); use Template; use LedgerSMB::Template::TTI18N; my $binmode = ':utf8'; binmode STDOUT, $binmode; binmode STDERR, $binmode; sub get_template { my $name = shift; return "${name}.csv"; } sub preprocess { my $rawvars = shift; my $vars; my $type = ref $rawvars; #XXX fix escaping function return $rawvars if $type =~ /^LedgerSMB::Locale/; return unless defined $rawvars; if ( $type eq 'ARRAY' ) { for (@{$rawvars}) { push @{$vars}, preprocess( $_ ); } } elsif ( !$type or $type eq 'SCALAR' or $type eq 'Math::BigInt::GMP') { # Scalars or GMP objects (which are SCALAR refs) --CT if ($type eq 'SCALAR' or $type eq 'Math::BigInt::GMP') { $vars = $$rawvars; return unless defined $vars; } else { $vars = $rawvars; } $vars =~ s/(^ +| +$)//g; $vars =~ s/"/""/g; $vars = qq|"$vars"| if $vars =~ /[^0-9.+-]/; } elsif ( $type eq 'CODE' ) { # a code reference makes no sense return undef; } else { # hashes and objects for ( keys %{$rawvars} ) { $vars->{$_} = preprocess( $rawvars->{$_} ); } } return $vars; } sub process { my $parent = shift; my $cleanvars = shift; for my $col (@{$cleanvars->{columns}}){ $col =~ s/""/"/g; $col =~ s/(^"|"$)//g; } my $template; my $source; my $output; $parent->{binmode} = $binmode; if ($parent->{outputfile}) { $output = "$parent->{outputfile}.csv"; } else { $output = \$parent->{output}; } if (ref $parent->{template} eq 'SCALAR') { $source = $parent->{template}; } elsif (ref $parent->{template} eq 'ARRAY') { $source = join "\n", @{$parent->{template}}; } else { $source = get_template($parent->{template}); } $template = Template->new({ INCLUDE_PATH => [$parent->{include_path_lang}, $parent->{include_path}, 'UI/lib'], START_TAG => quotemeta(' quotemeta('?>'), DELIMITER => ';', DEBUG => ($parent->{debug})? 'dirs': undef, DEBUG_FORMAT => '', }) || throw Error::Simple Template->error(); if (not $template->process( $source, {%$cleanvars, %$LedgerSMB::Template::TTI18N::ttfuncs, 'escape' => \&preprocess}, $output, binmode => ':utf8')) { throw Error::Simple $template->error(); } $parent->{mimetype} = 'text/csv'; } sub postprocess { my $parent = shift; $parent->{rendered} = "$parent->{outputfile}.csv" if $parent->{outputfile}; if (!$parent->{rendered}){ return "$parent->{template}.csv"; } return $parent->{rendered}; } 1; ledgersmb/LedgerSMB/Template/TTI18N.pm0000644000000000000000000000240211733662646016340 0ustar rootroot =head1 NAME LedgerSMB::Template::TTI18N - Template Toolkit i18n support functions =head1 SYNOPSIS Various functions for Template Toolkit templates for internationalisation support. =head1 METHODS =over =item Output the gettext translation for the string in the given locale. If locale is a LedgerSMB::Locale object, it uses it. If it is a string, the locale is loaded, cached, and used. =back =head1 Copyright (C) 2007, The LedgerSMB core team. This work contains copyrighted information from a number of sources all used with permission. It is released under the GNU General Public License Version 2 or, at your option, any later version. See COPYRIGHT file for details. For a full list including contact information of contributors, maintainers, and copyright holders, see the CONTRIBUTORS file. =cut package LedgerSMB::Template::TTI18N; use LedgerSMB::Locale; my %locales; # Cache string-loaded locales our $ttfuncs = {}; $ttfuncs->{gettext} = sub { my $locale = shift; if (ref $locale) { return $locale->text(@_); } elsif ($locales{$locale}) { return $locales{$locale}->text(@_); } else { $locales{$locale} = LedgerSMB::Locale->get_handle($locale); return $locales{$locale}->text(@_); } }; ledgersmb/LedgerSMB/Template/ODS.pm0000644000000000000000000006311011757615722016040 0ustar rootroot =head1 NAME LedgerSMB::Template::ODS - Template support module for LedgerSMB =head1 SYNOPSIS OpenDocument Spreadsheet output. =head1 METHODS =over =item get_template ($name) Returns the appropriate template filename for this format. '.xlst' is the extension that was chosen for the templates. =item preprocess ($vars) Returns $vars. =item process ($parent, $cleanvars) Processes the template for text. =item postprocess ($parent) Returns the output filename. =back =head1 Copyright (C) 2007, The LedgerSMB core team. This work contains copyrighted information from a number of sources all used with permission. It is released under the GNU General Public License Version 2 or, at your option, any later version. See COPYRIGHT file for details. For a full list including contact information of contributors, maintainers, and copyright holders, see the CONTRIBUTORS file. =cut package LedgerSMB::Template::ODS; use strict; use warnings; use Error qw(:try); use Data::Dumper; use CGI::Simple::Standard qw(:html); use Template; use XML::Twig; use OpenOffice::OODoc; use OpenOffice::OODoc::Styles; use LedgerSMB::Template::TTI18N; use LedgerSMB::Sysconfig; $OpenOffice::OODoc::File::WORKING_DIRECTORY = $LedgerSMB::Sysconfig::tempdir; my $binmode = undef; binmode STDOUT, ':bytes'; binmode STDERR, ':bytes'; # SC: The ODS handlers need these vars in common my $ods; my $rowcount; my $currcol; my $maxrows; my $maxcols; my %celltype; my $sheetnum = -1; my $sheetname; # SC: The elements of the style table for regular styles and stack are # arrays where the stack name is the first element and the style # properties are the second. The name is used for setting styles, # while the properties are used in handling nested styles. my @style_stack; # stack of styles, 0 is active style my %style_table; # hash table for created styles # SC: Subtract 8 from the attribute to get the index # http://search.cpan.org/src/JMCNAMARA/Spreadsheet-WriteExcel-2.11/doc/palette.html my @colour = (odfColor(0, 0, 0), odfColor(255, 255, 255), odfColor(255, 0, 0), odfColor(0, 255, 0), odfColor(0, 0, 255), odfColor(255, 255, 0), odfColor(255, 0, 255), odfColor(0, 255, 255), odfColor(128, 0, 0), odfColor(0, 128, 0), odfColor(0, 0, 128), odfColor(128, 128, 0), odfColor(128, 0, 128), odfColor(0, 128, 128), odfColor(192, 192, 192), odfColor(128, 128, 128), odfColor(153, 153, 255), odfColor(153, 51, 102), odfColor(255, 255, 204), odfColor(204, 255, 255), odfColor(102, 0, 102), odfColor(255, 128, 128), odfColor(0, 102, 204), odfColor(204, 204, 255), odfColor(0, 0, 128), odfColor(255, 0, 255), odfColor(255, 255, 0), odfColor(0, 255, 255), odfColor(128, 0, 128), odfColor(120, 0, 0), odfColor(0, 128, 128), odfColor(0, 0, 255), odfColor(0, 204, 255), odfColor(204, 255, 255), odfColor(204, 255, 204), odfColor(255, 255, 153), odfColor(153, 204, 255), odfColor(255, 153, 204), odfColor(204, 153, 255), odfColor(192, 192, 192), odfColor(51, 102, 255), odfColor(51, 204, 204), odfColor(153, 204, 0), odfColor(255, 204, 0), odfColor(255, 153, 0), odfColor(255, 102, 0), odfColor(102, 102, 153), odfColor(150, 150, 150), odfColor(0, 51, 102), odfColor(51, 153, 102), odfColor(0, 51, 0), odfColor(51, 51, 0), odfColor(153, 51, 0), odfColor(153, 51, 102), odfColor(51, 51, 153), odfColor(51, 51, 51), ); my %colour_name = ('black' => $colour[0], 'white' => $colour[1], 'red' => $colour[2], 'lime' => $colour[3], 'blue' => $colour[4], 'yellow' => $colour[5], 'magenta' => $colour[6], 'cyan' => $colour[7], 'brown' => $colour[8], 'green' => $colour[9], 'navy' => $colour[10], 'purple' => $colour[12], 'silver' => $colour[14], 'gray' => $colour[15], 'grey' => $colour[15], 'orange' => $colour[45], ); my @line_width = ('none', '0.018cm solid', '0.035cm solid', '0.018cm dashed', '0.018cm dotted', '0.141cm solid', '0.039cm double', '0.002cm solid' ); sub _worksheet_handler { $sheetnum += 1; $rowcount = -1; $currcol = 0; my $rows = $_->{att}->{rows}; my $columns = $_->{att}->{columns}; $rows ||= 1000; $columns ||= 52; $maxrows = $rows; $maxcols = $columns; my $sheet; if ($_->is_first_child) { $sheet = $ods->getTable(0, $rows, $columns); $ods->renameTable($sheet, $_->{att}->{name}); $sheetname = $_->{att}->{name}; } else { $sheet = $ods->appendTable($_->{att}->{name}, $rows, $columns); } } sub _row_handler { $rowcount++; $currcol = 0; } sub _cell_handler { $ods->expandTable($sheetname, $maxrows, $maxcols); my $cell = $ods->getCell($sheetname, $rowcount, $currcol); if (@style_stack and $celltype{$style_stack[0][0]}) { $ods->cellValueType($cell, $celltype{$style_stack[0][0]}[0]); } elsif ($_->{att}->{type}) { my $type = $_->{att}->{type}; if ($type =~ /^(string|blank|url)$/i) { $ods->cellValueType($cell, 'string'); } elsif ($type =~ /^(number|formula)$/i) { $ods->cellValueType($cell, 'float'); } } $ods->cellValue($sheetname, $rowcount, $currcol, $_->{att}->{text}); if (@style_stack) { $ods->cellStyle($cell, $style_stack[0][0]); } $currcol++; } sub _formula_handler { my $cell = $ods->getCell($sheetnum, $rowcount, $currcol); if (@style_stack and $celltype{$style_stack[0][0]}) { $ods->cellValueType($cell, $celltype{$style_stack[0][0]}[0]); } elsif ($_->{att}->{type}) { my $type = $_->{att}->{type}; if ($type =~ /^(string|blank|url)$/i) { $ods->cellValueType($cell, 'string'); } elsif ($type =~ /^(number|formula)$/i) { $ods->cellValueType($cell, 'float'); } } $ods->cellFormula($cell, "oooc:=$_->{att}->{text}"); if (@style_stack) { $ods->cellStyle($cell, $style_stack[0][0]); } $currcol++; } sub _border_set { my ($format, $properties, $border) = @_; my $edge = $border; $edge =~ s/^border-?//; my $val; if ($edge) { $val = $format->{att}{$edge}; } else { $val = $format->{att}{'border'}; } if ($properties->{cell}{"fo:$border"}){ $properties->{cell}{"fo:$border"} =~ s/^.* (\#......)$/$val $1/; } else { $properties->{cell}{"fo:$border"} = "$line_width[$val] #000000"; } if ($edge and $format->{att}->{"${edge}_color"}) { my $colour = $format->{att}->{"${edge}_color"}; if ($colour =~ /^\d+$/) { $colour = $colour[$colour]; } elsif ($colour !~ /^\#......$/) { $colour = $colour_name{$colour}; } $properties->{cell}{"fo:$border"} =~ s/^(.*) \#......$/$1 $colour/; } elsif ($format->{att}->{border_color}) { my $colour = $format->{att}->{"${edge}_color"}; if ($colour =~ /^\d+$/) { $colour = $colour[$colour]; } elsif ($colour !~ /^\#......$/) { $colour = $colour_name{$colour}; } $properties->{cell}{"fo:$border"} =~ s/^(.*) \#......$/$1 $colour/; } } sub _prepare_float { my ($style) = shift; my %properties; my @sides = split /\./, $style; if ($#sides == 1) { # decimal places $properties{'number:decimal-places'} = length $sides[1]; } else { $properties{'number:decimal-places'} = 0; } $properties{'number:min-integer-digits'} = length($sides[0] =~ /0+$/); $properties{'number:grouping'} = 'true' if $sides[0] =~ /.,...$/; \%properties; } sub _prepare_fraction { my ($style) = shift; my %properties; my @sides = split /[ \/]/, $style; $properties{'number:min-integer-digits'} = length($sides[0] =~ /0+$/); $properties{'number:min-numerator-digits'} = length($sides[1]); $properties{'number:min-denominator-digits'} = length($sides[2]); \%properties; } sub _create_positive_style { my ($name, $type, $base) = @_; my $pstyle = $ods->createStyle( $name, namespace => 'number', type => $type, properties => $base, references => { 'style:volatile' => 'true', }, ); $pstyle->insert_new_elt('last-child', 'number:text', {}, ' '); } sub _format_handler { my ($t, $format) = @_; my $style = sprintf "ce%d", (scalar (keys %style_table) + 1); my @extras; # SC: There are multiple types of properties that can be associated # with a style. However, the OO::OOD style creation code appears # to only allow for a single type to be added to the style at a # time. As a result, %properties is split into property groupings # to allow for each group to get the correct type. my %properties; if (@style_stack) { %properties = %{$style_stack[0][1]}; if ($celltype{$style_stack[0][0]}) { $celltype{$style} = $celltype{$style_stack[0][0]}; @extras = ('references', { 'style:data-style-name' => $celltype{$style}[1] }); } } &_border_set(\%properties, $format, 'border') if $format->{att}->{border}; while (my ($attr, $val) = each %{$format->{att}}) { if ($attr eq 'bottom') { &_border_set($format, \%properties, 'border-bottom'); } elsif ($attr eq 'top') { &_border_set($format, \%properties, 'border-top'); } elsif ($attr eq 'left') { &_border_set($format, \%properties, 'border-left'); } elsif ($attr eq 'right') { &_border_set($format, \%properties, 'border-right'); } elsif ($attr eq 'bg_color' or $attr eq 'bg_colour') { if ($val =~ /^\d+$/) { $properties{cell}{'fo:background-color'} = $colour[$val - 8]; } elsif ($val =~ /^\#[0-9A-Fa-f]{6}$/) { $properties{cell}{'fo:background-color'} = $val; } else { $properties{cell}{'fo:background-color'} = $colour_name{$val}; } } elsif ($attr eq 'color' or $attr eq 'colour') { if ($val =~ /^\d+$/) { $properties{text}{'fo:color'} = $colour[$val - 8]; } elsif ($val =~ /^\#[0-9A-Fa-f]{6}$/) { $properties{text}{'fo:color'} = $val; } else { $properties{text}{'fo:color'} = $colour_name{$val}; } } elsif ($attr eq 'align') { if (lc $val eq 'right') { $properties{paragraph}{'fo:text-align'} = 'end'; } elsif (lc $val eq 'left') { $properties{paragraph}{'fo:text-align'} = 'start'; } else { $properties{paragraph}{'fo:text-align'} = $val; } } elsif ($attr eq 'valign') { # takes top, vcenter, bottom, or vjustify # needs top, middle, or bottom if ($val =~ /^v/i) { $properties{paragraph}{'style:vertical-align'} = 'middle'; } else { $properties{paragraph}{'style:vertical-align'} = $val; } } elsif ($attr eq 'hidden') { if ($properties{cell}{'style:cell-protect'} and !$val) { delete $properties{cell}{'style:cell-protect'}; } elsif ($val) { $properties{cell}{'style:cell-protect'} = 'formula-hidden'; } } elsif ($attr eq 'font') { $properties{text}{'style:font-name'} = $val; } elsif ($attr eq 'size') { $properties{text}{'fo:font-size'} = "${val}pt"; } elsif ($attr eq 'bold') { if ($properties{text}{'fo:font-weight'} and !$val) { delete $properties{text}{'fo:font-weight'}; } elsif ($val) { $properties{text}{'fo:font-weight'} = 'bold'; } } elsif ($attr eq 'italic') { if ($properties{text}{'fo:font-style'} and !$val) { delete $properties{text}{'fo:font-style'}; } elsif ($val) { $properties{text}{'fo:font-style'} = 'italic'; } } elsif ($attr eq 'font_strikeout') { if (!$val) { $properties{text}{'style:text-line-through-type'} = 'none'; } elsif ($val) { $properties{text}{'style:text-line-through-type'} = 'single'; } } elsif ($attr eq 'font_shadow') { if ($properties{text}{'fo:text-shadow'} and !$val) { delete $properties{text}{'fo:text-shadow'}; } elsif ($val) { $properties{text}{'fo:text-shadow'} = '2pt'; } } elsif ($attr eq 'font_outline') { if ($properties{text}{'style:text-outline'} and !$val) { delete $properties{text}{'style:text-outline'}; } elsif ($val) { $properties{text}{'style:text-outline'} = 'true'; } } elsif ($attr eq 'shrink') { if ($properties{cell}{'style:shrink-to-fit'} and !$val) { delete $properties{cell}{'style:shrink-to-fit'}; } elsif ($val) { $properties{cell}{'style:shrink-to-fit'} = 'true'; } } elsif ($attr eq 'text_wrap') { if (!$val) { $properties{cell}{'style:wrap-option'} = 'no-wrap'; } else { $properties{text}{'style:wrap-option'} = 'wrap'; } } elsif ($attr eq 'text_justlast') { if ($properties{paragraph}{'fo:text-align-last'} and !$val) { delete $properties{paragraph}{'fo:text-align-last'}; } elsif ($val) { $properties{paragraph}{'fo:text-align-last'} = 'justify'; } } elsif ($attr eq 'num_format') { #SC: Number formatting is when I hit the point of, # "Screw the OO::OOD API, XML::Twig is simpler". # @children's elements are passed right into the # style via XML::Twig::Elt's insert_new_elt. The # OO:OOD API, while decent enough for the text # styles, is not so pleasant with complex number # styles. my @children; my %nproperties; my @nextras; my $nstyle; my $fval = sprintf 'N%02d', $val; @extras = ('references', {'style:data-style-name' => $fval}); if ($style_table{$fval}) { # pass through } elsif ($val == 0) { $celltype{$style} = 'float'; } elsif ($val == 1) { $celltype{$style} = ['float', 'N01']; $nstyle = 'number-style'; %nproperties = %{&_prepare_float('0')} } elsif ($val == 2) { $celltype{$style} = ['float', 'N02']; $nstyle = 'number-style'; %nproperties = %{&_prepare_float('0.00')} } elsif ($val == 3) { $celltype{$style} = ['float', 'N03']; $nstyle = 'number-style'; %nproperties = %{&_prepare_float('#,##0')} } elsif ($val == 4) { $celltype{$style} = ['float', "N04"]; $nstyle = 'number-style'; %nproperties = %{&_prepare_float('#,##0.00')} } elsif ($val == 5) { ## ($#,##0_);($#,##0) } elsif ($val == 6) { $celltype{$style} = 'currency'; } elsif ($val == 7) { $celltype{$style} = 'currency'; } elsif ($val == 8) { $celltype{$style} = 'currency'; } elsif ($val == 9) { ## 0% $celltype{$style} = ['percentage', "N09"]; $nstyle = 'percentage-style'; %nproperties = %{&_prepare_float('0')}; push @children, ['number:text', {}, '%']; } elsif ($val == 10) { ## 0.00% $celltype{$style} = ['percentage', "N10"]; $nstyle = 'percentage-style'; %nproperties = %{&_prepare_float('0.00')}; push @children, ['number:text', {}, '%']; } elsif ($val == 11) { ## 0.00E+00 $celltype{$style} = ['float', "N11"]; $nstyle = 'number-style'; push @children, ['number:scientific-number', { %{&_prepare_float('0.00')}, 'number:min-exponent-digits' => 2 }]; } elsif ($val == 12) { ## # ?/? $celltype{$style} = ['float', "N12"]; $nstyle = 'number-style'; push @children, ['number:fraction', %{&_prepare_fraction('# ?/?')}]; } elsif ($val == 13) { ## # ??/?? $celltype{$style} = ['float', "N13"]; $nstyle = 'number-style'; push @children, ['number:fraction', %{&_prepare_fraction('# ??/??')}]; } elsif ($val == 14) { ## m/d/yy $celltype{$style} = ['date', "N14"]; $nstyle = 'date-style'; @nextras = ('references' => { 'number:automatic-order' => 'true'}); @children = ( ['number:month'], ['number:text', {}, '/'], ['number:day'], ['number:text', {}, '/'], ['number:year'], ); } elsif ($val == 15) { ## d-mmm-yy $celltype{$style} = ['date', "N15"]; $nstyle = 'date-style'; @nextras = ('references' => { 'number:automatic-order' => 'true'}); @children = ( ['number:day'], ['number:text', {}, '-'], ['number:month', { 'number:textual' => 'true'}], ['number:text', {}, '-'], ['number:year'], ); } elsif ($val == 16) { ## d-mmm $celltype{$style} = ['date', "N16"]; $nstyle = 'date-style'; @nextras = ('references' => { 'number:automatic-order' => 'true'}); @children = ( ['number:day'], ['number:text', {}, '-'], ['number:month', { 'number:textual' => 'true'}], ); } elsif ($val == 17) { ## mmm-yy $celltype{$style} = ['date', "N17"]; $nstyle = 'date-style'; @nextras = ('references' => { 'number:automatic-order' => 'true'}); @children = ( ['number:month', { 'number:textual' => 'true'}], ['number:text', {}, '-'], ['number:year'], ); } elsif ($val == 18) { ## h:mm AM/PM $celltype{$style} = ['time', "N18"]; $nstyle = 'time-style'; @nextras = ('references' => { 'number:automatic-order' => 'true'}); @children = ( ['number:hours'], ['number:text', {}, ':'], ['number:minutes', {'number:style' => 'long'}], ['number:text', {}, ' '], ['number:am-pm'] ); } elsif ($val == 19) { ## h:mm:ss AM/PM $celltype{$style} = ['time', "N19"]; $nstyle = 'time-style'; @nextras = ('references' => { 'number:automatic-order' => 'true'}); @children = ( ['number:hours'], ['number:text', {}, ':'], ['number:minutes', {'number:style' => 'long'}], ['number:text', {}, ':'], ['number:seconds', {'number:style' => 'long'}], ['number:text', {}, ' '], ['number:am-pm'] ); } elsif ($val == 20) { ## h:mm $celltype{$style} = ['time', "N20"]; $nstyle = 'time-style'; @nextras = ('references' => { 'number:automatic-order' => 'true'}); @children = ( ['number:hours'], ['number:text', {}, ':'], ['number:minutes', {'number:style' => 'long'}], ); } elsif ($val == 21) { ## h:mm:ss $celltype{$style} = ['time', "N21"]; $nstyle = 'time-style'; @nextras = ('references' => { 'number:automatic-order' => 'true'}); @children = ( ['number:hours'], ['number:text', {}, ':'], ['number:minutes', {'number:style' => 'long'}], ['number:text', {}, ':'], ['number:seconds', {'number:style' => 'long'}], ); } elsif ($val == 22) { ## m/d/yy h:mm $celltype{$style} = ['date', "N22"]; $nstyle = 'date-style'; @nextras = ('references' => { 'number:automatic-order' => 'true'}); @children = ( ['number:month'], ['number:text', {}, '/'], ['number:day'], ['number:text', {}, '/'], ['number:year'], ['number:text', {}, ' '], ['number:hours'], ['number:text', {}, ':'], ['number:minutes', {'number:style' => 'long'}], ); } elsif ($val == 37) { ## (#,##0_);(#,##0) $celltype{$style} = ['float', "N37"]; $nstyle = 'number-style'; my %base = ( 'number:min-integer-digits' => 1, 'number:grouping' => 'true', ); @children = ( ['number:text', {}, '('], ['number:number', \%base], ['number:text', {}, ')'], ['style:map', { 'style:condition' => 'value()>=0', 'style:apply-style-name' => "NP37", }], ); &_create_positive_style("NP37", $nstyle, \%base); } elsif ($val == 38) { ## (#,##0_);[Red](#,##0) $celltype{$style} = ['float', "N38"]; $nstyle = 'number-style'; my %base = %{&_prepare_float('#,##0')}; @children = ( ['style:text-properties', {'fo:color' => '#ff0000'}], ['number:text', {}, '('], ['number:number', \%base], ['number:text', {}, ')'], ['style:map',{ 'style:condition' => 'value()>=0', 'style:apply-style-name' => "NP38", }] ); &_create_positive_style("NP38", $nstyle, \%base); } elsif ($val == 39) { ## (#,##0.00_);(#,##0.00) $celltype{$style} = ['float', "N39"]; $nstyle = 'number-style'; my %base = %{&_prepare_float('#,##0.00')}; @children = ( ['number:text', {}, '('], ['number:number', \%base], ['number:text', {}, ')'], ['style:map',{ 'style:condition' => 'value()>=0', 'style:apply-style-name' => "NP39", }] ); &_create_positive_style("NP39", $nstyle, \%base); } elsif ($val == 40) { ## (#,##0.00_);[Red](#,##0.00) $celltype{$style} = ['float', "N40"]; $nstyle = 'number-style'; my %base = %{&_prepare_float('#,##0.00')}; @children = ( ['style:text-properties', {'fo:color' => '#ff0000'}], ['number:text', {}, '('], ['number:number', \%base], ['number:text', {}, ')'], ['style:map', { 'style:condition' => 'value()>=0', 'style:apply-style-name' => "NP40", }], ); &_create_positive_style("NP40", $nstyle, \%base); } elsif ($val == 41) { $celltype{$style} = 'float'; } elsif ($val == 42) { $celltype{$style} = 'currency'; } elsif ($val == 43) { $celltype{$style} = 'float'; } elsif ($val == 44) { $celltype{$style} = 'currency'; } elsif ($val == 45) { ## mm:ss $celltype{$style} = ['time', "N45"]; $nstyle = 'time-style'; @nextras = ('references' => { 'number:automatic-order' => 'true'}); @children = ( ['number:minutes', {'number:style' => 'long'}], ['number:text', {}, ':'], ['number:seconds', {'number:style' => 'long'}], ); } elsif ($val == 46) { ## [h]:mm:ss $celltype{$style} = ['time', "N46"]; $nstyle = 'time-style'; @nextras = ('references' => { 'number:automatic-order' => 'true', 'number:truncate-on-overflow' => 'false'}); @children = ( ['number:hours', {}], ['number:text', {}, ':'], ['number:minutes', {'number:style' => 'long'}], ['number:text', {}, ':'], ['number:seconds', {'number:style' => 'long'}], ); } elsif ($val == 47) { ## mm:ss.0 $celltype{$style} = ['time', "N47"]; $nstyle = 'time-style'; @nextras = ('references' => { 'number:automatic-order' => 'true'}); @children = ( ['number:minutes', {'number:style' => 'long'}], ['number:text', {}, ':'], ['number:seconds', {'number:style' => 'long', 'number:decimal-places' => 1}], ); } elsif ($val == 48) { ## ##0.0E+0 $celltype{$style} = ['float', "N48"]; $nstyle = 'number-style'; %nproperties = (); push @children, ['number:scientific-number', {%{&_prepare_float(0.0)}, 'number:min-exponent-digits' => 1 }]; } elsif ($val == 49) { $celltype{$style} = 'string'; } # $nstyle is set on new styles if ($nstyle) { my $cstyle = $ods->createStyle( $celltype{$style}[1], namespace => 'number', type => $nstyle, properties => \%nproperties, @nextras, ); for my $child (@children) { $cstyle->insert_new_elt('last_child', @$child); } $style_table{$fval} = 1; } } } # Maintain a hash table to keep the final style list size down $Data::Dumper::Sortkeys = 1; my $mystyle = Digest::MD5::md5_hex(Dumper(\%properties, \@extras)); if (!$style_table{$mystyle}) { $ods->createStyle( $style, family => 'table-cell', properties => $properties{cell}, @extras, ); $ods->updateStyle( $style, properties => { -area => 'text', %{$properties{text}} } ) if $properties{text}; $ods->updateStyle( $style, properties => { -area => 'paragraph', %{$properties{paragraph}} } ) if $properties{paragraph}; $style_table{$mystyle} = [$style, \%properties]; } unshift @style_stack, $style_table{$mystyle}; } sub _named_format { my ($name, $t, $format) = @_; $format->{att}{$name} = 1; &_format_handler($t, $format); } sub _format_cleanup_handler { my ($t, $format) = @_; shift @style_stack; } sub _ods_process { my ($filename, $template) = @_; $ods = ooDocument(file => "$filename", create => 'spreadsheet'); my $parser = XML::Twig->new( start_tag_handlers => { worksheet => \&_worksheet_handler, row => \&_row_handler, cell => \&_cell_handler, formula => \&_formula_handler, format => \&_format_handler, bold => sub { &_named_format('bold', @_) }, hidden => sub { &_named_format('hidden', @_) }, italic => sub { &_named_format('italic', @_) }, shadow => sub { &_named_format('shadow', @_) }, strikeout => sub { &_named_format('strikeout', @_) }, }, twig_handlers => { format => \&_format_cleanup_handler, bold => \&_format_cleanup_handler, hidden => \&_format_cleanup_handler, italic => \&_format_cleanup_handler, shadow => \&_format_cleanup_handler, strikeout => \&_format_cleanup_handler, } ); $parser->parse($template); $parser->purge; $ods->save; } sub get_template { my $name = shift; return "${name}.odst"; } sub preprocess { my $rawvars = shift; my $vars; my $type = ref $rawvars; #XXX fix escaping function return $rawvars if $type =~ /^LedgerSMB::Locale/; return unless defined $rawvars; if ( $type eq 'ARRAY' ) { for (@{$rawvars}) { push @{$vars}, preprocess( $_ ); } } elsif (!$type) { return escapeHTML($rawvars); } elsif ($type eq 'SCALAR' or $type eq 'Math::BigInt::GMP') { return escapeHTML($$rawvars); } else { # Hashes and objects for ( keys %{$rawvars} ) { $vars->{preprocess($_)} = preprocess( $rawvars->{$_} ); } } return $vars; } sub process { my $parent = shift; my $cleanvars = shift; my $template; my $source; my $tempdir = ${LedgerSMB::Sysconfig::tempdir}; my $output = ''; $parent->{binmode} = $binmode; $parent->{outputfile} ||= "$tempdir/$parent->{template}-output-$$"; if (ref $parent->{template} eq 'SCALAR') { $source = $parent->{template}; } elsif (ref $parent->{template} eq 'ARRAY') { $source = join "\n", @{$parent->{template}}; } else { $source = get_template($parent->{template}); } $template = Template->new({ INCLUDE_PATH => [$parent->{include_path_lang}, $parent->{include_path}, 'UI/lib'], START_TAG => quotemeta(' quotemeta('?>'), DELIMITER => ';', DEBUG => ($parent->{debug})? 'dirs': undef, DEBUG_FORMAT => '', }) || throw Error::Simple Template->error(); if (not $template->process( $source, {%$cleanvars, %$LedgerSMB::Template::TTI18N::ttfuncs, 'escape' => \&preprocess}, \$output, binmode => ':utf8')) { throw Error::Simple $template->error(); } &_ods_process("$parent->{outputfile}.ods", $output); $parent->{mimetype} = 'application/vnd.oasis.opendocument.spreadsheet'; } sub postprocess { my $parent = shift; $parent->{rendered} = "$parent->{outputfile}.ods"; return $parent->{rendered}; } 1; ledgersmb/LedgerSMB/Template/TXT.pm0000755000000000000000000000537511742621101016064 0ustar rootroot =head1 NAME LedgerSMB::Template::TXT - Template support module for LedgerSMB =head1 METHODS =over =item get_extension Private method to get extension. Do not call directly. =item get_template ($name) Returns the appropriate template filename for this format. =item preprocess ($vars) Returns $vars. =item process ($parent, $cleanvars) Processes the template for text. =item postprocess ($parent) Returns the output filename. =back =head1 Copyright (C) 2007, The LedgerSMB core team. This work contains copyrighted information from a number of sources all used with permission. It is released under the GNU General Public License Version 2 or, at your option, any later version. See COPYRIGHT file for details. For a full list including contact information of contributors, maintainers, and copyright holders, see the CONTRIBUTORS file. =cut package LedgerSMB::Template::TXT; use warnings; use strict; use Error qw(:try); use Template; use LedgerSMB::Template::TTI18N; my $binmode = ':utf8'; binmode STDOUT, $binmode; binmode STDERR, $binmode; sub get_extension { my ($parent) = shift; if ($parent->{format_args}->{extension}){ return $parent->{format_args}->{extension}; } else { return 'txt'; } } sub get_template { my ($name, $parent) = @_; my $extension; return "${name}.". get_extension($parent); } sub preprocess { my $rawvars = shift; return $rawvars; } sub process { my $parent = shift; my $cleanvars = shift; my $template; my $source; my $output; $parent->{binmode} = $binmode; if ($parent->{outputfile}) { $output = "$parent->{outputfile}.". get_extension($parent); } else { $output = \$parent->{output}; } if (ref $parent->{template} eq 'SCALAR') { $source = $parent->{template}; } elsif (ref $parent->{template} eq 'ARRAY') { $source = join "\n", @{$parent->{template}}; } else { $source = get_template($parent->{template}, $parent); } $template = Template->new({ INCLUDE_PATH => [$parent->{include_path_lang}, $parent->{include_path}, 'UI/lib'], START_TAG => quotemeta(' quotemeta('?>'), DELIMITER => ';', DEBUG => ($parent->{debug})? 'dirs': undef, DEBUG_FORMAT => '', }) || throw Error::Simple Template->error(); if (not $template->process( $source, {%$cleanvars, %$LedgerSMB::Template::TTI18N::ttfuncs, 'escape' => \&preprocess}, $output, binmode => ':utf8')) { throw Error::Simple $template->error(); } $parent->{mimetype} = 'text/plain'; } sub postprocess { my ($parent) = shift; if (!$parent->{rendered}){ return $parent->{template} . '.' . get_extension($parent); } $parent->{rendered} = "$parent->{outputfile}.". get_extension($parent) if $parent->{outputfile}; return $parent->{rendered}; } 1; ledgersmb/LedgerSMB/Template/LaTeX.pm0000755000000000000000000001046111745225440016363 0ustar rootroot =head1 NAME LedgerSMB::Template::LaTeX - Template support module for LedgerSMB =head1 SYNOPSIS Muxed LaTeX rendering support. Handles PDF, Postscript, and DVI output. =head1 DETAILS The final output format is determined by the format_option of filetype. The valid filetype specifiers are 'pdf', 'ps', and 'dvi'. =head1 METHODS =over =item get_template ($name) Returns the appropriate template filename for this format. =item preprocess ($vars) Currently does nothing. =item process ($parent, $cleanvars) Processes the template for the appropriate output format. =item postprocess ($parent) Currently does nothing. =item escape($string) Escapes a scalar string and returns the sanitized version. =back =head1 Copyright (C) 2007, The LedgerSMB core team. This work contains copyrighted information from a number of sources all used with permission. It is released under the GNU General Public License Version 2 or, at your option, any later version. See COPYRIGHT file for details. For a full list including contact information of contributors, maintainers, and copyright holders, see the CONTRIBUTORS file. =cut package LedgerSMB::Template::LaTeX; use warnings; use strict; use Error qw(:try); use Template::Latex; use LedgerSMB::Template::TTI18N; #my $binmode = ':utf8'; my $binmode = ':raw'; binmode STDOUT, $binmode; binmode STDERR, $binmode; my $logger = Log::Log4perl->get_logger('LedgerSMB::Template::LaTeX'); sub get_template { my $name = shift; return "${name}.tex"; } sub preprocess { my $rawvars = shift; my $vars; my $type = ref $rawvars; return $rawvars if $type =~ /^LedgerSMB::Locale/; return unless defined $type; if ($type eq 'ARRAY') { for (@{$rawvars}) { push @{$vars}, preprocess($_); } } elsif (!$type or $type eq 'SCALAR' or $type eq 'Math::BigInt::GMP' or $type eq 'CODE' ) { if ($type eq 'SCALAR' or $type eq 'Math::BigInt::GMP') { $vars = $$rawvars; } else { $vars = $rawvars; } #XXX Fix escaping $vars = escape($vars); } else { for ( keys %{$rawvars} ) { $vars->{$_} = preprocess($rawvars->{$_}); } } return $vars; } my %escapes = ( '&' => '\\&', '$' => '\\$', '\\' => '{\\textbackslash}', '_' => '\\_', '<' => '\\<', '>' => '\\>', '~' => '\\~', '^' => '\\^', '#' => '\\#', '%' => '\\%', '{' => '\\{', '}' => '\\}', ); # Breaking this off to be used separately. sub escape { my ($vars) = shift @_; if (defined $vars){ $vars =~ s/([&\$\\_<>~^#\%\{\}])/$escapes{$1}/g; $vars =~ s/–/--/g; $vars =~ s/[—―]/---/g; $vars =~ s/"(.*)"/``$1''/gs; $vars =~ s/\n/\\\\/gm; $vars =~ s/\\\\\\\\/\n\n/g; } return $vars; } sub process { my $parent = shift; my $cleanvars = shift; my $template; my $source; $parent->{outputfile} ||= "${LedgerSMB::Sysconfig::tempdir}/$parent->{template}-output-$$"; $parent->{binmode} = $binmode; if (ref $parent->{template} eq 'SCALAR') { $source = $parent->{template}; } elsif (ref $parent->{template} eq 'ARRAY') { $source = join "\n", @{$parent->{template}}; } else { $source = get_template($parent->{template}); } $Template::Latex::DEBUG = 1 if $parent->{debug}; my $format = 'ps'; if ($parent->{format_args}{filetype} eq 'dvi') { $format = 'dvi'; } elsif ($parent->{format_args}{filetype} eq 'pdf') { $format = 'pdf'; } $template = Template::Latex->new({ LATEX_FORMAT => $format, INCLUDE_PATH => [$parent->{include_path_lang}, $parent->{include_path},'templates/demo','UI/lib'], START_TAG => quotemeta(' quotemeta('?>'), DELIMITER => ';', ENCODING => 'utf8', DEBUG => ($parent->{debug})? 'dirs': undef, DEBUG_FORMAT => '', }) || throw Error::Simple Template::Latex->error(); if (not $template->process( $source, {%$cleanvars, %$LedgerSMB::Template::TTI18N::ttfuncs, 'escape' => \&preprocess}, "$parent->{outputfile}.$format", {binmode => 1})) { throw Error::Simple $template->error(); } if (lc $format eq 'dvi') { $parent->{mimetype} = 'application/x-dvi'; } elsif (lc $format eq 'pdf') { $parent->{mimetype} = 'application/pdf'; } else { $parent->{mimetype} = 'application/postscript'; } $parent->{rendered} = "$parent->{outputfile}.$format"; } sub postprocess { my $parent = shift; return $parent->{rendered}; } 1; ledgersmb/LedgerSMB/Template/HTML.pm0000755000000000000000000000741312051434011016140 0ustar rootroot =head1 NAME LedgerSMB::Template::HTML - Template support module for LedgerSMB =head1 METHODS =over =item get_template ($name) Returns the appropriate template filename for this format. =item preprocess ($vars) This method returns a reference to a hash that contains a copy of the passed hashref's data with HTML entities converted to escapes. =item process ($parent, $cleanvars) Processes the template for HTML. =item postprocess ($parent) Currently does nothing. =item escape($string) Escapes a scalar string and returns the sanitized version. =back =head1 Copyright (C) 2007, The LedgerSMB core team. This work contains copyrighted information from a number of sources all used with permission. It is released under the GNU General Public License Version 2 or, at your option, any later version. See COPYRIGHT file for details. For a full list including contact information of contributors, maintainers, and copyright holders, see the CONTRIBUTORS file. =cut package LedgerSMB::Template::HTML; use warnings; use strict; use Error qw(:try); use CGI::Simple::Standard qw(:html); use Template; use LedgerSMB::Template::TTI18N; my $binmode = ':utf8'; binmode STDOUT, $binmode; binmode STDERR, $binmode; sub get_template { my $name = shift; return "${name}.html"; } sub preprocess { my $rawvars = shift; my $vars; my $type = ref $rawvars; return $rawvars if $type =~ /^LedgerSMB::Locale/; return unless defined $rawvars; if ( $type eq 'ARRAY' ) { for (@{$rawvars}) { push @{$vars}, preprocess( $_ ); } } elsif (!$type) { return escapeHTML($rawvars); } elsif ($type eq 'SCALAR' or $type eq 'Math::BigInt::GMP') { return escapeHTML($$rawvars); } elsif ($type eq 'CODE'){ return $rawvars; } elsif ($type eq 'IO::File'){ return undef; } else { # Hashes and objects for ( keys %{$rawvars} ) { $vars->{preprocess($_)} = preprocess( $rawvars->{$_} ); } } return $vars; } sub escape { my $vars = shift @_; if (defined $vars){ $vars = escapeHTML($vars); $vars =~ s|\n|
|gm;#better syntax-look under gvim with escaped slash return $vars; } return undef; } sub process { my $parent = shift; my $cleanvars = shift; my $template; my $output; my $source; $parent->{binmode} = $binmode; if ($parent->{outputfile}) { $output = "$parent->{outputfile}.html"; } else { $output = \$parent->{output}; } if (ref $parent->{template} eq 'SCALAR') { $source = $parent->{template}; } elsif (ref $parent->{template} eq 'ARRAY') { $source = join "\n", @{$parent->{template}}; } else { $source = get_template($parent->{template}); } my $tempdir; my $arghash = { INCLUDE_PATH => [$parent->{include_path_lang}, $parent->{include_path},'templates/demo','UI/lib'], ENCODING => 'utf8', START_TAG => quotemeta(' quotemeta('?>'), DELIMITER => ';', TRIM => 1, DEBUG => ($parent->{debug})? 'dirs': undef, DEBUG_FORMAT => '', }; if ($LedgerSMB::Sysconfig::cache_templates){ $arghash->{COMPILE_EXT} = '.lttc'; $arghash->{COMPILE_DIR} = $LedgerSMB::Sysconfig::cache_template_dir; } $template = Template->new( $arghash ) || throw Error::Simple Template->error(); if (not $template->process( $source, {%$cleanvars, %$LedgerSMB::Template::TTI18N::ttfuncs, 'escape' => \&preprocess}, $output, {binmode => ':utf8'})) { throw Error::Simple $template->error(); } $parent->{mimetype} = 'text/html'; } sub postprocess { my $parent = shift; $parent->{rendered} = "$parent->{outputfile}.html" if $parent->{outputfile}; return $parent->{rendered}; } 1; ledgersmb/LedgerSMB/Template/Elements.pm0000644000000000000000000001174211733662646017174 0ustar rootroot=head1 NAME LedgerSMB::Template::Elements - Template Utility Functions =head1 SYNOPSIS Provides utility functions for generating elements for the user interface templates =head1 METHODS =over =item LedgerSMB::Template::Elements->new() Returns a blessed hashref from this namespace. =back =cut package LedgerSMB::Template::Elements; use strict; sub new { my ($class) = @_; my $self = {}; bless $self, $class; return $self; } =over =item $object->generate_hidden_elements([...]); Builds data structure for hidden form fields. Values from the $form object are run through $form->quote. Sample data structure added to $form->hidden_elements(): $self->{form_elements}{hidden_elements} = [{ type => 'hidden', name => 'foo', value => 'bar'... } ...] A reference to this structure is returned as well. =back =cut sub generate_hidden_elements { my $self = shift; if (! $self->{form_elements}{hidden_elements} ) { $self->{form_elements}{hidden_elements} = []; } for (@_) { my $value = defined($self->{$_}) ? $self->quote( $self->{$_} ) : ''; push @{$self->{form_elements}{hidden_elements}}, { type => 'hidden', name => $_, value => $value }; } return $self->{form_elements}{hidden_elements}; } =over =item $form->generate_radio_elements($radios); Roll out a single radios hash to an array of radio elements, using the values array as index. Sample data structure added to $form->generate_radio_elements($radios): my $radios = { name => 'radio_name', class => 'radio', attributes => { foo => 'bar' }, values => [ '1', '2', '3'], labels => [ 'Label one', '', 'Label three'], default_value => '2', }; =back =cut sub generate_radio_elements { my $self = shift; my $radios = shift; my $elements = []; my $i = 0; # One new radio element for each listed value. foreach my $radio_value ( @{$radios->{values}} ) { my $element = {}; # copy all additional attributes while ( my ($key, $value) = each(%$radios) ) { if ( $key !~ /^(values|labels|id|(default_)?value)$/ ) { $element->{$key} = $value; } } $element->{id} = $radios->{name} .'-'. $radio_value; # id tags with only numbers, letters, and dashes -- nicer CSS. $element->{id} =~ s/[^\p{IsAlnum}]/-/g; $element->{value} = $radio_value; $element->{type} = 'radio'; # Add label key if present for this element. if ( $radios->{labels}[$i] ) { $element->{label} = $radios->{labels}[$i]; } # Add checked attribute if the default value applies to this element. if ( defined($radios->{default_value}) && $radios->{default_value} eq $radio_value) { $element->{checked} = 'checked'; } push @$elements, $element; $i++; } return $elements; } =over =item $form->generate_checkbox_elements($checkboxes); Roll out a single checkboxes hash to an array of checkbox elements, using the names array as index. Note that if no 'values' array is passed, value for all checkboxes default to 1. Sample data structure added to $form->generate_checkbox_elements($checkboxes): my $checkboxes = { names => [ 'checkbox_name1', 'checkbox_name2', 'checkbox_name3', ], class => 'checkbox', attributes => { foo => 'bar' }, values => [ '4', '', '3'], labels => [ 'Label one', '', 'Label three'], default_values => [ 'checkbox_name1'], }; =back =cut sub generate_checkbox_elements { my $self = shift; my $checkboxes = shift; my $elements = []; my $i = 0; # One new checkbox element for each listed name. foreach my $checkbox_name ( @{$checkboxes->{names}} ) { my $element = {}; # Additional attributes while ( my ($key, $value) = each(%$checkboxes) ) { if ( $key !~ /^(names|(default_)?values|labels|id|value|name)$/ ) { $element->{$key} = $value; } } # Value defaults to 1 if not passed for this element. $element->{value} = defined($checkboxes->{values}[$i]) ? $checkboxes->{values}[$i] : '1'; $element->{name} = $checkbox_name; $element->{id} = $element->{name}; # id tags with only numbers, letters, and dashes -- nicer CSS. $element->{id} =~ s/[^\p{IsAlnum}]/-/g; $element->{type} = 'checkbox'; # Add label key if present for this element. if ( $checkboxes->{labels}[$i] ) { $element->{label} = $checkboxes->{labels}[$i]; } # Add checked attribute if the default value applies to this element. if ( defined($checkboxes->{default_values}) && grep {$_ eq $checkbox_name} @{$checkboxes->{default_values}}) { $element->{checked} = 'checked'; } push @$elements, $element; $i++; } return $elements; } 1; ledgersmb/LedgerSMB/CP.pm0000644000000000000000000000273511614062624014135 0ustar rootroot#===================================================================== # LedgerSMB # Small Medium Business Accounting software # http://www.ledgersmb.org/ # # Copyright (C) 2006 # This work contains copyrighted information from a number of sources all used # with permission. # # This file contains source code included with or based on SQL-Ledger which # is Copyright Dieter Simader and DWS Systems Inc. 2000-2005 and licensed # under the GNU General Public License version 2 or, at your option, any later # version. For a full list including contact information of contributors, # maintainers, and copyright holders, see the CONTRIBUTORS file. # # Original Copyright Notice from SQL-Ledger 2.6.17 (before the fork): # Copyright (C) 2003 # # Author: DWS Systems Inc. # Web: http://www.sql-ledger.org # # Contributors: # # #====================================================================== # # This file has undergone whitespace cleanup. # #====================================================================== # # Check and receipt printing payment module backend routines # Number to text conversion routines are in # locale/{countrycode}/Num2text # #====================================================================== package CP; use LedgerSMB::Sysconfig; sub new { my ( $type, $countrycode ) = @_; $self = {}; use LedgerSMB::Num2text; use LedgerSMB::Locale; $self->{'locale'} = LedgerSMB::Locale->get_handle($countrycode); bless $self, $type; } 1; ledgersmb/LedgerSMB/Setting.pm0000644000000000000000000001076311620335000015234 0ustar rootroot =head1 NAME LedgerSMB::Setting - LedgerSMB class for managing Business Locations =head1 SYOPSIS This module creates object instances based on LedgerSMB's in-database ORM. =head1 METHODS The following method is static: =over =item new ($LedgerSMB object); =back The following methods are passed through to stored procedures: =over =item get ($self->{key}) =item set ($self->{key}, $self->{value}) =item parse_increment ($self->{key}) This function updates a default entry in the database, incrimenting the last set of digits not including tags or non-digits, and then parses the returned value, doing tag substitution. The final value is then returned by the function. =back The above list may grow over time, and may depend on other installed modules. =head1 Copyright (C) 2007, The LedgerSMB core team. This file is licensed under the Gnu General Public License version 2, or at your option any later version. A copy of the license should have been included with your software. =cut package LedgerSMB::Setting; use base qw(LedgerSMB::DBObject); use strict; our $VERSION = '1.0.0'; sub get { my $self = shift; my ($key) = @_; if ($key){ $self->{key} = $key; } my ($hashref) = $self->exec_method( funcname => 'setting_get' ) ; $self->{value} = $hashref->{value}; return $self->{value}; } sub increment { my $self = shift; my $myconfig = shift; # Long-run, we may want to run this via Parse::RecDescent, but this is # at least a start for here. Chris T. # Replaces Form::UpdateDefaults my ($retval) = $self->exec_method('funcname' => 'setting_increment'); my $value = $retval->{setting_increment}; # check for and replace # , , , , or variations of # , , , # , , only for parts # for customer and vendors my $dbvar = $value; my $var = $value; my $str; my $param; if ($value =~ /<\?lsmb /) { while ($value =~ /<\?lsmb /) { $value =~ s/(<\?lsmb .*? \?>)//; last unless $&; $param = $1; $str = ""; if ( $param =~ /<\?lsmb date \?>/i ) { $str = ( $self->split_date( $myconfig->{dateformat}, $self->{transdate} ) )[0]; $var =~ s/$param/$str/; } if ( $param =~ /<\?lsmb (name|business|description|item|partsgroup|phone|custom)/i ) { my $fld = lc $&; $fld =~ s/<\?lsmb //; if ( $fld =~ /name/ ) { if ( $self->{type} ) { $fld = $self->{vc}; } } my $p = $param; $p =~ s/(<|>|%)//g; my @p = split / /, $p; my @n = split / /, uc $self->{$fld}; if ( $#p > 0 ) { for ( my $i = 1 ; $i <= $#p ; $i++ ) { $str .= substr( $n[ $i - 1 ], 0, $p[$i] ); } } else { ($str) = split /--/, $self->{$fld}; } $var =~ s/$param/$str/; $var =~ s/\W//g if $fld eq 'phone'; } if ( $param =~ /<\?lsmb (yy|mm|dd)/i ) { my $p = $param; $p =~ s/(<|>|%)//g; my $spc = $p; $spc =~ s/\w//g; $spc = substr( $spc, 0, 1 ); my %d = ( yy => 1, mm => 2, dd => 3 ); my @p = (); my @a = $self->split_date( $myconfig->{dateformat}, $self->{transdate} ); for ( sort keys %d ) { push @p, $a[ $d{$_} ] if ( $p =~ /$_/ ) } $str = join $spc, @p; $var =~ s/$param/$str/; } if ( $param =~ /<\?lsmb curr/i ) { $var =~ s/$param/$self->{currency}/; } } } $self->{value} = $var; $var; } sub get_currencies { my $self = shift; my @data = $self->exec_method(funcname => 'setting__get_currencies'); @{$self->{currencies}} = $self->_parse_array($data[0]->{setting__get_currencies}); return @{$self->{currencies}}; } ledgersmb/LedgerSMB/AM.pm0000644000000000000000000016667312004635003014133 0ustar rootroot =head1 NAME LedgerSMB::AM - This module provides some administrative functions =head1 SYNOPSIS This module provides some administrative functions =head1 COPYRIGHT #==================================================================== # LedgerSMB # Small Medium Business Accounting software # http://www.ledgersmb.org/ # # Copyright (C) 2006 # This work contains copyrighted information from a number of sources # all used with permission. # # This file contains source code included with or based on SQL-Ledger # which is Copyright Dieter Simader and DWS Systems Inc. 2000-2005 # and licensed under the GNU General Public License version 2 or, at # your option, any later version. For a full list including contact # information of contributors, maintainers, and copyright holders, # see the CONTRIBUTORS file. # # Original Copyright Notice from SQL-Ledger 2.6.17 (before the fork): # Copyright (C) 2000 # # Author: DWS Systems Inc. # Web: http://www.sql-ledger.org # # Contributors: Jim Rawlings # #==================================================================== # # This file has undergone whitespace cleanup. # #==================================================================== # # Administration module # Chart of Accounts # template routines # preferences # #==================================================================== =head1 METHODS =over =cut package AM; use LedgerSMB::Tax; use LedgerSMB::Sysconfig; my $logger = Log::Log4perl->get_logger('AM'); =item AM->get_account($myconfig, $form); Populates the $form attributes accno, description, charttype, gifi_accno, category, link, and contra with details about the account that has the id $form->{id}. If there are no acc_trans entries that refer to that account, $form->{orphaned} is made true, otherwise $form->{orphaned} is set to false. Also populates 'inventory_accno_id', 'income_accno_id', 'expense_accno_id', 'fxgain_accno_id', and 'fxloss_accno_id' with the values from defaults. $myconfig is unused. =cut sub get_account { my ( $self, $myconfig, $form ) = @_; my $dbh = $form->{dbh}; my $query = qq| SELECT accno, description, charttype, gifi_accno, category, link, contra FROM chart WHERE id = ?|; my $sth = $dbh->prepare($query); $sth->execute( $form->{id} ) || $form->dberror($query); my $ref = $sth->fetchrow_hashref(NAME_lc); for ( keys %$ref ) { $form->{$_} = $ref->{$_} } $sth->finish; # get default accounts $query = qq| SELECT (SELECT value FROM defaults WHERE setting_key = 'inventory_accno_id') AS inventory_accno_id, (SELECT value FROM defaults WHERE setting_key = 'income_accno_id') AS income_accno_id, (SELECT value FROM defaults WHERE setting_key = 'expense_accno_id') AS expense_accno_id, (SELECT value FROM defaults WHERE setting_key = 'fxgain_accno_id') AS fxgain_accno_id, (SELECT value FROM defaults WHERE setting_key = 'fxloss_accno_id') AS fxloss_accno_id|; $sth = $dbh->prepare($query); $sth->execute || $form->dberror($query); $ref = $sth->fetchrow_hashref(NAME_lc); for ( keys %$ref ) { $form->{$_} = $ref->{$_} } $sth->finish; # check if we have any transactions $query = qq| SELECT trans_id FROM acc_trans WHERE chart_id = ? LIMIT 1|; $sth = $dbh->prepare($query); $sth->execute( $form->{id} ); ( $form->{orphaned} ) = $sth->fetchrow_array(); $form->{orphaned} = !$form->{orphaned}; $dbh->commit; } =item AM->delete_account($myconfig, $form); Deletes the account with the id $form->{id}. Calls $form->error if there are any acc_trans entries that reference it. If any parts have that account for an inventory, income, or COGS (expense) account, switch the part to using the default account for that type. Also deletes all tax, partstax, customertax, and vendortax table entries for the account. $myconfig is unused. =cut sub delete_account { my ( $self, $myconfig, $form ) = @_; # connect to database, turn off AutoCommit my $dbh = $form->{dbh}; my $sth; my $query = qq| SELECT count(*) FROM acc_trans WHERE chart_id = ?|; $sth = $dbh->prepare($query); $sth->execute( $form->{id} ); my ($rowcount) = $sth->fetchrow_array(); if ($rowcount) { $form->error( "Cannot delete accounts with associated or pending transactions!" ); } # delete chart of account record $query = qq| DELETE FROM account where id = ?|; $sth = $dbh->prepare($query); $sth->execute( $form->{id} ) || $form->dberror($query); # set inventory_accno_id, income_accno_id, expense_accno_id to defaults $query = qq| UPDATE parts SET inventory_accno_id = (SELECT value::int FROM defaults WHERE setting_key = 'inventory_accno_id') WHERE inventory_accno_id = ?|; $sth = $dbh->prepare($query); $sth->execute( $form->{id} ) || $form->dberror($query); for (qw(income_accno_id expense_accno_id)) { $query = qq| UPDATE parts SET $_ = (SELECT value::int FROM defaults WHERE setting_key = '$_') WHERE $_ = ?|; $sth = $dbh->prepare($query); $sth->execute( $form->{id} ) || $form->dberror($query); $sth->finish; } foreach my $table (qw(partstax customertax vendortax tax)) { $query = qq| DELETE FROM $table WHERE chart_id = ?|; $sth = $dbh->prepare($query); $sth->execute( $form->{id} ) || $form->dberror($query); $sth->finish; } # commit and redirect my $rc = $dbh->commit; $rc; } =item AM->gifi_accounts($myconfig, $form); Populates the list referred to as $form->{ALL} with hashes of gifi numbers and descriptions in order of the GIFI number. The GIFI number referred to as 'accno'. $myconfig is not used. =cut sub gifi_accounts { my ( $self, $myconfig, $form ) = @_; # connect to database my $dbh = $form->{dbh}; my $query = qq| SELECT accno, description FROM gifi ORDER BY accno|; $sth = $dbh->prepare($query); $sth->execute || $form->dberror($query); while ( my $ref = $sth->fetchrow_hashref(NAME_lc) ) { push @{ $form->{ALL} }, $ref; } $sth->finish; $dbh->commit; } =item AM->get_gifi($myconfig, $form); Sets $form->{description} to the description of the GIFI number $form->{accno}. Sets $form->{orphaned} to true if there are no entries in acc_trans that refer to this GIFI and to false otherwise. $myconfig is not used. =cut sub get_gifi { my ( $self, $myconfig, $form ) = @_; # connect to database my $dbh = $form->{dbh}; my $sth; my $query = qq| SELECT accno, description FROM gifi WHERE accno = ?|; $sth = $dbh->prepare($query); $sth->execute( $form->{accno} ) || $form->dberror($query); ( $form->{accno}, $form->{description} ) = $sth->fetchrow_array(); $sth->finish; # check for transactions $query = qq| SELECT count(*) FROM acc_trans a JOIN chart c ON (a.chart_id = c.id) JOIN gifi g ON (c.gifi_accno = g.accno) WHERE g.accno = ?|; $sth = $dbh->prepare($query); $sth->execute( $form->{accno} ) || $form->dberror($query); ($numrows) = $sth->fetchrow_array; if ( ( $numrows * 1 ) == 0 ) { $form->{orphaned} = 1; } else { $form->{orphaned} = 0; } $dbh->commit; } =item AM->save_gifi($myconfig, $form); Adds or updates a GIFI record. If $form->{id} is set, update the gifi record that has that as an account number. The new values for an added or updated record are stored in $form->{accno} and $form->{description}. $myconfig is not used. =cut sub save_gifi { my ( $self, $myconfig, $form ) = @_; my $dbh = $form->{dbh}; $form->{accno} =~ s/( |')//g; foreach my $item (qw(accno description)) { $form->{$item} =~ s/-(-+)/-/g; $form->{$item} =~ s/ ( )+/ /g; } my @queryargs = ( $form->{accno}, $form->{description} ); # id is the old account number! if ( $form->{id} ) { $query = qq| UPDATE gifi SET accno = ?, description = ? WHERE accno = ?|; push @queryargs, $form->{id}; } else { $query = qq| INSERT INTO gifi (accno, description) VALUES (?, ?)|; } $sth = $dbh->prepare($query); $sth->execute(@queryargs) || $form->dberror($query); $sth->finish; $dbh->commit; } =item AM->delete_gifi($myconfig, $form); Deletes the gifi record with the GIFI number $form->{id}. $myconfig is not used. =cut sub delete_gifi { my ( $self, $myconfig, $form ) = @_; # connect to database my $dbh = $form->{dbh}; # id is the old account number! $query = qq| DELETE FROM gifi WHERE accno = ?|; $sth = $dbh->prepare($query); $sth->execute( $form->{id} ) || $form->dberror($query); $sth->finish; $dbh->commit; } =item AM->warehouses($myconfig, $form); Populates the list referred to as $form->{ALL} with hashes describing warehouses, ordered according to the logic of $form->sort_order. Each hash has an id and a description element. $myconfig is not used. =cut sub warehouses { my ( $self, $myconfig, $form ) = @_; # connect to database my $dbh = $form->{dbh}; $form->sort_order(); my $query = qq| SELECT id, description FROM warehouse ORDER BY description $form->{direction}|; $sth = $dbh->prepare($query); $sth->execute || $form->dberror($query); while ( my $ref = $sth->fetchrow_hashref(NAME_lc) ) { push @{ $form->{ALL} }, $ref; } $sth->finish; $dbh->commit; } =item AM->get_warehouse($myconfig, $form); Sets $form->{description} to the name of the warehouse $form->{id}. If no inventory is currently linked to the warehouse, set $form->{orphaned} to true, otherwise $form->{orphaned} is false. $myconfig is not used. =cut sub get_warehouse { my ( $self, $myconfig, $form ) = @_; # connect to database my $dbh = $form->{dbh}; my $sth; my $query = qq| SELECT description FROM warehouse WHERE id = ?|; $sth = $dbh->prepare($query); $sth->execute( $form->{id} ) || $form->dberror($query); ( $form->{description} ) = $sth->fetchrow_array; $sth->finish; # see if it is in use $query = qq| SELECT count(*) FROM inventory WHERE warehouse_id = ?|; $sth = $dbh->prepare($query); $sth->execute( $form->{id} ); ( $form->{orphaned} ) = $sth->fetchrow_array; if ( ( $form->{orphaned} * 1 ) == 0 ) { $form->{orphaned} = 1; } else { $form->{orphaned} = 0; } $dbh->commit; } =item AM->save_warehouse($myconfig, $form); Add or update a warehouse. If $form->{id} is set, that warehouse is updated instead of adding a new warehouse. In both cases, the description of the warehouse is set to $form->{description}. $myconfig is not used. =cut sub save_warehouse { my ( $self, $myconfig, $form ) = @_; # connect to database my $dbh = $form->{dbh}; my $sth; my @queryargs = ( $form->{description} ); $form->{description} =~ s/-(-)+/-/g; $form->{description} =~ s/ ( )+/ /g; if ( $form->{id} ) { $query = qq| UPDATE warehouse SET description = ? WHERE id = ?|; push @queryargs, $form->{id}; } else { $query = qq| INSERT INTO warehouse (description) VALUES (?)|; } $sth = $dbh->prepare($query); $sth->execute(@queryargs) || $form->dberror($query); $sth->finish; $dbh->commit; } =item AM->delete_warehouse($myconfig, $form); Deletes the warehouse with the id $form->{id}. $myconfig is not used. =cut sub delete_warehouse { my ( $self, $myconfig, $form ) = @_; # connect to database my $dbh = $form->{dbh}; $query = qq| DELETE FROM warehouse WHERE id = ?|; $dbh->prepare($query)->execute( $form->{id} ) || $form->dberror($query); $dbh->commit; } =item AM->departments($myconfig, $form); Populate the list referred to as $form->{ALL} with hashes of details about departments. The hashes all contain the id, description, and role of the department and are ordered by the description. $myconfig is unused. =cut sub departments { my ( $self, $myconfig, $form ) = @_; # connect to database my $dbh = $form->{dbh}; $form->sort_order(); my $query = qq|SELECT id, description, role FROM department ORDER BY description $form->{direction}|; $sth = $dbh->prepare($query); $sth->execute || $form->dberror($query); while ( my $ref = $sth->fetchrow_hashref(NAME_lc) ) { push @{ $form->{ALL} }, $ref; } $sth->finish; $dbh->commit; } =item AM->get_department($myconfig, $form); Fills $form->{description} and $form->{role} with details about the department with the id value of $form->{id}. If the department has not been used as part of a transaction referred to in dpt_trans, set $form->{orphaned} to true, otherwise it is set to false. $myconfig is unused. =cut sub get_department { my ( $self, $myconfig, $form ) = @_; # connect to database my $dbh = $form->{dbh}; my $sth; my $query = qq| SELECT description, role FROM department WHERE id = ?|; $sth = $dbh->prepare($query); $sth->execute( $form->{id} ); ( $form->{description}, $form->{role} ) = $sth->fetchrow_array; $sth->finish; for ( keys %$ref ) { $form->{$_} = $ref->{$_} } # see if it is in use $query = qq| SELECT count(*) FROM dpt_trans WHERE department_id = ? |; $sth = $dbh->prepare($query); $sth->execute( $form->{id} ); ( $form->{orphaned} ) = $sth->fetchrow_array; if ( ( $form->{orphaned} * 1 ) == 0 ) { $form->{orphaned} = 1; } else { $form->{orphaned} = 0; } $dbh->commit; } =item AM->save_department($myconfig, $form); Add or update a department record. If $form->{id} is set, the department with that id is updated, otherwise a new department is added. The department role (either 'C' for cost centres or 'P' for profit centres) and description is taken from the $form attributes 'role' and 'description'. $myconfig is unused. =cut sub save_department { my ( $self, $myconfig, $form ) = @_; # connect to database my $dbh = $form->{dbh}; $form->{description} =~ s/-(-)+/-/g; $form->{description} =~ s/ ( )+/ /g; my $sth; my @queryargs = ( $form->{description}, $form->{role} ); if ( $form->{id} ) { $query = qq| UPDATE department SET description = ?, role = ? WHERE id = ?|; push @queryargs, $form->{id}; } else { $query = qq| INSERT INTO department (description, role) VALUES (?, ?)|; } $sth = $dbh->prepare($query); $sth->execute(@queryargs) || $form->dberror($query); $dbh->commit; } =item AM->delete_department($myconfig, $form) Deletes the department with an id of $form->{id}. $myconfig is unused. =cut sub delete_department { my ( $self, $myconfig, $form ) = @_; # connect to database my $dbh = $form->{dbh}; $query = qq| DELETE FROM department WHERE id = ?|; $dbh->prepare($query)->execute( $form->{id} ); $dbh->commit; } =item AM->business($myconfig, $form); Populates the list referred to as $form->{ALL} with hashes containing details about all known types of business. Each hash contains the id, description, and discount for businesses of this type. The discount is represented in numeric form, such that a 10% discount is stored and retrieved as 0.1. The hashes are sorted by the business description. $myconfig is unused. =cut sub business { my ( $self, $myconfig, $form ) = @_; # connect to database my $dbh = $form->{dbh}; $form->sort_order(); my $query = qq| SELECT id, description, discount FROM business ORDER BY description $form->{direction}|; $sth = $dbh->prepare($query); $sth->execute || $form->dberror($query); while ( my $ref = $sth->fetchrow_hashref(NAME_lc) ) { push @{ $form->{ALL} }, $ref; } $sth->finish; $dbh->commit; } =item AM->get_business($myconfig, $form); Places the description and discount for the business with an id of $form->{id} into $form->{description} and $form->{discount}. $myconfig is unused. =cut sub get_business { my ( $self, $myconfig, $form ) = @_; # connect to database my $dbh = $form->{dbh}; my $query = qq| SELECT description, discount FROM business WHERE id = ?|; $sth = $dbh->prepare($query); $sth->execute( $form->{id} ); ( $form->{description}, $form->{discount} ) = $sth->fetchrow_array(); $dbh->commit; } =item AM->save_business($myconfig, $form); Adds or updates a type of business. If $form->{id} is set, the business type with a corresponding id is updated, otherwise a new type is added. The new description is $form->{description}. The discount taken as a percentage stored in $form->{discount}, which then value is divided by 100 in place and the multiplier is stored. As an example, if $form->{discount} is 10 when this function is called, it is changed to 0.1 and stored as 0.1. $myconfig is unused. =cut sub save_business { my ( $self, $myconfig, $form ) = @_; # connect to database my $dbh = $form->{dbh}; $form->{description} =~ s/-(-)+/-/g; $form->{description} =~ s/ ( )+/ /g; $form->{discount} /= 100; my $sth; my @queryargs = ( $form->{description}, $form->{discount} ); if ( $form->{id} ) { $query = qq| UPDATE business SET description = ?, discount = ? WHERE id = ?|; push @queryargs, $form->{id}; } else { $query = qq|INSERT INTO business (description, discount) VALUES (?, ?)|; } $dbh->prepare($query)->execute(@queryargs) || $form->dberror($query); if (!$form->{id}){ my $sth = $dbh->prepare("SELECT currval('business_id_seq')"); $sth->execute(); ($form->{id}) = $sth->fetchrow_array; } $dbh->commit; } =item AM->delete_business($myconfig, $form); Deletes the business type with the id $form->{id}. $myconfig is unused. =cut sub delete_business { my ( $self, $myconfig, $form ) = @_; # connect to database my $dbh = $form->{dbh}; $query = qq| DELETE FROM business WHERE id = ?|; $dbh->prepare($query)->execute( $form->{id} ) || $form->dberror($query); $dbh->commit; } =item AM->sic($myconfig, $form); Populate the list referred to as $form->{ALL} with hashes containing SIC (some well known systems of which are NAICS and ISIC) data from the sic table. code is the actual SIC code, description is a textual description of the code, and sictype is an indicator of whether or not the entry refers to a header. The hashes will be sorted by either the code or description. $myconfig is unused. =cut sub sic { my ( $self, $myconfig, $form ) = @_; # connect to database my $dbh = $form->{dbh}; $form->{sort} = "code" unless $form->{sort}; my @a = qw(code description); my %ordinal = ( code => 1, description => 3 ); my $sortorder = $form->sort_order( \@a, \%ordinal ); my $query = qq|SELECT code, sictype, description FROM sic ORDER BY $sortorder|; $sth = $dbh->prepare($query); $sth->execute || $form->dberror($query); while ( my $ref = $sth->fetchrow_hashref(NAME_lc) ) { push @{ $form->{ALL} }, $ref; } $sth->finish; $dbh->commit; } =item AM->get_sic($myconfig, $form); Retrieves the sictype and description for the SIC indicated by $form->{code} and places the retrieved values into $form->{sictype} and $form->{description}. $myconfig is unused =cut sub get_sic { my ( $self, $myconfig, $form ) = @_; # connect to database my $dbh = $form->{dbh}; my $query = qq| SELECT code, sictype, description FROM sic WHERE code = | . $dbh->quote( $form->{code} ); my $sth = $dbh->prepare($query); $sth->execute || $form->dberror($query); my $ref = $sth->fetchrow_hashref(NAME_lc); for ( keys %$ref ) { $form->{$_} = $ref->{$_} } $sth->finish; $dbh->commit; } =item AM->save_sic($myconfig, $form); Add or update a SIC entry. If $form->{id} is set, take it as the original code to identify the entry update, otherwise treat it as a new entry. $form->{code}, $form->{description}, and $form->{sictype} contain the new values. sictype is a single character to flag whether or not the entry is for a header ('H'). $myconfig is unused. =cut sub save_sic { my ( $self, $myconfig, $form ) = @_; my $dbh = $form->{dbh}; foreach my $item (qw(code description)) { $form->{$item} =~ s/-(-)+/-/g; } my $sth; @queryargs = ( $form->{code}, $form->{sictype}, $form->{description} ); # if there is an id if ( $form->{id} ) { $query = qq| UPDATE sic SET code = ?, sictype = ?, description = ? WHERE code = ?|; push @queryargs, $form->{id}; } else { $query = qq| INSERT INTO sic (code, sictype, description) VALUES (?, ?, ?)|; } $dbh->prepare($query)->execute(@queryargs) || $form->dberror($query); $dbh->commit; } =item AM->delete_sic($myconfig, $form); Deletes the SIC entry with the code $form->{code}. $myconfig is unused. =cut sub delete_sic { my ( $self, $myconfig, $form ) = @_; my $dbh = $form->{dbh}; $query = qq| DELETE FROM sic WHERE code = ?|; $dbh->prepare($query)->execute( $form->{code} ); $dbh->commit; } =item AM->language($myconfig, $form); Populates the list referred to as $form->{ALL} with hashes containing the code and description of all languages entered in the language table. The usual set of $form attributes affect the order in which the hashes are entered in the list. These language functions are unrelated to LedgerSMB::Locale, although these language codes are also used for non-UI templates and by LedgerSMB::PE. $myconfig is unused. =cut sub language { my ( $self, $myconfig, $form ) = @_; # connect to database my $dbh = $form->{dbh}; $form->{sort} = "code" unless $form->{sort}; my @a = qw(code description); my %ordinal = ( code => 1, description => 2 ); my $sortorder = $form->sort_order( \@a, \%ordinal ); my $query = qq| SELECT code, description FROM language ORDER BY $sortorder|; $sth = $dbh->prepare($query); $sth->execute || $form->dberror($query); while ( my $ref = $sth->fetchrow_hashref(NAME_lc) ) { push @{ $form->{ALL} }, $ref; } $sth->finish; $dbh->commit; } =item AM->get_language($myconfig, $form); Sets $form->{description} to the description of the language that has the code $form->{code}. $myconfig is unused. =cut sub get_language { my ( $self, $myconfig, $form ) = @_; # connect to database my $dbh = $form->{dbh}; my $query = qq| SELECT code, description FROM language WHERE code = ?|; my $sth = $dbh->prepare($query); $sth->execute( $form->{code} ) || $form->dberror($query); my $ref = $sth->fetchrow_hashref(NAME_lc); for ( keys %$ref ) { $form->{$_} = $ref->{$_} } $sth->finish; $dbh->commit; } =item AM->save_language($myconfig, $form); Add or update a language entry. If $form->{id} is set, the language entry that has that as a code is updated, otherwise a new entry is added. $form->{code} and $form->{description} contain the new values for the entry. $myconfig is unused. =cut sub save_language { my ( $self, $myconfig, $form ) = @_; # connect to database my $dbh = $form->{dbh}; $form->{code} =~ s/ //g; foreach my $item (qw(code description)) { $form->{$item} =~ s/-(-)+/-/g; $form->{$item} =~ s/ ( )+/-/g; } my $sth; my @queryargs = ( $form->{code}, $form->{description} ); # if there is an id if ( $form->{id} ) { $query = qq| UPDATE language SET code = ?, description = ? WHERE code = ?|; push @queryargs, $form->{id}; } else { $query = qq| INSERT INTO language (code, description) VALUES (?, ?)|; } $dbh->prepare($query)->execute(@queryargs) || $form->dberror($query); $dbh->commit; } =item AM->delete_language($myconfig, $form); Deletes the language entry with the code $form->{code}. $myconfig is unused. =cut sub delete_language { my ( $self, $myconfig, $form ) = @_; # connect to database my $dbh = $form->{dbh}; $query = qq| DELETE FROM language WHERE code = | . $dbh->quote( $form->{code} ); $dbh->do($query) || $form->dberror($query); } =item AM->recurring_transactions($myconfig, $form); Populates lists referred to in the form of $form->{transactions}{$type}, where the possible values for $type are 'ar', 'ap', 'gl', 'so', and 'po', with hashes containing details about recurring transactions of the $type variety. These hashes have the fields module (the frontend script that governs the transaction type), transaction (the transaction type), invoice (true if the transaction is an invoice), description (a field that is a customer, vendor, or in the case of a GL transaction, an arbitrary text field), amount (the cash value of the transaction), id (the id of the recurring transaction), reference (the reference value for the transaction), startdate (the date the recurring sequence started), nextdate (the date of the next occurrence of the event), enddate (the date the sequence ends), repeat (the number of units involved in the recurrence frequency), unit (the base recurrence unit), howmany (how many times the event occurs), payment (whether or not the event involves a payment), recurringemail (a colon separated list of forms to email as part of the event), recurringprint (a colon separated list of forms to print as part of the event), overdue (how many days until the next repetition of the event), vc (vendor, customer, or empty), exchangerate (the exchangerate involved on the day of the original transaction), curr (the currency of the event), and expired (if there will be no more recurrences). By default, these lists are sorted in order of the date of the next occurrence of the transaction. This order can be affected by the usual attributes used by $form->sort_order. $myconfig is unused. =cut sub recurring_transactions { my ( $self, $myconfig, $form ) = @_; my $dbh = $form->{dbh}; my $query = qq|SELECT value FROM defaults where setting_key = 'curr'|; my ($defaultcurrency) = $dbh->selectrow_array($query); $defaultcurrency = $dbh->quote( $defaultcurrency =~ s/:.*//g ); $form->{sort} ||= "nextdate"; my @a = ( $form->{sort} ); my $sortorder = $form->sort_order( \@a ); $query = qq| SELECT 'ar' AS module, 'ar' AS transaction, a.invoice, e.name AS description, a.amount, s.*, se.formname AS recurringemail, sp.formname AS recurringprint, s.nextdate - current_date AS overdue, 'customer' AS vc, ex.buy AS exchangerate, a.curr, (s.nextdate IS NULL OR s.nextdate > s.enddate) AS expired FROM recurring s JOIN ar a ON (a.id = s.id) JOIN entity_credit_account eca ON a.entity_credit_account = eca.id JOIN entity e ON (eca.entity_id = e.id) LEFT JOIN recurringemail se ON (se.id = s.id) LEFT JOIN recurringprint sp ON (sp.id = s.id) LEFT JOIN exchangerate ex ON (ex.curr = a.curr AND a.transdate = ex.transdate) UNION SELECT 'ap' AS module, 'ap' AS transaction, a.invoice, e.name AS description, a.amount, s.*, se.formname AS recurringemail, sp.formname AS recurringprint, s.nextdate - current_date AS overdue, 'vendor' AS vc, ex.sell AS exchangerate, a.curr, (s.nextdate IS NULL OR s.nextdate > s.enddate) AS expired FROM recurring s JOIN ap a ON (a.id = s.id) JOIN entity_credit_account eca ON a.entity_credit_account = eca.id JOIN entity e ON (eca.entity_id = e.id) LEFT JOIN recurringemail se ON (se.id = s.id) LEFT JOIN recurringprint sp ON (sp.id = s.id) LEFT JOIN exchangerate ex ON (ex.curr = a.curr AND a.transdate = ex.transdate) UNION SELECT 'gl' AS module, 'gl' AS transaction, FALSE AS invoice, a.description, (SELECT SUM(ac.amount) FROM acc_trans ac WHERE ac.trans_id = a.id AND ac.amount > 0) AS amount, s.*, se.formname AS recurringemail, sp.formname AS recurringprint, s.nextdate - current_date AS overdue, '' AS vc, '1' AS exchangerate, $defaultcurrency AS curr, (s.nextdate IS NULL OR s.nextdate > s.enddate) AS expired FROM recurring s JOIN gl a ON (a.id = s.id) LEFT JOIN recurringemail se ON (se.id = s.id) LEFT JOIN recurringprint sp ON (sp.id = s.id) UNION SELECT 'oe' AS module, 'so' AS transaction, FALSE AS invoice, e.name AS description, a.amount, s.*, se.formname AS recurringemail, sp.formname AS recurringprint, s.nextdate - current_date AS overdue, 'customer' AS vc, ex.buy AS exchangerate, a.curr, (s.nextdate IS NULL OR s.nextdate > s.enddate) AS expired FROM recurring s JOIN oe a ON (a.id = s.id) JOIN entity e ON (a.entity_id = e.id) LEFT JOIN recurringemail se ON (se.id = s.id) LEFT JOIN recurringprint sp ON (sp.id = s.id) LEFT JOIN exchangerate ex ON (ex.curr = a.curr AND a.transdate = ex.transdate) WHERE a.quotation = '0' UNION SELECT 'oe' AS module, 'po' AS transaction, FALSE AS invoice, e.name AS description, a.amount, s.*, se.formname AS recurringemail, sp.formname AS recurringprint, s.nextdate - current_date AS overdue, 'vendor' AS vc, ex.sell AS exchangerate, a.curr, (s.nextdate IS NULL OR s.nextdate > s.enddate) AS expired FROM recurring s JOIN oe a ON (a.id = s.id) JOIN entity e ON (a.entity_id = e.id) LEFT JOIN recurringemail se ON (se.id = s.id) LEFT JOIN recurringprint sp ON (sp.id = s.id) LEFT JOIN exchangerate ex ON (ex.curr = a.curr AND a.transdate = ex.transdate) WHERE a.quotation = '0' ORDER BY $sortorder|; my $sth = $dbh->prepare($query); $sth->execute || $form->dberror($query); my $id; my $transaction; my %e = (); my %p = (); while ( my $ref = $sth->fetchrow_hashref('NAME_lc') ) { $ref->{exchangerate} ||= 1; $form->db_parse_numeric(sth => $sth, hashref => $ref); if ( $ref->{id} != $id ) { if (%e) { $form->{transactions}{$transaction}->[$i]->{recurringemail} = ""; for ( keys %e ) { $form->{transactions}{$transaction}->[$i] ->{recurringemail} .= "${_}:"; } chop $form->{transactions}{$transaction}->[$i] ->{recurringemail}; } if (%p) { $form->{transactions}{$transaction}->[$i]->{recurringprint} = ""; for ( keys %p ) { $form->{transactions}{$transaction}->[$i] ->{recurringprint} .= "${_}:"; } chop $form->{transactions}{$transaction}->[$i] ->{recurringprint}; } %e = (); %p = (); push @{ $form->{transactions}{ $ref->{transaction} } }, $ref; $id = $ref->{id}; $i = $#{ $form->{transactions}{ $ref->{transaction} } }; } $transaction = $ref->{transaction}; $e{ $ref->{recurringemail} } = 1 if $ref->{recurringemail}; $p{ $ref->{recurringprint} } = 1 if $ref->{recurringprint}; } $sth->finish; # this is for the last row if (%e) { $form->{transactions}{$transaction}->[$i]->{recurringemail} = ""; for ( keys %e ) { $form->{transactions}{$transaction}->[$i]->{recurringemail} .= "${_}:"; } chop $form->{transactions}{$transaction}->[$i]->{recurringemail}; } if (%p) { $form->{transactions}{$transaction}->[$i]->{recurringprint} = ""; for ( keys %p ) { $form->{transactions}{$transaction}->[$i]->{recurringprint} .= "${_}:"; } chop $form->{transactions}{$transaction}->[$i]->{recurringprint}; } $dbh->commit; } =item AM->recurring_details($myconfig, $form, $id); Retrieves details about the recurring transaction $id and places them into attributes of $form. Sets id (the transaction id passed in, $id), reference (a reference string for the recurring transaction), startdate (the date the recurrence series started on), nextdate (the date of the next occurrence of the event), enddate (the date of the final occurrence of the event), repeat (the number of units involved in a recurrence period), unit (the recurrence unit), howmany (the total number of recurrences in the recurrence series), payment (whether or not the transaction is associated with a payment), arid (true if an ar event), apid (true if an ap event), overdue (number of days an ar event was to the duedate), paid (number of days after an ar event it was paid), req (days until the requirement date from the transdate of an oe event), oeid (true if an oe event), customer_id (vendor id if sales order), vendor_id (vendor id if puchase order), vc ('customer' if customer_id set, 'vendor' if vendor_id set), invoice (true if both arid and arinvoice set or if both apid and apinvoice set), recurringemail (colon separated list of forms and formats to be emailed), message (the non-attachement message body for the emails), and recurringprint (colon separated list of form names, formats, and printer names). $myconfig is unused. =cut sub recurring_details { my ( $self, $myconfig, $form, $id ) = @_; my $dbh = $form->{dbh}; my $query = qq| SELECT s.*, ar.id AS arid, ar.invoice AS arinvoice, ap.id AS apid, ap.invoice AS apinvoice, ar.duedate - ar.transdate AS overdue, ar.datepaid - ar.transdate AS paid, oe.reqdate - oe.transdate AS req, oe.id AS oeid, CASE oe.oe_class_id WHEN 1 THEN oe.entity_credit_account ELSE NULL END AS customer_id, CASE oe.oe_class_id WHEN 2 THEN oe.entity_credit_account ELSE NULL END AS vendor_id FROM recurring s LEFT JOIN ar ON (ar.id = s.id) LEFT JOIN ap ON (ap.id = s.id) LEFT JOIN oe ON (oe.id = s.id) WHERE s.id = ?|; my $sth = $dbh->prepare($query); $sth->execute($id) || $form->dberror($query); my $ref = $sth->fetchrow_hashref(NAME_lc); $form->{vc} = "customer" if $ref->{customer_id}; $form->{vc} = "vendor" if $ref->{vendor_id}; for ( keys %$ref ) { $form->{$_} = $ref->{$_} } $sth->finish; $form->{invoice} = ( $form->{arid} && $form->{arinvoice} ); $form->{invoice} = ( $form->{apid} && $form->{apinvoice} ) unless $form->{invoice}; $query = qq| SELECT * FROM recurringemail WHERE id = ?|; $sth = $dbh->prepare($query); $sth->execute($id) || $form->dberror($query); $form->{recurringemail} = ""; while ( $ref = $sth->fetchrow_hashref(NAME_lc) ) { $form->{recurringemail} .= "$ref->{formname}:$ref->{format}:"; $form->{message} = $ref->{message}; } $sth->finish; $query = qq| SELECT * FROM recurringprint WHERE id = ?|; $sth = $dbh->prepare($query); $sth->execute($id) || $form->dberror($query); $form->{recurringprint} = ""; while ( $ref = $sth->fetchrow_hashref(NAME_lc) ) { $form->{recurringprint} .= "$ref->{formname}:$ref->{format}:$ref->{printer}:"; } $sth->finish; chop $form->{recurringemail}; chop $form->{recurringprint}; for (qw(arinvoice apinvoice invnumber)) { delete $form->{$_} } $dbh->commit; } =item AM->update_recurring($myconfig, $form, $id) Updates nextdate for the recurring transaction $id to the next date of the sequence. If the new value for nextdate is after enddate, nextdate is set to NULL. $myconfig is unused. =cut sub update_recurring { my ( $self, $myconfig, $form, $id ) = @_; my $dbh = $form->{dbh}; $id = $dbh->quote($id); my $query = qq| SELECT nextdate, repeat, unit FROM recurring WHERE id = $id|; my ( $nextdate, $repeat, $unit ) = $dbh->selectrow_array($query); $nextdate = $dbh->quote($nextdate); my $interval = $dbh->quote("$repeat $unit"); # check if it is the last date $query = qq| SELECT (date $nextdate + interval $interval) > enddate FROM recurring WHERE id = $id|; my ($last_repeat) = $dbh->selectrow_array($query); if ($last_repeat) { $query = qq| UPDATE recurring SET nextdate = NULL WHERE id = $id|; } else { $query = qq| UPDATE recurring SET nextdate = (date $nextdate + interval $interval) WHERE id = $id|; } $dbh->do($query) || $form->dberror($query); $dbh->commit; } =item AM->check_template_name($myconfig, $form); Performs some sanity checking on the filename $form->{file} and calls $form->error if the filename is disallowed. =cut sub check_template_name { my ( $self, $myconfig, $form ) = @_; my @allowedsuff = qw(css tex txt html xml); my $test = $form->{file}; $test =~ s|^$LedgerSMB::Sysconfig::fs_cssdir||; if ($LedgerSMB::Sysconfig::fs_cssdir and $LedgerSMB::Sysconfig::fs_cssdir !~ m|/$|){ $test =~ s|^/||; } if ($LedgerSMB::Sysconfig::templates =~ /^(.:)*?\//){ $test =~ s#^$LedgerSMB::Sysconfig::templates/?\\?##; } if ( $test =~ /^(.:)*?\/|:|\.\.\// ) { $form->error("Directory transversal not allowed."); } if ( $form->{file} =~ /^${LedgerSMB::Sysconfig::backuppath}\// ) { $form->error( "Not allowed to access ${LedgerSMB::Sysconfig::backuppath}/ with this method" ); } my $whitelisted = 0; for (@allowedsuff) { if ( $form->{file} =~ /$_$/ ) { $whitelisted = 1; } } if ( !$whitelisted ) { $form->error("Error: File is of type that is not allowed."); } if ( $form->{file} !~ /^$myconfig->{templates}\// ) { $form->error("Not in a whitelisted directory: $form->{file}") unless $form->{file} =~ /^$LedgerSMB::Sysconfig::fs_cssdir\//; } } =item AM->load_template($myconfig, $form); Populates $form->{body} with the contents of the file $form->{file}. =cut sub load_template { my ( $self, $myconfig, $form ) = @_; my $testval = 0; $form->{file} ||= lc "$myconfig->{templates}/$form->{template}.$form->{format}"; $self->check_template_name( \%$myconfig, \%$form ); open( TEMPLATE, '<', "$form->{file}" ) || ($testval = 1); if ($testval == 1 && ($! eq 'No such file or directory')){ my $file = $form->{file}; $file =~ s|$form->{code}/|| if $form->{code}; open( TEMPLATE, '<', "$file" ) || $form->error( "Template not found: $file" ); } elsif ($testval == 1){ $form->error("$form->{file} : $!"); } while (