stockor 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -4
  3. data/Gemfile.lock +104 -87
  4. data/client/skr/api.js +3 -1
  5. data/client/skr/api/Components/AddressForm.cjsx +1 -1
  6. data/client/skr/api/Components/SingleItemCart.cjsx +1 -1
  7. data/client/skr/api/SingleItemCheckout.cjsx +3 -3
  8. data/client/skr/components/BankAccountFinder.cjsx +1 -1
  9. data/client/skr/components/CreditCardForm.cjsx +1 -1
  10. data/client/skr/components/Currency.cjsx +2 -1
  11. data/client/skr/components/CustomerFinder.cjsx +1 -1
  12. data/client/skr/components/CustomerProjectFinder.cjsx +1 -1
  13. data/client/skr/components/ExpenseCategoryFinder.cjsx +34 -0
  14. data/client/skr/components/GlAccountChooser.cjsx +2 -1
  15. data/client/skr/components/InvoiceFinder.cjsx +1 -1
  16. data/client/skr/components/LatexSnippets.cjsx +3 -0
  17. data/client/skr/components/LocationChooser.cjsx +3 -3
  18. data/client/skr/components/PaymentCategoryFinder.cjsx +1 -1
  19. data/client/skr/components/SalesOrderFinder.cjsx +1 -2
  20. data/client/skr/components/SkuFinder.cjsx +1 -1
  21. data/client/skr/components/SystemSettings.cjsx +4 -1
  22. data/client/skr/components/TermsChooser.cjsx +2 -2
  23. data/client/skr/components/ToolbarButton.cjsx +7 -3
  24. data/client/skr/components/TotalsLine.cjsx +5 -1
  25. data/client/skr/components/UserPreferences.cjsx +1 -1
  26. data/client/skr/components/VendorFinder.cjsx +1 -1
  27. data/client/skr/components/address/Address.cjsx +14 -1
  28. data/client/skr/components/styles.scss +6 -0
  29. data/client/skr/index.js +1 -0
  30. data/client/skr/lib/Remote.coffee +32 -0
  31. data/client/skr/lib/index.js +2 -0
  32. data/client/skr/lib/namespace.coffee +1 -0
  33. data/client/skr/models/CreditCardGateway.coffee +1 -1
  34. data/client/skr/models/ExpenseCategory.coffee +11 -0
  35. data/client/skr/models/ExpenseEntry.coffee +64 -0
  36. data/client/skr/models/ExpenseEntryCategory.coffee +11 -0
  37. data/client/skr/models/Invoice.coffee +4 -1
  38. data/client/skr/models/Payment.coffee +2 -2
  39. data/client/skr/models/SalesOrder.coffee +3 -2
  40. data/client/skr/models/SequentialId.coffee +1 -1
  41. data/client/skr/models/Vendor.coffee +1 -1
  42. data/client/skr/models/mixins/PrintSupport.coffee +1 -1
  43. data/client/skr/screens/bank-maint/BankMaint.cjsx +1 -1
  44. data/client/skr/screens/chart-of-accounts/ChartOfAccounts.cjsx +1 -1
  45. data/client/skr/screens/customer-maint/CustomerMaint.cjsx +1 -1
  46. data/client/skr/screens/customer-projects/CustomerProjects.cjsx +1 -1
  47. data/client/skr/screens/expense-categories/ExpenseCategories.cjsx +31 -0
  48. data/client/skr/screens/expense-categories/index.js +5 -0
  49. data/client/skr/screens/expense-categories/index.scss +9 -0
  50. data/client/skr/screens/expense-entry/ApprovalRequest.coffee +14 -0
  51. data/client/skr/screens/expense-entry/ApproveDialog.cjsx +30 -0
  52. data/client/skr/screens/expense-entry/Categories.cjsx +112 -0
  53. data/client/skr/screens/expense-entry/ExpenseEntry.cjsx +193 -0
  54. data/client/skr/screens/expense-entry/Form.cjsx +54 -0
  55. data/client/skr/screens/expense-entry/Grid.cjsx +51 -0
  56. data/client/skr/screens/expense-entry/ScreenState.coffee +1 -0
  57. data/client/skr/screens/expense-entry/index.js +1 -0
  58. data/client/skr/screens/expense-entry/index.scss +106 -0
  59. data/client/skr/screens/fresh-books-import/ApiInfo.cjsx +3 -3
  60. data/client/skr/screens/fresh-books-import/ChooseRecords.cjsx +6 -4
  61. data/client/skr/screens/fresh-books-import/FreshBooksImport.cjsx +1 -1
  62. data/client/skr/screens/fresh-books-import/ViewRecords.cjsx +2 -2
  63. data/client/skr/screens/fresh-books-import/index.scss +5 -4
  64. data/client/skr/screens/gl-accounts/GlAccounts.cjsx +1 -1
  65. data/client/skr/screens/gl-transactions/GlTransactions.cjsx +1 -1
  66. data/client/skr/screens/invoice/Invoice.cjsx +6 -2
  67. data/client/skr/screens/invoice/Payment.cjsx +1 -1
  68. data/client/skr/screens/invoice/TotalExtraInfo.cjsx +32 -0
  69. data/client/skr/screens/invoice/index.scss +4 -2
  70. data/client/skr/screens/locations/Locations.cjsx +1 -1
  71. data/client/skr/screens/payment-category/PaymentCategory.cjsx +1 -1
  72. data/client/skr/screens/payment-terms/PaymentTerms.cjsx +1 -1
  73. data/client/skr/screens/payments/Payments.cjsx +13 -6
  74. data/client/skr/screens/sale-report/SaleReport.cjsx +1 -1
  75. data/client/skr/screens/sales-order/SalesOrder.cjsx +2 -1
  76. data/client/skr/screens/sku-maint/SkuMaint.cjsx +1 -1
  77. data/client/skr/screens/sku-maint/SkuUomList.cjsx +2 -2
  78. data/client/skr/screens/time-invoicing/TimeInvoicing.cjsx +4 -4
  79. data/client/skr/screens/time-tracking/EditEntry.cjsx +2 -2
  80. data/client/skr/screens/time-tracking/Entries.coffee +6 -4
  81. data/client/skr/screens/time-tracking/Popover.cjsx +11 -6
  82. data/client/skr/screens/time-tracking/TimeTracking.cjsx +12 -5
  83. data/client/skr/screens/vendor-maint/VendorMaint.cjsx +2 -2
  84. data/config/database.yml +2 -0
  85. data/config/puma.rb +0 -4
  86. data/config/routes.rb +4 -0
  87. data/config/screens.rb +17 -0
  88. data/db/migrate/20140323001446_create_so_details_view.rb +2 -2
  89. data/db/migrate/20151121211323_create_customer_project_details_views.rb +1 -1
  90. data/db/migrate/20160216142845_create_gl_account_balances_view.rb +1 -1
  91. data/db/migrate/20160726004411_string_check_numbers.rb +5 -0
  92. data/db/migrate/20160805002717_create_expenses.rb +65 -0
  93. data/db/schema.sql +394 -229
  94. data/db/seed.rb +12 -12
  95. data/lib/skr/access_roles.rb +9 -4
  96. data/lib/skr/concerns/has_gl_transaction.rb +1 -1
  97. data/lib/skr/configuration.rb +3 -1
  98. data/lib/skr/db/migration_helpers.rb +2 -2
  99. data/lib/skr/handlers/approve_expense_entries.rb +16 -0
  100. data/lib/skr/handlers/invoice_from_time_entries.rb +1 -1
  101. data/lib/skr/handlers/sequential_ids.rb +2 -2
  102. data/lib/skr/jobs/fresh_books/import.rb +18 -17
  103. data/lib/skr/model.rb +3 -0
  104. data/lib/skr/models/bank_account.rb +9 -0
  105. data/lib/skr/models/expense_category.rb +27 -0
  106. data/lib/skr/models/expense_entry.rb +76 -0
  107. data/lib/skr/models/expense_entry_category.rb +15 -0
  108. data/lib/skr/models/gl_transaction.rb +2 -2
  109. data/lib/skr/models/inv_line.rb +3 -1
  110. data/lib/skr/models/invoice.rb +9 -5
  111. data/lib/skr/models/payment.rb +1 -1
  112. data/lib/skr/models/purchase_order.rb +4 -4
  113. data/lib/skr/models/uom.rb +2 -2
  114. data/lib/skr/models/voucher.rb +4 -4
  115. data/lib/skr/print/form.rb +17 -14
  116. data/lib/skr/version.rb +1 -1
  117. data/spec/fixtures/skr/expense_category.yml +17 -0
  118. data/spec/fixtures/skr/expense_entries.yml +20 -0
  119. data/spec/fixtures/skr/expense_entry_category.yml +19 -0
  120. data/spec/fixtures/skr/gl_account.yml +10 -0
  121. data/spec/server/handlers/invoice_from_time_entries_spec.rb +2 -2
  122. data/spec/server/handlers/sequential_ids_spec.rb +1 -1
  123. data/spec/server/models/expense_category_spec.rb +17 -0
  124. data/spec/server/models/expense_entry_spec.rb +44 -0
  125. data/spec/server/models/invoice_spec.rb +0 -1
  126. data/spec/server/models/spec_helper_spec.rb +5 -10
  127. data/spec/server/spec_helper.rb +12 -11
  128. data/spec/skr/components/SkuLinesSpec.coffee +11 -9
  129. data/spec/skr/models/CustomerSpec.coffee +1 -1
  130. data/spec/skr/models/ExpenseAccountSpec.coffee +5 -0
  131. data/spec/skr/screens/expense-categories/ExpenseCategoriesSpec.coffee +5 -0
  132. data/spec/skr/screens/expense-entry/ExpenseEntrySpec.coffee +5 -0
  133. data/spec/skr/screens/locations/LocationsSpec.coffee +4 -4
  134. data/spec/skr/screens/time-tracking/TimeTrackingSpec.coffee +4 -4
  135. data/stockor.gemspec +2 -3
  136. data/templates/print/partials/header.tex.erb +1 -1
  137. data/templates/print/partials/skus_table_invoice_footer.tex.erb +22 -19
  138. data/templates/print/partials/skus_table_invoice_info_line.tex.erb +5 -1
  139. data/templates/print/types/payment/default.tex.erb +10 -10
  140. metadata +40 -14
  141. data/client/skr/api/onReady.coffee +0 -23
  142. data/spec/skr/api/SingleItemCheckoutSpec.cjsx +0 -10
  143. data/spec/skr/screens/bank-maint/BankMaintSpec.coffee +0 -5
  144. data/spec/skr/screens/gl-accounts/GlAccountsSpec.coffee +0 -5
  145. data/spec/skr/screens/invoice/InvoiceSpec.coffee +0 -5
  146. data/spec/skr/screens/payment-category/PaymentCategorySpec.coffee +0 -5
  147. data/spec/skr/screens/payments/PaymentsSpec.coffee +0 -5
  148. data/spec/skr/screens/sale-report/SaleReportSpec.coffee +0 -5
