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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d734100c2a781d64262d82c9d253abbdeb944441
|
4
|
+
data.tar.gz: bc35cfaaecd7fb4ada61cc37838c64bcb9e21d0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c33358eb4136bfdd0da75142a5d383a65324588653386c6593d99b29ef904959093475c6863b02a29afee54a8e86d72b6aa84399dd34c54eae491cb758f11c2e
|
7
|
+
data.tar.gz: 6c20dc9ca46b14e0d720c8bb0729322e4db866323c0459fd5cc36097425597c78ccc84d2a59d26d7d31ef9632a4aad33fe7ce9fabd5352cac788fa35617e49f3
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,88 +1,230 @@
|
|
1
1
|
GIT
|
2
2
|
remote: git://github.com/argosity/lanes.git
|
3
|
-
revision:
|
3
|
+
revision: 8347b9f30227829d8c52eb100299b9e30a455e02
|
4
4
|
branch: master
|
5
5
|
specs:
|
6
|
-
lanes (0.
|
6
|
+
lanes (0.3.0)
|
7
|
+
activejob (~> 4.2)
|
7
8
|
activerecord (~> 4.2)
|
8
9
|
bcrypt (~> 3.1)
|
9
|
-
|
10
|
+
carrierwave (~> 0.10.0)
|
10
11
|
coffee-react (~> 3.0)
|
11
12
|
coffee-script (~> 2.3)
|
12
13
|
compass-import-once (~> 1.0)
|
13
14
|
execjs (~> 2.2)
|
15
|
+
fastimage (~> 1.8.1)
|
16
|
+
fog (~> 1.37.0)
|
14
17
|
guard (~> 2.0)
|
15
18
|
guard-jasmine (~> 2.0)
|
16
19
|
guard-minitest (~> 2.3)
|
17
20
|
hashie (~> 3.3)
|
18
21
|
jasmine-core (~> 2.0)
|
19
|
-
|
22
|
+
jobba (~> 1.4)
|
23
|
+
message_bus (= 2.0.0.beta.6)
|
24
|
+
mini_magick (~> 4.3.6)
|
20
25
|
minitest-around (~> 0.2)
|
21
26
|
mocha (~> 1.1)
|
22
27
|
oj (~> 2.1)
|
23
28
|
pg (~> 0.17)
|
29
|
+
rack-protection (~> 1.5)
|
24
30
|
rack-test (~> 0.6)
|
25
|
-
rack_csrf (~> 2.5)
|
26
31
|
rake (~> 10.0)
|
27
32
|
require_all (~> 1.3)
|
33
|
+
resque (~> 1.25)
|
28
34
|
sanitize (~> 3.0)
|
29
35
|
sass (~> 3.4)
|
30
36
|
sinatra (~> 1.4)
|
31
|
-
sprockets (~>
|
32
|
-
sprockets-helpers (~> 1.
|
37
|
+
sprockets (~> 3.0)
|
38
|
+
sprockets-helpers (~> 1.2)
|
33
39
|
thor (~> 0.19)
|
34
|
-
|
40
|
+
uglifier (~> 2.7)
|
41
|
+
|
42
|
+
GIT
|
43
|
+
remote: git://github.com/nathanstitt/erb_latex.git
|
44
|
+
revision: 6d16aea21c99710be94445b610e3ba03485f9bc7
|
45
|
+
branch: master
|
46
|
+
specs:
|
47
|
+
erb_latex (0.3.0)
|
35
48
|
|
36
49
|
PATH
|
37
50
|
remote: .
|
38
51
|
specs:
|
39
|
-
stockor (0.
|
52
|
+
stockor (0.2)
|
40
53
|
aasm (~> 4.1)
|
54
|
+
erb_latex (= 0.3)
|
41
55
|
lanes
|
56
|
+
numbers_in_words (~> 0.4.0)
|
57
|
+
ruby-freshbooks
|
42
58
|
|
43
59
|
GEM
|
44
60
|
remote: https://rubygems.org/
|
45
61
|
specs:
|
46
|
-
|
47
|
-
|
48
|
-
|
62
|
+
CFPropertyList (2.3.2)
|
63
|
+
aasm (4.10.0)
|
64
|
+
activejob (4.2.6)
|
65
|
+
activesupport (= 4.2.6)
|
66
|
+
globalid (>= 0.3.0)
|
67
|
+
activemodel (4.2.6)
|
68
|
+
activesupport (= 4.2.6)
|
49
69
|
builder (~> 3.1)
|
50
|
-
activerecord (4.2.
|
51
|
-
activemodel (= 4.2.
|
52
|
-
activesupport (= 4.2.
|
70
|
+
activerecord (4.2.6)
|
71
|
+
activemodel (= 4.2.6)
|
72
|
+
activesupport (= 4.2.6)
|
53
73
|
arel (~> 6.0)
|
54
|
-
activesupport (4.2.
|
74
|
+
activesupport (4.2.6)
|
55
75
|
i18n (~> 0.7)
|
56
76
|
json (~> 1.7, >= 1.7.7)
|
57
77
|
minitest (~> 5.1)
|
58
78
|
thread_safe (~> 0.3, >= 0.3.4)
|
59
79
|
tzinfo (~> 1.1)
|
60
|
-
|
61
|
-
|
80
|
+
addressable (2.4.0)
|
81
|
+
arel (6.0.3)
|
82
|
+
bcrypt (3.1.11)
|
62
83
|
builder (3.2.2)
|
63
|
-
byebug (
|
64
|
-
|
65
|
-
|
84
|
+
byebug (8.2.2)
|
85
|
+
carrierwave (0.10.0)
|
86
|
+
activemodel (>= 3.2.0)
|
87
|
+
activesupport (>= 3.2.0)
|
88
|
+
json (>= 1.7)
|
89
|
+
mime-types (>= 1.16)
|
90
|
+
childprocess (0.5.9)
|
66
91
|
ffi (~> 1.0, >= 1.0.11)
|
67
|
-
|
68
|
-
|
69
|
-
coffee-react (3.0.1)
|
92
|
+
coderay (1.1.1)
|
93
|
+
coffee-react (3.4.0)
|
70
94
|
execjs
|
71
95
|
coffee-script (2.4.1)
|
72
96
|
coffee-script-source
|
73
97
|
execjs
|
74
|
-
coffee-script-source (1.
|
75
|
-
columnize (0.9.0)
|
98
|
+
coffee-script-source (1.10.0)
|
76
99
|
compass-import-once (1.0.5)
|
77
100
|
sass (>= 3.2, < 3.5)
|
101
|
+
concurrent-ruby (1.0.1)
|
102
|
+
crack (0.4.3)
|
103
|
+
safe_yaml (~> 1.0.0)
|
78
104
|
crass (1.0.2)
|
79
|
-
|
80
|
-
|
105
|
+
excon (0.49.0)
|
106
|
+
execjs (2.6.0)
|
107
|
+
faker (1.6.3)
|
81
108
|
i18n (~> 0.5)
|
109
|
+
fastimage (1.8.1)
|
110
|
+
addressable (~> 2.3, >= 2.3.5)
|
82
111
|
ffi (1.9.10)
|
112
|
+
fission (0.5.0)
|
113
|
+
CFPropertyList (~> 2.2)
|
114
|
+
fog (1.37.0)
|
115
|
+
fog-aliyun (>= 0.1.0)
|
116
|
+
fog-atmos
|
117
|
+
fog-aws (>= 0.6.0)
|
118
|
+
fog-brightbox (~> 0.4)
|
119
|
+
fog-core (~> 1.32)
|
120
|
+
fog-dynect (~> 0.0.2)
|
121
|
+
fog-ecloud (~> 0.1)
|
122
|
+
fog-google (<= 0.1.0)
|
123
|
+
fog-json
|
124
|
+
fog-local
|
125
|
+
fog-powerdns (>= 0.1.1)
|
126
|
+
fog-profitbricks
|
127
|
+
fog-radosgw (>= 0.0.2)
|
128
|
+
fog-riakcs
|
129
|
+
fog-sakuracloud (>= 0.0.4)
|
130
|
+
fog-serverlove
|
131
|
+
fog-softlayer
|
132
|
+
fog-storm_on_demand
|
133
|
+
fog-terremark
|
134
|
+
fog-vmfusion
|
135
|
+
fog-voxel
|
136
|
+
fog-vsphere (>= 0.4.0)
|
137
|
+
fog-xenserver
|
138
|
+
fog-xml (~> 0.1.1)
|
139
|
+
ipaddress (~> 0.5)
|
140
|
+
fog-aliyun (0.1.0)
|
141
|
+
fog-core (~> 1.27)
|
142
|
+
fog-json (~> 1.0)
|
143
|
+
ipaddress (~> 0.8)
|
144
|
+
xml-simple (~> 1.1)
|
145
|
+
fog-atmos (0.1.0)
|
146
|
+
fog-core
|
147
|
+
fog-xml
|
148
|
+
fog-aws (0.9.2)
|
149
|
+
fog-core (~> 1.27)
|
150
|
+
fog-json (~> 1.0)
|
151
|
+
fog-xml (~> 0.1)
|
152
|
+
ipaddress (~> 0.8)
|
153
|
+
fog-brightbox (0.10.1)
|
154
|
+
fog-core (~> 1.22)
|
155
|
+
fog-json
|
156
|
+
inflecto (~> 0.0.2)
|
157
|
+
fog-core (1.37.0)
|
158
|
+
builder
|
159
|
+
excon (~> 0.45)
|
160
|
+
formatador (~> 0.2)
|
161
|
+
fog-dynect (0.0.3)
|
162
|
+
fog-core
|
163
|
+
fog-json
|
164
|
+
fog-xml
|
165
|
+
fog-ecloud (0.3.0)
|
166
|
+
fog-core
|
167
|
+
fog-xml
|
168
|
+
fog-google (0.1.0)
|
169
|
+
fog-core
|
170
|
+
fog-json
|
171
|
+
fog-xml
|
172
|
+
fog-json (1.0.2)
|
173
|
+
fog-core (~> 1.0)
|
174
|
+
multi_json (~> 1.10)
|
175
|
+
fog-local (0.3.0)
|
176
|
+
fog-core (~> 1.27)
|
177
|
+
fog-powerdns (0.1.1)
|
178
|
+
fog-core (~> 1.27)
|
179
|
+
fog-json (~> 1.0)
|
180
|
+
fog-xml (~> 0.1)
|
181
|
+
fog-profitbricks (0.0.5)
|
182
|
+
fog-core
|
183
|
+
fog-xml
|
184
|
+
nokogiri
|
185
|
+
fog-radosgw (0.0.5)
|
186
|
+
fog-core (>= 1.21.0)
|
187
|
+
fog-json
|
188
|
+
fog-xml (>= 0.0.1)
|
189
|
+
fog-riakcs (0.1.0)
|
190
|
+
fog-core
|
191
|
+
fog-json
|
192
|
+
fog-xml
|
193
|
+
fog-sakuracloud (1.7.5)
|
194
|
+
fog-core
|
195
|
+
fog-json
|
196
|
+
fog-serverlove (0.1.2)
|
197
|
+
fog-core
|
198
|
+
fog-json
|
199
|
+
fog-softlayer (1.1.0)
|
200
|
+
fog-core
|
201
|
+
fog-json
|
202
|
+
fog-storm_on_demand (0.1.1)
|
203
|
+
fog-core
|
204
|
+
fog-json
|
205
|
+
fog-terremark (0.1.0)
|
206
|
+
fog-core
|
207
|
+
fog-xml
|
208
|
+
fog-vmfusion (0.1.0)
|
209
|
+
fission
|
210
|
+
fog-core
|
211
|
+
fog-voxel (0.1.0)
|
212
|
+
fog-core
|
213
|
+
fog-xml
|
214
|
+
fog-vsphere (0.6.3)
|
215
|
+
fog-core
|
216
|
+
rbvmomi (~> 1.8)
|
217
|
+
fog-xenserver (0.2.3)
|
218
|
+
fog-core
|
219
|
+
fog-xml
|
220
|
+
fog-xml (0.1.2)
|
221
|
+
fog-core
|
222
|
+
nokogiri (~> 1.5, >= 1.5.11)
|
83
223
|
formatador (0.2.5)
|
224
|
+
globalid (0.3.6)
|
225
|
+
activesupport (>= 4.1.0)
|
84
226
|
growl (1.0.3)
|
85
|
-
guard (2.
|
227
|
+
guard (2.13.0)
|
86
228
|
formatador (>= 0.2.4)
|
87
229
|
listen (>= 2.7, <= 4.0)
|
88
230
|
lumberjack (~> 1.0)
|
@@ -103,95 +245,133 @@ GEM
|
|
103
245
|
guard-minitest (2.4.4)
|
104
246
|
guard-compat (~> 1.2)
|
105
247
|
minitest (>= 3.0)
|
106
|
-
|
107
|
-
|
248
|
+
hashdiff (0.3.0)
|
249
|
+
hashie (3.4.3)
|
250
|
+
httparty (0.13.7)
|
251
|
+
json (~> 1.8)
|
252
|
+
multi_xml (>= 0.5.2)
|
108
253
|
i18n (0.7.0)
|
109
|
-
|
110
|
-
|
254
|
+
inflecto (0.0.2)
|
255
|
+
ipaddress (0.8.3)
|
256
|
+
jasmine (2.4.0)
|
257
|
+
jasmine-core (~> 2.4)
|
111
258
|
phantomjs
|
112
259
|
rack (>= 1.2.1)
|
113
260
|
rake
|
114
|
-
jasmine-core (2.
|
261
|
+
jasmine-core (2.4.1)
|
262
|
+
jobba (1.4.0)
|
263
|
+
redis (~> 3.2)
|
264
|
+
redis-namespace
|
115
265
|
json (1.8.3)
|
116
|
-
listen (3.0.
|
266
|
+
listen (3.0.6)
|
117
267
|
rb-fsevent (>= 0.9.3)
|
118
|
-
rb-inotify (>= 0.9)
|
119
|
-
lumberjack (1.0.
|
120
|
-
message_bus (
|
268
|
+
rb-inotify (>= 0.9.7)
|
269
|
+
lumberjack (1.0.10)
|
270
|
+
message_bus (2.0.0.beta.6)
|
121
271
|
rack (>= 1.1.3)
|
122
|
-
redis
|
123
272
|
metaclass (0.0.4)
|
124
273
|
method_source (0.8.2)
|
125
|
-
|
126
|
-
|
127
|
-
|
274
|
+
mime-types (3.0)
|
275
|
+
mime-types-data (~> 3.2015)
|
276
|
+
mime-types-data (3.2016.0221)
|
277
|
+
mini_magick (4.3.6)
|
278
|
+
mini_portile2 (2.0.0)
|
279
|
+
minitest (5.8.4)
|
280
|
+
minitest-around (0.3.2)
|
128
281
|
minitest (~> 5.0)
|
129
282
|
mocha (1.1.0)
|
130
283
|
metaclass (~> 0.0.1)
|
284
|
+
mono_logger (1.1.0)
|
131
285
|
multi_json (1.11.2)
|
132
|
-
|
133
|
-
|
134
|
-
|
286
|
+
multi_xml (0.5.5)
|
287
|
+
nenv (0.3.0)
|
288
|
+
nokogiri (1.6.7.2)
|
289
|
+
mini_portile2 (~> 2.0.0.rc2)
|
135
290
|
nokogumbo (1.2.0)
|
136
291
|
nokogiri
|
137
|
-
notiffany (0.0.
|
292
|
+
notiffany (0.0.8)
|
138
293
|
nenv (~> 0.1)
|
139
294
|
shellany (~> 0.0)
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
295
|
+
numbers_in_words (0.4.0)
|
296
|
+
activesupport
|
297
|
+
oj (2.15.0)
|
298
|
+
pg (0.18.4)
|
299
|
+
phantomjs (2.1.1.0)
|
300
|
+
pry (0.10.3)
|
144
301
|
coderay (~> 1.1.0)
|
145
302
|
method_source (~> 0.8.1)
|
146
303
|
slop (~> 3.4)
|
147
|
-
pry-byebug (3.
|
148
|
-
byebug (~>
|
304
|
+
pry-byebug (3.3.0)
|
305
|
+
byebug (~> 8.0)
|
149
306
|
pry (~> 0.10)
|
150
|
-
puma (2.
|
151
|
-
rack (>= 1.1, < 2.0)
|
307
|
+
puma (3.2.0)
|
152
308
|
rack (1.6.4)
|
153
309
|
rack-protection (1.5.3)
|
154
310
|
rack
|
155
311
|
rack-test (0.6.3)
|
156
312
|
rack (>= 1.0)
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
rb-fsevent (0.9.5)
|
161
|
-
rb-inotify (0.9.5)
|
313
|
+
rake (10.5.0)
|
314
|
+
rb-fsevent (0.9.7)
|
315
|
+
rb-inotify (0.9.7)
|
162
316
|
ffi (>= 0.5.0)
|
163
|
-
|
164
|
-
|
317
|
+
rbvmomi (1.8.2)
|
318
|
+
builder
|
319
|
+
nokogiri (>= 1.4.1)
|
320
|
+
trollop
|
321
|
+
redis (3.2.2)
|
322
|
+
redis-namespace (1.5.2)
|
323
|
+
redis (~> 3.0, >= 3.0.4)
|
324
|
+
require_all (1.3.3)
|
325
|
+
resque (1.26.0)
|
326
|
+
mono_logger (~> 1.0)
|
327
|
+
multi_json (~> 1.0)
|
328
|
+
redis-namespace (~> 1.3)
|
329
|
+
sinatra (>= 0.9.2)
|
330
|
+
vegas (~> 0.1.2)
|
331
|
+
ruby-freshbooks (0.4.1)
|
332
|
+
builder (>= 2.1.2)
|
333
|
+
httparty (>= 0.5.0)
|
334
|
+
safe_yaml (1.0.4)
|
165
335
|
sanitize (3.1.2)
|
166
336
|
crass (~> 1.0.1)
|
167
337
|
nokogiri (>= 1.4.4)
|
168
338
|
nokogumbo (= 1.2.0)
|
169
|
-
sass (3.4.
|
339
|
+
sass (3.4.22)
|
170
340
|
shellany (0.0.1)
|
171
|
-
sinatra (1.4.
|
172
|
-
rack (~> 1.
|
341
|
+
sinatra (1.4.7)
|
342
|
+
rack (~> 1.5)
|
173
343
|
rack-protection (~> 1.4)
|
174
344
|
tilt (>= 1.3, < 3)
|
175
345
|
slop (3.6.0)
|
176
|
-
sprockets (
|
177
|
-
|
178
|
-
|
179
|
-
rack (~> 1.0)
|
180
|
-
tilt (~> 1.1, != 1.3.0)
|
346
|
+
sprockets (3.5.2)
|
347
|
+
concurrent-ruby (~> 1.0)
|
348
|
+
rack (> 1, < 3)
|
181
349
|
sprockets-helpers (1.2.1)
|
182
350
|
sprockets (>= 2.2)
|
183
351
|
thor (0.19.1)
|
184
352
|
thread_safe (0.3.5)
|
185
|
-
tilt (
|
353
|
+
tilt (2.0.2)
|
354
|
+
trollop (2.1.2)
|
186
355
|
tzinfo (1.2.2)
|
187
356
|
thread_safe (~> 0.1)
|
188
|
-
|
357
|
+
uglifier (2.7.2)
|
358
|
+
execjs (>= 0.3.0)
|
359
|
+
json (>= 1.8.0)
|
360
|
+
vcr (3.0.1)
|
361
|
+
vegas (0.1.11)
|
362
|
+
rack (>= 1.0.0)
|
363
|
+
webmock (1.24.2)
|
364
|
+
addressable (>= 2.3.6)
|
365
|
+
crack (>= 0.3.2)
|
366
|
+
hashdiff
|
367
|
+
xml-simple (1.1.5)
|
189
368
|
|
190
369
|
PLATFORMS
|
191
370
|
ruby
|
192
371
|
|
193
372
|
DEPENDENCIES
|
194
373
|
bundler (~> 1.5)
|
374
|
+
erb_latex!
|
195
375
|
faker
|
196
376
|
growl
|
197
377
|
guard
|
@@ -201,6 +381,8 @@ DEPENDENCIES
|
|
201
381
|
puma
|
202
382
|
rake
|
203
383
|
stockor!
|
384
|
+
vcr (~> 3.0)
|
385
|
+
webmock (~> 1.22)
|
204
386
|
|
205
387
|
BUNDLED WITH
|
206
|
-
1.
|
388
|
+
1.11.2
|
data/Guardfile
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,28 @@
|
|
1
1
|
# Stockor
|
2
2
|
|
3
|
-
|
3
|
+
## A business management system for freelancers, contractors and small business owners.
|
4
4
|
|
5
|
-
|
5
|
+
### Features
|
6
6
|
|
7
|
-
|
7
|
+
* Per Project/Customer Time Tracking
|
8
|
+
* Sales Orders and Invoicing
|
9
|
+
* Customers and Vendors
|
10
|
+
* Completely web-based, user interface is React / Bootstrap
|
11
|
+
* Mobile friendly, screens are responsive
|
12
|
+
* Chart of Accounts and double-entry General Ledger.
|
13
|
+
* Real-time updates for multi-user access
|
14
|
+
* Released under the open-source AGPL3 license
|
15
|
+
|
16
|
+
|
17
|
+
### Demo
|
18
|
+
A demo that shows off portions of the interface is available at [demo.stockor.com](http://demo.stockor.com/). The demo is set to randomly create updates for the `STOCKOR` customer and vendor. If you load one of those records you should be able to observe the updates occur.
|
19
|
+
|
20
|
+
### Tech stack
|
21
|
+
|
22
|
+
Stockor's server-side component is written in Ruby on top of the Sinatra derived [Lanes framework](https://github.com/argosity/lanes). It borrows several familiar libraries from Rails such as ActiveRecord and Sprockets.
|
23
|
+
|
24
|
+
The web interface is React and Bootstrap. There's a bit of light customization on the class creation to seamlessly support a custom data layer that's built off of [ampersand state](https://github.com/AmpersandJS/ampersand-state).
|
25
|
+
|
26
|
+
### Contributing and bug reports
|
27
|
+
|
28
|
+
Are welcome ;-) Typical github flow - file a issue or pull request. If you'd like to chat about anything Stockor related feel free to drop us a line at contact@argosity.com
|
data/app.json
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
{
|
2
|
+
"name": "Stockor",
|
3
|
+
"description": "Stockor is a business management system.",
|
4
|
+
"keywords": [
|
5
|
+
"invoice",
|
6
|
+
"erp",
|
7
|
+
"productivity"
|
8
|
+
],
|
9
|
+
"website": "http://stockor.org/",
|
10
|
+
"repository": "https://github.com/argosity/stockor",
|
11
|
+
"logo": "http://stockor.org/images/logo.png",
|
12
|
+
"success_url": "/",
|
13
|
+
"scripts": {
|
14
|
+
"postdeploy": "bundle exec lanes db migrate && bundle exec lanes db seed"
|
15
|
+
},
|
16
|
+
"env": {},
|
17
|
+
"image": "heroku/ruby",
|
18
|
+
"addons": [
|
19
|
+
"heroku-redis"
|
20
|
+
],
|
21
|
+
"buildpacks": [
|
22
|
+
{
|
23
|
+
"url": "git://github.com/syphar/heroku-buildpack-tex.git"
|
24
|
+
}, {
|
25
|
+
"url": "git://github.com/heroku/heroku-buildpack-ruby.git"
|
26
|
+
}
|
27
|
+
]
|
28
|
+
}
|
data/client/skr/Extension.coffee
CHANGED
@@ -5,10 +5,28 @@ class Skr.Extension extends Lanes.Extensions.Base
|
|
5
5
|
# Data that is provided by lib/skr/extension.rb's
|
6
6
|
# client_bootstrap_data method ends up here
|
7
7
|
setBootstrapData: (data) ->
|
8
|
+
Lanes.Models.Query.LIKE_QUERY_TYPES.push 'visible_id'
|
8
9
|
Skr.Models.GlAccount.initialize(
|
9
10
|
accounts: data.gl_accounts
|
10
11
|
default_ids: data.default_gl_account_ids,
|
11
12
|
)
|
13
|
+
Skr.Models.Location.initialize(
|
14
|
+
locations: data.locations
|
15
|
+
)
|
16
|
+
Skr.Models.PaymentTerm.initialize(
|
17
|
+
payment_terms: data.payment_terms
|
18
|
+
)
|
19
|
+
for type, choices of data.templates
|
20
|
+
klass = Skr.Models[_.classify(type)]
|
21
|
+
if klass
|
22
|
+
klass.Templates = choices
|
23
|
+
else
|
24
|
+
console.log "Unable to find model for #{type}"
|
12
25
|
|
13
26
|
rootComponent: (viewport) ->
|
14
27
|
Lanes.Workspace.Layout
|
28
|
+
|
29
|
+
preferenceElement: (props) ->
|
30
|
+
React.createElement(SC.UserPreferences, key: 'skr')
|
31
|
+
settingsElement: (props) ->
|
32
|
+
React.createElement(SC.SystemSettings, key: 'skr')
|
@@ -0,0 +1,34 @@
|
|
1
|
+
class Skr.Components.BankAccountFinder extends Lanes.React.Component
|
2
|
+
|
3
|
+
propTypes:
|
4
|
+
model: Lanes.PropTypes.Model
|
5
|
+
commands: React.PropTypes.object
|
6
|
+
autoFocus: React.PropTypes.bool
|
7
|
+
name: React.PropTypes.string
|
8
|
+
selectField: React.PropTypes.bool
|
9
|
+
|
10
|
+
getDefaultProps: ->
|
11
|
+
autoFocus: false, label: 'Bank Account', name: 'code'
|
12
|
+
|
13
|
+
dataObjects:
|
14
|
+
query: ->
|
15
|
+
new Lanes.Models.Query({
|
16
|
+
syncOptions: @props.syncOptions, autoRetrieve: true
|
17
|
+
src: Skr.Models.BankAccount, fields: [
|
18
|
+
{id:'id', visible: false}
|
19
|
+
{id: 'code', fixedWidth: 130 },
|
20
|
+
{id: 'name', flex: 1}
|
21
|
+
{id: 'description', flex: 1.5}
|
22
|
+
]
|
23
|
+
})
|
24
|
+
|
25
|
+
render: ->
|
26
|
+
props = _.clone(@props)
|
27
|
+
|
28
|
+
if props.selectField
|
29
|
+
<LC.SelectField queryModel={Skr.Models.BankAccount} sm=2 {...props} />
|
30
|
+
else
|
31
|
+
<LC.RecordFinder ref="finder" sm=3 autoFocus
|
32
|
+
commands={@props.commands}
|
33
|
+
query={@query}
|
34
|
+
{...props} />
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class Skr.Components.Currency extends Lanes.React.Component
|
2
|
+
|
3
|
+
getDefaultProps: ->
|
4
|
+
amount: _.bigDecimal('0.0')
|
5
|
+
symbol: '$'
|
6
|
+
|
7
|
+
propTypes:
|
8
|
+
amount: React.PropTypes.oneOfType([
|
9
|
+
React.PropTypes.number,
|
10
|
+
React.PropTypes.instanceOf(_.bigDecimal)
|
11
|
+
])
|
12
|
+
symbol: React.PropTypes.string
|
13
|
+
|
14
|
+
render: ->
|
15
|
+
className = _.classnames 'currency', @props.className
|
16
|
+
<span {...@props} className={className}>
|
17
|
+
<span className="sym">{@props.symbol}</span>
|
18
|
+
{Lanes.u.format.currency(@props.amount)}
|
19
|
+
</span>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
class Skr.Components.CustomerFinder extends Lanes.React.Component
|
2
|
+
|
3
|
+
propTypes:
|
4
|
+
model: Lanes.PropTypes.Model.isRequired
|
5
|
+
commands: React.PropTypes.object
|
6
|
+
autoFocus: React.PropTypes.bool
|
7
|
+
name: React.PropTypes.string
|
8
|
+
selectField: React.PropTypes.bool
|
9
|
+
|
10
|
+
getDefaultProps: ->
|
11
|
+
autoFocus: false, label: 'Customer Code', name: 'customer'
|
12
|
+
|
13
|
+
dataObjects:
|
14
|
+
query: ->
|
15
|
+
new Lanes.Models.Query({
|
16
|
+
syncOptions: @props.syncOptions, autoRetrieve: true
|
17
|
+
src: Skr.Models.Customer, fields: [
|
18
|
+
{id:'id', visible: false}
|
19
|
+
{ id: 'code', fixedWidth: 130 }, 'name', 'notes',
|
20
|
+
{ id: 'open_balance', fixedWidth: 100, textAlign: 'right', format: (v) ->
|
21
|
+
if v then _.bigDecimal(v).toFixed(2) else '0.00'
|
22
|
+
}
|
23
|
+
]
|
24
|
+
})
|
25
|
+
|
26
|
+
render: ->
|
27
|
+
props = _.clone(@props)
|
28
|
+
if @model.hasAttribute('customer_code')
|
29
|
+
props.defaultLabel = @model.customer_code
|
30
|
+
|
31
|
+
if props.selectField
|
32
|
+
<LC.SelectField sm=2 labelField="code" {...props} />
|
33
|
+
else
|
34
|
+
<LC.RecordFinder ref="finder" sm=3 autoFocus
|
35
|
+
commands={@props.commands}
|
36
|
+
query={@query}
|
37
|
+
{...props} />
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class Skr.Components.CustomerLink extends Lanes.React.Component
|
2
|
+
propTypes:
|
3
|
+
onClick: React.PropTypes.func
|
4
|
+
customer: React.PropTypes.instanceOf(Skr.Models.Customer)
|
5
|
+
|
6
|
+
onClick: ->
|
7
|
+
@props.onClick?()
|
8
|
+
@props.customer.withAssociations(['billing_address', 'shipping_address']).then =>
|
9
|
+
Lanes.Screens.Definitions.all.get('customer-maint')
|
10
|
+
.display(props: {customer: @props.customer})
|
11
|
+
|
12
|
+
render: ->
|
13
|
+
<a href='#' onClick={@onClick}>{@props.customer.code}</a>
|