ekwo-os 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +873 -0
- package/dist/args.d.ts +57 -0
- package/dist/args.d.ts.map +1 -0
- package/dist/args.js +134 -0
- package/dist/args.js.map +1 -0
- package/dist/assets/expected-objects.json +9432 -0
- package/dist/assets/migrations/20260911120000_core_companies.sql +260 -0
- package/dist/assets/migrations/20260911120100_accounts_journals.sql +211 -0
- package/dist/assets/migrations/20260911120200_contacts.sql +90 -0
- package/dist/assets/migrations/20260911120300_taxes.sql +146 -0
- package/dist/assets/migrations/20260911120400_entries.sql +338 -0
- package/dist/assets/migrations/20260911120500_documents.sql +279 -0
- package/dist/assets/migrations/20260911120600_payments_reconciliation.sql +251 -0
- package/dist/assets/migrations/20260911120700_bank.sql +178 -0
- package/dist/assets/migrations/20260911120800_analytics_attachments.sql +128 -0
- package/dist/assets/migrations/20260911120900_post_document.sql +279 -0
- package/dist/assets/migrations/20260911121000_reporting.sql +235 -0
- package/dist/assets/migrations/20260911121100_country_templates.sql +226 -0
- package/dist/assets/migrations/20260911121200_fec.sql +71 -0
- package/dist/assets/migrations/20260911130000_instance.sql +77 -0
- package/dist/assets/migrations/20260911130100_instance_members.sql +224 -0
- package/dist/assets/migrations/20260911140000_instance_admins.sql +112 -0
- package/dist/assets/migrations/20260911160000_tax_posting_templates_unique.sql +17 -0
- package/dist/assets/migrations/20260911170000_document_amount_paid.sql +82 -0
- package/dist/assets/migrations/20260911173000_post_payment.sql +122 -0
- package/dist/assets/migrations/20260911173100_sequence_counters_under_rls.sql +84 -0
- package/dist/assets/migrations/20260911183000_country_journal_defaults.sql +143 -0
- package/dist/assets/migrations/20260911193853_line_account_defaults.sql +274 -0
- package/dist/assets/migrations/20260911195054_products.sql +221 -0
- package/dist/assets/migrations/20260911210131_anon_surface.sql +85 -0
- package/dist/assets/migrations/20260912074712_country_packs.sql +318 -0
- package/dist/assets/migrations/20260912080311_report_code_and_region.sql +198 -0
- package/dist/assets/migrations/20260912081014_pack_certification_maintained.sql +31 -0
- package/dist/assets/migrations/20260912081015_pack_certification_backfill.sql +16 -0
- package/dist/assets/migrations/20260912090407_tax_report_boxes.sql +329 -0
- package/dist/assets/migrations/20260912091917_tax_on_base_value.sql +25 -0
- package/dist/assets/migrations/20260912091918_tax_engine_columns.sql +776 -0
- package/dist/assets/migrations/20260912094412_opening_and_closing.sql +759 -0
- package/dist/assets/migrations/20260912095825_charts_of_accounts.sql +326 -0
- package/dist/assets/migrations/20260912100412_financial_statements.sql +632 -0
- package/dist/assets/migrations/20260912104719_one_formula_evaluator.sql +209 -0
- package/dist/assets/migrations/20260912105720_entry_kind_appropriation.sql +26 -0
- package/dist/assets/migrations/20260912105721_appropriation_entry_kind.sql +444 -0
- package/dist/assets/migrations/20260912111751_document_rules.sql +274 -0
- package/dist/assets/migrations/20260912112132_cash_basis_vat_and_fx.sql +1189 -0
- package/dist/assets/migrations/20260913074512_modules.sql +493 -0
- package/dist/assets/migrations/20260913075903_asset_disposal_roles.sql +47 -0
- package/dist/assets/migrations/20260913083216_capabilities.sql +637 -0
- package/dist/assets/migrations/20260913083901_company_invitations.sql +262 -0
- package/dist/assets/migrations/20260913084402_user_preferences.sql +376 -0
- package/dist/assets/migrations/20260913084847_company_profile.sql +261 -0
- package/dist/assets/migrations/20260913085436_numbering_reads_the_pack.sql +235 -0
- package/dist/assets/migrations/20260913085932_api_keys.sql +303 -0
- package/dist/assets/migrations/20260913090216_fiscal_year_bounds.sql +159 -0
- package/dist/assets/migrations/20260913092527_entries_import.sql +219 -0
- package/dist/assets/migrations/20260913101536_null_safe_guards.sql +188 -0
- package/dist/assets/migrations/20260913102115_installer_is_named.sql +462 -0
- package/dist/assets/migrations/20260913102758_no_currency_default.sql +138 -0
- package/dist/assets/migrations/20260913103355_cash_basis_needs_a_box.sql +453 -0
- package/dist/assets/migrations/20260913104014_aged_balance_named_group.sql +79 -0
- package/dist/assets/migrations/20260913104232_foreign_key_indexes.sql +144 -0
- package/dist/assets/migrations/20260913105120_declared_no_reader.sql +41 -0
- package/dist/assets/migrations/20260913111407_pack_languages.sql +223 -0
- package/dist/assets/migrations/20260913112233_schema_comments_for_a_reader.sql +27 -0
- package/dist/assets/migrations/20260913114535_fec_opening_balances.sql +307 -0
- package/dist/assets/migrations/20260914103412_audit_log.sql +509 -0
- package/dist/assets/migrations/20260914111907_pack_upgrade.sql +428 -0
- package/dist/assets/migrations/20260914120500_rounding_reads_the_currency.sql +206 -0
- package/dist/assets/migrations/20260914121200_amounts_round_at_the_currency.sql +2403 -0
- package/dist/assets/migrations/20260914134325_schema_version_0_2_0.sql +36 -0
- package/dist/assets/migrations/20260914143915_accounts_in_use.sql +428 -0
- package/dist/assets/migrations/20260914144731_account_code_frozen.sql +99 -0
- package/dist/assets/migrations/20260914151207_schema_grants_its_own_rights.sql +284 -0
- package/dist/assets/migrations/20260914152840_pack_upgrade_records_its_own_line.sql +237 -0
- package/dist/assets/migrations/20260914163943_declaration_periodicity.sql +349 -0
- package/dist/assets/migrations/20260915094000_foreign_services_received.sql +37 -0
- package/dist/assets/migrations/20260915094500_mentions_read_a_foreign_service.sql +72 -0
- package/dist/assets/migrations/20260915153000_document_shares.sql +568 -0
- package/dist/assets/migrations/20260915160000_ec_sales_list.sql +181 -0
- package/dist/assets/migrations/20260915161842_pack_sources.sql +56 -0
- package/dist/assets/migrations/20260915170500_schema_version_0_3_0.sql +45 -0
- package/dist/assets/migrations/20260915174500_a_vat_category_is_a_code.sql +177 -0
- package/dist/assets/migrations/20260915180000_document_rule_references.sql +85 -0
- package/dist/assets/migrations/20260915181000_territories.sql +342 -0
- package/dist/assets/migrations/20260915181500_ec_sales_list_reads_the_territories.sql +222 -0
- package/dist/assets/migrations/20260915182000_intracom_triangular.sql +53 -0
- package/dist/assets/migrations/20260915182500_a_triangular_supply_says_reverse_charge.sql +99 -0
- package/dist/assets/migrations/20260915191200_a_document_knows_its_language.sql +633 -0
- package/dist/assets/migrations/20260915195000_a_price_that_holds_its_tax.sql +649 -0
- package/dist/assets/migrations/20260915200000_a_posting_names_its_boxes.sql +1004 -0
- package/dist/assets/migrations/20260916094500_a_company_files_more_than_one_declaration.sql +795 -0
- package/dist/assets/migrations/20260916103000_a_ledger_line_names_its_posting.sql +902 -0
- package/dist/assets/migrations/20260916123000_a_vocabulary_for_a_tax_that_is_not_a_vat.sql +144 -0
- package/dist/assets/migrations/20260916124000_a_box_can_be_a_rate_of_a_box.sql +525 -0
- package/dist/assets/migrations/20260916125000_a_tax_follows_the_territory.sql +1318 -0
- package/dist/assets/migrations/20260916126000_a_tax_point_and_its_exception.sql +1211 -0
- package/dist/assets/migrations/20260917090000_a_counterparty_that_learns.sql +561 -0
- package/dist/assets/migrations/20260917120000_what_the_money_pays.sql +545 -0
- package/dist/assets/migrations/20260917150000_a_filing_is_a_row.sql +488 -0
- package/dist/assets/migrations/20260917170000_when_it_is_due.sql +194 -0
- package/dist/assets/migrations/20260917180000_a_box_is_a_number_and_a_kind.sql +213 -0
- package/dist/assets/migrations/20260917190000_what_a_declaration_owes.sql +486 -0
- package/dist/assets/migrations/20260917200000_what_moved_after_it_went.sql +227 -0
- package/dist/assets/migrations/20260918090000_a_form_names_its_file.sql +27 -0
- package/dist/assets/migrations/20260918110000_a_deposit_and_what_came_back.sql +286 -0
- package/dist/assets/migrations/20260918113741_a_fourth_preset_is_named.sql +9 -0
- package/dist/assets/migrations/20260918113807_a_client_reads_and_hands_over.sql +96 -0
- package/dist/assets/migrations/20260918114322_two_definer_functions_check_their_caller.sql +75 -0
- package/dist/assets/migrations/20260918130000_every_company_somebody_keeps.sql +177 -0
- package/dist/assets/migrations/20260918140000_a_session_nobody_prepared.sql +40 -0
- package/dist/assets/migrations/20260918141107_a_line_keeps_the_tax_it_was_posted_with.sql +256 -0
- package/dist/assets/migrations/20260918141342_a_company_has_an_electronic_address.sql +66 -0
- package/dist/assets/migrations/20260918141605_an_invoice_reads_whole_from_the_views.sql +313 -0
- package/dist/assets/migrations/20260918141627_a_policy_asks_once.sql +132 -0
- package/dist/assets/migrations/20260918143352_a_suggestion_reads_the_words_once.sql +204 -0
- package/dist/assets/migrations/20260918143417_a_reference_of_the_caller_and_a_rehearsal.sql +115 -0
- package/dist/assets/migrations/20260918150712_a_company_leaves_with_its_books.sql +1119 -0
- package/dist/assets/migrations/20260918150931_a_statement_is_imported_once.sql +654 -0
- package/dist/assets/migrations/20260918161204_a_posted_document_does_not_move.sql +437 -0
- package/dist/assets/migrations/20260918161538_a_posted_entry_does_not_move.sql +252 -0
- package/dist/assets/migrations/20260918171946_an_entry_is_posted_by_post_entry.sql +289 -0
- package/dist/assets/migrations/20260918174312_schema_version_0_4_0.sql +53 -0
- package/dist/assets/modules/assets/module.json +13 -0
- package/dist/assets/modules/assets/supabase/migrations/20260913081447_assets.sql +1190 -0
- package/dist/assets/modules/assets/supabase/migrations/20260913104234_foreign_key_indexes.sql +47 -0
- package/dist/assets/modules/assets/supabase/migrations/20260913104500_assets_capabilities.sql +145 -0
- package/dist/assets/modules/assets/supabase/migrations/20260914122100_assets_round_at_the_currency.sql +564 -0
- package/dist/assets/modules/assets/supabase/migrations/20260914145012_assets_accounts_in_use.sql +37 -0
- package/dist/assets/modules/assets/supabase/migrations/20260914151530_assets_grants_its_own_rights.sql +63 -0
- package/dist/assets/modules/assets/supabase/migrations/20260918113912_assets_client_reads.sql +20 -0
- package/dist/assets/modules/assets/supabase/migrations/20260918150801_assets_leave_with_the_company.sql +41 -0
- package/dist/assets/modules/budgets/module.json +12 -0
- package/dist/assets/modules/budgets/supabase/migrations/20260913083012_budgets.sql +210 -0
- package/dist/assets/modules/budgets/supabase/migrations/20260913104233_foreign_key_indexes.sql +37 -0
- package/dist/assets/modules/budgets/supabase/migrations/20260913104501_budgets_capabilities.sql +72 -0
- package/dist/assets/modules/budgets/supabase/migrations/20260914122400_budgets_round_at_the_currency.sql +68 -0
- package/dist/assets/modules/budgets/supabase/migrations/20260914145048_budgets_accounts_in_use.sql +30 -0
- package/dist/assets/modules/budgets/supabase/migrations/20260914151812_budgets_grants_its_own_rights.sql +31 -0
- package/dist/assets/modules/budgets/supabase/migrations/20260918113954_budgets_client_reads.sql +20 -0
- package/dist/assets/modules/budgets/supabase/migrations/20260918150823_budgets_leave_with_the_company.sql +37 -0
- package/dist/assets/modules/schema/module.1.json +69 -0
- package/dist/assets/seed/00_currencies.sql +15 -0
- package/dist/assets/seed/00_territories.sql +280 -0
- package/dist/assets/seed/05_framework_generic.sql +110 -0
- package/dist/assets/seed/10_pack_be.sql +1284 -0
- package/dist/assets/seed/11_pack_fr.sql +1112 -0
- package/dist/assets/seed/12_pack_lu.sql +2484 -0
- package/dist/assets/seed/13_pack_ee.sql +733 -0
- package/dist/assets/seed/14_pack_gb.sql +796 -0
- package/dist/assets/seed/15_pack_us.sql +751 -0
- package/dist/assets/seed/90_demo_company.sql +368 -0
- package/dist/assets/seed/modules/assets/10_pack_be.sql +58 -0
- package/dist/assets/seed/modules/assets/11_pack_fr.sql +57 -0
- package/dist/assets/seed/modules/assets/14_pack_gb.sql +58 -0
- package/dist/assets/seed/modules/assets/15_pack_us.sql +60 -0
- package/dist/auth.d.ts +59 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +134 -0
- package/dist/auth.js.map +1 -0
- package/dist/bin.d.ts +6 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +8 -0
- package/dist/bin.js.map +1 -0
- package/dist/books.d.ts +60 -0
- package/dist/books.d.ts.map +1 -0
- package/dist/books.js +168 -0
- package/dist/books.js.map +1 -0
- package/dist/bootstrap.d.ts +236 -0
- package/dist/bootstrap.d.ts.map +1 -0
- package/dist/bootstrap.js +459 -0
- package/dist/bootstrap.js.map +1 -0
- package/dist/bundle.d.ts +27 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +47 -0
- package/dist/bundle.js.map +1 -0
- package/dist/checklist.d.ts +35 -0
- package/dist/checklist.d.ts.map +1 -0
- package/dist/checklist.js +64 -0
- package/dist/checklist.js.map +1 -0
- package/dist/cli.d.ts +14 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +318 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/company.d.ts +59 -0
- package/dist/commands/company.d.ts.map +1 -0
- package/dist/commands/company.js +287 -0
- package/dist/commands/company.js.map +1 -0
- package/dist/commands/contact.d.ts +9 -0
- package/dist/commands/contact.d.ts.map +1 -0
- package/dist/commands/contact.js +82 -0
- package/dist/commands/contact.js.map +1 -0
- package/dist/commands/demo.d.ts +19 -0
- package/dist/commands/demo.d.ts.map +1 -0
- package/dist/commands/demo.js +72 -0
- package/dist/commands/demo.js.map +1 -0
- package/dist/commands/doctor.d.ts +12 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +68 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/document.d.ts +17 -0
- package/dist/commands/document.d.ts.map +1 -0
- package/dist/commands/document.js +217 -0
- package/dist/commands/document.js.map +1 -0
- package/dist/commands/init.d.ts +31 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +535 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/login.d.ts +24 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +128 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/migrate.d.ts +30 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +115 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/module.d.ts +32 -0
- package/dist/commands/module.d.ts.map +1 -0
- package/dist/commands/module.js +285 -0
- package/dist/commands/module.js.map +1 -0
- package/dist/commands/pack.d.ts +22 -0
- package/dist/commands/pack.d.ts.map +1 -0
- package/dist/commands/pack.js +481 -0
- package/dist/commands/pack.js.map +1 -0
- package/dist/commands/payment.d.ts +15 -0
- package/dist/commands/payment.d.ts.map +1 -0
- package/dist/commands/payment.js +97 -0
- package/dist/commands/payment.js.map +1 -0
- package/dist/commands/register.d.ts +20 -0
- package/dist/commands/register.d.ts.map +1 -0
- package/dist/commands/register.js +134 -0
- package/dist/commands/register.js.map +1 -0
- package/dist/commands/status.d.ts +8 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +134 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/whoami.d.ts +21 -0
- package/dist/commands/whoami.d.ts.map +1 -0
- package/dist/commands/whoami.js +133 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/company.d.ts +16 -0
- package/dist/company.d.ts.map +1 -0
- package/dist/company.js +26 -0
- package/dist/company.js.map +1 -0
- package/dist/config.d.ts +24 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +50 -0
- package/dist/config.js.map +1 -0
- package/dist/connection.d.ts +79 -0
- package/dist/connection.d.ts.map +1 -0
- package/dist/connection.js +116 -0
- package/dist/connection.js.map +1 -0
- package/dist/context.d.ts +47 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +93 -0
- package/dist/context.js.map +1 -0
- package/dist/doctor.d.ts +45 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +448 -0
- package/dist/doctor.js.map +1 -0
- package/dist/grants.d.ts +88 -0
- package/dist/grants.d.ts.map +1 -0
- package/dist/grants.js +174 -0
- package/dist/grants.js.map +1 -0
- package/dist/identity.d.ts +54 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +132 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/inventory.d.ts +155 -0
- package/dist/inventory.d.ts.map +1 -0
- package/dist/inventory.js +303 -0
- package/dist/inventory.js.map +1 -0
- package/dist/migrations.d.ts +76 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +226 -0
- package/dist/migrations.js.map +1 -0
- package/dist/module/read.d.ts +91 -0
- package/dist/module/read.d.ts.map +1 -0
- package/dist/module/read.js +172 -0
- package/dist/module/read.js.map +1 -0
- package/dist/output.d.ts +110 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +173 -0
- package/dist/output.js.map +1 -0
- package/dist/pack/certification.d.ts +27 -0
- package/dist/pack/certification.d.ts.map +1 -0
- package/dist/pack/certification.js +38 -0
- package/dist/pack/certification.js.map +1 -0
- package/dist/pack/compile.d.ts +75 -0
- package/dist/pack/compile.d.ts.map +1 -0
- package/dist/pack/compile.js +801 -0
- package/dist/pack/compile.js.map +1 -0
- package/dist/pack/filing.d.ts +48 -0
- package/dist/pack/filing.d.ts.map +1 -0
- package/dist/pack/filing.js +56 -0
- package/dist/pack/filing.js.map +1 -0
- package/dist/pack/read.d.ts +766 -0
- package/dist/pack/read.d.ts.map +1 -0
- package/dist/pack/read.js +2336 -0
- package/dist/pack/read.js.map +1 -0
- package/dist/pack/schema.d.ts +26 -0
- package/dist/pack/schema.d.ts.map +1 -0
- package/dist/pack/schema.js +181 -0
- package/dist/pack/schema.js.map +1 -0
- package/dist/pack/territories.d.ts +98 -0
- package/dist/pack/territories.d.ts.map +1 -0
- package/dist/pack/territories.js +0 -0
- package/dist/pack/territories.js.map +1 -0
- package/dist/pack/upgrade.d.ts +86 -0
- package/dist/pack/upgrade.d.ts.map +1 -0
- package/dist/pack/upgrade.js +76 -0
- package/dist/pack/upgrade.js.map +1 -0
- package/dist/pack/vat-codes.d.ts +273 -0
- package/dist/pack/vat-codes.d.ts.map +1 -0
- package/dist/pack/vat-codes.js +513 -0
- package/dist/pack/vat-codes.js.map +1 -0
- package/dist/profiles.d.ts +67 -0
- package/dist/profiles.d.ts.map +1 -0
- package/dist/profiles.js +187 -0
- package/dist/profiles.js.map +1 -0
- package/dist/prompt.d.ts +40 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +120 -0
- package/dist/prompt.js.map +1 -0
- package/dist/registry.d.ts +84 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +104 -0
- package/dist/registry.js.map +1 -0
- package/dist/rest.d.ts +81 -0
- package/dist/rest.d.ts.map +1 -0
- package/dist/rest.js +245 -0
- package/dist/rest.js.map +1 -0
- package/dist/schema.d.ts +15 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +15 -0
- package/dist/schema.js.map +1 -0
- package/dist/seeds.d.ts +27 -0
- package/dist/seeds.d.ts.map +1 -0
- package/dist/seeds.js +47 -0
- package/dist/seeds.js.map +1 -0
- package/dist/session.d.ts +39 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +92 -0
- package/dist/session.js.map +1 -0
- package/dist/sql.d.ts +48 -0
- package/dist/sql.d.ts.map +1 -0
- package/dist/sql.js +112 -0
- package/dist/sql.js.map +1 -0
- package/dist/status.d.ts +94 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/status.js +120 -0
- package/dist/status.js.map +1 -0
- package/dist/ui.d.ts +55 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +114 -0
- package/dist/ui.js.map +1 -0
- package/package.json +29 -0
- package/schema/output.1.json +613 -0
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
-- Ekwo OS — demo data.
|
|
2
|
+
--
|
|
3
|
+
-- A fictional Belgian consultancy, its customers and suppliers, a quarter of
|
|
4
|
+
-- invoices, a payment, a matching and a bank statement. Everything here is
|
|
5
|
+
-- invented: no real company, person, VAT number or bank account.
|
|
6
|
+
--
|
|
7
|
+
-- It also stands in for the installer: it records the instance and claims the
|
|
8
|
+
-- first instance administrator, which is what `init_instance()` and
|
|
9
|
+
-- `claim_instance_admin()` do on a real install.
|
|
10
|
+
--
|
|
11
|
+
-- Drop this file from `supabase/seed/` before installing on a real project.
|
|
12
|
+
|
|
13
|
+
do $$
|
|
14
|
+
declare
|
|
15
|
+
v_owner uuid := '00000000-0000-0000-0000-000000000001';
|
|
16
|
+
v_company uuid;
|
|
17
|
+
v_bank uuid;
|
|
18
|
+
v_bank_jrnl uuid;
|
|
19
|
+
v_stmt uuid;
|
|
20
|
+
v_entry entries%rowtype;
|
|
21
|
+
-- contacts
|
|
22
|
+
c_dumont uuid;
|
|
23
|
+
c_verhoeven uuid;
|
|
24
|
+
c_northwind uuid;
|
|
25
|
+
s_lelievre uuid;
|
|
26
|
+
s_hollandia uuid;
|
|
27
|
+
s_immo uuid;
|
|
28
|
+
-- products
|
|
29
|
+
p_conseil uuid;
|
|
30
|
+
p_atelier uuid;
|
|
31
|
+
p_support uuid;
|
|
32
|
+
p_brochure uuid;
|
|
33
|
+
-- documents
|
|
34
|
+
d uuid;
|
|
35
|
+
v_doc_ids uuid[] := '{}';
|
|
36
|
+
v_line_debit uuid;
|
|
37
|
+
v_line_credit uuid;
|
|
38
|
+
begin
|
|
39
|
+
if exists (select 1 from companies where vat_number = 'BE0123456749') then
|
|
40
|
+
return;
|
|
41
|
+
end if;
|
|
42
|
+
|
|
43
|
+
-- A real installation calls init_instance() from the installer; the demo
|
|
44
|
+
-- stands in for it so the seeded database looks like an installed one.
|
|
45
|
+
if not exists (select 1 from instance) then
|
|
46
|
+
perform init_instance('Exemple Conseil', 'BE', 'community');
|
|
47
|
+
end if;
|
|
48
|
+
|
|
49
|
+
-- The demo administrator is a fictional account. On a real installation the
|
|
50
|
+
-- user already exists in Supabase Auth and simply calls
|
|
51
|
+
-- claim_instance_admin(); this insert only exists so the demo stands alone.
|
|
52
|
+
insert into auth.users (id, email)
|
|
53
|
+
values (v_owner, 'admin@exemple-conseil.example')
|
|
54
|
+
on conflict (id) do nothing;
|
|
55
|
+
|
|
56
|
+
perform claim_instance_admin(v_owner);
|
|
57
|
+
|
|
58
|
+
-- The currency and the language come from the pack of the country this
|
|
59
|
+
-- company is in, which is where they come from for a real one too. Since
|
|
60
|
+
-- 20260913102758 the columns carry no default, so naming them is the only
|
|
61
|
+
-- way, and reading them off `country_defaults` keeps the demo honest about
|
|
62
|
+
-- where the answer lives.
|
|
63
|
+
insert into companies (name, legal_name, legal_form, country, fiscal_country,
|
|
64
|
+
vat_number, registration_number, address_line1,
|
|
65
|
+
postal_code, city, email, website, currency_code, language)
|
|
66
|
+
select 'Exemple Conseil', 'Exemple Conseil SRL', 'SRL', 'BE', 'BE',
|
|
67
|
+
'BE0123456749', '0123.456.749', 'Rue de l''Exemple 1',
|
|
68
|
+
'1000', 'Bruxelles', 'compta@exemple-conseil.example',
|
|
69
|
+
'https://exemple-conseil.example', d.currency_code, d.language_default
|
|
70
|
+
from country_defaults d where d.country = 'BE'
|
|
71
|
+
returning id into v_company;
|
|
72
|
+
|
|
73
|
+
insert into company_members (company_id, user_id, role) values (v_company, v_owner, 'owner');
|
|
74
|
+
|
|
75
|
+
-- From here the sample books are kept by the fictional owner, and not by
|
|
76
|
+
-- whoever happens to be running the installer. `ekwo demo` acts as the real
|
|
77
|
+
-- administrator so that `claim_instance_admin()` is satisfied rather than
|
|
78
|
+
-- circumvented — and that administrator is not a member of this fictional
|
|
79
|
+
-- company, so posting as them is exactly what the capability guards refuse.
|
|
80
|
+
-- Transaction-local, so the claim the caller set comes back when this block
|
|
81
|
+
-- commits.
|
|
82
|
+
perform set_config('request.jwt.claims',
|
|
83
|
+
json_build_object('sub', v_owner, 'role', 'authenticated')::text,
|
|
84
|
+
true);
|
|
85
|
+
|
|
86
|
+
perform install_country_template(v_company, 'BE');
|
|
87
|
+
|
|
88
|
+
insert into fiscal_years (company_id, name, start_date, end_date, is_closed) values
|
|
89
|
+
(v_company, 'Exercice 2025', date '2025-01-01', date '2025-12-31', true),
|
|
90
|
+
(v_company, 'Exercice 2026', date '2026-01-01', date '2026-12-31', false);
|
|
91
|
+
|
|
92
|
+
-- Nothing may be booked in 2025 any more.
|
|
93
|
+
update companies set lock_date = date '2025-12-31' where id = v_company;
|
|
94
|
+
|
|
95
|
+
-- ---------------------------------------------------------------- contacts
|
|
96
|
+
insert into contacts (company_id, name, contact_type, vat_number, auxiliary_code,
|
|
97
|
+
email, address_line1, postal_code, city, country,
|
|
98
|
+
payment_terms_days, peppol_scheme, peppol_identifier)
|
|
99
|
+
values (v_company, 'Atelier Dumont SRL', 'customer', 'BE0400000086', 'C0001',
|
|
100
|
+
'facturation@atelier-dumont.example', 'Chaussee de Wavre 210', '1050', 'Ixelles', 'BE',
|
|
101
|
+
30, '0208', '0400000086')
|
|
102
|
+
returning id into c_dumont;
|
|
103
|
+
|
|
104
|
+
insert into contacts (company_id, name, contact_type, vat_number, auxiliary_code,
|
|
105
|
+
email, address_line1, postal_code, city, country, payment_terms_days)
|
|
106
|
+
values (v_company, 'Studio Verhoeven BV', 'customer', 'NL001234567B01', 'C0002',
|
|
107
|
+
'admin@studio-verhoeven.example', 'Keizersgracht 12', '1015 CJ', 'Amsterdam', 'NL', 30)
|
|
108
|
+
returning id into c_verhoeven;
|
|
109
|
+
|
|
110
|
+
insert into contacts (company_id, name, contact_type, vat_number, auxiliary_code,
|
|
111
|
+
email, address_line1, postal_code, city, country, payment_terms_days)
|
|
112
|
+
values (v_company, 'Northwind Systems Inc', 'customer', null, 'C0003',
|
|
113
|
+
'ap@northwind-systems.example', '500 Market Street', 'WA 98101', 'Seattle', 'US', 45)
|
|
114
|
+
returning id into c_northwind;
|
|
115
|
+
|
|
116
|
+
insert into contacts (company_id, name, contact_type, vat_number, auxiliary_code,
|
|
117
|
+
email, address_line1, postal_code, city, country, payment_terms_days)
|
|
118
|
+
values (v_company, 'Bureau Lelievre SA', 'supplier', 'BE0400000185', 'F0001',
|
|
119
|
+
'compta@bureau-lelievre.example', 'Rue Haute 45', '1000', 'Bruxelles', 'BE', 30)
|
|
120
|
+
returning id into s_lelievre;
|
|
121
|
+
|
|
122
|
+
insert into contacts (company_id, name, contact_type, vat_number, auxiliary_code,
|
|
123
|
+
email, address_line1, postal_code, city, country, payment_terms_days)
|
|
124
|
+
values (v_company, 'Hollandia Software BV', 'supplier', 'NL009876543B01', 'F0002',
|
|
125
|
+
'billing@hollandia-software.example', 'Stationsplein 8', '3511 ED', 'Utrecht', 'NL', 15)
|
|
126
|
+
returning id into s_hollandia;
|
|
127
|
+
|
|
128
|
+
insert into contacts (company_id, name, contact_type, vat_number, auxiliary_code,
|
|
129
|
+
email, address_line1, postal_code, city, country, payment_terms_days)
|
|
130
|
+
values (v_company, 'Immo Central SA', 'supplier', 'BE0400000284', 'F0003',
|
|
131
|
+
'loyers@immo-central.example', 'Avenue Louise 100', '1050', 'Ixelles', 'BE', 10)
|
|
132
|
+
returning id into s_immo;
|
|
133
|
+
|
|
134
|
+
-- --------------------------------------------------------------- products
|
|
135
|
+
-- Four catalogue rows, so the demo shows what a product does: it fills a
|
|
136
|
+
-- line in — name, unit, price, account, tax — and constrains nothing.
|
|
137
|
+
-- `on conflict do nothing` keeps the file re-appliable, like the rest.
|
|
138
|
+
insert into products (company_id, code, name, description, kind, unit_code,
|
|
139
|
+
sale_price, sale_account_id, sale_tax_id) values
|
|
140
|
+
(v_company, 'CONS-JOUR', 'Journee de conseil',
|
|
141
|
+
'Accompagnement sur site ou a distance, par journee de sept heures.',
|
|
142
|
+
'service', 'DAY', 500,
|
|
143
|
+
account_id_by_code(v_company, '704000'),
|
|
144
|
+
(select id from taxes where company_id = v_company and code = 'BE-S-21')),
|
|
145
|
+
(v_company, 'CONS-ATELIER', 'Atelier de cadrage',
|
|
146
|
+
'Demi-journee de cadrage, jusqu''a huit participants.',
|
|
147
|
+
'service', 'C62', 1200,
|
|
148
|
+
account_id_by_code(v_company, '704000'),
|
|
149
|
+
(select id from taxes where company_id = v_company and code = 'BE-S-21')),
|
|
150
|
+
(v_company, 'SUPPORT-M', 'Support mensuel',
|
|
151
|
+
'Assistance par courriel, un mois, temps de reponse un jour ouvrable.',
|
|
152
|
+
'service', 'MON', 800,
|
|
153
|
+
account_id_by_code(v_company, '704000'),
|
|
154
|
+
(select id from taxes where company_id = v_company and code = 'BE-S-21')),
|
|
155
|
+
(v_company, 'BROCHURE', 'Brochure imprimee',
|
|
156
|
+
'Brochure seize pages, quadrichromie, taux reduit.',
|
|
157
|
+
'goods', 'C62', 1,
|
|
158
|
+
account_id_by_code(v_company, '700100'),
|
|
159
|
+
(select id from taxes where company_id = v_company and code = 'BE-S-06'))
|
|
160
|
+
on conflict (company_id, code) do nothing;
|
|
161
|
+
|
|
162
|
+
select id into p_conseil from products where company_id = v_company and code = 'CONS-JOUR';
|
|
163
|
+
select id into p_atelier from products where company_id = v_company and code = 'CONS-ATELIER';
|
|
164
|
+
select id into p_support from products where company_id = v_company and code = 'SUPPORT-M';
|
|
165
|
+
select id into p_brochure from products where company_id = v_company and code = 'BROCHURE';
|
|
166
|
+
|
|
167
|
+
-- ------------------------------------------------------------------- bank
|
|
168
|
+
select id into v_bank_jrnl from journals where company_id = v_company and code = 'BNK';
|
|
169
|
+
|
|
170
|
+
insert into bank_accounts (company_id, name, iban, bic, bank_name, currency_code,
|
|
171
|
+
account_id, journal_id)
|
|
172
|
+
values (v_company, 'Compte courant', 'BE71096123456769', 'GKCCBEBB', 'Banque Exemple',
|
|
173
|
+
'EUR', account_id_by_code(v_company, '550000'), v_bank_jrnl)
|
|
174
|
+
returning id into v_bank;
|
|
175
|
+
|
|
176
|
+
update journals set bank_account_id = v_bank, default_account_id = account_id_by_code(v_company, '550000')
|
|
177
|
+
where id = v_bank_jrnl;
|
|
178
|
+
|
|
179
|
+
-- -------------------------------------------------------------- documents
|
|
180
|
+
-- 1. Two-line consultancy invoice, 21 %.
|
|
181
|
+
insert into documents (company_id, doc_type, number, contact_id, document_date, due_date,
|
|
182
|
+
buyer_reference, payment_reference, note)
|
|
183
|
+
values (v_company, 'sale_invoice', 'FAC-2026-0001', c_dumont, date '2026-07-03', date '2026-08-02',
|
|
184
|
+
'PO-DUM-118', '+++010/1234/56789+++', 'Mission d''accompagnement, juin 2026')
|
|
185
|
+
returning id into d;
|
|
186
|
+
v_doc_ids := v_doc_ids || d;
|
|
187
|
+
insert into document_lines (document_id, company_id, sequence, product_id, name, description,
|
|
188
|
+
quantity, unit_code, unit_price, tax_id, account_id,
|
|
189
|
+
vat_category, vat_rate) values
|
|
190
|
+
(d, v_company, 10, p_conseil, 'Journees de conseil',
|
|
191
|
+
'Accompagnement sur site ou a distance, par journee de sept heures.', 5, 'DAY', 500,
|
|
192
|
+
(select id from taxes where company_id = v_company and code = 'BE-S-21'),
|
|
193
|
+
account_id_by_code(v_company, '704000'), 'S', 21),
|
|
194
|
+
(d, v_company, 20, p_atelier, 'Atelier de cadrage', null, 1, 'C62', 1200,
|
|
195
|
+
(select id from taxes where company_id = v_company and code = 'BE-S-21'),
|
|
196
|
+
account_id_by_code(v_company, '704000'), 'S', 21);
|
|
197
|
+
|
|
198
|
+
-- 2. Single-line invoice, 21 %.
|
|
199
|
+
insert into documents (company_id, doc_type, number, contact_id, document_date, due_date)
|
|
200
|
+
values (v_company, 'sale_invoice', 'FAC-2026-0002', c_dumont, date '2026-07-24', date '2026-08-23')
|
|
201
|
+
returning id into d;
|
|
202
|
+
v_doc_ids := v_doc_ids || d;
|
|
203
|
+
insert into document_lines (document_id, company_id, sequence, product_id, name, quantity,
|
|
204
|
+
unit_code, unit_price, tax_id, account_id, vat_category, vat_rate)
|
|
205
|
+
values (d, v_company, 10, p_support, 'Support mensuel', 1, 'MON', 800,
|
|
206
|
+
(select id from taxes where company_id = v_company and code = 'BE-S-21'),
|
|
207
|
+
account_id_by_code(v_company, '704000'), 'S', 21);
|
|
208
|
+
|
|
209
|
+
-- 3. Reduced rate, 6 %.
|
|
210
|
+
insert into documents (company_id, doc_type, number, contact_id, document_date, due_date)
|
|
211
|
+
values (v_company, 'sale_invoice', 'FAC-2026-0003', c_dumont, date '2026-08-05', date '2026-09-04')
|
|
212
|
+
returning id into d;
|
|
213
|
+
v_doc_ids := v_doc_ids || d;
|
|
214
|
+
insert into document_lines (document_id, company_id, sequence, product_id, name, quantity,
|
|
215
|
+
unit_price, tax_id, account_id, vat_category, vat_rate)
|
|
216
|
+
values (d, v_company, 10, p_brochure, 'Brochure imprimee', 400, 1,
|
|
217
|
+
(select id from taxes where company_id = v_company and code = 'BE-S-06'),
|
|
218
|
+
account_id_by_code(v_company, '700100'), 'S', 6);
|
|
219
|
+
|
|
220
|
+
-- 4. Intra-community service, reverse charged by the customer.
|
|
221
|
+
insert into documents (company_id, doc_type, number, contact_id, document_date, due_date, note)
|
|
222
|
+
values (v_company, 'sale_invoice', 'FAC-2026-0004', c_verhoeven, date '2026-08-12', date '2026-09-11',
|
|
223
|
+
'Autoliquidation, article 21 par. 2 du Code de la TVA')
|
|
224
|
+
returning id into d;
|
|
225
|
+
v_doc_ids := v_doc_ids || d;
|
|
226
|
+
insert into document_lines (document_id, company_id, sequence, name, quantity, unit_code,
|
|
227
|
+
unit_price, tax_id, account_id, vat_category, vat_rate)
|
|
228
|
+
values (d, v_company, 10, 'Audit technique', 8, 'DAY', 400,
|
|
229
|
+
(select id from taxes where company_id = v_company and code = 'BE-S-ICS'),
|
|
230
|
+
account_id_by_code(v_company, '700200'), 'AE', 0);
|
|
231
|
+
|
|
232
|
+
-- 5. Export outside the EU.
|
|
233
|
+
insert into documents (company_id, doc_type, number, contact_id, document_date, due_date,
|
|
234
|
+
currency_code, order_reference)
|
|
235
|
+
values (v_company, 'sale_invoice', 'FAC-2026-0005', c_northwind, date '2026-08-28', date '2026-10-12',
|
|
236
|
+
'EUR', 'NW-2026-441')
|
|
237
|
+
returning id into d;
|
|
238
|
+
v_doc_ids := v_doc_ids || d;
|
|
239
|
+
insert into document_lines (document_id, company_id, sequence, name, quantity, unit_price,
|
|
240
|
+
tax_id, account_id, vat_category, vat_rate)
|
|
241
|
+
values (d, v_company, 10, 'Licence annuelle', 1, 5400,
|
|
242
|
+
(select id from taxes where company_id = v_company and code = 'BE-S-EXP'),
|
|
243
|
+
account_id_by_code(v_company, '700300'), 'G', 0);
|
|
244
|
+
|
|
245
|
+
-- 6. Credit note on invoice 2.
|
|
246
|
+
insert into documents (company_id, doc_type, number, contact_id, document_date, due_date,
|
|
247
|
+
reversed_document_id, note)
|
|
248
|
+
values (v_company, 'sale_credit_note', 'NCC-2026-0001', c_dumont, date '2026-08-30', date '2026-08-30',
|
|
249
|
+
v_doc_ids[2], 'Geste commercial sur FAC-2026-0002')
|
|
250
|
+
returning id into d;
|
|
251
|
+
v_doc_ids := v_doc_ids || d;
|
|
252
|
+
insert into document_lines (document_id, company_id, sequence, name, quantity, unit_price,
|
|
253
|
+
tax_id, account_id, vat_category, vat_rate)
|
|
254
|
+
values (d, v_company, 10, 'Remise sur support mensuel', 1, 300,
|
|
255
|
+
(select id from taxes where company_id = v_company and code = 'BE-S-21'),
|
|
256
|
+
account_id_by_code(v_company, '704000'), 'S', 21);
|
|
257
|
+
|
|
258
|
+
-- 7. Domestic purchase of services, 21 %.
|
|
259
|
+
insert into documents (company_id, doc_type, number, supplier_reference, contact_id,
|
|
260
|
+
document_date, due_date)
|
|
261
|
+
values (v_company, 'purchase_invoice', 'ACH-2026-0001', 'BL-2026-3312', s_lelievre,
|
|
262
|
+
date '2026-07-09', date '2026-08-08')
|
|
263
|
+
returning id into d;
|
|
264
|
+
v_doc_ids := v_doc_ids || d;
|
|
265
|
+
insert into document_lines (document_id, company_id, sequence, name, quantity, unit_price,
|
|
266
|
+
tax_id, account_id, vat_category, vat_rate)
|
|
267
|
+
values (d, v_company, 10, 'Honoraires comptables T2', 1, 1450,
|
|
268
|
+
(select id from taxes where company_id = v_company and code = 'BE-P-21-S'),
|
|
269
|
+
account_id_by_code(v_company, '613000'), 'S', 21);
|
|
270
|
+
|
|
271
|
+
-- 8. Intra-community service received: self-assessed.
|
|
272
|
+
insert into documents (company_id, doc_type, number, supplier_reference, contact_id,
|
|
273
|
+
document_date, due_date, note)
|
|
274
|
+
values (v_company, 'purchase_invoice', 'ACH-2026-0002', 'HS-99120', s_hollandia,
|
|
275
|
+
date '2026-07-31', date '2026-08-15', 'Report de perception, grilles 88 / 55 / 59')
|
|
276
|
+
returning id into d;
|
|
277
|
+
v_doc_ids := v_doc_ids || d;
|
|
278
|
+
insert into document_lines (document_id, company_id, sequence, name, quantity, unit_price,
|
|
279
|
+
tax_id, account_id, vat_category, vat_rate)
|
|
280
|
+
values (d, v_company, 10, 'Abonnement plateforme, un an', 1, 990,
|
|
281
|
+
(select id from taxes where company_id = v_company and code = 'BE-P-ICS-21'),
|
|
282
|
+
account_id_by_code(v_company, '612400'), 'AE', 0);
|
|
283
|
+
|
|
284
|
+
-- 9. Rent, 21 %.
|
|
285
|
+
insert into documents (company_id, doc_type, number, supplier_reference, contact_id,
|
|
286
|
+
document_date, due_date)
|
|
287
|
+
values (v_company, 'purchase_invoice', 'ACH-2026-0003', 'IC-2026-0807', s_immo,
|
|
288
|
+
date '2026-08-01', date '2026-08-11')
|
|
289
|
+
returning id into d;
|
|
290
|
+
v_doc_ids := v_doc_ids || d;
|
|
291
|
+
insert into document_lines (document_id, company_id, sequence, name, quantity, unit_price,
|
|
292
|
+
tax_id, account_id, vat_category, vat_rate)
|
|
293
|
+
values (d, v_company, 10, 'Loyer du bureau, aout', 1, 1200,
|
|
294
|
+
(select id from taxes where company_id = v_company and code = 'BE-P-21-S'),
|
|
295
|
+
account_id_by_code(v_company, '610000'), 'S', 21);
|
|
296
|
+
|
|
297
|
+
-- 10. Capital goods, 21 %: box 83, not 82.
|
|
298
|
+
insert into documents (company_id, doc_type, number, supplier_reference, contact_id,
|
|
299
|
+
document_date, due_date)
|
|
300
|
+
values (v_company, 'purchase_invoice', 'ACH-2026-0004', 'BL-2026-3401', s_lelievre,
|
|
301
|
+
date '2026-08-20', date '2026-09-19')
|
|
302
|
+
returning id into d;
|
|
303
|
+
v_doc_ids := v_doc_ids || d;
|
|
304
|
+
insert into document_lines (document_id, company_id, sequence, name, quantity, unit_price,
|
|
305
|
+
tax_id, account_id, vat_category, vat_rate)
|
|
306
|
+
values (d, v_company, 10, 'Poste de travail', 2, 1200,
|
|
307
|
+
(select id from taxes where company_id = v_company and code = 'BE-P-21-I'),
|
|
308
|
+
account_id_by_code(v_company, '241000'), 'S', 21);
|
|
309
|
+
|
|
310
|
+
-- Book them all.
|
|
311
|
+
for i in 1 .. array_length(v_doc_ids, 1) loop
|
|
312
|
+
perform post_document(v_doc_ids[i]);
|
|
313
|
+
end loop;
|
|
314
|
+
|
|
315
|
+
-- ------------------------------------------------------------- settlement
|
|
316
|
+
-- Invoice 1 (4 477,00) paid in full on 5 August.
|
|
317
|
+
insert into entries (company_id, journal_id, entry_date, reference, description, state)
|
|
318
|
+
values (v_company, v_bank_jrnl, date '2026-08-05', 'FAC-2026-0001',
|
|
319
|
+
'Reglement FAC-2026-0001', 'draft')
|
|
320
|
+
returning * into v_entry;
|
|
321
|
+
|
|
322
|
+
insert into entry_lines (entry_id, company_id, account_id, sequence, name, debit, credit)
|
|
323
|
+
values (v_entry.id, v_company, account_id_by_code(v_company, '550000'), 10,
|
|
324
|
+
'Reglement Atelier Dumont', 4477.00, 0);
|
|
325
|
+
|
|
326
|
+
insert into entry_lines (entry_id, company_id, account_id, sequence, name, debit, credit,
|
|
327
|
+
contact_id, date_maturity)
|
|
328
|
+
values (v_entry.id, v_company, account_id_by_code(v_company, '400000'), 20,
|
|
329
|
+
'FAC-2026-0001', 0, 4477.00, c_dumont, date '2026-08-02')
|
|
330
|
+
returning id into v_line_credit;
|
|
331
|
+
|
|
332
|
+
perform post_entry(v_entry.id);
|
|
333
|
+
|
|
334
|
+
insert into payments (company_id, direction, payment_date, amount, contact_id,
|
|
335
|
+
journal_id, bank_account_id, entry_id, reference, state)
|
|
336
|
+
values (v_company, 'inbound', date '2026-08-05', 4477.00, c_dumont, v_bank_jrnl,
|
|
337
|
+
v_bank, v_entry.id, 'FAC-2026-0001', 'posted');
|
|
338
|
+
|
|
339
|
+
select l.id into v_line_debit
|
|
340
|
+
from entry_lines l
|
|
341
|
+
join entries e on e.id = l.entry_id
|
|
342
|
+
where e.document_id = v_doc_ids[1] and l.debit > 0
|
|
343
|
+
and l.account_id = account_id_by_code(v_company, '400000');
|
|
344
|
+
|
|
345
|
+
-- No amount_paid to write: matching the customer line moves the document.
|
|
346
|
+
perform reconcile(v_line_debit, v_line_credit, null);
|
|
347
|
+
|
|
348
|
+
-- ------------------------------------------------------- bank statement
|
|
349
|
+
insert into bank_statements (company_id, bank_account_id, name, statement_date,
|
|
350
|
+
balance_start, balance_end_declared, state, source)
|
|
351
|
+
values (v_company, v_bank, 'Extrait 2026/08', date '2026-08-31',
|
|
352
|
+
12500.00, 14813.00, 'confirmed', 'demo')
|
|
353
|
+
returning id into v_stmt;
|
|
354
|
+
|
|
355
|
+
insert into bank_transactions (company_id, statement_id, bank_account_id, sequence,
|
|
356
|
+
transaction_date, value_date, amount, description,
|
|
357
|
+
counterpart_name, counterpart_iban, structured_reference,
|
|
358
|
+
contact_id, entry_id, state) values
|
|
359
|
+
(v_company, v_stmt, v_bank, 10, date '2026-08-05', date '2026-08-05', 4477.00,
|
|
360
|
+
'Virement en votre faveur', 'Atelier Dumont SRL', 'BE68539007547034',
|
|
361
|
+
'+++010/1234/56789+++', c_dumont, v_entry.id, 'reconciled'),
|
|
362
|
+
(v_company, v_stmt, v_bank, 20, date '2026-08-11', date '2026-08-11', -1452.00,
|
|
363
|
+
'Virement Immo Central SA', 'Immo Central SA', 'BE62510007547061',
|
|
364
|
+
null, s_immo, null, 'pending'),
|
|
365
|
+
(v_company, v_stmt, v_bank, 30, date '2026-08-20', date '2026-08-20', -712.00,
|
|
366
|
+
'Paiement carte, fournitures', null, null, null, null, null, 'pending');
|
|
367
|
+
end
|
|
368
|
+
$$;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
-- Ekwo OS — Belgium: how this country depreciates and derecognises a fixed asset.
|
|
2
|
+
--
|
|
3
|
+
-- Generated from packs/be/assets.json at version 1.14.0, do not edit.
|
|
4
|
+
-- Change the pack and run `ekwo pack build be`; `ekwo pack check --all`
|
|
5
|
+
-- refuses a seed that is not the exact output of its pack, and the CI runs it.
|
|
6
|
+
--
|
|
7
|
+
-- Applied by the module migration runner — `ekwo migrate`, or `ekwo module
|
|
8
|
+
-- migrate` — and never by the socle seed step: these tables exist only on an
|
|
9
|
+
-- installation that carries the `assets` module.
|
|
10
|
+
--
|
|
11
|
+
-- The accounts a disposal lands on are not here. They are roles of the chart,
|
|
12
|
+
-- in `country_defaults`, written by the pack seed beside every other role.
|
|
13
|
+
|
|
14
|
+
insert into assets.country_rules
|
|
15
|
+
(country, prorata_straight_line, prorata_declining, day_count,
|
|
16
|
+
declining_cap_percent, declining_switch_to_linear, disposal_style, legal_reference)
|
|
17
|
+
values
|
|
18
|
+
('BE', 'days', 'days', 'actual', 40, true, 'net_result', 'Code des impôts sur les revenus 1992, art. 61 — les amortissements sont admis dans la mesure où ils correspondent à une dépréciation réellement survenue ; art. 196, § 2, 1° — l''annuité de l''exercice d''acquisition est réduite au prorata de la partie de l''exercice restant à courir, pour les sociétés autres que les petites sociétés au sens de l''art. 1:24 du Code des sociétés et des associations ; art. 64 et AR/CIR 92, art. 36 à 43 — régime dégressif, annuité limitée à 40 % de la valeur d''investissement et abandon du dégressif dès que l''annuité linéaire est supérieure')
|
|
19
|
+
on conflict (country) do update set
|
|
20
|
+
prorata_straight_line = excluded.prorata_straight_line,
|
|
21
|
+
prorata_declining = excluded.prorata_declining,
|
|
22
|
+
day_count = excluded.day_count,
|
|
23
|
+
declining_cap_percent = excluded.declining_cap_percent,
|
|
24
|
+
declining_switch_to_linear = excluded.declining_switch_to_linear,
|
|
25
|
+
disposal_style = excluded.disposal_style,
|
|
26
|
+
legal_reference = excluded.legal_reference;
|
|
27
|
+
|
|
28
|
+
insert into assets.category_templates
|
|
29
|
+
(country, code, name, name_i18n, method, duration_months, coefficient,
|
|
30
|
+
prorata, account_type, sequence, legal_reference)
|
|
31
|
+
select v.country::char(2), v.code, v.name, v.name_i18n::jsonb,
|
|
32
|
+
v.method::assets.depreciation_method, v.duration_months::integer,
|
|
33
|
+
v.coefficient::numeric, v.prorata::assets.prorata_rule,
|
|
34
|
+
v.account_type::account_type, v.sequence::integer, v.legal_reference
|
|
35
|
+
from (values
|
|
36
|
+
('BE', 'formation-expenses', 'Frais d''établissement', '{"de":"Gründungskosten","en":"Formation expenses","nl":"Oprichtingskosten"}'::jsonb, 'straight_line', 60, null, null, 'asset_fixed', 10, 'Code des impôts sur les revenus 1992, art. 62 — les frais d''établissement sont amortis par annuités égales, échelonnées sans interruption sur cinq ans au moins'),
|
|
37
|
+
('BE', 'intangible-rd', 'Frais de recherche et de développement', '{"de":"Forschungs- und Entwicklungskosten","en":"Research and development costs","nl":"Kosten van onderzoek en ontwikkeling"}'::jsonb, 'straight_line', 36, null, null, 'asset_fixed', 20, 'Code des impôts sur les revenus 1992, art. 63 — immobilisations incorporelles amorties par annuités fixes sur trois ans au moins pour les investissements en recherche et développement'),
|
|
38
|
+
('BE', 'software', 'Logiciels, concessions, brevets et licences', '{"de":"Software, Konzessionen, Patente und Lizenzen","en":"Software, concessions, patents and licences","nl":"Software, concessies, octrooien en licenties"}'::jsonb, 'straight_line', 60, null, null, 'asset_fixed', 30, 'Code des impôts sur les revenus 1992, art. 63 — immobilisations incorporelles autres que la recherche et le développement, amorties par annuités fixes sur cinq ans au moins'),
|
|
39
|
+
('BE', 'building-industrial', 'Bâtiments industriels', '{"de":"Industriegebäude","en":"Industrial buildings","nl":"Industriële gebouwen"}'::jsonb, 'straight_line', 240, null, null, 'asset_fixed', 40, 'Code des impôts sur les revenus 1992, art. 61 ; durée usuellement admise par l''administration pour un bâtiment industriel — vingt ans, soit 5 % l''an. Une durée usuelle est une pratique administrative et non un texte : elle se justifie par la dépréciation réelle du bien.'),
|
|
40
|
+
('BE', 'building-commercial', 'Bâtiments commerciaux et de bureaux', '{"de":"Geschäfts- und Bürogebäude","en":"Commercial and office buildings","nl":"Handels- en kantoorgebouwen"}'::jsonb, 'straight_line', 396, null, null, 'asset_fixed', 50, 'Code des impôts sur les revenus 1992, art. 61 ; durée usuellement admise par l''administration pour un bâtiment commercial ou de bureaux — trente-trois ans, soit 3 % l''an. Pratique administrative, à justifier par la dépréciation réelle du bien.'),
|
|
41
|
+
('BE', 'machinery', 'Installations, machines et outillage', '{"de":"Anlagen, Maschinen und Werkzeuge","en":"Plant, machinery and equipment","nl":"Installaties, machines en uitrusting"}'::jsonb, 'straight_line', 120, null, null, 'asset_fixed', 60, 'Code des impôts sur les revenus 1992, art. 61 ; durée usuellement admise — dix ans, soit 10 % l''an. Pratique administrative.'),
|
|
42
|
+
('BE', 'machinery-declining', 'Installations, machines et outillage — régime dégressif', '{"de":"Anlagen, Maschinen und Werkzeuge — degressive Abschreibung","en":"Plant, machinery and equipment — declining balance","nl":"Installaties, machines en uitrusting — degressief stelsel"}'::jsonb, 'declining_balance', 120, 2, null, 'asset_fixed', 70, 'Code des impôts sur les revenus 1992, art. 64 et AR/CIR 92, art. 36 à 43 — taux double du taux linéaire, annuité plafonnée à 40 % de la valeur d''investissement, retour au linéaire dès qu''il donne une annuité supérieure. Le régime est exclu pour les immobilisations incorporelles et pour les biens dont l''usage est cédé à un tiers (art. 64, al. 2).'),
|
|
43
|
+
('BE', 'furniture', 'Mobilier', '{"de":"Mobiliar","en":"Furniture","nl":"Meubilair"}'::jsonb, 'straight_line', 120, null, null, 'asset_fixed', 80, 'Code des impôts sur les revenus 1992, art. 61 ; durée usuellement admise — dix ans, soit 10 % l''an. Pratique administrative.'),
|
|
44
|
+
('BE', 'it-equipment', 'Matériel de bureau et matériel informatique', '{"de":"Büro- und EDV-Ausstattung","en":"Office and computer equipment","nl":"Kantoormaterieel en informaticamaterieel"}'::jsonb, 'straight_line', 36, null, null, 'asset_fixed', 90, 'Code des impôts sur les revenus 1992, art. 61 ; durée usuellement admise pour le matériel informatique — trois ans, soit 33 % l''an. Pratique administrative.'),
|
|
45
|
+
('BE', 'vehicle', 'Matériel roulant', '{"de":"Fuhrpark","en":"Vehicles","nl":"Rollend materieel"}'::jsonb, 'straight_line', 60, null, null, 'asset_fixed', 100, 'Code des impôts sur les revenus 1992, art. 61 ; durée usuellement admise — cinq ans, soit 20 % l''an. Pratique administrative. La déductibilité des frais de voiture est une question distincte de la durée d''amortissement (art. 66 et 198bis).')
|
|
46
|
+
) as v (country, code, name, name_i18n, method, duration_months, coefficient,
|
|
47
|
+
prorata, account_type, sequence, legal_reference)
|
|
48
|
+
on conflict (country, code) do update set
|
|
49
|
+
name = excluded.name,
|
|
50
|
+
name_i18n = excluded.name_i18n,
|
|
51
|
+
method = excluded.method,
|
|
52
|
+
duration_months = excluded.duration_months,
|
|
53
|
+
coefficient = excluded.coefficient,
|
|
54
|
+
prorata = excluded.prorata,
|
|
55
|
+
account_type = excluded.account_type,
|
|
56
|
+
sequence = excluded.sequence,
|
|
57
|
+
legal_reference = excluded.legal_reference;
|
|
58
|
+
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
-- Ekwo OS — France: how this country depreciates and derecognises a fixed asset.
|
|
2
|
+
--
|
|
3
|
+
-- Generated from packs/fr/assets.json at version 1.12.0, do not edit.
|
|
4
|
+
-- Change the pack and run `ekwo pack build fr`; `ekwo pack check --all`
|
|
5
|
+
-- refuses a seed that is not the exact output of its pack, and the CI runs it.
|
|
6
|
+
--
|
|
7
|
+
-- Applied by the module migration runner — `ekwo migrate`, or `ekwo module
|
|
8
|
+
-- migrate` — and never by the socle seed step: these tables exist only on an
|
|
9
|
+
-- installation that carries the `assets` module.
|
|
10
|
+
--
|
|
11
|
+
-- The accounts a disposal lands on are not here. They are roles of the chart,
|
|
12
|
+
-- in `country_defaults`, written by the pack seed beside every other role.
|
|
13
|
+
|
|
14
|
+
insert into assets.country_rules
|
|
15
|
+
(country, prorata_straight_line, prorata_declining, day_count,
|
|
16
|
+
declining_cap_percent, declining_switch_to_linear, disposal_style, legal_reference)
|
|
17
|
+
values
|
|
18
|
+
('FR', 'days', 'months', 'thirty_360', null, true, 'gross', 'Règlement ANC 2014-03 (plan comptable général), art. 214-1 et suivants — l''amortissement commence à la date de mise en service ; l''annuité linéaire de l''exercice de mise en service est réduite prorata temporis, comptée en jours sur une année commerciale de trois cent soixante jours et des mois de trente jours. Code général des impôts, art. 39 A — amortissement dégressif : l''annuité de l''exercice d''acquisition court du premier jour du mois d''acquisition, et le régime est abandonné pour le linéaire dès que celui-ci donne une annuité supérieure.')
|
|
19
|
+
on conflict (country) do update set
|
|
20
|
+
prorata_straight_line = excluded.prorata_straight_line,
|
|
21
|
+
prorata_declining = excluded.prorata_declining,
|
|
22
|
+
day_count = excluded.day_count,
|
|
23
|
+
declining_cap_percent = excluded.declining_cap_percent,
|
|
24
|
+
declining_switch_to_linear = excluded.declining_switch_to_linear,
|
|
25
|
+
disposal_style = excluded.disposal_style,
|
|
26
|
+
legal_reference = excluded.legal_reference;
|
|
27
|
+
|
|
28
|
+
insert into assets.category_templates
|
|
29
|
+
(country, code, name, name_i18n, method, duration_months, coefficient,
|
|
30
|
+
prorata, account_type, sequence, legal_reference)
|
|
31
|
+
select v.country::char(2), v.code, v.name, v.name_i18n::jsonb,
|
|
32
|
+
v.method::assets.depreciation_method, v.duration_months::integer,
|
|
33
|
+
v.coefficient::numeric, v.prorata::assets.prorata_rule,
|
|
34
|
+
v.account_type::account_type, v.sequence::integer, v.legal_reference
|
|
35
|
+
from (values
|
|
36
|
+
('FR', 'software', 'Logiciels', '{"en":"Software"}'::jsonb, 'straight_line', 36, null, null, 'asset_fixed', 10, 'Durée d''usage de trois ans (BOI-BIC-AMT-10-40-10). L''amortissement exceptionnel sur douze mois des logiciels acquis est une option fiscale distincte, art. 236, II du code général des impôts.'),
|
|
37
|
+
('FR', 'building-commercial', 'Constructions à usage commercial', '{"en":"Commercial buildings"}'::jsonb, 'straight_line', 240, null, null, 'asset_fixed', 20, 'Durée d''usage des constructions : vingt à cinquante ans selon la nature du bâtiment (BOI-BIC-AMT-10-40-10). Vingt ans est la borne basse ; la durée retenue se justifie par l''utilisation attendue du bien (règlement ANC 2014-03, art. 214-1).'),
|
|
38
|
+
('FR', 'fixtures', 'Installations générales et agencements', '{"en":"General installations and fittings"}'::jsonb, 'straight_line', 120, null, null, 'asset_fixed', 30, 'Durée d''usage de dix ans pour les agencements et installations (BOI-BIC-AMT-10-40-10).'),
|
|
39
|
+
('FR', 'machinery', 'Matériel industriel', '{"en":"Industrial plant"}'::jsonb, 'straight_line', 120, null, null, 'asset_fixed', 40, 'Durée d''usage du matériel et de l''outillage : six ans et huit mois à dix ans (BOI-BIC-AMT-10-40-10). Dix ans est retenu ici.'),
|
|
40
|
+
('FR', 'machinery-declining', 'Matériel industriel — régime dégressif', '{"en":"Industrial plant — declining balance"}'::jsonb, 'declining_balance', 120, 2.25, null, 'asset_fixed', 50, 'Code général des impôts, art. 39 A, 1 — coefficient de 2,25 pour une durée normale d''utilisation supérieure à six ans, pour les biens acquis à compter du 1er janvier 2001. Le régime est réservé aux biens d''équipement énumérés par le texte.'),
|
|
41
|
+
('FR', 'furniture', 'Mobilier de bureau', '{"en":"Office furniture"}'::jsonb, 'straight_line', 120, null, null, 'asset_fixed', 60, 'Durée d''usage de dix ans pour le mobilier de bureau (BOI-BIC-AMT-10-40-10).'),
|
|
42
|
+
('FR', 'it-equipment', 'Matériel de bureau et matériel informatique', '{"en":"Office and computer equipment"}'::jsonb, 'straight_line', 36, null, null, 'asset_fixed', 70, 'Durée d''usage de trois ans pour le matériel informatique (BOI-BIC-AMT-10-40-10).'),
|
|
43
|
+
('FR', 'it-equipment-declining', 'Matériel informatique — régime dégressif', '{"en":"Computer equipment — declining balance"}'::jsonb, 'declining_balance', 36, 1.25, null, 'asset_fixed', 80, 'Code général des impôts, art. 39 A, 1 — coefficient de 1,25 pour une durée normale d''utilisation de trois ou quatre ans, pour les biens acquis à compter du 1er janvier 2001.'),
|
|
44
|
+
('FR', 'vehicle', 'Matériel de transport', '{"en":"Vehicles"}'::jsonb, 'straight_line', 60, null, null, 'asset_fixed', 90, 'Durée d''usage de quatre à cinq ans pour le matériel de transport (BOI-BIC-AMT-10-40-10) ; cinq ans est retenu. Les véhicules de tourisme sont exclus de l''amortissement dégressif (code général des impôts, art. 39 A) et leur base amortissable est plafonnée (art. 39, 4).')
|
|
45
|
+
) as v (country, code, name, name_i18n, method, duration_months, coefficient,
|
|
46
|
+
prorata, account_type, sequence, legal_reference)
|
|
47
|
+
on conflict (country, code) do update set
|
|
48
|
+
name = excluded.name,
|
|
49
|
+
name_i18n = excluded.name_i18n,
|
|
50
|
+
method = excluded.method,
|
|
51
|
+
duration_months = excluded.duration_months,
|
|
52
|
+
coefficient = excluded.coefficient,
|
|
53
|
+
prorata = excluded.prorata,
|
|
54
|
+
account_type = excluded.account_type,
|
|
55
|
+
sequence = excluded.sequence,
|
|
56
|
+
legal_reference = excluded.legal_reference;
|
|
57
|
+
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
-- Ekwo OS — United Kingdom: how this country depreciates and derecognises a fixed asset.
|
|
2
|
+
--
|
|
3
|
+
-- Generated from packs/gb/assets.json at version 0.7.0, do not edit.
|
|
4
|
+
-- Change the pack and run `ekwo pack build gb`; `ekwo pack check --all`
|
|
5
|
+
-- refuses a seed that is not the exact output of its pack, and the CI runs it.
|
|
6
|
+
--
|
|
7
|
+
-- Applied by the module migration runner — `ekwo migrate`, or `ekwo module
|
|
8
|
+
-- migrate` — and never by the socle seed step: these tables exist only on an
|
|
9
|
+
-- installation that carries the `assets` module.
|
|
10
|
+
--
|
|
11
|
+
-- The accounts a disposal lands on are not here. They are roles of the chart,
|
|
12
|
+
-- in `country_defaults`, written by the pack seed beside every other role.
|
|
13
|
+
|
|
14
|
+
insert into assets.country_rules
|
|
15
|
+
(country, prorata_straight_line, prorata_declining, day_count,
|
|
16
|
+
declining_cap_percent, declining_switch_to_linear, disposal_style, legal_reference)
|
|
17
|
+
values
|
|
18
|
+
('GB', 'months', 'months', 'actual', null, true, 'net_result', 'FRS 102 The Financial Reporting Standard applicable in the UK and Republic of Ireland, Section 17 Property, Plant and Equipment — depreciation begins when the asset is available for use, so a charge is taken from the month the asset is brought into use rather than for the whole of the first year; the standard prescribes no method, and the straight line and the reducing balance are both named among those an entity may select. Nothing in British law caps an annuity, which is why no cap is declared here.')
|
|
19
|
+
on conflict (country) do update set
|
|
20
|
+
prorata_straight_line = excluded.prorata_straight_line,
|
|
21
|
+
prorata_declining = excluded.prorata_declining,
|
|
22
|
+
day_count = excluded.day_count,
|
|
23
|
+
declining_cap_percent = excluded.declining_cap_percent,
|
|
24
|
+
declining_switch_to_linear = excluded.declining_switch_to_linear,
|
|
25
|
+
disposal_style = excluded.disposal_style,
|
|
26
|
+
legal_reference = excluded.legal_reference;
|
|
27
|
+
|
|
28
|
+
insert into assets.category_templates
|
|
29
|
+
(country, code, name, name_i18n, method, duration_months, coefficient,
|
|
30
|
+
prorata, account_type, sequence, legal_reference)
|
|
31
|
+
select v.country::char(2), v.code, v.name, v.name_i18n::jsonb,
|
|
32
|
+
v.method::assets.depreciation_method, v.duration_months::integer,
|
|
33
|
+
v.coefficient::numeric, v.prorata::assets.prorata_rule,
|
|
34
|
+
v.account_type::account_type, v.sequence::integer, v.legal_reference
|
|
35
|
+
from (values
|
|
36
|
+
('GB', 'goodwill', 'Goodwill', '{}'::jsonb, 'straight_line', 120, null, null, 'asset_fixed', 10, 'FRS 102, Section 19 — goodwill is amortised over its useful life, and where that cannot be reliably estimated the life shall not exceed ten years. Ten years is therefore the ceiling this category starts from and not a life anybody estimated. There is no legal or fiscal table of useful lives in the United Kingdom. FRS 102, Section 17, paragraphs 17.16 to 17.21 require the depreciable amount of an item of property, plant and equipment to be allocated on a systematic basis over its useful life, which the entity reviews and estimates for itself; capital allowances under the capital allowances legislation are a tax computation and are never the accounting charge. The duration below is therefore common British practice and not a rule, and an asset that depreciates differently says so in its own columns.'),
|
|
37
|
+
('GB', 'intangibles', 'Other intangible assets, patents and licences', '{}'::jsonb, 'straight_line', 60, null, null, 'asset_fixed', 20, 'FRS 102, Section 18 — an intangible asset with a finite useful life is amortised over it, with the same ten-year ceiling where the life cannot be estimated. There is no legal or fiscal table of useful lives in the United Kingdom. FRS 102, Section 17, paragraphs 17.16 to 17.21 require the depreciable amount of an item of property, plant and equipment to be allocated on a systematic basis over its useful life, which the entity reviews and estimates for itself; capital allowances under the capital allowances legislation are a tax computation and are never the accounting charge. The duration below is therefore common British practice and not a rule, and an asset that depreciates differently says so in its own columns.'),
|
|
38
|
+
('GB', 'freehold-buildings', 'Freehold buildings', '{}'::jsonb, 'straight_line', 600, null, null, 'asset_fixed', 30, 'Land is not depreciated and the building on it is, so a freehold property is split before this category is applied to the part that has a life. There is no legal or fiscal table of useful lives in the United Kingdom. FRS 102, Section 17, paragraphs 17.16 to 17.21 require the depreciable amount of an item of property, plant and equipment to be allocated on a systematic basis over its useful life, which the entity reviews and estimates for itself; capital allowances under the capital allowances legislation are a tax computation and are never the accounting charge. The duration below is therefore common British practice and not a rule, and an asset that depreciates differently says so in its own columns.'),
|
|
39
|
+
('GB', 'leasehold-improvements', 'Leasehold property and improvements', '{}'::jsonb, 'straight_line', 120, null, null, 'asset_fixed', 40, 'Common practice depreciates a leasehold improvement over the shorter of its own life and the remaining term of the lease, which is a fact about the lease and not about the category. There is no legal or fiscal table of useful lives in the United Kingdom. FRS 102, Section 17, paragraphs 17.16 to 17.21 require the depreciable amount of an item of property, plant and equipment to be allocated on a systematic basis over its useful life, which the entity reviews and estimates for itself; capital allowances under the capital allowances legislation are a tax computation and are never the accounting charge. The duration below is therefore common British practice and not a rule, and an asset that depreciates differently says so in its own columns.'),
|
|
40
|
+
('GB', 'plant-and-machinery', 'Plant and machinery', '{}'::jsonb, 'straight_line', 120, null, null, 'asset_fixed', 50, 'There is no legal or fiscal table of useful lives in the United Kingdom. FRS 102, Section 17, paragraphs 17.16 to 17.21 require the depreciable amount of an item of property, plant and equipment to be allocated on a systematic basis over its useful life, which the entity reviews and estimates for itself; capital allowances under the capital allowances legislation are a tax computation and are never the accounting charge. The duration below is therefore common British practice and not a rule, and an asset that depreciates differently says so in its own columns.'),
|
|
41
|
+
('GB', 'fixtures-and-fittings', 'Fixtures and fittings', '{}'::jsonb, 'straight_line', 120, null, null, 'asset_fixed', 60, 'There is no legal or fiscal table of useful lives in the United Kingdom. FRS 102, Section 17, paragraphs 17.16 to 17.21 require the depreciable amount of an item of property, plant and equipment to be allocated on a systematic basis over its useful life, which the entity reviews and estimates for itself; capital allowances under the capital allowances legislation are a tax computation and are never the accounting charge. The duration below is therefore common British practice and not a rule, and an asset that depreciates differently says so in its own columns.'),
|
|
42
|
+
('GB', 'office-equipment', 'Office equipment', '{}'::jsonb, 'straight_line', 60, null, null, 'asset_fixed', 70, 'There is no legal or fiscal table of useful lives in the United Kingdom. FRS 102, Section 17, paragraphs 17.16 to 17.21 require the depreciable amount of an item of property, plant and equipment to be allocated on a systematic basis over its useful life, which the entity reviews and estimates for itself; capital allowances under the capital allowances legislation are a tax computation and are never the accounting charge. The duration below is therefore common British practice and not a rule, and an asset that depreciates differently says so in its own columns.'),
|
|
43
|
+
('GB', 'computer-equipment', 'Computer equipment', '{}'::jsonb, 'straight_line', 36, null, null, 'asset_fixed', 80, 'There is no legal or fiscal table of useful lives in the United Kingdom. FRS 102, Section 17, paragraphs 17.16 to 17.21 require the depreciable amount of an item of property, plant and equipment to be allocated on a systematic basis over its useful life, which the entity reviews and estimates for itself; capital allowances under the capital allowances legislation are a tax computation and are never the accounting charge. The duration below is therefore common British practice and not a rule, and an asset that depreciates differently says so in its own columns.'),
|
|
44
|
+
('GB', 'motor-vehicles', 'Motor vehicles, straight line', '{}'::jsonb, 'straight_line', 48, null, null, 'asset_fixed', 90, 'There is no legal or fiscal table of useful lives in the United Kingdom. FRS 102, Section 17, paragraphs 17.16 to 17.21 require the depreciable amount of an item of property, plant and equipment to be allocated on a systematic basis over its useful life, which the entity reviews and estimates for itself; capital allowances under the capital allowances legislation are a tax computation and are never the accounting charge. The duration below is therefore common British practice and not a rule, and an asset that depreciates differently says so in its own columns.'),
|
|
45
|
+
('GB', 'motor-vehicles-reducing', 'Motor vehicles, reducing balance at 25 %', '{}'::jsonb, 'declining_balance', 96, 2, null, 'asset_fixed', 100, 'Twice the straight-line rate of an eight-year life is 25 per cent a year, which is the reducing-balance rate British practice applies to a car most often. There is no legal or fiscal table of useful lives in the United Kingdom. FRS 102, Section 17, paragraphs 17.16 to 17.21 require the depreciable amount of an item of property, plant and equipment to be allocated on a systematic basis over its useful life, which the entity reviews and estimates for itself; capital allowances under the capital allowances legislation are a tax computation and are never the accounting charge. The duration below is therefore common British practice and not a rule, and an asset that depreciates differently says so in its own columns.')
|
|
46
|
+
) as v (country, code, name, name_i18n, method, duration_months, coefficient,
|
|
47
|
+
prorata, account_type, sequence, legal_reference)
|
|
48
|
+
on conflict (country, code) do update set
|
|
49
|
+
name = excluded.name,
|
|
50
|
+
name_i18n = excluded.name_i18n,
|
|
51
|
+
method = excluded.method,
|
|
52
|
+
duration_months = excluded.duration_months,
|
|
53
|
+
coefficient = excluded.coefficient,
|
|
54
|
+
prorata = excluded.prorata,
|
|
55
|
+
account_type = excluded.account_type,
|
|
56
|
+
sequence = excluded.sequence,
|
|
57
|
+
legal_reference = excluded.legal_reference;
|
|
58
|
+
|