@@ -2,12 +2,16 @@
2
2
  -- PostgreSQL database dump
3
3
  --
4
4
 
5
+ -- Dumped from database version 9.5.4
6
+ -- Dumped by pg_dump version 9.5.4
7
+
5
8
  SET statement_timeout = 0;
6
9
  SET lock_timeout = 0;
7
10
  SET client_encoding = 'UTF8';
8
11
  SET standard_conforming_strings = on;
9
12
  SET check_function_bodies = false;
10
13
  SET client_min_messages = warning;
14
+ SET row_security = off;
11
15
 
12
16
  --
13
17
  -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
@@ -61,12 +65,52 @@ end;
61
65
  $_$;
62
66
 
63
67
 
68
+ --
69
+ -- Name: btree_hstore_ops; Type: OPERATOR FAMILY; Schema: public; Owner: -
70
+ --
71
+
72
+ CREATE OPERATOR FAMILY btree_hstore_ops USING btree;
73
+
74
+
75
+ --
76
+ -- Name: gin_hstore_ops; Type: OPERATOR FAMILY; Schema: public; Owner: -
77
+ --
78
+
79
+ CREATE OPERATOR FAMILY gin_hstore_ops USING gin;
80
+
81
+
82
+ --
83
+ -- Name: gist_hstore_ops; Type: OPERATOR FAMILY; Schema: public; Owner: -
84
+ --
85
+
86
+ CREATE OPERATOR FAMILY gist_hstore_ops USING gist;
87
+
88
+
89
+ --
90
+ -- Name: hash_hstore_ops; Type: OPERATOR FAMILY; Schema: public; Owner: -
91
+ --
92
+
93
+ CREATE OPERATOR FAMILY hash_hstore_ops USING hash;
94
+
95
+
64
96
  SET default_tablespace = '';
65
97
 
66
98
  SET default_with_oids = false;
67
99
 
68
100
  --
69
- -- Name: assets; Type: TABLE; Schema: public; Owner: -; Tablespace:
101
+ -- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: -
102
+ --
103
+
104
+ CREATE TABLE ar_internal_metadata (
105
+ key character varying NOT NULL,
106
+ value character varying,
107
+ created_at timestamp without time zone NOT NULL,
108
+ updated_at timestamp without time zone NOT NULL
109
+ );
110
+
111
+
112
+ --
113
+ -- Name: assets; Type: TABLE; Schema: public; Owner: -
70
114
  --
71
115
 
