stockor 0.1.9 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +254 -72
- data/Guardfile +1 -1
- data/README.md +24 -3
- data/app.json +28 -0
- data/client/skr/Extension.coffee +18 -0
- data/client/skr/components/BankAccountFinder.cjsx +34 -0
- data/client/skr/components/Currency.cjsx +19 -0
- data/client/skr/components/CustomerFinder.cjsx +37 -0
- data/client/skr/components/CustomerLink.cjsx +13 -0
- data/client/skr/components/CustomerProjectFinder.cjsx +49 -0
- data/client/skr/components/GlAccountChooser.cjsx +38 -0
- data/client/skr/components/InvoiceFinder.cjsx +37 -0
- data/client/skr/components/InvoiceLink.cjsx +13 -0
- data/client/skr/components/LocationChooser.cjsx +37 -0
- data/client/skr/components/PaymentCategoryFinder.cjsx +34 -0
- data/client/skr/components/PrintFormChooser.cjsx +29 -0
- data/client/skr/components/SalesOrderFinder.cjsx +38 -0
- data/client/skr/components/ScreenControls.cjsx +20 -0
- data/client/skr/components/SkuFinder.cjsx +30 -0
- data/client/skr/components/SkuLines.cjsx +76 -0
- data/client/skr/components/SystemSettings.cjsx +26 -0
- data/client/skr/components/TermsChooser.cjsx +40 -0
- data/client/skr/components/ToolbarButton.cjsx +7 -0
- data/client/skr/components/TotalsLine.cjsx +21 -0
- data/client/skr/components/TriStateIcon.cjsx +12 -0
- data/client/skr/components/UOMChooser.cjsx +24 -0
- data/client/skr/components/UserPreferences.cjsx +30 -0
- data/client/skr/components/VendorFinder.cjsx +40 -0
- data/client/skr/components/address/Address.cjsx +10 -10
- data/client/skr/components/styles.scss +16 -0
- data/client/skr/index.js +3 -1
- data/client/skr/models/Address.coffee +9 -1
- data/client/skr/models/BankAccount.coffee +17 -0
- data/client/skr/models/Base.coffee +6 -0
- data/client/skr/models/Customer.coffee +17 -10
- data/client/skr/models/CustomerProject.coffee +29 -0
- data/client/skr/models/GlAccount.coffee +22 -10
- data/client/skr/models/GlManualEntry.coffee +4 -2
- data/client/skr/models/GlPeriod.coffee +4 -6
- data/client/skr/models/GlPosting.coffee +7 -7
- data/client/skr/models/GlTransaction.coffee +3 -3
- data/client/skr/models/IaLine.coffee +9 -9
- data/client/skr/models/IaReason.coffee +4 -4
- data/client/skr/models/InvLine.coffee +30 -11
- data/client/skr/models/InventoryAdjustment.coffee +8 -6
- data/client/skr/models/Invoice.coffee +89 -18
- data/client/skr/models/Location.coffee +27 -6
- data/client/skr/models/Payment.coffee +36 -0
- data/client/skr/models/PaymentCategory.coffee +12 -0
- data/client/skr/models/PaymentTerm.coffee +17 -4
- data/client/skr/models/PickTicket.coffee +7 -5
- data/client/skr/models/PoLine.coffee +15 -15
- data/client/skr/models/PoReceipt.coffee +8 -6
- data/client/skr/models/PorLine.coffee +11 -11
- data/client/skr/models/PricingProvider.coffee +6 -0
- data/client/skr/models/PtLine.coffee +13 -13
- data/client/skr/models/PurchaseOrder.coffee +11 -9
- data/client/skr/models/SalesOrder.coffee +59 -22
- data/client/skr/models/Sku.coffee +17 -15
- data/client/skr/models/SkuLoc.coffee +14 -9
- data/client/skr/models/SkuTran.coffee +10 -10
- data/client/skr/models/SkuVendor.coffee +9 -9
- data/client/skr/models/SoLine.coffee +27 -20
- data/client/skr/models/TimeEntry.coffee +75 -0
- data/client/skr/models/Uom.coffee +27 -6
- data/client/skr/models/Vendor.coffee +14 -12
- data/client/skr/models/VoLine.coffee +11 -11
- data/client/skr/models/Voucher.coffee +7 -5
- data/client/skr/models/mixins/HasVisibleId.coffee +7 -0
- data/client/skr/models/mixins/PrintSupport.coffee +6 -0
- data/client/skr/models/mixins/SkuLine.coffee +61 -0
- data/client/skr/screens/Commands.coffee +29 -0
- data/client/skr/screens/bank-maint/BankMaint.cjsx +43 -0
- data/client/skr/screens/bank-maint/index.js +5 -0
- data/client/skr/screens/chart-of-accounts/ChartOfAccounts.cjsx +40 -0
- data/client/skr/screens/chart-of-accounts/index.js +1 -0
- data/client/skr/screens/chart-of-accounts/index.scss +12 -0
- data/client/skr/screens/customer-maint/CustomerMaint.cjsx +35 -36
- data/client/skr/screens/customer-projects/CustomerProjects.cjsx +70 -0
- data/client/skr/screens/customer-projects/index.js +5 -0
- data/client/skr/screens/customer-projects/index.scss +25 -0
- data/client/skr/screens/fresh-books-import/ApiInfo.cjsx +35 -0
- data/client/skr/screens/fresh-books-import/ChooseRecords.cjsx +116 -0
- data/client/skr/screens/fresh-books-import/FreshBooksImport.cjsx +31 -0
- data/client/skr/screens/fresh-books-import/Import.coffee +52 -0
- data/client/skr/screens/fresh-books-import/ViewRecords.cjsx +96 -0
- data/client/skr/screens/fresh-books-import/index.js +1 -0
- data/client/skr/screens/fresh-books-import/index.scss +39 -0
- data/client/skr/screens/gl-accounts/GlAccounts.cjsx +31 -0
- data/client/skr/screens/gl-accounts/index.js +5 -0
- data/client/skr/screens/gl-transactions/GlTransactions.cjsx +46 -0
- data/client/skr/screens/gl-transactions/index.js +1 -0
- data/client/skr/screens/gl-transactions/index.scss +12 -0
- data/client/skr/screens/invoice/Invoice.cjsx +92 -0
- data/client/skr/screens/invoice/Payment.cjsx +28 -0
- data/client/skr/screens/invoice/index.js +5 -0
- data/client/skr/screens/locations/Locations.cjsx +31 -0
- data/client/skr/screens/locations/index.js +5 -0
- data/client/skr/screens/payment-category/PaymentCategory.cjsx +28 -0
- data/client/skr/screens/payment-category/index.js +5 -0
- data/client/skr/screens/payment-category/index.scss +9 -0
- data/client/skr/screens/payment-terms/PaymentTerms.cjsx +28 -0
- data/client/skr/screens/payment-terms/index.js +5 -0
- data/client/skr/screens/payment-terms/index.scss +9 -0
- data/client/skr/screens/payments/Payments.cjsx +59 -0
- data/client/skr/screens/payments/index.js +5 -0
- data/client/skr/screens/sales-order/SalesOrder.cjsx +68 -0
- data/client/skr/screens/sales-order/index.js +1 -5
- data/client/skr/screens/sku-maint/SkuMaint.cjsx +53 -0
- data/client/skr/screens/sku-maint/SkuUomList.cjsx +209 -0
- data/client/skr/screens/sku-maint/index.js +2 -5
- data/client/skr/screens/sku-maint/index.scss +37 -6
- data/client/skr/screens/time-invoicing/TimeInvoicing.cjsx +156 -0
- data/client/skr/screens/time-invoicing/index.js +5 -0
- data/client/skr/screens/time-invoicing/index.scss +7 -0
- data/client/skr/screens/time-tracking/EditEntry.cjsx +54 -0
- data/client/skr/screens/time-tracking/Entries.coffee +132 -0
- data/client/skr/screens/time-tracking/Header.cjsx +71 -0
- data/client/skr/screens/time-tracking/Popover.cjsx +70 -0
- data/client/skr/screens/time-tracking/PopoverMiniControls.cjsx +25 -0
- data/client/skr/screens/time-tracking/TimeTracking.cjsx +63 -0
- data/client/skr/screens/time-tracking/WeekSummary.cjsx +16 -0
- data/client/skr/screens/time-tracking/index.js +1 -0
- data/client/skr/screens/time-tracking/index.scss +126 -0
- data/client/skr/screens/vendor-maint/VendorMaint.cjsx +45 -0
- data/client/skr/screens/vendor-maint/index.js +1 -5
- data/client/skr/styles.scss +1 -13
- data/config/puma.rb +4 -0
- data/config/routes.rb +21 -9
- data/config/screens.rb +147 -32
- data/db/migrate/20140202194700_create_skr_gl_transaction_details.rb +35 -0
- data/db/migrate/20140220031800_create_skr_locations.rb +2 -0
- data/db/migrate/20140220190836_create_skr_vendors.rb +1 -0
- data/db/migrate/20140220203029_create_skr_customers.rb +3 -2
- data/db/migrate/20140224034759_create_skr_skus.rb +2 -3
- data/db/migrate/20140322223912_create_skr_sales_orders.rb +4 -3
- data/db/migrate/20140322223920_create_skr_so_lines.rb +4 -5
- data/db/migrate/20140323001446_create_so_details_view.rb +7 -5
- data/db/migrate/20140327202209_create_skr_pt_lines.rb +2 -2
- data/db/migrate/20140327214000_create_customer_project.rb +16 -0
- data/db/migrate/20140327223002_create_time_entries.rb +17 -0
- data/db/migrate/20140327224000_create_skr_invoices.rb +5 -1
- data/db/migrate/20140327224002_create_skr_inv_lines.rb +3 -1
- data/db/migrate/20140422024010_create_skr_inv_details_view.rb +1 -1
- data/db/migrate/20151121211323_create_customer_project_details_views.rb +31 -0
- data/db/migrate/20160216142845_create_gl_account_balances_view.rb +20 -0
- data/db/migrate/20160229002044_create_bank_accounts.rb +18 -0
- data/db/migrate/20160229041711_create_payments.rb +33 -0
- data/db/migrate/20160307022705_create_create_combined_uom_views.rb +18 -0
- data/db/schema.sql +639 -140
- data/db/seed/chart_of_accounts.yml +8 -6
- data/db/seed/payment_categories.yml +12 -0
- data/db/seed/skus.yml +32 -0
- data/db/seed.rb +21 -0
- data/lib/skr/access_roles.rb +19 -6
- data/lib/skr/concerns/has_sku_loc_lines.rb +0 -16
- data/lib/skr/concerns/inv_extensions.rb +24 -0
- data/lib/skr/concerns/is_sku_loc_line.rb +3 -4
- data/lib/skr/concerns/so_extensions.rb +8 -0
- data/lib/skr/concerns/visible_id_identifier.rb +1 -1
- data/lib/skr/db/migration_helpers.rb +2 -4
- data/lib/skr/extension.rb +11 -4
- data/lib/skr/handlers/fresh_books_import.rb +20 -0
- data/lib/skr/handlers/invoice_from_time_entries.rb +49 -0
- data/lib/skr/jobs/fresh_books/base.rb +54 -0
- data/lib/skr/jobs/fresh_books/import.rb +151 -0
- data/lib/skr/jobs/fresh_books/retrieve.rb +62 -0
- data/lib/skr/model.rb +5 -0
- data/lib/skr/models/address.rb +1 -1
- data/lib/skr/models/bank_account.rb +13 -0
- data/lib/skr/models/business_entity.rb +3 -0
- data/lib/skr/models/customer.rb +1 -1
- data/lib/skr/models/customer_project.rb +22 -0
- data/lib/skr/models/gl_account.rb +13 -3
- data/lib/skr/models/gl_period.rb +6 -0
- data/lib/skr/models/gl_posting.rb +7 -4
- data/lib/skr/models/gl_transaction.rb +19 -33
- data/lib/skr/models/ia_line.rb +1 -1
- data/lib/skr/models/inv_line.rb +33 -15
- data/lib/skr/models/invoice.rb +47 -20
- data/lib/skr/models/location.rb +7 -1
- data/lib/skr/models/payment.rb +49 -0
- data/lib/skr/models/payment_category.rb +11 -0
- data/lib/skr/models/payment_term.rb +1 -1
- data/lib/skr/models/por_line.rb +1 -1
- data/lib/skr/models/pt_line.rb +1 -1
- data/lib/skr/models/sales_order.rb +9 -9
- data/lib/skr/models/sku_loc.rb +1 -1
- data/lib/skr/models/sku_tran.rb +6 -11
- data/lib/skr/models/so_line.rb +22 -12
- data/lib/skr/models/time_entry.rb +36 -0
- data/lib/skr/models/uom.rb +11 -10
- data/lib/skr/models/user_proxy.rb +1 -1
- data/lib/skr/number.rb +25 -0
- data/lib/skr/print/form.rb +46 -0
- data/lib/skr/print/template.rb +48 -0
- data/lib/skr/print.rb +11 -0
- data/lib/skr/string.rb +11 -0
- data/lib/skr/version.rb +1 -1
- data/lib/skr.rb +9 -0
- data/spec/fixtures/skr/address.yml +164 -4
- data/spec/fixtures/skr/bank_account.yml +8 -0
- data/spec/fixtures/skr/customer.yml +30 -4
- data/spec/fixtures/skr/customer_project.yml +20 -0
- data/spec/fixtures/skr/gl_account.yml +19 -1
- data/spec/fixtures/skr/gl_period.yml +3 -0
- data/spec/fixtures/skr/gl_posting.yml +22 -1
- data/spec/fixtures/skr/gl_transaction.yml +4 -1
- data/spec/fixtures/skr/inv_line.yml +35 -0
- data/spec/fixtures/skr/invoice.yml +13 -2
- data/spec/fixtures/skr/location.yml +5 -0
- data/spec/fixtures/skr/payment.yml +10 -0
- data/spec/fixtures/skr/payment_category.yml +8 -0
- data/spec/fixtures/skr/payment_term.yml +37 -3
- data/spec/fixtures/skr/sales_order.yml +12 -1
- data/spec/fixtures/skr/sku.yml +78 -1
- data/spec/fixtures/skr/sku_loc.yml +42 -1
- data/spec/fixtures/skr/sku_tran.yml +24 -1
- data/spec/fixtures/skr/so_line.yml +32 -0
- data/spec/fixtures/skr/time_entry.yml +82 -0
- data/spec/fixtures/skr/uom.yml +52 -1
- data/spec/fixtures/skr/vendor.yml +28 -1
- data/spec/fixtures/stockor.png +0 -0
- data/spec/server/bank_account_spec.rb +10 -0
- data/spec/server/customer_project_spec.rb +10 -0
- data/spec/server/handlers/invoice_from_time_entries_spec.rb +49 -0
- data/spec/server/jobs/fresh_books/import_spec.rb +69 -0
- data/spec/server/jobs/fresh_books/retrieve_spec.rb +37 -0
- data/spec/server/models/address_spec.rb +4 -3
- data/spec/server/models/gl_transaction_spec.rb +3 -3
- data/spec/server/models/inv_line_spec.rb +83 -3
- data/spec/server/models/invoice_spec.rb +32 -3
- data/spec/server/models/payment_spec.rb +40 -0
- data/spec/server/models/sales_order_spec.rb +1 -1
- data/spec/server/models/so_line_spec.rb +3 -3
- data/spec/server/models/spec_helper_spec.rb +1 -1
- data/spec/server/payment_spec.rb +10 -0
- data/spec/server/print/form_spec.rb +47 -0
- data/spec/server/print/template_spec.rb +36 -0
- data/spec/server/spec_helper.rb +14 -1
- data/spec/server/time_entry_spec.rb +10 -0
- data/spec/skr/components/SkuLinesSpec.coffee +61 -0
- data/spec/skr/models/BankAccountSpec.coffee +5 -0
- data/spec/skr/models/CustomerProjectSpec.coffee +5 -0
- data/spec/skr/models/CustomerSpec.coffee +2 -2
- data/spec/skr/models/PaymentSpec.coffee +5 -0
- data/spec/skr/models/SalesOrderSpec.coffee +21 -5
- data/spec/skr/models/SoLineSpec.coffee +7 -2
- data/spec/skr/models/TimeEntrySpec.coffee +5 -0
- data/spec/skr/screens/bank-maint/BankMaintSpec.coffee +5 -0
- data/spec/skr/screens/customer-projects/CustomerProjectsSpec.coffee +5 -0
- data/spec/skr/screens/fresh-books-import/FreshBooksImportSpec.coffee +1 -0
- data/spec/skr/screens/gl-accounts/GlAccountsSpec.coffee +5 -0
- data/spec/skr/screens/invoice/InvoiceSpec.coffee +5 -0
- data/spec/skr/screens/locations/LocationsSpec.coffee +5 -0
- data/spec/skr/screens/payment-category/PaymentCategorySpec.coffee +5 -0
- data/spec/skr/screens/payment-terms/PaymentTermsSpec.coffee +5 -0
- data/spec/skr/screens/payments/PaymentsSpec.coffee +5 -0
- data/spec/skr/screens/time-invoicing/TimeInvoicingSpec.coffee +5 -0
- data/spec/skr/screens/time-tracking/TimeTrackingSpec.coffee +14 -0
- data/spec/vcr/freshbooks.yml +698 -0
- data/stockor.gemspec +5 -1
- data/templates/print/fonts/GnuMICR.otf +0 -0
- data/templates/print/layout.tex.erb +39 -0
- data/templates/print/packages/booktabs.sty +182 -0
- data/templates/print/packages/fancybox.sty +966 -0
- data/templates/print/packages/fancyhdr.sty +485 -0
- data/templates/print/packages/graphbox.sty +129 -0
- data/templates/print/packages/lastpage.sty +283 -0
- data/templates/print/packages/lastpage209.sty +70 -0
- data/templates/print/packages/marginnote.sty +412 -0
- data/templates/print/packages/multirow.sty +159 -0
- data/templates/print/packages/rotating.sty +282 -0
- data/templates/print/packages/tabu.sty +2557 -0
- data/templates/print/packages/textpos.sty +361 -0
- data/templates/print/packages/varwidth.sty +318 -0
- data/templates/print/partials/address.tex.erb +6 -0
- data/templates/print/partials/bill_to_ship_to.tex.erb +13 -0
- data/templates/print/partials/header.tex.erb +13 -0
- data/templates/print/partials/invoice_paid_state.tex.erb +2 -0
- data/templates/print/partials/old/inv_lines_grouping.tex.erb +8 -0
- data/templates/print/partials/old/labor_lines_footer.tex.erb +18 -0
- data/templates/print/partials/skus_table.tex.erb +32 -0
- data/templates/print/partials/skus_table_col_hdr.tex.erb +8 -0
- data/templates/print/partials/skus_table_footer.tex.erb +5 -0
- data/templates/print/partials/skus_table_group_footer.tex.erb +4 -0
- data/templates/print/partials/skus_table_invoice_footer.tex.erb +25 -0
- data/templates/print/partials/skus_table_invoice_info_line.tex.erb +16 -0
- data/templates/print/partials/skus_table_labor_col_hdr.tex.erb +8 -0
- data/templates/print/partials/skus_table_labor_group_footer.tex.erb +7 -0
- data/templates/print/partials/skus_table_labor_line.tex.erb +11 -0
- data/templates/print/partials/skus_table_line.tex.erb +6 -0
- data/templates/print/partials/skus_table_other_charge_lines.tex.erb +7 -0
- data/templates/print/partials/so_info_line.tex.erb +14 -0
- data/templates/print/types/invoice/default.tex.erb +13 -0
- data/templates/print/types/invoice/labor.tex.erb +33 -0
- data/templates/print/types/payment/default.tex.erb +64 -0
- data/templates/print/types/sales-order/default.tex.erb +8 -0
- metadata +252 -15
- data/client/skr/components/address/address.html +0 -20
- data/client/skr/models/mixins/CodeField.coffee +0 -5
- data/client/skr/screens/customer-maint/index.scss +0 -11
- data/client/skr/screens/customer-maint/layout.html +0 -32
- data/client/skr/screens/sales-order/SalesOrder.coffee +0 -30
- data/client/skr/screens/sales-order/index.scss +0 -8
- data/client/skr/screens/sales-order/layout.html +0 -30
- data/client/skr/screens/sku-maint/SkuMaint.coffee +0 -18
- data/client/skr/screens/sku-maint/layout.html +0 -16
- data/client/skr/screens/vendor-maint/VendorMaint.coffee +0 -28
- data/client/skr/screens/vendor-maint/index.scss +0 -8
- data/client/skr/screens/vendor-maint/layout.html +0 -32
@@ -7,9 +7,14 @@ cash:
|
|
7
7
|
|
8
8
|
bank_checking:
|
9
9
|
number: 1011
|
10
|
-
name: Cash
|
10
|
+
name: Cash - Checking
|
11
11
|
description: Checking account balance (as shown in company records), currency, coins, checks received from customers but not yet deposited.
|
12
12
|
|
13
|
+
inventory:
|
14
|
+
number: 1110
|
15
|
+
name: Inventory
|
16
|
+
description: Inventory on hand and awaiting sale
|
17
|
+
|
13
18
|
deposits:
|
14
19
|
number: 1200
|
15
20
|
name: Deposits
|
@@ -40,4 +45,17 @@ sales:
|
|
40
45
|
name: Sales
|
41
46
|
description: Amounts earned from selling physical goods. When a sale is provided on credit, both this account and Accounts Receivable will increase. When a service is provided for immediate cash, both this account and Cash will increase.
|
42
47
|
|
48
|
+
labor:
|
49
|
+
number: 5100
|
50
|
+
name: Labor
|
51
|
+
description: Labor Costs
|
52
|
+
|
53
|
+
utilities:
|
54
|
+
number: 5150
|
55
|
+
name: Utilities
|
56
|
+
description: Utility Costs
|
43
57
|
|
58
|
+
ship:
|
59
|
+
number: 5100
|
60
|
+
name: Shipping
|
61
|
+
description: Shipping charges
|
@@ -1,2 +1,23 @@
|
|
1
|
-
|
1
|
+
tiny_inv_goods_credit:
|
2
|
+
gl_transaction: tiny_inv
|
3
|
+
account_number: 122001
|
4
|
+
amount: 285.1
|
5
|
+
is_debit: false
|
6
|
+
year: <%= Time.now.year %>
|
7
|
+
period: <%= Time.now.month %>
|
2
8
|
|
9
|
+
tiny_inv_goods_debit:
|
10
|
+
gl_transaction: tiny_inv
|
11
|
+
account_number: 111001
|
12
|
+
amount: 72.6
|
13
|
+
is_debit: true
|
14
|
+
year: <%= Time.now.year %>
|
15
|
+
period: <%= Time.now.month %>
|
16
|
+
|
17
|
+
tiny_inv_labor_debit:
|
18
|
+
gl_transaction: tiny_inv
|
19
|
+
account_number: 510001
|
20
|
+
amount: 212.5
|
21
|
+
is_debit: true
|
22
|
+
year: <%= Time.now.year %>
|
23
|
+
period: <%= Time.now.month %>
|
@@ -1,2 +1,37 @@
|
|
1
1
|
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
2
2
|
|
3
|
+
tiny_hat:
|
4
|
+
invoice: tiny
|
5
|
+
so_line: tiny_hat
|
6
|
+
sku_loc: hat_def
|
7
|
+
qty: 1
|
8
|
+
price: 8.85
|
9
|
+
sku_code: HAT
|
10
|
+
description: A Top Hat
|
11
|
+
uom_code: EA
|
12
|
+
uom_size: 1
|
13
|
+
position: 1
|
14
|
+
|
15
|
+
tiny_yarn:
|
16
|
+
invoice: tiny
|
17
|
+
so_line: tiny_yarn
|
18
|
+
sku_loc: yarn_def
|
19
|
+
qty: 3
|
20
|
+
price: 21.25
|
21
|
+
sku_code: GLDYARN
|
22
|
+
description: Yarn (golden)
|
23
|
+
uom_code: FT
|
24
|
+
uom_size: 1
|
25
|
+
position: 2
|
26
|
+
|
27
|
+
tiny_time:
|
28
|
+
invoice: tiny
|
29
|
+
time_entry: siteprep
|
30
|
+
sku_loc: labor_def
|
31
|
+
qty: 8.5
|
32
|
+
price: 25.00
|
33
|
+
sku_code: LABOR
|
34
|
+
description: Purchase material, initial site prep. Go to store and call unicorns in for questions. Ran across lake barefoot without shoes.
|
35
|
+
uom_code: HOUR
|
36
|
+
uom_size: 1
|
37
|
+
position: 3
|
@@ -1,2 +1,13 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
tiny:
|
2
|
+
visible_id: 1024
|
3
|
+
customer: billy
|
4
|
+
location: default
|
5
|
+
sales_order: tiny
|
6
|
+
notes: Ship promptly in all organic packaging
|
7
|
+
billing_address: hg_billing
|
8
|
+
shipping_address: sw_shipping
|
9
|
+
terms: net10
|
10
|
+
po_num: BAAH!
|
11
|
+
form: labor
|
12
|
+
invoice_date: <%= 1.days.ago %>
|
13
|
+
state: 0
|
@@ -1,6 +1,40 @@
|
|
1
1
|
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
2
2
|
|
3
|
-
|
4
|
-
code:
|
5
|
-
description:
|
3
|
+
credcard:
|
4
|
+
code: CREDCARD
|
5
|
+
description: Payment due at time of sale with credit card
|
6
|
+
days: 0
|
7
|
+
discount_days: 0
|
8
|
+
discount_amount: 0
|
9
|
+
check:
|
10
|
+
code: CHECK
|
11
|
+
description: Payment due at time of sale by check
|
12
|
+
days: 0
|
13
|
+
discount_days: 0
|
14
|
+
discount_amount: 0
|
15
|
+
cash:
|
16
|
+
code: CASH
|
17
|
+
description: Payment due at time of sale with cash
|
18
|
+
days: 0
|
19
|
+
discount_days: 0
|
20
|
+
discount_amount: 0
|
21
|
+
net10:
|
22
|
+
code: NET10
|
23
|
+
description: Payment due in 10 days, no discount for early payment
|
24
|
+
days: 10
|
25
|
+
discount_days: 0
|
26
|
+
discount_amount: 0
|
6
27
|
|
28
|
+
net15:
|
29
|
+
code: NET15
|
30
|
+
description: Payment due in 15 days, no discount for early payment
|
31
|
+
days: 15
|
32
|
+
discount_days: 0
|
33
|
+
discount_amount: 0
|
34
|
+
|
35
|
+
net30:
|
36
|
+
code: NET30
|
37
|
+
description: Payment due in 30 days, no discount for early payment
|
38
|
+
days: 30
|
39
|
+
discount_days: 0
|
40
|
+
discount_amount: 0
|
@@ -1,2 +1,13 @@
|
|
1
1
|
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
2
|
-
|
2
|
+
tiny:
|
3
|
+
visible_id: 1
|
4
|
+
customer: billy
|
5
|
+
location: default
|
6
|
+
notes: Ship promptly in all organic packaging
|
7
|
+
billing_address: hg_billing
|
8
|
+
shipping_address: sw_shipping
|
9
|
+
terms: credcard
|
10
|
+
form: default
|
11
|
+
po_num: BAAH!
|
12
|
+
order_date: <%= 2.days.ago %>
|
13
|
+
state: 0
|
data/spec/fixtures/skr/sku.yml
CHANGED
@@ -1,2 +1,79 @@
|
|
1
|
-
|
1
|
+
misc:
|
2
|
+
code: MISC
|
3
|
+
description: Miscellaneous Item
|
4
|
+
default_vendor: rump
|
5
|
+
gl_asset_account: inventory
|
6
|
+
default_uom_code: EA
|
7
|
+
is_other_charge: false
|
8
|
+
does_track_inventory: yes
|
9
|
+
can_backorder: no
|
2
10
|
|
11
|
+
yarn:
|
12
|
+
code: GLDYARN
|
13
|
+
description: Yarn (golden)
|
14
|
+
default_vendor: rump
|
15
|
+
gl_asset_account: inventory
|
16
|
+
default_uom_code: FT
|
17
|
+
is_other_charge: false
|
18
|
+
does_track_inventory: yes
|
19
|
+
can_backorder: no
|
20
|
+
|
21
|
+
gs:
|
22
|
+
code: GLSHOE
|
23
|
+
description: Glass Shoe
|
24
|
+
default_vendor: cinderella
|
25
|
+
gl_asset_account: inventory
|
26
|
+
default_uom_code: EA
|
27
|
+
is_other_charge: false
|
28
|
+
does_track_inventory: yes
|
29
|
+
can_backorder: no
|
30
|
+
|
31
|
+
hat:
|
32
|
+
code: HAT
|
33
|
+
description: A Large Top Hat
|
34
|
+
default_vendor: bigco
|
35
|
+
default_uom_code: EA
|
36
|
+
is_other_charge: false
|
37
|
+
does_track_inventory: true
|
38
|
+
gl_asset_account: inventory
|
39
|
+
can_backorder: false
|
40
|
+
|
41
|
+
glove:
|
42
|
+
code: GLOVE
|
43
|
+
description: A small black riding glove
|
44
|
+
default_vendor: bigco
|
45
|
+
default_uom_code: PR
|
46
|
+
is_other_charge: false
|
47
|
+
does_track_inventory: true
|
48
|
+
gl_asset_account: inventory
|
49
|
+
can_backorder: false
|
50
|
+
|
51
|
+
labor:
|
52
|
+
code: LABOR
|
53
|
+
description: Work performed
|
54
|
+
default_vendor: bigco
|
55
|
+
default_uom_code: HOUR
|
56
|
+
is_other_charge: false
|
57
|
+
does_track_inventory: false
|
58
|
+
gl_asset_account: labor
|
59
|
+
can_backorder: false
|
60
|
+
|
61
|
+
tax:
|
62
|
+
code: TAX
|
63
|
+
description: Sales Tax
|
64
|
+
is_other_charge: true
|
65
|
+
does_track_inventory: false
|
66
|
+
default_vendor: bigco
|
67
|
+
default_uom_code: EA
|
68
|
+
gl_asset_account: tax
|
69
|
+
can_backorder: false
|
70
|
+
|
71
|
+
ship:
|
72
|
+
code: SHIP
|
73
|
+
description: Sales Ship
|
74
|
+
is_other_charge: true
|
75
|
+
does_track_inventory: false
|
76
|
+
default_vendor: bigco
|
77
|
+
default_uom_code: EA
|
78
|
+
gl_asset_account: ship
|
79
|
+
can_backorder: false
|
@@ -1,2 +1,43 @@
|
|
1
|
-
|
1
|
+
misc_def:
|
2
|
+
sku: misc
|
3
|
+
qty: 1
|
4
|
+
mac: 1.1
|
5
|
+
location: default
|
2
6
|
|
7
|
+
yarn_def:
|
8
|
+
sku: yarn
|
9
|
+
qty: 1
|
10
|
+
mac: 1.1
|
11
|
+
location: default
|
12
|
+
|
13
|
+
gs_def:
|
14
|
+
sku: gs
|
15
|
+
qty: 2
|
16
|
+
mac: 2.2
|
17
|
+
location: default
|
18
|
+
|
19
|
+
hat_def:
|
20
|
+
sku: hat
|
21
|
+
qty: 3
|
22
|
+
mac: 3.3
|
23
|
+
location: default
|
24
|
+
|
25
|
+
labor_def:
|
26
|
+
sku: labor
|
27
|
+
qty: 4
|
28
|
+
mac: 4.4
|
29
|
+
location: default
|
30
|
+
|
31
|
+
glove_def:
|
32
|
+
sku: glove
|
33
|
+
qty: 5
|
34
|
+
mac: 5.5
|
35
|
+
location: default
|
36
|
+
|
37
|
+
tax_def:
|
38
|
+
sku: tax
|
39
|
+
location: default
|
40
|
+
|
41
|
+
ship_def:
|
42
|
+
sku: ship
|
43
|
+
location: default
|
@@ -1,2 +1,25 @@
|
|
1
|
-
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
2
1
|
|
2
|
+
tiny_hat:
|
3
|
+
origin: tiny_hat(InvLine)
|
4
|
+
sku_loc: hat_def
|
5
|
+
prior_qty: 4
|
6
|
+
qty: -1
|
7
|
+
cost: 8.85
|
8
|
+
prior_mac: 3.3
|
9
|
+
mac: 0.0
|
10
|
+
prior_mac: 3.3000
|
11
|
+
origin_description: INV 1:HAT
|
12
|
+
uom_code: EA
|
13
|
+
uom_size: 1
|
14
|
+
|
15
|
+
tiny_yarn:
|
16
|
+
origin: tiny_yarn(InvLine)
|
17
|
+
sku_loc: yarn_def
|
18
|
+
prior_qty: 4
|
19
|
+
prior_mac: 1.1
|
20
|
+
qty: -3
|
21
|
+
mac: 0.0
|
22
|
+
cost: 64.75
|
23
|
+
origin_description: INV 1:GLDYARN
|
24
|
+
uom_code: FT
|
25
|
+
uom_size: 1
|
@@ -1,2 +1,34 @@
|
|
1
1
|
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
2
2
|
|
3
|
+
tiny_glove:
|
4
|
+
sales_order: tiny
|
5
|
+
sku_loc: glove_def
|
6
|
+
qty: 1
|
7
|
+
price: 42.88
|
8
|
+
sku_code: GLOVE
|
9
|
+
description: A Glove
|
10
|
+
uom_code: CS
|
11
|
+
uom_size: 24
|
12
|
+
position: 1
|
13
|
+
|
14
|
+
tiny_hat:
|
15
|
+
sales_order: tiny
|
16
|
+
sku_loc: hat_def
|
17
|
+
qty: 1
|
18
|
+
price: 8.85
|
19
|
+
sku_code: HAT
|
20
|
+
description: A Top Hat
|
21
|
+
uom_code: EA
|
22
|
+
uom_size: 1
|
23
|
+
position: 2
|
24
|
+
|
25
|
+
tiny_yarn:
|
26
|
+
sales_order: tiny
|
27
|
+
sku_loc: yarn_def
|
28
|
+
qty: 3
|
29
|
+
price: 21.25
|
30
|
+
sku_code: GLDYARN
|
31
|
+
description: Yarn (golden)
|
32
|
+
uom_code: FT
|
33
|
+
uom_size: 1
|
34
|
+
position: 3
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
2
|
+
# <% date = ->(day, hours=8, mins=0){ (day.days.ago.midnight + hours.hours + mins.minutes).to_s } %>
|
3
|
+
|
4
|
+
siteprep:
|
5
|
+
customer_project: goatpens
|
6
|
+
lanes_user_id: 1
|
7
|
+
is_invoiced: true
|
8
|
+
start_at: <%= date[5] %>
|
9
|
+
end_at: <%= date[5, 16, 30] %>
|
10
|
+
description: Purchase material, initial site prep
|
11
|
+
|
12
|
+
lumber:
|
13
|
+
customer_project: goatpens
|
14
|
+
lanes_user_id: 1
|
15
|
+
is_invoiced: false
|
16
|
+
start_at: <%= date[4, 10] %>
|
17
|
+
end_at: <%= date[4, 15, 15] %>
|
18
|
+
description: Cut lumber to size, construct pre-sized panels off-site
|
19
|
+
|
20
|
+
install:
|
21
|
+
customer_project: goatpens
|
22
|
+
lanes_user_id: 1
|
23
|
+
is_invoiced: false
|
24
|
+
start_at: <%= date[3] %>
|
25
|
+
end_at: <%= date[3, 19, 15] %>
|
26
|
+
description: Onsite install and painting of fence panels
|
27
|
+
|
28
|
+
walkthrough:
|
29
|
+
customer_project: goatpens
|
30
|
+
lanes_user_id: 1
|
31
|
+
is_invoiced: false
|
32
|
+
start_at: <%= date[2, 12] %>
|
33
|
+
end_at: <%= date[2, 15, 45] %>
|
34
|
+
description: Customer walkthrough and approval, punch down list review
|
35
|
+
|
36
|
+
puchdown:
|
37
|
+
customer_project: goatpens
|
38
|
+
lanes_user_id: 1
|
39
|
+
is_invoiced: false
|
40
|
+
start_at: <%= date[1, 15] %>
|
41
|
+
end_at: <%= date[1, 16, 30] %>
|
42
|
+
description: Tighten lag bolts, re-paint missed joints
|
43
|
+
|
44
|
+
magic:
|
45
|
+
customer_project: mirror
|
46
|
+
lanes_user_id: 1
|
47
|
+
is_invoiced: false
|
48
|
+
start_at: <%= date[5, 12] %>
|
49
|
+
end_at: <%= date[5, 15, 15] %>
|
50
|
+
description: Met with magician, described specifications and reviewed prior art
|
51
|
+
|
52
|
+
prototype:
|
53
|
+
customer_project: mirror
|
54
|
+
lanes_user_id: 1
|
55
|
+
is_invoiced: false
|
56
|
+
start_at: <%= date[3, 8] %>
|
57
|
+
end_at: <%= date[3, 10, 45] %>
|
58
|
+
description: Built test-case and tested magicians prototype against it.
|
59
|
+
|
60
|
+
effects:
|
61
|
+
customer_project: mirror
|
62
|
+
lanes_user_id: 1
|
63
|
+
is_invoiced: false
|
64
|
+
start_at: <%= date[3, 12] %>
|
65
|
+
end_at: <%= date[3, 15] %>
|
66
|
+
description: Fine-tune magical effects with magician, adjusted prophetic accuracy
|
67
|
+
|
68
|
+
frame:
|
69
|
+
customer_project: mirror
|
70
|
+
lanes_user_id: 1
|
71
|
+
is_invoiced: false
|
72
|
+
start_at: <%= date[2, 10] %>
|
73
|
+
end_at: <%= date[2, 15, 30] %>
|
74
|
+
description: Construct guilded silver frame to serve as containment field for mirror
|
75
|
+
|
76
|
+
magic_train:
|
77
|
+
customer_project: mirror
|
78
|
+
lanes_user_id: 1
|
79
|
+
is_invoiced: false
|
80
|
+
start_at: <%= date[1, 13] %>
|
81
|
+
end_at: <%= date[1, 15] %>
|
82
|
+
description: Delivered and installed mirror. Performed on-site training in use of magical query language
|
data/spec/fixtures/skr/uom.yml
CHANGED
@@ -1,2 +1,53 @@
|
|
1
|
-
|
1
|
+
miscea:
|
2
|
+
code: EA
|
3
|
+
size: 1
|
4
|
+
sku: misc
|
5
|
+
price: 10
|
2
6
|
|
7
|
+
gsea:
|
8
|
+
code: EA
|
9
|
+
size: 1
|
10
|
+
sku: gs
|
11
|
+
price: 101.14
|
12
|
+
|
13
|
+
yarnft:
|
14
|
+
code: FT
|
15
|
+
size: 1
|
16
|
+
sku: yarn
|
17
|
+
price: 21.25
|
18
|
+
|
19
|
+
hatea:
|
20
|
+
code: EA
|
21
|
+
size: 1
|
22
|
+
sku: hat
|
23
|
+
price: 8.85
|
24
|
+
|
25
|
+
glovepr:
|
26
|
+
code: PR
|
27
|
+
size: 1
|
28
|
+
sku: glove
|
29
|
+
price: 12.14
|
30
|
+
|
31
|
+
glovecs:
|
32
|
+
code: CS
|
33
|
+
size: 24
|
34
|
+
sku: glove
|
35
|
+
price: 288.00
|
36
|
+
|
37
|
+
laborea:
|
38
|
+
code: HOUR
|
39
|
+
size: 1
|
40
|
+
sku: labor
|
41
|
+
price: 1
|
42
|
+
|
43
|
+
taxea:
|
44
|
+
code: EA
|
45
|
+
size: 1
|
46
|
+
sku: tax
|
47
|
+
price: 0.0
|
48
|
+
|
49
|
+
shipea:
|
50
|
+
code: EA
|
51
|
+
size: 1
|
52
|
+
sku: ship
|
53
|
+
price: 0.0
|
@@ -1,2 +1,29 @@
|
|
1
|
-
|
1
|
+
cinderella:
|
2
|
+
code: CINDERELLA
|
3
|
+
name: Cinderella
|
4
|
+
terms: net30
|
5
|
+
notes: Always mention shoe sale
|
6
|
+
gl_payables_account: ar
|
7
|
+
gl_freight_account: ship
|
8
|
+
billing_address: cinder_billing
|
9
|
+
shipping_address: cinder_shipping
|
2
10
|
|
11
|
+
rump:
|
12
|
+
code: RUMPY
|
13
|
+
name: Rumpelstiltskin
|
14
|
+
terms: net10
|
15
|
+
notes: Likes to pay in gold - always accept it
|
16
|
+
gl_payables_account: ar
|
17
|
+
gl_freight_account: ship
|
18
|
+
billing_address: rump_billing
|
19
|
+
shipping_address: rump_shipping
|
20
|
+
|
21
|
+
hg:
|
22
|
+
code: HANSGRET
|
23
|
+
name: Hansel and Gretel
|
24
|
+
terms: net10
|
25
|
+
notes: Likes to chat about birds of the forest, do not mention parents
|
26
|
+
gl_payables_account: ar
|
27
|
+
gl_freight_account: ship
|
28
|
+
billing_address: hg_billing
|
29
|
+
shipping_address: hg_shipping
|
Binary file
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
|
3
|
+
class InvoiceFromTimeEntriesSpec < Skr::TestCase
|
4
|
+
|
5
|
+
subject { Skr::Handlers::InvoiceFromTimeEntries }
|
6
|
+
let (:project) { skr_customer_project(:goatpens) }
|
7
|
+
let (:invoice) {
|
8
|
+
subject.new(
|
9
|
+
project.id, project.time_entries.map(&:id), 'po_num' => 'Testing Only!'
|
10
|
+
).build_invoice
|
11
|
+
}
|
12
|
+
let (:time_entry) { skr_time_entry(:siteprep) }
|
13
|
+
let (:line) { invoice.lines.first }
|
14
|
+
|
15
|
+
it "raises exception if ids are not found" do
|
16
|
+
assert_raises(ActiveRecord::RecordNotFound) {
|
17
|
+
subject.new(
|
18
|
+
project.id, [12345], 'po_num' => 'Testing Only!'
|
19
|
+
).build_invoice
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
it "sets attributes on invoice" do
|
24
|
+
assert_kind_of Skr::Invoice, invoice
|
25
|
+
assert_equal invoice.customer, project.customer
|
26
|
+
assert_equal 'Testing Only!', invoice.po_num
|
27
|
+
assert_equal invoice.customer_project, project
|
28
|
+
end
|
29
|
+
|
30
|
+
it "creates lines on invoice" do
|
31
|
+
assert line, 'did not add a line to invoice'
|
32
|
+
assert_equal line.time_entry, time_entry
|
33
|
+
assert line.sku_loc, "didn't set sku loc"
|
34
|
+
assert_equal project.rates['hourly'], line.price
|
35
|
+
assert_equal time_entry.description, line.description
|
36
|
+
assert_equal 8.5, line.qty
|
37
|
+
end
|
38
|
+
|
39
|
+
it "creates savable invoice" do
|
40
|
+
assert invoice.save, "Invoice failed to save, errors: #{invoice.errors.full_messages}"
|
41
|
+
end
|
42
|
+
|
43
|
+
it "marks time entry as invoiced after save" do
|
44
|
+
invoice.save!
|
45
|
+
time_entry.reload
|
46
|
+
assert time_entry.inv_line, "invoice line wasn't set on time entry"
|
47
|
+
assert time_entry.is_invoiced, "time entry wasn't marked as invoiced after save"
|
48
|
+
end
|
49
|
+
end
|