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
@@ -2,17 +2,19 @@ class Skr.Models.PickTicket extends Skr.Models.Base
|
|
2
2
|
|
3
3
|
|
4
4
|
props:
|
5
|
-
id: {
|
6
|
-
visible_id: {
|
7
|
-
sales_order_id:{
|
8
|
-
location_id: {
|
5
|
+
id: {type:"integer"}
|
6
|
+
visible_id: {type:"visible_id"}
|
7
|
+
sales_order_id:{type:"integer"}
|
8
|
+
location_id: {type:"integer"}
|
9
9
|
shipped_at: "any"
|
10
10
|
is_complete: "boolean"
|
11
11
|
|
12
|
+
mixins: [ 'HasVisibleId' ]
|
13
|
+
|
12
14
|
associations:
|
13
15
|
sales_order: { model: "SalesOrder" }
|
14
16
|
invoice: { model: "Invoice" }
|
15
17
|
location: { model: "Location" }
|
16
18
|
customer: { model: "Customer" }
|
17
19
|
terms: { model: "PaymentTerm" }
|
18
|
-
lines: { collection: "PtLine" }
|
20
|
+
lines: { collection: "PtLine", inverse: 'pick_ticket' }
|
@@ -2,21 +2,21 @@ class Skr.Models.PoLine extends Skr.Models.Base
|
|
2
2
|
|
3
3
|
|
4
4
|
props:
|
5
|
-
id: {
|
6
|
-
purchase_order_id:{
|
7
|
-
sku_loc_id: {
|
8
|
-
sku_vendor_id: {
|
9
|
-
part_code: {
|
10
|
-
sku_code: {
|
11
|
-
description: {
|
12
|
-
uom_code: {
|
13
|
-
uom_size: {
|
14
|
-
position: {
|
15
|
-
qty: {
|
16
|
-
qty_received: {
|
17
|
-
qty_canceled: {
|
18
|
-
price: {
|
19
|
-
is_revised: {
|
5
|
+
id: {type:"integer"}
|
6
|
+
purchase_order_id:{type:"integer"}
|
7
|
+
sku_loc_id: {type:"integer"}
|
8
|
+
sku_vendor_id: {type:"integer"}
|
9
|
+
part_code: {type:"string"}
|
10
|
+
sku_code: {type:"string"}
|
11
|
+
description: {type:"string"}
|
12
|
+
uom_code: {type:"string"}
|
13
|
+
uom_size: {type:"integer"}
|
14
|
+
position: {type:"integer"}
|
15
|
+
qty: {type:"integer", "default":"0"}
|
16
|
+
qty_received: {type:"integer", "default":"0"}
|
17
|
+
qty_canceled: {type:"integer", "default":"0"}
|
18
|
+
price: {type:"bigdec"}
|
19
|
+
is_revised: {type:"boolean", default:false}
|
20
20
|
|
21
21
|
associations:
|
22
22
|
purchase_order: { model: "PurchaseOrder" }
|
@@ -2,15 +2,17 @@ class Skr.Models.PoReceipt extends Skr.Models.Base
|
|
2
2
|
|
3
3
|
|
4
4
|
props:
|
5
|
-
id: {
|
6
|
-
visible_id: {
|
7
|
-
location_id: {
|
8
|
-
freight: {
|
9
|
-
purchase_order_id:{
|
10
|
-
vendor_id: {
|
5
|
+
id: {type:"integer"}
|
6
|
+
visible_id: {type:"visible_id"}
|
7
|
+
location_id: {type:"integer"}
|
8
|
+
freight: {type:"bigdec", "default":"0.0"}
|
9
|
+
purchase_order_id:{type:"integer"}
|
10
|
+
vendor_id: {type:"integer"}
|
11
11
|
voucher_id: "integer"
|
12
12
|
refno: "string"
|
13
13
|
|
14
|
+
mixins: [ 'HasVisibleId' ]
|
15
|
+
|
14
16
|
associations:
|
15
17
|
purchase_order: { model: "PurchaseOrder" }
|
16
18
|
vendor: { model: "Vendor" }
|
@@ -2,19 +2,19 @@ class Skr.Models.PorLine extends Skr.Models.Base
|
|
2
2
|
|
3
3
|
|
4
4
|
props:
|
5
|
-
id: {
|
6
|
-
po_receipt_id:{
|
5
|
+
id: {type:"integer"}
|
6
|
+
po_receipt_id:{type:"integer"}
|
7
7
|
po_line_id: "integer"
|
8
|
-
sku_loc_id: {
|
8
|
+
sku_loc_id: {type:"integer"}
|
9
9
|
sku_vendor_id:"integer"
|
10
|
-
sku_code: {
|
11
|
-
part_code: {
|
12
|
-
description: {
|
13
|
-
uom_code: {
|
14
|
-
uom_size: {
|
15
|
-
position: {
|
16
|
-
qty: {
|
17
|
-
price: {
|
10
|
+
sku_code: {type:"string"}
|
11
|
+
part_code: {type:"string"}
|
12
|
+
description: {type:"string"}
|
13
|
+
uom_code: {type:"string"}
|
14
|
+
uom_size: {type:"integer"}
|
15
|
+
position: {type:"integer"}
|
16
|
+
qty: {type:"integer", "default":"0"}
|
17
|
+
price: {type:"bigdec"}
|
18
18
|
|
19
19
|
associations:
|
20
20
|
po_receipt: { model: "PoReceipt" }
|
@@ -2,20 +2,20 @@ class Skr.Models.PtLine extends Skr.Models.Base
|
|
2
2
|
|
3
3
|
|
4
4
|
props:
|
5
|
-
id: {
|
6
|
-
pick_ticket_id:{
|
7
|
-
so_line_id: {
|
8
|
-
sku_loc_id: {
|
9
|
-
price: {
|
10
|
-
sku_code: {
|
11
|
-
description: {
|
12
|
-
uom_code: {
|
5
|
+
id: {type:"integer"}
|
6
|
+
pick_ticket_id:{type:"integer"}
|
7
|
+
so_line_id: {type:"integer"}
|
8
|
+
sku_loc_id: {type:"integer"}
|
9
|
+
price: {type:"bigdec"}
|
10
|
+
sku_code: {type:"string"}
|
11
|
+
description: {type:"string"}
|
12
|
+
uom_code: {type:"string"}
|
13
13
|
bin: "string"
|
14
|
-
uom_size: {
|
15
|
-
position: {
|
16
|
-
qty: {
|
17
|
-
qty_invoiced: {
|
18
|
-
is_complete: {
|
14
|
+
uom_size: {type:"integer"}
|
15
|
+
position: {type:"integer"}
|
16
|
+
qty: {type:"integer", "default":"0"}
|
17
|
+
qty_invoiced: {type:"integer", "default":"0"}
|
18
|
+
is_complete: {type:"boolean", default:false}
|
19
19
|
|
20
20
|
associations:
|
21
21
|
pick_ticket: { model: "PickTicket" }
|
@@ -2,17 +2,19 @@ class Skr.Models.PurchaseOrder extends Skr.Models.Base
|
|
2
2
|
|
3
3
|
|
4
4
|
props:
|
5
|
-
id: {
|
6
|
-
visible_id: {
|
7
|
-
vendor_id: {
|
8
|
-
location_id: {
|
9
|
-
ship_addr_id: {
|
10
|
-
terms_id: {
|
11
|
-
state: {
|
12
|
-
is_revised: {
|
13
|
-
order_date: {
|
5
|
+
id: {type:"integer"}
|
6
|
+
visible_id: {type:"visible_id"}
|
7
|
+
vendor_id: {type:"integer"}
|
8
|
+
location_id: {type:"integer"}
|
9
|
+
ship_addr_id: {type:"integer"}
|
10
|
+
terms_id: {type:"integer"}
|
11
|
+
state: {type:"integer"}
|
12
|
+
is_revised: {type:"boolean", default:false}
|
13
|
+
order_date: {type:"any"}
|
14
14
|
receiving_completed_at:"date"
|
15
15
|
|
16
|
+
mixins: [ 'HasVisibleId' ]
|
17
|
+
|
16
18
|
enums:
|
17
19
|
state:
|
18
20
|
open: 1
|
@@ -1,22 +1,40 @@
|
|
1
1
|
class Skr.Models.SalesOrder extends Skr.Models.Base
|
2
2
|
|
3
3
|
props:
|
4
|
-
id: {
|
5
|
-
visible_id: {
|
6
|
-
customer_id: {
|
7
|
-
location_id: {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
4
|
+
id: {type:"integer"}
|
5
|
+
visible_id: {type:"visible_id"}
|
6
|
+
customer_id: {type:"integer"}
|
7
|
+
location_id: {type:"integer", default: ->
|
8
|
+
Skr.Models.Location.default.id
|
9
|
+
}
|
10
|
+
shipping_address_id:{type:"integer"}
|
11
|
+
billing_address_id: {type:"integer"}
|
12
|
+
terms_id: {type:"integer"}
|
13
|
+
order_date: {type:"date", default: ->
|
14
|
+
new Date
|
15
|
+
}
|
16
|
+
state: {type:"integer"}
|
17
|
+
is_revised: {type:"boolean", default:false}
|
18
|
+
hash_code: {type:"string"}
|
19
|
+
ship_partial: {type:"boolean", default:false}
|
20
|
+
form: "string"
|
16
21
|
po_num: "string"
|
17
|
-
notes: "string"
|
22
|
+
notes: {type: "string"}
|
18
23
|
options: "any"
|
19
24
|
|
25
|
+
mixins: [ 'PrintSupport', 'HasVisibleId' ]
|
26
|
+
|
27
|
+
# optional attributes from details view
|
28
|
+
session:
|
29
|
+
customer_code: {type:"string"}
|
30
|
+
order_total: {type:"bigdec"}
|
31
|
+
|
32
|
+
derived:
|
33
|
+
total: deps: ['order_total'], fn: ->
|
34
|
+
@order_total or @lines.reduce( (t, l) ->
|
35
|
+
t.plus(l.total)
|
36
|
+
, _.bigDecimal(0))
|
37
|
+
|
20
38
|
enums:
|
21
39
|
state:
|
22
40
|
open: 1
|
@@ -24,12 +42,31 @@ class Skr.Models.SalesOrder extends Skr.Models.Base
|
|
24
42
|
canceled: 9
|
25
43
|
|
26
44
|
associations:
|
27
|
-
customer: { model: "Customer" }
|
28
|
-
location: { model: "Location"
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
invoices: { collection: "Invoice" }
|
45
|
+
customer: { model: "Customer", required: true }
|
46
|
+
location: { model: "Location", required: true, default: ->
|
47
|
+
Skr.Models.Location.all.get(@location_id) if @location_id
|
48
|
+
}
|
49
|
+
terms: { model: "PaymentTerm" }
|
50
|
+
billing_address: { model: "Address" }
|
51
|
+
shipping_address: { model: "Address" }
|
52
|
+
|
53
|
+
invoices: { collection: "Invoice", inverse: 'sales_order' }
|
54
|
+
lines: { collection: "SoLine", inverse: 'sales_order', fk: 'sales_order_id', }
|
55
|
+
pick_tickets: { collection: "PickTicket", inverse: 'sales_order' }
|
56
|
+
|
57
|
+
events:
|
58
|
+
'change:customer': 'onCustomerChange'
|
59
|
+
'lines add remove change:total': 'onTotalChange'
|
60
|
+
|
61
|
+
onTotalChange: ->
|
62
|
+
@trigger('change', @, {})
|
63
|
+
@unCacheDerived('total')
|
64
|
+
@unset('order_total')
|
65
|
+
|
66
|
+
onCustomerChange: ->
|
67
|
+
return unless @isNew()
|
68
|
+
associations = ['billing_address', 'shipping_address']
|
69
|
+
|
70
|
+
@customer.withAssociations(associations).then =>
|
71
|
+
for name in associations
|
72
|
+
@associations.replace(@, name, @customer[name])
|
@@ -2,23 +2,25 @@ class Skr.Models.Sku extends Skr.Models.Base
|
|
2
2
|
|
3
3
|
|
4
4
|
props:
|
5
|
-
id: {
|
6
|
-
default_vendor_id: {
|
7
|
-
gl_asset_account_id: {
|
5
|
+
id: {type:"integer"}
|
6
|
+
default_vendor_id: {type:"integer"}
|
7
|
+
gl_asset_account_id: {type:"integer", default: ->
|
8
8
|
Skr.Models.GlAccount.default_ids.asset
|
9
9
|
}
|
10
|
-
default_uom_code: {
|
11
|
-
code: {
|
12
|
-
description: {
|
13
|
-
is_other_charge: {
|
14
|
-
does_track_inventory:{
|
15
|
-
can_backorder: {
|
10
|
+
default_uom_code: {type:"string"}
|
11
|
+
code: {type:"code", required:true}
|
12
|
+
description: {type:"string", required:true}
|
13
|
+
is_other_charge: {type:"boolean", default:false}
|
14
|
+
does_track_inventory:{type:"boolean", default:false}
|
15
|
+
can_backorder: {type:"boolean", default:false}
|
16
|
+
|
17
|
+
mixins: ['HasCodeField']
|
16
18
|
|
17
19
|
associations:
|
18
|
-
default_vendor: { model: "Vendor" }
|
19
|
-
gl_asset_account: { model: "GlAccount", default: ->
|
20
|
-
Skr.Models.GlAccount.
|
20
|
+
default_vendor: { model: "Vendor", required: true}
|
21
|
+
gl_asset_account: { model: "GlAccount", required: true, default: ->
|
22
|
+
Skr.Models.GlAccount.all.get(this.gl_asset_account_id)
|
21
23
|
}
|
22
|
-
sku_locs: { collection: "SkuLoc" }
|
23
|
-
sku_vendors: { collection: "SkuVendor" }
|
24
|
-
uoms: { collection: "Uom" }
|
24
|
+
sku_locs: { collection: "SkuLoc", required: true}
|
25
|
+
sku_vendors: { collection: "SkuVendor", required: true }
|
26
|
+
uoms: { collection: "Uom", inverse: 'sku' }
|
@@ -2,19 +2,24 @@ class Skr.Models.SkuLoc extends Skr.Models.Base
|
|
2
2
|
|
3
3
|
|
4
4
|
props:
|
5
|
-
id: {
|
6
|
-
sku_id: {
|
7
|
-
location_id: {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
id: {type:"integer"}
|
6
|
+
sku_id: {type:"integer"}
|
7
|
+
location_id: {type:"integer", default: ->
|
8
|
+
Skr.Models.Location.default.id
|
9
|
+
}
|
10
|
+
mac: {type:"bigdec", "default":"0.0"}
|
11
|
+
qty: {type:"integer", "default":"0"}
|
12
|
+
qty_allocated:{type:"integer", "default":"0"}
|
13
|
+
qty_picking: {type:"integer", "default":"0"}
|
14
|
+
qty_reserved: {type:"integer", "default":"0"}
|
13
15
|
bin: "string"
|
16
|
+
sku_code: {type:"string"}
|
14
17
|
|
15
18
|
associations:
|
16
19
|
sku: { model: "Sku" }
|
17
|
-
location: { model: "Location"
|
20
|
+
location: { model: "Location", default: ->
|
21
|
+
Skr.Models.Location.all.get(this.location_id)
|
22
|
+
}
|
18
23
|
so_lines: { collection: "SoLine" }
|
19
24
|
pt_lines: { collection: "PtLine" }
|
20
25
|
sku_vendors: { collection: "SkuVendor" }
|
@@ -2,18 +2,18 @@ class Skr.Models.SkuTran extends Skr.Models.Base
|
|
2
2
|
|
3
3
|
|
4
4
|
props:
|
5
|
-
id: {
|
5
|
+
id: {type:"integer"}
|
6
6
|
origin_id: "integer"
|
7
7
|
origin_type: "string"
|
8
|
-
sku_loc_id: {
|
9
|
-
cost: {
|
10
|
-
origin_description:{
|
11
|
-
prior_qty: {
|
12
|
-
mac: {
|
13
|
-
prior_mac: {
|
14
|
-
qty: {
|
15
|
-
uom_code: {
|
16
|
-
uom_size: {
|
8
|
+
sku_loc_id: {type:"integer"}
|
9
|
+
cost: {type:"bigdec"}
|
10
|
+
origin_description:{type:"string"}
|
11
|
+
prior_qty: {type:"integer"}
|
12
|
+
mac: {type:"bigdec"}
|
13
|
+
prior_mac: {type:"bigdec"}
|
14
|
+
qty: {type:"integer", "default":"0"}
|
15
|
+
uom_code: {type:"string", "default":"EA"}
|
16
|
+
uom_size: {type:"integer", "default":"1"}
|
17
17
|
|
18
18
|
associations:
|
19
19
|
sku_loc: { model: "SkuLoc" }
|
@@ -2,15 +2,15 @@ class Skr.Models.SkuVendor extends Skr.Models.Base
|
|
2
2
|
|
3
3
|
|
4
4
|
props:
|
5
|
-
id: {
|
6
|
-
sku_id: {
|
7
|
-
vendor_id: {
|
8
|
-
list_price:{
|
9
|
-
part_code: {
|
10
|
-
is_active: {
|
11
|
-
uom_size: {
|
12
|
-
uom_code: {
|
13
|
-
cost: {
|
5
|
+
id: {type:"integer"}
|
6
|
+
sku_id: {type:"integer"}
|
7
|
+
vendor_id: {type:"integer"}
|
8
|
+
list_price:{type:"bigdec"}
|
9
|
+
part_code: {type:"string"}
|
10
|
+
is_active: {type:"boolean", default:true}
|
11
|
+
uom_size: {type:"integer", "default":"1"}
|
12
|
+
uom_code: {type:"string", "default":"EA"}
|
13
|
+
cost: {type:"bigdec"}
|
14
14
|
|
15
15
|
associations:
|
16
16
|
sku: { model: "Sku" }
|
@@ -1,26 +1,33 @@
|
|
1
1
|
class Skr.Models.SoLine extends Skr.Models.Base
|
2
2
|
|
3
|
+
mixins: [ Skr.Models.Mixins.SkuLine ]
|
3
4
|
|
4
5
|
props:
|
5
|
-
id: {
|
6
|
-
sales_order_id:{
|
7
|
-
sku_loc_id: {
|
8
|
-
price: {
|
9
|
-
sku_code: {
|
10
|
-
description: {
|
11
|
-
uom_code: {
|
12
|
-
uom_size: {
|
13
|
-
position: {
|
14
|
-
qty: {
|
15
|
-
qty_allocated: {
|
16
|
-
qty_picking: {
|
17
|
-
qty_invoiced: {
|
18
|
-
qty_canceled: {
|
19
|
-
is_revised: {
|
6
|
+
id: {type:"integer"}
|
7
|
+
sales_order_id:{type:"integer"}
|
8
|
+
sku_loc_id: {type:"integer"}
|
9
|
+
price: {type:"bigdec"}
|
10
|
+
sku_code: {type:"string"}
|
11
|
+
description: {type:"string"}
|
12
|
+
uom_code: {type:"string", default: 'EA'}
|
13
|
+
uom_size: {type:"integer", default: 1}
|
14
|
+
position: {type:"integer"}
|
15
|
+
qty: {type:"bigdec", default:"0"}
|
16
|
+
qty_allocated: {type:"bigdec", default:"0"}
|
17
|
+
qty_picking: {type:"bigdec", default:"0"}
|
18
|
+
qty_invoiced: {type:"bigdec", default:"0"}
|
19
|
+
qty_canceled: {type:"bigdec", default:"0"}
|
20
|
+
is_revised: {type:"boolean", default:false}
|
21
|
+
|
22
|
+
session:
|
23
|
+
sku_id: {type: 'integer'}
|
20
24
|
|
21
25
|
associations:
|
22
|
-
sales_order: { model: "SalesOrder"
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
26
|
+
sales_order: { model: "SalesOrder" }
|
27
|
+
|
28
|
+
modelForAccess: ->
|
29
|
+
@sales_order || this
|
30
|
+
|
31
|
+
dataForSave: ->
|
32
|
+
# so lines should never send associations
|
33
|
+
super(excludeAssociations: true)
|
@@ -0,0 +1,75 @@
|
|
1
|
+
class Skr.Models.TimeEntry extends Skr.Models.Base
|
2
|
+
|
3
|
+
props:
|
4
|
+
id: {"type":"integer"}
|
5
|
+
customer_project_id:{"type":"integer"}
|
6
|
+
is_invoiced: {"type":"boolean", default:false}
|
7
|
+
lanes_user_id: {"type":"integer", default: ->
|
8
|
+
Lanes.current_user.id
|
9
|
+
}
|
10
|
+
start_at: {"type":"date", required: true, default: ->
|
11
|
+
new Date
|
12
|
+
}
|
13
|
+
end_at: {"type":"date", required: true, default: ->
|
14
|
+
d = new Date; d.setHours(d.getHours() + 1)
|
15
|
+
}
|
16
|
+
description: {"type":"string", required: true, default: 'New Event'}
|
17
|
+
|
18
|
+
session:
|
19
|
+
hours: { "type":"bigdec" }
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
associations:
|
24
|
+
customer_project: { model: "CustomerProject", required: true }
|
25
|
+
|
26
|
+
derived:
|
27
|
+
range: deps: ['start_at', 'end_at'], fn: ->
|
28
|
+
_.moment.range(@start_at, @end_at)
|
29
|
+
|
30
|
+
content: deps: ['start_at', 'end_at', 'description'], fn: ->
|
31
|
+
this.range.end.diff(this.range.start, 'hour', true).toFixed(2) +
|
32
|
+
" hours: " + @description
|
33
|
+
|
34
|
+
initialize: ->
|
35
|
+
@updateHours() if @start_at and @end_at
|
36
|
+
|
37
|
+
events:
|
38
|
+
'change:end_at' : 'onEndChange'
|
39
|
+
'change:start_at' : 'onStartChange'
|
40
|
+
'change:hours' : 'onHoursChange'
|
41
|
+
|
42
|
+
onEndChange: (te, val) ->
|
43
|
+
@start_at = _.moment(@end_at).add(1, 'hour') if @start_at > @end_at
|
44
|
+
@updateHours()
|
45
|
+
onStartChange: (te, val) ->
|
46
|
+
@end_at = _.moment(@start_at).add(1, 'hour') if @start_at > @end_at
|
47
|
+
@updateHours()
|
48
|
+
|
49
|
+
updateHours: ->
|
50
|
+
@set('hours', _.moment(this.end_at).diff(this.start_at, 'hour', true).toFixed(2),
|
51
|
+
silent: true)
|
52
|
+
onHoursChange: ->
|
53
|
+
@end_at = _.moment(@start_at).add(@hours.toFixed(), 'hour').toDate()
|
54
|
+
|
55
|
+
length: (duration = 'hour') ->
|
56
|
+
@range.end.diff(@range.start, duration, true)
|
57
|
+
|
58
|
+
lengthInRange: (range, duration = 'hour') ->
|
59
|
+
_.moment.min(@range.end, range.end).diff(
|
60
|
+
_.moment.max(@range.start, range.start), duration, true
|
61
|
+
)
|
62
|
+
|
63
|
+
toCalEvent: ->
|
64
|
+
attrs = {entry: this, range: @range, content: @content, resizable: {step: 15}}
|
65
|
+
project = @collection.projectForEntry(this)
|
66
|
+
if project?.options
|
67
|
+
_.extend attrs, colorIndex: project.options.color
|
68
|
+
attrs
|
69
|
+
|
70
|
+
fromCalEvent: (event) ->
|
71
|
+
attrs =
|
72
|
+
id: event.entryId,
|
73
|
+
start_at: event.start()
|
74
|
+
end_at: event.end()
|
75
|
+
this.set(_.pick(attrs, _.identity))
|
@@ -1,16 +1,37 @@
|
|
1
1
|
class Skr.Models.Uom extends Skr.Models.Base
|
2
2
|
|
3
|
-
|
4
3
|
props:
|
5
|
-
id: {
|
6
|
-
sku_id:{
|
7
|
-
price: {
|
8
|
-
size: {
|
9
|
-
code: {
|
4
|
+
id: {type:"integer"}
|
5
|
+
sku_id:{type:"integer"}
|
6
|
+
price: {type:"bigdec", required:true}
|
7
|
+
size: {type:"integer", default: 1}
|
8
|
+
code: {type:"string", required:true, default: "EA"}
|
10
9
|
weight:"bigdec"
|
11
10
|
height:"bigdec"
|
12
11
|
width: "bigdec"
|
13
12
|
depth: "bigdec"
|
14
13
|
|
14
|
+
derived:
|
15
|
+
combined:
|
16
|
+
deps: ['size', 'code'], fn: ->
|
17
|
+
if @size is 1 then @code else "#{@code}/#{@size}"
|
18
|
+
|
19
|
+
isDefault:
|
20
|
+
deps: ['code', 'sku'], fn: ->
|
21
|
+
@sku.default_uom_code is @code
|
22
|
+
|
15
23
|
associations:
|
16
24
|
sku: { model: "Sku" }
|
25
|
+
|
26
|
+
eq: (other) ->
|
27
|
+
other.size is @size and other.code is @code
|
28
|
+
|
29
|
+
setDefault: ->
|
30
|
+
this.sku.default_uom_code = @code
|
31
|
+
|
32
|
+
constructor: ->
|
33
|
+
super
|
34
|
+
@sku.on('change:default_uom_code', ->
|
35
|
+
@trigger('change', @, {})
|
36
|
+
@unCacheDerived('total')
|
37
|
+
, this)
|