72
116
  CREATE TABLE assets (
@@ -99,7 +143,7 @@ ALTER SEQUENCE assets_id_seq OWNED BY assets.id;
99
143
 
100
144
 
101
145
  --
102
- -- Name: lanes_users; Type: TABLE; Schema: public; Owner: -; Tablespace:
146
+ -- Name: lanes_users; Type: TABLE; Schema: public; Owner: -
103
147
  --
104
148
 
105
149
  CREATE TABLE lanes_users (
@@ -135,7 +179,7 @@ ALTER SEQUENCE lanes_users_id_seq OWNED BY lanes_users.id;
135
179
 
136
180
 
137
181
  --
138
- -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace:
182
+ -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
139
183
  --
140
184
 
141
185
  CREATE TABLE schema_migrations (
@@ -144,7 +188,7 @@ CREATE TABLE schema_migrations (
144
188
 
145
189
 
146
190
  --
147
- -- Name: skr_addresses; Type: TABLE; Schema: public; Owner: -; Tablespace:
191
+ -- Name: skr_addresses; Type: TABLE; Schema: public; Owner: -
148
192
  --
149
193
 
150
194
  CREATE TABLE skr_addresses (
@@ -184,7 +228,7 @@ ALTER SEQUENCE skr_addresses_id_seq OWNED BY skr_addresses.id;
184
228
 
185
229
 
186
230
  --
187
- -- Name: skr_bank_accounts; Type: TABLE; Schema: public; Owner: -; Tablespace:
231
+ -- Name: skr_bank_accounts; Type: TABLE; Schema: public; Owner: -
188
232
  --
189
233
 
190
234
  CREATE TABLE skr_bank_accounts (
@@ -221,7 +265,7 @@ ALTER SEQUENCE skr_bank_accounts_id_seq OWNED BY skr_bank_accounts.id;
221
265
 
222
266
 
223
267
  --
224
- -- Name: skr_uoms; Type: TABLE; Schema: public; Owner: -; Tablespace:
268
+ -- Name: skr_uoms; Type: TABLE; Schema: public; Owner: -
225
269
  --
226
270
 
227
271
  CREATE TABLE skr_uoms (
@@ -255,7 +299,7 @@ CREATE VIEW skr_combined_uom AS
255
299
 
256
300
 
257
301
  --
258
- -- Name: skr_customer_projects; Type: TABLE; Schema: public; Owner: -; Tablespace:
302
+ -- Name: skr_customer_projects; Type: TABLE; Schema: public; Owner: -
259
303
  --
260
304
 
261
305
  CREATE TABLE skr_customer_projects (
@@ -275,7 +319,7 @@ CREATE TABLE skr_customer_projects (
275
319
 
276
320
 
277
321
  --
278
- -- Name: skr_customers; Type: TABLE; Schema: public; Owner: -; Tablespace:
322
+ -- Name: skr_customers; Type: TABLE; Schema: public; Owner: -
279
323
  --
280
324
 
281
325
  CREATE TABLE skr_customers (
@@ -302,7 +346,7 @@ CREATE TABLE skr_customers (
302
346
 
303
347
 
304
348
  --
305
- -- Name: skr_skus; Type: TABLE; Schema: public; Owner: -; Tablespace:
349
+ -- Name: skr_skus; Type: TABLE; Schema: public; Owner: -
306
350
  --
307
351
 
308
352
  CREATE TABLE skr_skus (
@@ -329,7 +373,7 @@ CREATE TABLE skr_skus (
329
373
  --
330
374
 
331
375
  CREATE VIEW skr_customer_project_details AS
332
- SELECT cp.id AS skr_customer_project_id,
376
+ SELECT cp.id AS customer_project_id,
333
377
  c.code AS customer_code,
334
378
  c.name AS customer_description,
335
379
  s.code AS sku_code,
@@ -378,7 +422,148 @@ ALTER SEQUENCE skr_customers_id_seq OWNED BY skr_customers.id;
378
422
 
379
423
 
380
424
  --
381
- -- Name: skr_gl_account_balances; Type: TABLE; Schema: public; Owner: -; Tablespace:
425
+ -- Name: skr_expense_categories; Type: TABLE; Schema: public; Owner: -
426
+ --
427
+
428
+ CREATE TABLE skr_expense_categories (
429
+ id integer NOT NULL,
430
+ code character varying NOT NULL,
431
+ name character varying NOT NULL,
432
+ is_active boolean DEFAULT true NOT NULL,
433
+ gl_account_id integer NOT NULL,
434
+ created_at timestamp without time zone NOT NULL,
435
+ created_by_id integer NOT NULL,
436
+ updated_at timestamp without time zone NOT NULL,
437
+ updated_by_id integer NOT NULL
438
+ );
439
+
440
+
441
+ --
442
+ -- Name: skr_expense_categories_id_seq; Type: SEQUENCE; Schema: public; Owner: -
443
+ --
444
+
445
+ CREATE SEQUENCE skr_expense_categories_id_seq
446
+ START WITH 1
447
+ INCREMENT BY 1
448
+ NO MINVALUE
449
+ NO MAXVALUE
450
+ CACHE 1;
451
+
452
+
453
+ --
454
+ -- Name: skr_expense_categories_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
455
+ --
456
+
457
+ ALTER SEQUENCE skr_expense_categories_id_seq OWNED BY skr_expense_categories.id;
458
+
459
+
460
+ --
461
+ -- Name: skr_expense_entries; Type: TABLE; Schema: public; Owner: -
462
+ --
463
+
464
+ CREATE TABLE skr_expense_entries (
465
+ id integer NOT NULL,
466
+ uuid uuid NOT NULL,
467
+ name text NOT NULL,
468
+ memo text,
469
+ occured timestamp without time zone NOT NULL,
470
+ metadata jsonb DEFAULT '{}'::jsonb,
471
+ created_at timestamp without time zone NOT NULL,
472
+ created_by_id integer NOT NULL
473
+ );
474
+
475
+
476
+ --
477
+ -- Name: skr_expense_entries_id_seq; Type: SEQUENCE; Schema: public; Owner: -
478
+ --
479
+
480
+ CREATE SEQUENCE skr_expense_entries_id_seq
481
+ START WITH 1
482
+ INCREMENT BY 1
483
+ NO MINVALUE
484
+ NO MAXVALUE
485
+ CACHE 1;
486
+
487
+
488
+ --
489
+ -- Name: skr_expense_entries_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
490
+ --
491
+
492
+ ALTER SEQUENCE skr_expense_entries_id_seq OWNED BY skr_expense_entries.id;
493
+
494
+
495
+ --
496
+ -- Name: skr_expense_entry_categories; Type: TABLE; Schema: public; Owner: -
497
+ --
498
+
499
+ CREATE TABLE skr_expense_entry_categories (
500
+ id integer NOT NULL,
501
+ category_id integer NOT NULL,
502
+ entry_id integer NOT NULL,
503
+ amount numeric(15,2) NOT NULL
504
+ );
505
+
506
+
507
+ --
508
+ -- Name: skr_expense_entry_categories_id_seq; Type: SEQUENCE; Schema: public; Owner: -
509
+ --
510
+
511
+ CREATE SEQUENCE skr_expense_entry_categories_id_seq
512
+ START WITH 1
513
+ INCREMENT BY 1
514
+ NO MINVALUE
515
+ NO MAXVALUE
516
+ CACHE 1;
517
+
518
+
519
+ --
520
+ -- Name: skr_expense_entry_categories_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
521
+ --
522
+
523
+ ALTER SEQUENCE skr_expense_entry_categories_id_seq OWNED BY skr_expense_entry_categories.id;
524
+
525
+
526
+ --
527
+ -- Name: skr_gl_transactions; Type: TABLE; Schema: public; Owner: -
528
+ --
529
+
530
+ CREATE TABLE skr_gl_transactions (
531
+ id integer NOT NULL,
532
+ period_id integer NOT NULL,
533
+ source_id integer,
534
+ source_type character varying,
535
+ description text NOT NULL,
536
+ created_at timestamp without time zone NOT NULL,
537
+ created_by_id integer NOT NULL
538
+ );
539
+
540
+
541
+ --
542
+ -- Name: skr_expense_entry_details; Type: VIEW; Schema: public; Owner: -
543
+ --
544
+
545
+ CREATE VIEW skr_expense_entry_details AS
546
+ SELECT xref.expense_entry_id,
547
+ array_agg(xref.gl_transaction_id) FILTER (WHERE (xref.gl_transaction_id IS NOT NULL)) AS gl_transaction_ids,
548
+ array_agg(xref.category_id) AS category_ids,
549
+ sum(xref.amount) AS category_total,
550
+ json_agg(row_to_json(( SELECT t.*::record AS t
551
+ FROM ( SELECT xref.category_id,
552
+ xref.amount,
553
+ xref.balance) t(category_id, amount, balance)))) AS category_list
554
+ FROM ( SELECT entry.id AS expense_entry_id,
555
+ gl.id AS gl_transaction_id,
556
+ ec.category_id,
557
+ ec.amount,
558
+ sum(ec.amount) OVER (PARTITION BY ec.category_id ORDER BY entry.occured) AS balance
559
+ FROM ((skr_expense_entries entry
560
+ LEFT JOIN skr_gl_transactions gl ON ((((gl.source_type)::text = 'Skr::ExpenseEntry'::text) AND (gl.source_id = entry.id))))
561
+ JOIN skr_expense_entry_categories ec ON ((entry.id = ec.entry_id)))) xref
562
+ GROUP BY xref.expense_entry_id;
563
+
564
+
565
+ --
566
+ -- Name: skr_gl_account_balances; Type: TABLE; Schema: public; Owner: -
382
567
  --
383
568
 
384
569
  CREATE TABLE skr_gl_account_balances (
@@ -391,7 +576,7 @@ ALTER TABLE ONLY skr_gl_account_balances REPLICA IDENTITY NOTHING;
391
576
 
392
577
 
393
578
  --
394
- -- Name: skr_gl_accounts; Type: TABLE; Schema: public; Owner: -; Tablespace:
579
+ -- Name: skr_gl_accounts; Type: TABLE; Schema: public; Owner: -
395
580
  --
396
581
 
397
582
  CREATE TABLE skr_gl_accounts (
@@ -427,7 +612,7 @@ ALTER SEQUENCE skr_gl_accounts_id_seq OWNED BY skr_gl_accounts.id;
427
612
 
428
613
 
429
614
  --
430
- -- Name: skr_gl_manual_entries; Type: TABLE; Schema: public; Owner: -; Tablespace:
615
+ -- Name: skr_gl_manual_entries; Type: TABLE; Schema: public; Owner: -
431
616
  --
432
617
 
433
618
  CREATE TABLE skr_gl_manual_entries (
@@ -461,7 +646,7 @@ ALTER SEQUENCE skr_gl_manual_entries_id_seq OWNED BY skr_gl_manual_entries.id;
461
646
 
462
647
 
463
648
  --
464
- -- Name: skr_gl_periods; Type: TABLE; Schema: public; Owner: -; Tablespace:
649
+ -- Name: skr_gl_periods; Type: TABLE; Schema: public; Owner: -
465
650
  --
466
651
 
467
652
  CREATE TABLE skr_gl_periods (
@@ -496,7 +681,7 @@ ALTER SEQUENCE skr_gl_periods_id_seq OWNED BY skr_gl_periods.id;
496
681
 
497
682
 
498
683
  --
499
- -- Name: skr_gl_postings; Type: TABLE; Schema: public; Owner: -; Tablespace:
684
+ -- Name: skr_gl_postings; Type: TABLE; Schema: public; Owner: -
500
685
  --
501
686
 
502
687
  CREATE TABLE skr_gl_postings (
@@ -531,21 +716,6 @@ CREATE SEQUENCE skr_gl_postings_id_seq
531
716
  ALTER SEQUENCE skr_gl_postings_id_seq OWNED BY skr_gl_postings.id;
532
717
 
533
718
 
534
- --
535
- -- Name: skr_gl_transactions; Type: TABLE; Schema: public; Owner: -; Tablespace:
536
- --
537
-
538
- CREATE TABLE skr_gl_transactions (
539
- id integer NOT NULL,
540
- period_id integer NOT NULL,
541
- source_id integer,
542
- source_type character varying,
543
- description text NOT NULL,
544
- created_at timestamp without time zone NOT NULL,
545
- created_by_id integer NOT NULL
546
- );
547
-
548
-
549
719
  --
550
720
  -- Name: skr_gl_transaction_details; Type: VIEW; Schema: public; Owner: -
551
721
  --
@@ -592,7 +762,7 @@ ALTER SEQUENCE skr_gl_transactions_id_seq OWNED BY skr_gl_transactions.id;
592
762
 
593
763
 
594
764
  --
595
- -- Name: skr_ia_lines; Type: TABLE; Schema: public; Owner: -; Tablespace:
765
+ -- Name: skr_ia_lines; Type: TABLE; Schema: public; Owner: -
596
766
  --
597
767
 
598
768
  CREATE TABLE skr_ia_lines (
@@ -631,7 +801,7 @@ ALTER SEQUENCE skr_ia_lines_id_seq OWNED BY skr_ia_lines.id;
631
801
 
632
802
 
633
803
  --
634
- -- Name: skr_ia_reasons; Type: TABLE; Schema: public; Owner: -; Tablespace:
804
+ -- Name: skr_ia_reasons; Type: TABLE; Schema: public; Owner: -
635
805
  --
636
806
 
637
807
  CREATE TABLE skr_ia_reasons (
@@ -666,7 +836,7 @@ ALTER SEQUENCE skr_ia_reasons_id_seq OWNED BY skr_ia_reasons.id;
666
836
 
667
837
 
668
838
  --
669
- -- Name: skr_inv_lines; Type: TABLE; Schema: public; Owner: -; Tablespace:
839
+ -- Name: skr_inv_lines; Type: TABLE; Schema: public; Owner: -
670
840
  --
671
841
 
672
842
  CREATE TABLE skr_inv_lines (
@@ -693,7 +863,7 @@ CREATE TABLE skr_inv_lines (
693
863
 
694
864
 
695
865
  --
696
- -- Name: skr_invoices; Type: TABLE; Schema: public; Owner: -; Tablespace:
866
+ -- Name: skr_invoices; Type: TABLE; Schema: public; Owner: -
697
867
  --
698
868
 
699
869
  CREATE TABLE skr_invoices (
@@ -723,7 +893,7 @@ CREATE TABLE skr_invoices (
723
893
 
724
894
 
725
895
  --
726
- -- Name: skr_payments; Type: TABLE; Schema: public; Owner: -; Tablespace:
896
+ -- Name: skr_payments; Type: TABLE; Schema: public; Owner: -
727
897
  --
728
898
 
729
899
  CREATE TABLE skr_payments (
@@ -736,7 +906,7 @@ CREATE TABLE skr_payments (
736
906
  hash_code character varying NOT NULL,
737
907
  amount numeric(15,2) NOT NULL,
738
908
  date date NOT NULL,
739
- check_number integer,
909
+ check_number character varying,
740
910
  name text NOT NULL,
741
911
  address text,
742
912
  notes text,
@@ -748,7 +918,7 @@ CREATE TABLE skr_payments (
748
918
 
749
919
 
750
920
  --
751
- -- Name: skr_pick_tickets; Type: TABLE; Schema: public; Owner: -; Tablespace:
921
+ -- Name: skr_pick_tickets; Type: TABLE; Schema: public; Owner: -
752
922
  --
753
923
 
754
924
  CREATE TABLE skr_pick_tickets (
@@ -766,7 +936,7 @@ CREATE TABLE skr_pick_tickets (
766
936
 
767
937
 
768
938
  --
769
- -- Name: skr_sales_orders; Type: TABLE; Schema: public; Owner: -; Tablespace:
939
+ -- Name: skr_sales_orders; Type: TABLE; Schema: public; Owner: -
770
940
  --
771
941
 
772
942
  CREATE TABLE skr_sales_orders (
@@ -795,7 +965,7 @@ CREATE TABLE skr_sales_orders (
795
965
 
796
966
 
797
967
  --
798
- -- Name: skr_sku_locs; Type: TABLE; Schema: public; Owner: -; Tablespace:
968
+ -- Name: skr_sku_locs; Type: TABLE; Schema: public; Owner: -
799
969
  --
800
970
 
801
971
  CREATE TABLE skr_sku_locs (
@@ -877,7 +1047,7 @@ ALTER SEQUENCE skr_inv_lines_id_seq OWNED BY skr_inv_lines.id;
877
1047
 
878
1048
 
879
1049
  --
880
- -- Name: skr_inventory_adjustments; Type: TABLE; Schema: public; Owner: -; Tablespace:
1050
+ -- Name: skr_inventory_adjustments; Type: TABLE; Schema: public; Owner: -
881
1051
  --
882
1052
 
883
1053
  CREATE TABLE skr_inventory_adjustments (
@@ -933,7 +1103,7 @@ ALTER SEQUENCE skr_invoices_id_seq OWNED BY skr_invoices.id;
933
1103
 
934
1104
 
935
1105
  --
936
- -- Name: skr_locations; Type: TABLE; Schema: public; Owner: -; Tablespace:
1106
+ -- Name: skr_locations; Type: TABLE; Schema: public; Owner: -
937
1107
  --
938
1108
 
939
1109
  CREATE TABLE skr_locations (
@@ -971,7 +1141,7 @@ ALTER SEQUENCE skr_locations_id_seq OWNED BY skr_locations.id;
971
1141
 
972
1142
 
973
1143
  --
974
- -- Name: skr_payment_categories; Type: TABLE; Schema: public; Owner: -; Tablespace:
1144
+ -- Name: skr_payment_categories; Type: TABLE; Schema: public; Owner: -
975
1145
  --
976
1146
 
977
1147
  CREATE TABLE skr_payment_categories (
@@ -1004,7 +1174,7 @@ ALTER SEQUENCE skr_payment_categories_id_seq OWNED BY skr_payment_categories.id;
1004
1174
 
1005
1175
 
1006
1176
  --
1007
- -- Name: skr_payment_terms; Type: TABLE; Schema: public; Owner: -; Tablespace:
1177
+ -- Name: skr_payment_terms; Type: TABLE; Schema: public; Owner: -
1008
1178
  --
1009
1179
 
1010
1180
  CREATE TABLE skr_payment_terms (
@@ -1079,7 +1249,7 @@ ALTER SEQUENCE skr_pick_tickets_id_seq OWNED BY skr_pick_tickets.id;
1079
1249
 
1080
1250
 
1081
1251
  --
1082
- -- Name: skr_po_lines; Type: TABLE; Schema: public; Owner: -; Tablespace:
1252
+ -- Name: skr_po_lines; Type: TABLE; Schema: public; Owner: -
1083
1253
  --
1084
1254
 
1085
1255
  CREATE TABLE skr_po_lines (
@@ -1125,7 +1295,7 @@ ALTER SEQUENCE skr_po_lines_id_seq OWNED BY skr_po_lines.id;
1125
1295
 
1126
1296
 
1127
1297
  --
1128
- -- Name: skr_po_receipts; Type: TABLE; Schema: public; Owner: -; Tablespace:
1298
+ -- Name: skr_po_receipts; Type: TABLE; Schema: public; Owner: -
1129
1299
  --
1130
1300
 
1131
1301
  CREATE TABLE skr_po_receipts (
@@ -1162,7 +1332,7 @@ ALTER SEQUENCE skr_po_receipts_id_seq OWNED BY skr_po_receipts.id;
1162
1332
 
1163
1333
 
1164
1334
  --
1165
- -- Name: skr_por_lines; Type: TABLE; Schema: public; Owner: -; Tablespace:
1335
+ -- Name: skr_por_lines; Type: TABLE; Schema: public; Owner: -
1166
1336
  --
1167
1337
 
1168
1338
  CREATE TABLE skr_por_lines (
@@ -1204,7 +1374,7 @@ ALTER SEQUENCE skr_por_lines_id_seq OWNED BY skr_por_lines.id;
1204
1374
 
1205
1375
 
1206
1376
  --
1207
- -- Name: skr_pt_lines; Type: TABLE; Schema: public; Owner: -; Tablespace:
1377
+ -- Name: skr_pt_lines; Type: TABLE; Schema: public; Owner: -
1208
1378
  --
1209
1379
 
1210
1380
  CREATE TABLE skr_pt_lines (
@@ -1245,7 +1415,7 @@ ALTER SEQUENCE skr_pt_lines_id_seq OWNED BY skr_pt_lines.id;
1245
1415
 
1246
1416
 
1247
1417
  --
1248
- -- Name: skr_purchase_orders; Type: TABLE; Schema: public; Owner: -; Tablespace:
1418
+ -- Name: skr_purchase_orders; Type: TABLE; Schema: public; Owner: -
1249
1419
  --
1250
1420
 
1251
1421
  CREATE TABLE skr_purchase_orders (
@@ -1305,7 +1475,7 @@ ALTER SEQUENCE skr_sales_orders_id_seq OWNED BY skr_sales_orders.id;
1305
1475
 
1306
1476
 
1307
1477
  --
1308
- -- Name: skr_sequential_ids; Type: TABLE; Schema: public; Owner: -; Tablespace:
1478
+ -- Name: skr_sequential_ids; Type: TABLE; Schema: public; Owner: -
1309
1479
  --
1310
1480
 
1311
1481
  CREATE TABLE skr_sequential_ids (
@@ -1326,7 +1496,7 @@ CREATE VIEW skr_sku_inv_xref AS
1326
1496
 
1327
1497
 
1328
1498
  --
1329
- -- Name: skr_sku_vendors; Type: TABLE; Schema: public; Owner: -; Tablespace:
1499
+ -- Name: skr_sku_vendors; Type: TABLE; Schema: public; Owner: -
1330
1500
  --
1331
1501
 
1332
1502
  CREATE TABLE skr_sku_vendors (
@@ -1347,7 +1517,7 @@ CREATE TABLE skr_sku_vendors (
1347
1517
 
1348
1518
 
1349
1519
  --
1350
- -- Name: skr_vendors; Type: TABLE; Schema: public; Owner: -; Tablespace:
1520
+ -- Name: skr_vendors; Type: TABLE; Schema: public; Owner: -
1351
1521
  --
1352
1522
 
1353
1523
  CREATE TABLE skr_vendors (
@@ -1414,7 +1584,7 @@ ALTER SEQUENCE skr_sku_locs_id_seq OWNED BY skr_sku_locs.id;
1414
1584
 
1415
1585
 
1416
1586
  --
1417
- -- Name: skr_so_lines; Type: TABLE; Schema: public; Owner: -; Tablespace:
1587
+ -- Name: skr_so_lines; Type: TABLE; Schema: public; Owner: -
1418
1588
  --
1419
1589
 
1420
1590
  CREATE TABLE skr_so_lines (
@@ -1483,7 +1653,7 @@ CREATE VIEW skr_sku_so_xref AS
1483
1653
 
1484
1654
 
1485
1655
  --
1486
- -- Name: skr_sku_trans; Type: TABLE; Schema: public; Owner: -; Tablespace:
1656
+ -- Name: skr_sku_trans; Type: TABLE; Schema: public; Owner: -
1487
1657
  --
1488
1658
 
1489
1659
  CREATE TABLE skr_sku_trans (
@@ -1566,7 +1736,7 @@ ALTER SEQUENCE skr_skus_id_seq OWNED BY skr_skus.id;
1566
1736
  --
1567
1737
 
1568
1738
  CREATE VIEW skr_so_allocation_details AS
1569
- SELECT sol.sales_order_id AS skr_sales_order_id,
1739
+ SELECT sol.sales_order_id,
1570
1740
  count(*) AS number_of_lines,
1571
1741
  sum((sol.qty_allocated * sol.price)) AS allocated_total,
1572
1742
  sum(
@@ -1607,8 +1777,8 @@ CREATE VIEW skr_so_dailly_sales_history AS
1607
1777
  date_trunc('day'::text, so.created_at) AS so_date
1608
1778
  FROM (skr_so_lines sol
1609
1779
  JOIN skr_sales_orders so ON ((sol.sales_order_id = so.id)))
1610
- GROUP BY date_trunc('day'::text, so.created_at)) ttls ON ((ttls.so_date = date_trunc('day'::text, ((('now'::text)::date - days_ago.days_ago))::timestamp with time zone))))
1611
- ORDER BY date_trunc('day'::text, ((('now'::text)::date - days_ago.days_ago))::timestamp with time zone) DESC;
1780
+ GROUP BY (date_trunc('day'::text, so.created_at))) ttls ON ((ttls.so_date = date_trunc('day'::text, ((('now'::text)::date - days_ago.days_ago))::timestamp with time zone))))
1781
+ ORDER BY (date_trunc('day'::text, ((('now'::text)::date - days_ago.days_ago))::timestamp with time zone)) DESC;
1612
1782
 
1613
1783
 
1614
1784
  --
@@ -1616,7 +1786,7 @@ CREATE VIEW skr_so_dailly_sales_history AS
1616
1786
  --
1617
1787
 
1618
1788
  CREATE VIEW skr_so_details AS
1619
- SELECT so.id AS skr_sales_order_id,
1789
+ SELECT so.id AS sales_order_id,
1620
1790
  to_char((so.order_date)::timestamp with time zone, 'YYYY-MM-DD'::text) AS string_order_date,
1621
1791
  cust.code AS customer_code,
1622
1792
  cust.name AS customer_name,
@@ -1674,7 +1844,7 @@ ALTER SEQUENCE skr_so_lines_id_seq OWNED BY skr_so_lines.id;
1674
1844
 
1675
1845
 
1676
1846
  --
1677
- -- Name: skr_time_entries; Type: TABLE; Schema: public; Owner: -; Tablespace:
1847
+ -- Name: skr_time_entries; Type: TABLE; Schema: public; Owner: -
1678
1848
  --
1679
1849
 
1680
1850
  CREATE TABLE skr_time_entries (
@@ -1751,7 +1921,7 @@ ALTER SEQUENCE skr_vendors_id_seq OWNED BY skr_vendors.id;
1751
1921
 
1752
1922
 
1753
1923
  --
1754
- -- Name: skr_vo_lines; Type: TABLE; Schema: public; Owner: -; Tablespace:
1924
+ -- Name: skr_vo_lines; Type: TABLE; Schema: public; Owner: -
1755
1925
  --
1756
1926
 
1757
1927
  CREATE TABLE skr_vo_lines (
@@ -1794,7 +1964,7 @@ ALTER SEQUENCE skr_vo_lines_id_seq OWNED BY skr_vo_lines.id;
1794
1964
 
1795
1965
 
1796
1966
  --
1797
- -- Name: skr_vouchers; Type: TABLE; Schema: public; Owner: -; Tablespace:
1967
+ -- Name: skr_vouchers; Type: TABLE; Schema: public; Owner: -
1798
1968
  --
1799
1969
 
1800
1970
  CREATE TABLE skr_vouchers (
@@ -1833,7 +2003,7 @@ ALTER SEQUENCE skr_vouchers_id_seq OWNED BY skr_vouchers.id;
1833
2003
 
1834
2004
 
1835
2005
  --
1836
- -- Name: system_settings; Type: TABLE; Schema: public; Owner: -; Tablespace:
2006
+ -- Name: system_settings; Type: TABLE; Schema: public; Owner: -
1837
2007
  --
1838
2008
 
1839
2009
  CREATE TABLE system_settings (
@@ -1862,7 +2032,7 @@ ALTER SEQUENCE system_settings_id_seq OWNED BY system_settings.id;
1862
2032
 
1863
2033
 
1864
2034
  --
1865
- -- Name: testers; Type: TABLE; Schema: public; Owner: -; Tablespace:
2035
+ -- Name: testers; Type: TABLE; Schema: public; Owner: -
1866
2036
  --
1867
2037
 
1868
2038
  CREATE TABLE testers (
@@ -1936,6 +2106,27 @@ ALTER TABLE ONLY skr_customer_projects ALTER COLUMN id SET DEFAULT nextval('skr_
1936
2106
  ALTER TABLE ONLY skr_customers ALTER COLUMN id SET DEFAULT nextval('skr_customers_id_seq'::regclass);
1937
2107
 
1938
2108
 
2109
+ --
2110
+ -- Name: id; Type: DEFAULT; Schema: public; Owner: -
2111
+ --
2112
+
2113
+ ALTER TABLE ONLY skr_expense_categories ALTER COLUMN id SET DEFAULT nextval('skr_expense_categories_id_seq'::regclass);
2114
+
2115
+
2116
+ --
2117
+ -- Name: id; Type: DEFAULT; Schema: public; Owner: -
2118
+ --
2119
+
2120
+ ALTER TABLE ONLY skr_expense_entries ALTER COLUMN id SET DEFAULT nextval('skr_expense_entries_id_seq'::regclass);
2121
+
2122
+
2123
+ --
2124
+ -- Name: id; Type: DEFAULT; Schema: public; Owner: -
2125
+ --
2126
+
2127
+ ALTER TABLE ONLY skr_expense_entry_categories ALTER COLUMN id SET DEFAULT nextval('skr_expense_entry_categories_id_seq'::regclass);
2128
+
2129
+
1939
2130
  --
1940
2131
  -- Name: id; Type: DEFAULT; Schema: public; Owner: -
1941
2132
  --
@@ -2168,7 +2359,15 @@ ALTER TABLE ONLY testers ALTER COLUMN id SET DEFAULT nextval('testers_id_seq'::r
2168
2359
 
2169
2360
 
2170
2361
  --
2171
- -- Name: assets_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2362
+ -- Name: ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2363
+ --
2364
+
2365
+ ALTER TABLE ONLY ar_internal_metadata
2366
+ ADD CONSTRAINT ar_internal_metadata_pkey PRIMARY KEY (key);
2367
+
2368
+
2369
+ --
2370
+ -- Name: assets_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2172
2371
  --
2173
2372
 
2174
2373
  ALTER TABLE ONLY assets
@@ -2176,7 +2375,7 @@ ALTER TABLE ONLY assets
2176
2375
 
2177
2376
 
2178
2377
  --
2179
- -- Name: lanes_users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2378
+ -- Name: lanes_users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2180
2379
  --
2181
2380
 
2182
2381
  ALTER TABLE ONLY lanes_users
@@ -2184,7 +2383,7 @@ ALTER TABLE ONLY lanes_users
2184
2383
 
2185
2384
 
2186
2385
  --
2187
- -- Name: skr_addresses_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2386
+ -- Name: skr_addresses_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2188
2387
  --
2189
2388
 
2190
2389
  ALTER TABLE ONLY skr_addresses
@@ -2192,7 +2391,7 @@ ALTER TABLE ONLY skr_addresses
2192
2391
 
2193
2392
 
2194
2393
  --
2195
- -- Name: skr_bank_accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2394
+ -- Name: skr_bank_accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2196
2395
  --
2197
2396
 
2198
2397
  ALTER TABLE ONLY skr_bank_accounts
@@ -2200,7 +2399,7 @@ ALTER TABLE ONLY skr_bank_accounts
2200
2399
 
2201
2400
 
2202
2401
  --
2203
- -- Name: skr_customer_projects_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2402
+ -- Name: skr_customer_projects_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2204
2403
  --
2205
2404
 
2206
2405
  ALTER TABLE ONLY skr_customer_projects
@@ -2208,7 +2407,7 @@ ALTER TABLE ONLY skr_customer_projects
2208
2407
 
2209
2408
 
2210
2409
  --
2211
- -- Name: skr_customers_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2410
+ -- Name: skr_customers_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2212
2411
  --
2213
2412
 
2214
2413
  ALTER TABLE ONLY skr_customers
@@ -2216,7 +2415,31 @@ ALTER TABLE ONLY skr_customers
2216
2415
 
2217
2416
 
2218
2417
  --
2219
- -- Name: skr_gl_accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2418
+ -- Name: skr_expense_categories_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2419
+ --
2420
+
2421
+ ALTER TABLE ONLY skr_expense_categories
2422
+ ADD CONSTRAINT skr_expense_categories_pkey PRIMARY KEY (id);
2423
+
2424
+
2425
+ --
2426
+ -- Name: skr_expense_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2427
+ --
2428
+
2429
+ ALTER TABLE ONLY skr_expense_entries
2430
+ ADD CONSTRAINT skr_expense_entries_pkey PRIMARY KEY (id);
2431
+
2432
+
2433
+ --
2434
+ -- Name: skr_expense_entry_categories_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2435
+ --
2436
+
2437
+ ALTER TABLE ONLY skr_expense_entry_categories
2438
+ ADD CONSTRAINT skr_expense_entry_categories_pkey PRIMARY KEY (id);
2439
+
2440
+
2441
+ --
2442
+ -- Name: skr_gl_accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2220
2443
  --
2221
2444
 
2222
2445
  ALTER TABLE ONLY skr_gl_accounts
@@ -2224,7 +2447,7 @@ ALTER TABLE ONLY skr_gl_accounts
2224
2447
 
2225
2448
 
2226
2449
  --
2227
- -- Name: skr_gl_manual_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2450
+ -- Name: skr_gl_manual_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2228
2451
  --
2229
2452
 
2230
2453
  ALTER TABLE ONLY skr_gl_manual_entries
@@ -2232,7 +2455,7 @@ ALTER TABLE ONLY skr_gl_manual_entries
2232
2455
 
2233
2456
 
2234
2457
  --
2235
- -- Name: skr_gl_periods_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2458
+ -- Name: skr_gl_periods_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2236
2459
  --
2237
2460
 
2238
2461
  ALTER TABLE ONLY skr_gl_periods
@@ -2240,7 +2463,7 @@ ALTER TABLE ONLY skr_gl_periods
2240
2463
 
2241
2464
 
2242
2465
  --
2243
- -- Name: skr_gl_postings_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2466
+ -- Name: skr_gl_postings_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2244
2467
  --
2245
2468
 
2246
2469
  ALTER TABLE ONLY skr_gl_postings
@@ -2248,7 +2471,7 @@ ALTER TABLE ONLY skr_gl_postings
2248
2471
 
2249
2472
 
2250
2473
  --
2251
- -- Name: skr_gl_transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2474
+ -- Name: skr_gl_transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2252
2475
  --
2253
2476
 
2254
2477
  ALTER TABLE ONLY skr_gl_transactions
@@ -2256,7 +2479,7 @@ ALTER TABLE ONLY skr_gl_transactions
2256
2479
 
2257
2480
 
2258
2481
  --
2259
- -- Name: skr_ia_lines_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2482
+ -- Name: skr_ia_lines_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2260
2483
  --
2261
2484
 
2262
2485
  ALTER TABLE ONLY skr_ia_lines
@@ -2264,7 +2487,7 @@ ALTER TABLE ONLY skr_ia_lines
2264
2487
 
2265
2488
 
2266
2489
  --
2267
- -- Name: skr_ia_reasons_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2490
+ -- Name: skr_ia_reasons_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2268
2491
  --
2269
2492
 
2270
2493
  ALTER TABLE ONLY skr_ia_reasons
@@ -2272,7 +2495,7 @@ ALTER TABLE ONLY skr_ia_reasons
2272
2495
 
2273
2496
 
2274
2497
  --
2275
- -- Name: skr_inv_lines_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2498
+ -- Name: skr_inv_lines_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2276
2499
  --
2277
2500
 
2278
2501
  ALTER TABLE ONLY skr_inv_lines
@@ -2280,7 +2503,7 @@ ALTER TABLE ONLY skr_inv_lines
2280
2503
 
2281
2504
 
2282
2505
  --
2283
- -- Name: skr_inventory_adjustments_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2506
+ -- Name: skr_inventory_adjustments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2284
2507
  --
2285
2508
 
2286
2509
  ALTER TABLE ONLY skr_inventory_adjustments
@@ -2288,7 +2511,7 @@ ALTER TABLE ONLY skr_inventory_adjustments
2288
2511
 
2289
2512
 
2290
2513
  --
2291
- -- Name: skr_invoices_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2514
+ -- Name: skr_invoices_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2292
2515
  --
2293
2516
 
2294
2517
  ALTER TABLE ONLY skr_invoices
@@ -2296,7 +2519,7 @@ ALTER TABLE ONLY skr_invoices
2296
2519
 
2297
2520
 
2298
2521
  --
2299
- -- Name: skr_locations_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2522
+ -- Name: skr_locations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2300
2523
  --
2301
2524
 
2302
2525
  ALTER TABLE ONLY skr_locations
@@ -2304,7 +2527,7 @@ ALTER TABLE ONLY skr_locations
2304
2527
 
2305
2528
 
2306
2529
  --
2307
- -- Name: skr_payment_categories_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2530
+ -- Name: skr_payment_categories_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2308
2531
  --
2309
2532
 
2310
2533
  ALTER TABLE ONLY skr_payment_categories
@@ -2312,7 +2535,7 @@ ALTER TABLE ONLY skr_payment_categories
2312
2535
 
2313
2536
 
2314
2537
  --
2315
- -- Name: skr_payment_terms_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2538
+ -- Name: skr_payment_terms_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2316
2539
  --
2317
2540
 
2318
2541
  ALTER TABLE ONLY skr_payment_terms
@@ -2320,7 +2543,7 @@ ALTER TABLE ONLY skr_payment_terms
2320
2543
 
2321
2544
 
2322
2545
  --
2323
- -- Name: skr_payments_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2546
+ -- Name: skr_payments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2324
2547
  --
2325
2548
 
2326
2549
  ALTER TABLE ONLY skr_payments
@@ -2328,7 +2551,7 @@ ALTER TABLE ONLY skr_payments
2328
2551
 
2329
2552
 
2330
2553
  --
2331
- -- Name: skr_pick_tickets_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2554
+ -- Name: skr_pick_tickets_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2332
2555
  --
2333
2556
 
2334
2557
  ALTER TABLE ONLY skr_pick_tickets
@@ -2336,7 +2559,7 @@ ALTER TABLE ONLY skr_pick_tickets
2336
2559
 
2337
2560
 
2338
2561
  --
2339
- -- Name: skr_po_lines_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2562
+ -- Name: skr_po_lines_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2340
2563
  --
2341
2564
 
2342
2565
  ALTER TABLE ONLY skr_po_lines
@@ -2344,7 +2567,7 @@ ALTER TABLE ONLY skr_po_lines
2344
2567
 
2345
2568
 
2346
2569
  --
2347
- -- Name: skr_po_receipts_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2570
+ -- Name: skr_po_receipts_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2348
2571
  --
2349
2572
 
2350
2573
  ALTER TABLE ONLY skr_po_receipts
@@ -2352,7 +2575,7 @@ ALTER TABLE ONLY skr_po_receipts
2352
2575
 
2353
2576
 
2354
2577
  --
2355
- -- Name: skr_por_lines_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2578
+ -- Name: skr_por_lines_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2356
2579
  --
2357
2580
 
2358
2581
  ALTER TABLE ONLY skr_por_lines
@@ -2360,7 +2583,7 @@ ALTER TABLE ONLY skr_por_lines
2360
2583
 
2361
2584
 
2362
2585
  --
2363
- -- Name: skr_pt_lines_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2586
+ -- Name: skr_pt_lines_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2364
2587
  --
2365
2588
 
2366
2589
  ALTER TABLE ONLY skr_pt_lines
@@ -2368,7 +2591,7 @@ ALTER TABLE ONLY skr_pt_lines
2368
2591
 
2369
2592
 
2370
2593
  --
2371
- -- Name: skr_purchase_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2594
+ -- Name: skr_purchase_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2372
2595
  --
2373
2596
 
2374
2597
  ALTER TABLE ONLY skr_purchase_orders
@@ -2376,7 +2599,7 @@ ALTER TABLE ONLY skr_purchase_orders
2376
2599
 
2377
2600
 
2378
2601
  --
2379
- -- Name: skr_sales_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2602
+ -- Name: skr_sales_orders_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2380
2603
  --
2381
2604
 
2382
2605
  ALTER TABLE ONLY skr_sales_orders
@@ -2384,7 +2607,7 @@ ALTER TABLE ONLY skr_sales_orders
2384
2607
 
2385
2608
 
2386
2609
  --
2387
- -- Name: skr_sequential_ids_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2610
+ -- Name: skr_sequential_ids_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2388
2611
  --
2389
2612
 
2390
2613
  ALTER TABLE ONLY skr_sequential_ids
@@ -2392,7 +2615,7 @@ ALTER TABLE ONLY skr_sequential_ids
2392
2615
 
2393
2616
 
2394
2617
  --
2395
- -- Name: skr_sku_locs_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2618
+ -- Name: skr_sku_locs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2396
2619
  --
2397
2620
 
2398
2621
  ALTER TABLE ONLY skr_sku_locs
@@ -2400,7 +2623,7 @@ ALTER TABLE ONLY skr_sku_locs
2400
2623
 
2401
2624
 
2402
2625
  --
2403
- -- Name: skr_sku_trans_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2626
+ -- Name: skr_sku_trans_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2404
2627
  --
2405
2628
 
2406
2629
  ALTER TABLE ONLY skr_sku_trans
@@ -2408,7 +2631,7 @@ ALTER TABLE ONLY skr_sku_trans
2408
2631
 
2409
2632
 
2410
2633
  --
2411
- -- Name: skr_sku_vendors_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2634
+ -- Name: skr_sku_vendors_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2412
2635
  --
2413
2636
 
2414
2637
  ALTER TABLE ONLY skr_sku_vendors
@@ -2416,7 +2639,7 @@ ALTER TABLE ONLY skr_sku_vendors
2416
2639
 
2417
2640
 
2418
2641
  --
2419
- -- Name: skr_skus_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2642
+ -- Name: skr_skus_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2420
2643
  --
2421
2644
 
2422
2645
  ALTER TABLE ONLY skr_skus
@@ -2424,7 +2647,7 @@ ALTER TABLE ONLY skr_skus
2424
2647
 
2425
2648
 
2426
2649
  --
2427
- -- Name: skr_so_lines_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2650
+ -- Name: skr_so_lines_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2428
2651
  --
2429
2652
 
2430
2653
  ALTER TABLE ONLY skr_so_lines
@@ -2432,7 +2655,7 @@ ALTER TABLE ONLY skr_so_lines
2432
2655
 
2433
2656
 
2434
2657
  --
2435
- -- Name: skr_time_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2658
+ -- Name: skr_time_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2436
2659
  --
2437
2660
 
2438
2661
  ALTER TABLE ONLY skr_time_entries
@@ -2440,7 +2663,7 @@ ALTER TABLE ONLY skr_time_entries
2440
2663
 
2441
2664
 
2442
2665
  --
2443
- -- Name: skr_uoms_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2666
+ -- Name: skr_uoms_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2444
2667
  --
2445
2668
 
2446
2669
  ALTER TABLE ONLY skr_uoms
@@ -2448,7 +2671,7 @@ ALTER TABLE ONLY skr_uoms
2448
2671
 
2449
2672
 
2450
2673
  --
2451
- -- Name: skr_vendors_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2674
+ -- Name: skr_vendors_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2452
2675
  --
2453
2676
 
2454
2677
  ALTER TABLE ONLY skr_vendors
@@ -2456,7 +2679,7 @@ ALTER TABLE ONLY skr_vendors
2456
2679
 
2457
2680
 
2458
2681
  --
2459
- -- Name: skr_vo_lines_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2682
+ -- Name: skr_vo_lines_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2460
2683
  --
2461
2684
 
2462
2685
  ALTER TABLE ONLY skr_vo_lines
@@ -2464,7 +2687,7 @@ ALTER TABLE ONLY skr_vo_lines
2464
2687
 
2465
2688
 
2466
2689
  --
2467
- -- Name: skr_vouchers_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2690
+ -- Name: skr_vouchers_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2468
2691
  --
2469
2692
 
2470
2693
  ALTER TABLE ONLY skr_vouchers
@@ -2472,7 +2695,7 @@ ALTER TABLE ONLY skr_vouchers
2472
2695
 
2473
2696
 
2474
2697
  --
2475
- -- Name: system_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2698
+ -- Name: system_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2476
2699
  --
2477
2700
 
2478
2701
  ALTER TABLE ONLY system_settings
@@ -2480,7 +2703,7 @@ ALTER TABLE ONLY system_settings
2480
2703
 
2481
2704
 
2482
2705
  --
2483
- -- Name: testers_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
2706
+ -- Name: testers_pkey; Type: CONSTRAINT; Schema: public; Owner: -
2484
2707
  --
2485
2708
 
2486
2709
  ALTER TABLE ONLY testers
@@ -2488,147 +2711,168 @@ ALTER TABLE ONLY testers
2488
2711
 
2489
2712
 
2490
2713
  --
2491
- -- Name: index_assets_on_owner_id_and_owner_type; Type: INDEX; Schema: public; Owner: -; Tablespace:
2714
+ -- Name: index_assets_on_owner_id_and_owner_type; Type: INDEX; Schema: public; Owner: -
2492
2715
  --
2493
2716
 
2494
2717
  CREATE INDEX index_assets_on_owner_id_and_owner_type ON assets USING btree (owner_id, owner_type);
2495
2718
 
2496
2719
 
2497
2720
  --
2498
- -- Name: index_lanes_users_on_role_names; Type: INDEX; Schema: public; Owner: -; Tablespace:
2721
+ -- Name: index_lanes_users_on_role_names; Type: INDEX; Schema: public; Owner: -
2499
2722
  --
2500
2723
 
2501
2724
  CREATE INDEX index_lanes_users_on_role_names ON lanes_users USING gin (role_names);
2502
2725
 
2503
2726
 
2504
2727
  --
2505
- -- Name: index_skr_customer_projects_on_code; Type: INDEX; Schema: public; Owner: -; Tablespace:
2728
+ -- Name: index_skr_customer_projects_on_code; Type: INDEX; Schema: public; Owner: -
2506
2729
  --
2507
2730
 
2508
2731
  CREATE INDEX index_skr_customer_projects_on_code ON skr_customer_projects USING btree (code);
2509
2732
 
2510
2733
 
2511
2734
  --
2512
- -- Name: index_skr_customers_on_code; Type: INDEX; Schema: public; Owner: -; Tablespace:
2735
+ -- Name: index_skr_customers_on_code; Type: INDEX; Schema: public; Owner: -
2513
2736
  --
2514
2737
 
2515
2738
  CREATE INDEX index_skr_customers_on_code ON skr_customers USING btree (code);
2516
2739
 
2517
2740
 
2518
2741
  --
2519
- -- Name: index_skr_gl_manual_entries_on_visible_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
2742
+ -- Name: index_skr_expense_categories_on_code; Type: INDEX; Schema: public; Owner: -
2743
+ --
2744
+
2745
+ CREATE INDEX index_skr_expense_categories_on_code ON skr_expense_categories USING btree (code);
2746
+
2747
+
2748
+ --
2749
+ -- Name: index_skr_expense_entries_on_uuid; Type: INDEX; Schema: public; Owner: -
2750
+ --
2751
+
2752
+ CREATE UNIQUE INDEX index_skr_expense_entries_on_uuid ON skr_expense_entries USING btree (uuid);
2753
+
2754
+
2755
+ --
2756
+ -- Name: index_skr_expense_entry_categories_on_entry_id; Type: INDEX; Schema: public; Owner: -
2757
+ --
2758
+
2759
+ CREATE INDEX index_skr_expense_entry_categories_on_entry_id ON skr_expense_entry_categories USING btree (entry_id);
2760
+
2761
+
2762
+ --
2763
+ -- Name: index_skr_gl_manual_entries_on_visible_id; Type: INDEX; Schema: public; Owner: -
2520
2764
  --
2521
2765
 
2522
2766
  CREATE INDEX index_skr_gl_manual_entries_on_visible_id ON skr_gl_manual_entries USING btree (visible_id);
2523
2767
 
2524
2768
 
2525
2769
  --
2526
- -- Name: index_skr_gl_postings_on_period_and_year_and_account_number; Type: INDEX; Schema: public; Owner: -; Tablespace:
2770
+ -- Name: index_skr_gl_postings_on_period_and_year_and_account_number; Type: INDEX; Schema: public; Owner: -
2527
2771
  --
2528
2772
 
2529
2773
  CREATE INDEX index_skr_gl_postings_on_period_and_year_and_account_number ON skr_gl_postings USING btree (period, year, account_number);
2530
2774
 
2531
2775
 
2532
2776
  --
2533
- -- Name: index_skr_inv_lines_on_sku_loc_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
2777
+ -- Name: index_skr_inv_lines_on_sku_loc_id; Type: INDEX; Schema: public; Owner: -
2534
2778
  --
2535
2779
 
2536
2780
  CREATE INDEX index_skr_inv_lines_on_sku_loc_id ON skr_inv_lines USING btree (sku_loc_id);
2537
2781
 
2538
2782
 
2539
2783
  --
2540
- -- Name: index_skr_inventory_adjustments_on_visible_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
2784
+ -- Name: index_skr_inventory_adjustments_on_visible_id; Type: INDEX; Schema: public; Owner: -
2541
2785
  --
2542
2786
 
2543
2787
  CREATE INDEX index_skr_inventory_adjustments_on_visible_id ON skr_inventory_adjustments USING btree (visible_id);
2544
2788
 
2545
2789
 
2546
2790
  --
2547
- -- Name: index_skr_invoices_on_visible_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
2791
+ -- Name: index_skr_invoices_on_visible_id; Type: INDEX; Schema: public; Owner: -
2548
2792
  --
2549
2793
 
2550
2794
  CREATE INDEX index_skr_invoices_on_visible_id ON skr_invoices USING btree (visible_id);
2551
2795
 
2552
2796
 
2553
2797
  --
2554
- -- Name: index_skr_locations_on_code; Type: INDEX; Schema: public; Owner: -; Tablespace:
2798
+ -- Name: index_skr_locations_on_code; Type: INDEX; Schema: public; Owner: -
2555
2799
  --
2556
2800
 
2557
2801
  CREATE INDEX index_skr_locations_on_code ON skr_locations USING btree (code);
2558
2802
 
2559
2803
 
2560
2804
  --
2561
- -- Name: index_skr_payment_terms_on_code; Type: INDEX; Schema: public; Owner: -; Tablespace:
2805
+ -- Name: index_skr_payment_terms_on_code; Type: INDEX; Schema: public; Owner: -
2562
2806
  --
2563
2807
 
2564
2808
  CREATE INDEX index_skr_payment_terms_on_code ON skr_payment_terms USING btree (code);
2565
2809
 
2566
2810
 
2567
2811
  --
2568
- -- Name: index_skr_payments_on_visible_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
2812
+ -- Name: index_skr_payments_on_visible_id; Type: INDEX; Schema: public; Owner: -
2569
2813
  --
2570
2814
 
2571
2815
  CREATE INDEX index_skr_payments_on_visible_id ON skr_payments USING btree (visible_id);
2572
2816
 
2573
2817
 
2574
2818
  --
2575
- -- Name: index_skr_pick_tickets_on_visible_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
2819
+ -- Name: index_skr_pick_tickets_on_visible_id; Type: INDEX; Schema: public; Owner: -
2576
2820
  --
2577
2821
 
2578
2822
  CREATE INDEX index_skr_pick_tickets_on_visible_id ON skr_pick_tickets USING btree (visible_id);
2579
2823
 
2580
2824
 
2581
2825
  --
2582
- -- Name: index_skr_po_receipts_on_visible_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
2826
+ -- Name: index_skr_po_receipts_on_visible_id; Type: INDEX; Schema: public; Owner: -
2583
2827
  --
2584
2828
 
2585
2829
  CREATE INDEX index_skr_po_receipts_on_visible_id ON skr_po_receipts USING btree (visible_id);
2586
2830
 
2587
2831
 
2588
2832
  --
2589
- -- Name: index_skr_purchase_orders_on_visible_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
2833
+ -- Name: index_skr_purchase_orders_on_visible_id; Type: INDEX; Schema: public; Owner: -
2590
2834
  --
2591
2835
 
2592
2836
  CREATE INDEX index_skr_purchase_orders_on_visible_id ON skr_purchase_orders USING btree (visible_id);
2593
2837
 
2594
2838
 
2595
2839
  --
2596
- -- Name: index_skr_sales_orders_on_visible_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
2840
+ -- Name: index_skr_sales_orders_on_visible_id; Type: INDEX; Schema: public; Owner: -
2597
2841
  --
2598
2842
 
2599
2843
  CREATE INDEX index_skr_sales_orders_on_visible_id ON skr_sales_orders USING btree (visible_id);
2600
2844
 
2601
2845
 
2602
2846
  --
2603
- -- Name: index_skr_sku_locs_on_sku_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
2847
+ -- Name: index_skr_sku_locs_on_sku_id; Type: INDEX; Schema: public; Owner: -
2604
2848
  --
2605
2849
 
2606
2850
  CREATE INDEX index_skr_sku_locs_on_sku_id ON skr_sku_locs USING btree (sku_id);
2607
2851
 
2608
2852
 
2609
2853
  --
2610
- -- Name: index_skr_so_lines_on_sku_loc_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
2854
+ -- Name: index_skr_so_lines_on_sku_loc_id; Type: INDEX; Schema: public; Owner: -
2611
2855
  --
2612
2856
 
2613
2857
  CREATE INDEX index_skr_so_lines_on_sku_loc_id ON skr_so_lines USING btree (sku_loc_id);
2614
2858
 
2615
2859
 
2616
2860
  --
2617
- -- Name: index_skr_time_entries_on_lanes_user_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
2861
+ -- Name: index_skr_time_entries_on_lanes_user_id; Type: INDEX; Schema: public; Owner: -
2618
2862
  --
2619
2863
 
2620
2864
  CREATE INDEX index_skr_time_entries_on_lanes_user_id ON skr_time_entries USING btree (lanes_user_id);
2621
2865
 
2622
2866
 
2623
2867
  --
2624
- -- Name: index_skr_vouchers_on_visible_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
2868
+ -- Name: index_skr_vouchers_on_visible_id; Type: INDEX; Schema: public; Owner: -
2625
2869
  --
2626
2870
 
2627
2871
  CREATE INDEX index_skr_vouchers_on_visible_id ON skr_vouchers USING btree (visible_id);
2628
2872
 
2629
2873
 
2630
2874
  --
2631
- -- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace:
2875
+ -- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -
2632
2876
  --
2633
2877
 
2634
2878
  CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (version);
@@ -2644,7 +2888,7 @@ CREATE RULE "_RETURN" AS
2644
2888
  COALESCE(sum(glp.amount), 0.00) AS balance
2645
2889
  FROM (skr_gl_accounts gla
2646
2890
  LEFT JOIN skr_gl_postings glp ON (("left"((glp.account_number)::text, 4) = (gla.number)::text)))
2647
- GROUP BY gla.id, "right"((glp.account_number)::text, 2)
2891
+ GROUP BY gla.id, ("right"((glp.account_number)::text, 2))
2648
2892
  ORDER BY gla.number;
2649
2893
 
2650
2894
 
@@ -2712,6 +2956,30 @@ ALTER TABLE ONLY skr_customers
2712
2956
  ADD CONSTRAINT skr_customers_terms_id_fk FOREIGN KEY (terms_id) REFERENCES skr_payment_terms(id);
2713
2957
 
2714
2958
 
2959
+ --
2960
+ -- Name: skr_expense_categories_gl_account_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
2961
+ --
2962
+
2963
+ ALTER TABLE ONLY skr_expense_categories
2964
+ ADD CONSTRAINT skr_expense_categories_gl_account_id_fk FOREIGN KEY (gl_account_id) REFERENCES skr_gl_accounts(id);
2965
+
2966
+
2967
+ --
2968
+ -- Name: skr_expense_entry_categories_category_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
2969
+ --
2970
+
2971
+ ALTER TABLE ONLY skr_expense_entry_categories
2972
+ ADD CONSTRAINT skr_expense_entry_categories_category_id_fk FOREIGN KEY (category_id) REFERENCES skr_expense_categories(id);
2973
+
2974
+
2975
+ --
2976
+ -- Name: skr_expense_entry_categories_entry_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
2977
+ --
2978
+
2979
+ ALTER TABLE ONLY skr_expense_entry_categories
2980
+ ADD CONSTRAINT skr_expense_entry_categories_entry_id_fk FOREIGN KEY (entry_id) REFERENCES skr_expense_entries(id);
2981
+
2982
+
2715
2983
  --
2716
2984
  -- Name: skr_gl_postings_gl_transaction_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
2717
2985
  --
@@ -3268,111 +3536,8 @@ ALTER TABLE ONLY skr_vouchers
3268
3536
  -- PostgreSQL database dump complete
3269
3537
  --
3270
3538
 
3271
- SET search_path TO "$user",public;
3272
-
3273
- INSERT INTO schema_migrations (version) VALUES ('1');
3274
-
3275
- INSERT INTO schema_migrations (version) VALUES ('2');
3276
-
3277
- INSERT INTO schema_migrations (version) VALUES ('20120110142845');
3278
-
3279
- INSERT INTO schema_migrations (version) VALUES ('20140202185309');
3280
-
3281
- INSERT INTO schema_migrations (version) VALUES ('20140202193316');
3282
-
3283
- INSERT INTO schema_migrations (version) VALUES ('20140202193318');
3284
-
3285
- INSERT INTO schema_migrations (version) VALUES ('20140202193319');
3286
-
3287
- INSERT INTO schema_migrations (version) VALUES ('20140202193700');
3288
-
3289
- INSERT INTO schema_migrations (version) VALUES ('20140202194700');
3290
-
3291
- INSERT INTO schema_migrations (version) VALUES ('20140213040608');
3292
-
3293
- INSERT INTO schema_migrations (version) VALUES ('20140220031700');
3294
-
3295
- INSERT INTO schema_migrations (version) VALUES ('20140220031800');
3296
-
3297
- INSERT INTO schema_migrations (version) VALUES ('20140220190836');
3298
-
3299
- INSERT INTO schema_migrations (version) VALUES ('20140220203029');
3300
-
3301
- INSERT INTO schema_migrations (version) VALUES ('20140224034759');
3302
-
3303
- INSERT INTO schema_migrations (version) VALUES ('20140225032853');
3304
-
3305
- INSERT INTO schema_migrations (version) VALUES ('20140320030501');
3306
-
3307
- INSERT INTO schema_migrations (version) VALUES ('20140321031604');
3308
-
3309
- INSERT INTO schema_migrations (version) VALUES ('20140322012143');
3310
-
3311
- INSERT INTO schema_migrations (version) VALUES ('20140322014401');
3312
-
3313
- INSERT INTO schema_migrations (version) VALUES ('20140322023453');
3314
-
3315
- INSERT INTO schema_migrations (version) VALUES ('20140322035024');
3316
-
3317
- INSERT INTO schema_migrations (version) VALUES ('20140322223912');
3318
-
3319
- INSERT INTO schema_migrations (version) VALUES ('20140322223920');
3320
-
3321
- INSERT INTO schema_migrations (version) VALUES ('20140323001446');
3322
-
3323
- INSERT INTO schema_migrations (version) VALUES ('20140327202102');
3324
-
3325
- INSERT INTO schema_migrations (version) VALUES ('20140327202107');
3326
-
3327
- INSERT INTO schema_migrations (version) VALUES ('20140327202207');
3328
-
3329
- INSERT INTO schema_migrations (version) VALUES ('20140327202209');
3330
-
3331
- INSERT INTO schema_migrations (version) VALUES ('20140327214000');
3332
-
3333
- INSERT INTO schema_migrations (version) VALUES ('20140327223002');
3334
-
3335
- INSERT INTO schema_migrations (version) VALUES ('20140327224000');
3336
-
3337
- INSERT INTO schema_migrations (version) VALUES ('20140327224002');
3338
-
3339
- INSERT INTO schema_migrations (version) VALUES ('20140330232808');
3340
-
3341
- INSERT INTO schema_migrations (version) VALUES ('20140330232810');
3342
-
3343
- INSERT INTO schema_migrations (version) VALUES ('20140400164729');
3344
-
3345
- INSERT INTO schema_migrations (version) VALUES ('20140400164733');
3346
-
3347
- INSERT INTO schema_migrations (version) VALUES ('20140401164729');
3348
-
3349
- INSERT INTO schema_migrations (version) VALUES ('20140401164740');
3350
-
3351
- INSERT INTO schema_migrations (version) VALUES ('20140422024010');
3352
-
3353
- INSERT INTO schema_migrations (version) VALUES ('20140615031600');
3354
-
3355
- INSERT INTO schema_migrations (version) VALUES ('20150220015108');
3356
-
3357
- INSERT INTO schema_migrations (version) VALUES ('20151121211323');
3358
-
3359
- INSERT INTO schema_migrations (version) VALUES ('20160216142845');
3360
-
3361
- INSERT INTO schema_migrations (version) VALUES ('20160229002044');
3362
-
3363
- INSERT INTO schema_migrations (version) VALUES ('20160229041711');
3364
-
3365
- INSERT INTO schema_migrations (version) VALUES ('20160307022705');
3366
-
3367
- INSERT INTO schema_migrations (version) VALUES ('20160517032350');
3368
-
3369
- INSERT INTO schema_migrations (version) VALUES ('20160531014306');
3370
-
3371
- INSERT INTO schema_migrations (version) VALUES ('20160604195848');
3372
-
3373
- INSERT INTO schema_migrations (version) VALUES ('20160605024432');
3539
+ SET search_path TO "$user", public;
3374
3540
 
3375
- INSERT INTO schema_migrations (version) VALUES ('20160608023553');
3541
+ INSERT INTO schema_migrations (version) VALUES ('1'), ('2'), ('20120110142845'), ('20140202185309'), ('20140202193316'), ('20140202193318'), ('20140202193319'), ('20140202193700'), ('20140202194700'), ('20140213040608'), ('20140220031700'), ('20140220031800'), ('20140220190836'), ('20140220203029'), ('20140224034759'), ('20140225032853'), ('20140320030501'), ('20140321031604'), ('20140322012143'), ('20140322014401'), ('20140322023453'), ('20140322035024'), ('20140322223912'), ('20140322223920'), ('20140323001446'), ('20140327202102'), ('20140327202107'), ('20140327202207'), ('20140327202209'), ('20140327214000'), ('20140327223002'), ('20140327224000'), ('20140327224002'), ('20140330232808'), ('20140330232810'), ('20140400164729'), ('20140400164733'), ('20140401164729'), ('20140401164740'), ('20140422024010'), ('20140615031600'), ('20150220015108'), ('20151121211323'), ('20160216142845'), ('20160229002044'), ('20160229041711'), ('20160307022705'), ('20160517032350'), ('20160531014306'), ('20160604195848'), ('20160605024432'), ('20160608023553'), ('20160620010455'), ('20160726004411'), ('20160805002717');
3376
3542
 
3377
- INSERT INTO schema_migrations (version) VALUES ('20160620010455');
3378
3543