From 6be1dd5a3a8bad8f165f563a27a43e8984fc7204 Mon Sep 17 00:00:00 2001 From: tanshu Date: Fri, 25 May 2018 19:19:00 +0530 Subject: [PATCH] Moved to Angular 6.0 ---- Pending * Table width for the points column in incentive * Linting * keyboard navigation where it was used earlier * can remove the unused totals calculated serverside in productledger * spinner and loading bars * Activate Guard for Employee Function tabs * Progress for Fingerprint uploads * deleted reconcile and receipe features as they were not being used * focus the right control on component load --- .gitignore | 1 + brewman/models/master.py | 10 +- brewman/routes.py | 27 +- brewman/static/package.json | 43 - brewman/static/src/app/404.html | 7 - .../src/app/account/account-detail.html | 54 -- .../src/app/account/account-list.component.js | 9 - .../app/account/account-list.component.js.map | 1 - .../src/app/account/account-list.component.ts | 7 - .../app/account/account-list.controller.js | 84 -- .../account/account-list.controller.js.map | 1 - .../app/account/account-list.controller.ts | 87 -- .../static/src/app/account/account-list.html | 34 - .../src/app/account/account-list.resolver.js | 7 - .../app/account/account-list.resolver.js.map | 1 - .../src/app/account/account-list.resolver.ts | 3 - .../src/app/account/account-type.service.js | 7 - .../app/account/account-type.service.js.map | 1 - .../src/app/account/account-type.service.ts | 3 - .../src/app/account/account-types.resolver.js | 7 - .../app/account/account-types.resolver.js.map | 1 - .../src/app/account/account-types.resolver.ts | 4 - .../src/app/account/account.component.js | 9 - .../src/app/account/account.component.js.map | 1 - .../src/app/account/account.component.ts | 7 - .../src/app/account/account.controller.js | 62 -- .../src/app/account/account.controller.js.map | 1 - .../src/app/account/account.controller.ts | 62 -- .../src/app/account/account.resolver.js | 8 - .../src/app/account/account.resolver.js.map | 1 - .../src/app/account/account.resolver.ts | 4 - .../static/src/app/account/account.service.js | 11 - .../src/app/account/account.service.js.map | 1 - .../static/src/app/account/account.service.ts | 8 - .../app/account/payment-accounts.resolver.js | 7 - .../account/payment-accounts.resolver.js.map | 1 - .../app/account/payment-accounts.resolver.ts | 3 - .../app/account/receipt-accounts.resolver.js | 7 - .../account/receipt-accounts.resolver.js.map | 1 - .../app/account/receipt-accounts.resolver.ts | 3 - brewman/static/src/app/app.module.js | 6 - brewman/static/src/app/app.module.js.map | 1 - brewman/static/src/app/app.module.ts | 4 - .../attendance/attendance-info.resolver.js | 14 - .../attendance-info.resolver.js.map | 1 - .../attendance/attendance-info.resolver.ts | 10 - .../attendance/attendance-sub.controller.js | 31 - .../attendance-sub.controller.js.map | 1 - .../attendance/attendance-sub.controller.ts | 35 - .../attendance/attendance-sub.directive.js | 17 - .../attendance-sub.directive.js.map | 1 - .../attendance/attendance-sub.directive.ts | 14 - .../src/app/attendance/attendance-sub.html | 12 - .../attendance/attendance-types.resolver.js | 7 - .../attendance-types.resolver.js.map | 1 - .../attendance/attendance-types.resolver.ts | 3 - .../attendance/attendance-types.service.js | 7 - .../attendance-types.service.js.map | 1 - .../attendance/attendance-types.service.ts | 3 - .../app/attendance/attendance.component.js | 9 - .../attendance/attendance.component.js.map | 1 - .../app/attendance/attendance.component.ts | 7 - .../app/attendance/attendance.controller.js | 38 - .../attendance/attendance.controller.js.map | 1 - .../app/attendance/attendance.controller.ts | 34 - .../static/src/app/attendance/attendance.html | 44 - .../src/app/attendance/attendance.service.js | 7 - .../app/attendance/attendance.service.js.map | 1 - .../src/app/attendance/attendance.service.ts | 3 - .../balance-sheet/balance-sheet.component.js | 9 - .../balance-sheet.component.js.map | 1 - .../balance-sheet/balance-sheet.component.ts | 7 - .../balance-sheet/balance-sheet.controller.js | 27 - .../balance-sheet.controller.js.map | 1 - .../balance-sheet/balance-sheet.controller.ts | 24 - .../src/app/balance-sheet/balance-sheet.html | 48 -- .../balance-sheet/balance-sheet.resolver.js | 14 - .../balance-sheet.resolver.js.map | 1 - .../balance-sheet/balance-sheet.resolver.ts | 11 - .../balance-sheet/balance-sheet.service.js | 7 - .../balance-sheet.service.js.map | 1 - .../balance-sheet/balance-sheet.service.ts | 3 - brewman/static/src/app/base.controller.js | 42 - brewman/static/src/app/base.controller.js.map | 1 - brewman/static/src/app/base.controller.ts | 32 - .../src/app/cash-flow/cash-flow.component.js | 9 - .../app/cash-flow/cash-flow.component.js.map | 1 - .../src/app/cash-flow/cash-flow.component.ts | 7 - .../src/app/cash-flow/cash-flow.controller.js | 42 - .../app/cash-flow/cash-flow.controller.js.map | 1 - .../src/app/cash-flow/cash-flow.controller.ts | 42 - .../static/src/app/cash-flow/cash-flow.html | 87 -- .../src/app/cash-flow/cash-flow.resolver.js | 17 - .../app/cash-flow/cash-flow.resolver.js.map | 1 - .../src/app/cash-flow/cash-flow.resolver.ts | 15 - .../src/app/cash-flow/cash-flow.service.js | 7 - .../app/cash-flow/cash-flow.service.js.map | 1 - .../src/app/cash-flow/cash-flow.service.ts | 3 - .../static/src/app/client/client-detail.html | 42 - .../src/app/client/client-list.component.js | 9 - .../app/client/client-list.component.js.map | 1 - .../src/app/client/client-list.component.ts | 7 - .../src/app/client/client-list.controller.js | 13 - .../app/client/client-list.controller.js.map | 1 - .../src/app/client/client-list.controller.ts | 10 - .../static/src/app/client/client-list.html | 24 - .../src/app/client/client-list.resolver.js | 7 - .../app/client/client-list.resolver.js.map | 1 - .../src/app/client/client-list.resolver.ts | 3 - .../static/src/app/client/client.component.js | 9 - .../src/app/client/client.component.js.map | 1 - .../static/src/app/client/client.component.ts | 7 - .../src/app/client/client.controller.js | 60 -- .../src/app/client/client.controller.js.map | 1 - .../src/app/client/client.controller.ts | 58 -- .../static/src/app/client/client.resolver.js | 8 - .../src/app/client/client.resolver.js.map | 1 - .../static/src/app/client/client.resolver.ts | 4 - .../static/src/app/client/client.service.js | 9 - .../src/app/client/client.service.js.map | 1 - .../static/src/app/client/client.service.ts | 6 - .../closing-stock/closing-stock.component.js | 9 - .../closing-stock.component.js.map | 1 - .../closing-stock/closing-stock.component.ts | 7 - .../closing-stock/closing-stock.controller.js | 27 - .../closing-stock.controller.js.map | 1 - .../closing-stock/closing-stock.controller.ts | 24 - .../src/app/closing-stock/closing-stock.html | 40 - .../closing-stock/closing-stock.resolver.js | 14 - .../closing-stock.resolver.js.map | 1 - .../closing-stock/closing-stock.resolver.ts | 11 - .../closing-stock/closing-stock.service.js | 7 - .../closing-stock.service.js.map | 1 - .../closing-stock/closing-stock.service.ts | 3 - .../src/app/common/accounting.filter.js | 19 - .../src/app/common/accounting.filter.js.map | 1 - .../src/app/common/accounting.filter.ts | 15 - .../static/src/app/common/as-date.filter.js | 10 - .../src/app/common/as-date.filter.js.map | 1 - .../static/src/app/common/as-date.filter.ts | 7 - brewman/static/src/app/common/auth.service.js | 9 - .../static/src/app/common/auth.service.js.map | 1 - brewman/static/src/app/common/auth.service.ts | 5 - brewman/static/src/app/common/clr.filter.js | 12 - .../static/src/app/common/clr.filter.js.map | 1 - brewman/static/src/app/common/clr.filter.ts | 10 - .../src/app/common/credentials.service.js | 10 - .../src/app/common/credentials.service.js.map | 1 - .../src/app/common/credentials.service.ts | 6 - brewman/static/src/app/common/debit.filter.js | 17 - .../static/src/app/common/debit.filter.js.map | 1 - brewman/static/src/app/common/debit.filter.ts | 11 - .../static/src/app/common/fadey.directive.js | 23 - .../src/app/common/fadey.directive.js.map | 1 - .../static/src/app/common/fadey.directive.ts | 21 - .../src/app/common/file-upload.directive.js | 19 - .../app/common/file-upload.directive.js.map | 1 - .../src/app/common/file-upload.directive.ts | 15 - .../src/app/common/focus-on.directive.js | 21 - .../src/app/common/focus-on.directive.js.map | 1 - .../src/app/common/focus-on.directive.ts | 17 - .../static/src/app/common/growl.service.js | 65 -- .../src/app/common/growl.service.js.map | 1 - .../static/src/app/common/growl.service.ts | 63 -- .../src/app/common/journal-debit.filter.js | 18 - .../app/common/journal-debit.filter.js.map | 1 - .../src/app/common/journal-debit.filter.ts | 15 - .../src/app/common/keypress.directive.js | 32 - .../src/app/common/keypress.directive.js.map | 1 - .../src/app/common/keypress.directive.ts | 31 - .../src/app/common/local-time.filter.js | 52 -- .../src/app/common/local-time.filter.js.map | 1 - .../src/app/common/local-time.filter.ts | 51 -- .../src/app/common/math-solver.service.js | 24 - .../src/app/common/math-solver.service.js.map | 1 - .../src/app/common/math-solver.service.ts | 20 - brewman/static/src/app/common/md.filter.js | 11 - .../static/src/app/common/md.filter.js.map | 1 - brewman/static/src/app/common/md.filter.ts | 8 - .../static/src/app/common/message.service.js | 7 - .../src/app/common/message.service.js.map | 1 - .../static/src/app/common/message.service.ts | 3 - .../src/app/common/ng-growl.directive.js | 15 - .../src/app/common/ng-growl.directive.js.map | 1 - .../src/app/common/ng-growl.directive.ts | 11 - .../src/app/common/on-return.directive.js | 21 - .../src/app/common/on-return.directive.js.map | 1 - .../src/app/common/on-return.directive.ts | 17 - .../static/src/app/common/percent.filter.js | 13 - .../src/app/common/percent.filter.js.map | 1 - .../static/src/app/common/percent.filter.ts | 10 - .../static/src/app/common/posted.filter.js | 9 - .../src/app/common/posted.filter.js.map | 1 - .../static/src/app/common/posted.filter.ts | 5 - .../src/app/common/reader-promise.service.js | 42 - .../app/common/reader-promise.service.js.map | 1 - .../src/app/common/reader-promise.service.ts | 46 -- .../src/app/common/saveButtonText.filter.js | 9 - .../app/common/saveButtonText.filter.js.map | 1 - .../src/app/common/saveButtonText.filter.ts | 5 - .../src/app/common/tan-click.directive.js | 31 - .../src/app/common/tan-click.directive.js.map | 1 - .../src/app/common/tan-click.directive.ts | 27 - .../src/app/common/tokenizer.service.js | 129 --- .../src/app/common/tokenizer.service.js.map | 1 - .../src/app/common/tokenizer.service.ts | 145 ---- .../common/upload-image-resizer.service.js | 43 - .../upload-image-resizer.service.js.map | 1 - .../common/upload-image-resizer.service.ts | 52 -- .../static/src/app/common/voucher.service.js | 35 - .../src/app/common/voucher.service.js.map | 1 - .../static/src/app/common/voucher.service.ts | 44 - .../app/cost-centre/cost-centre-detail.html | 16 - .../cost-centre/cost-centre-list.component.js | 9 - .../cost-centre-list.component.js.map | 1 - .../cost-centre/cost-centre-list.component.ts | 7 - .../cost-centre-list.controller.js | 13 - .../cost-centre-list.controller.js.map | 1 - .../cost-centre-list.controller.ts | 10 - .../src/app/cost-centre/cost-centre-list.html | 13 - .../cost-centre/cost-centre-list.resolver.js | 7 - .../cost-centre-list.resolver.js.map | 1 - .../cost-centre/cost-centre-list.resolver.ts | 3 - .../app/cost-centre/cost-centre.component.js | 9 - .../cost-centre/cost-centre.component.js.map | 1 - .../app/cost-centre/cost-centre.component.ts | 7 - .../app/cost-centre/cost-centre.controller.js | 34 - .../cost-centre/cost-centre.controller.js.map | 1 - .../app/cost-centre/cost-centre.controller.ts | 28 - .../app/cost-centre/cost-centre.resolver.js | 8 - .../cost-centre/cost-centre.resolver.js.map | 1 - .../app/cost-centre/cost-centre.resolver.ts | 4 - .../app/cost-centre/cost-centre.service.js | 9 - .../cost-centre/cost-centre.service.js.map | 1 - .../app/cost-centre/cost-centre.service.ts | 6 - .../src/app/daybook/daybook.component.js | 9 - .../src/app/daybook/daybook.component.js.map | 1 - .../src/app/daybook/daybook.component.ts | 7 - .../src/app/daybook/daybook.controller.js | 35 - .../src/app/daybook/daybook.controller.js.map | 1 - .../src/app/daybook/daybook.controller.ts | 36 - brewman/static/src/app/daybook/daybook.html | 55 -- .../src/app/daybook/daybook.resolver.js | 14 - .../src/app/daybook/daybook.resolver.js.map | 1 - .../src/app/daybook/daybook.resolver.ts | 12 - .../static/src/app/daybook/daybook.service.js | 7 - .../src/app/daybook/daybook.service.js.map | 1 - .../static/src/app/daybook/daybook.service.ts | 3 - .../employee-attendance-info.resolver.js | 14 - .../employee-attendance-info.resolver.js.map | 1 - .../employee-attendance-info.resolver.ts | 13 - .../employee-attendance-sub.directive.js | 17 - .../employee-attendance-sub.directive.js.map | 1 - .../employee-attendance-sub.directive.ts | 14 - .../app/employee/employee-attendance-sub.html | 12 - .../employee/employee-attendance.component.js | 9 - .../employee-attendance.component.js.map | 1 - .../employee/employee-attendance.component.ts | 7 - .../employee-attendance.controller.js | 67 -- .../employee-attendance.controller.js.map | 1 - .../employee-attendance.controller.ts | 64 -- .../src/app/employee/employee-attendance.html | 64 -- .../employee/employee-attendance.service.js | 7 - .../employee-attendance.service.js.map | 1 - .../employee/employee-attendance.service.ts | 3 - .../src/app/employee/employee-detail.html | 91 --- .../employee/employee-functions.component.js | 9 - .../employee-functions.component.js.map | 1 - .../employee/employee-functions.component.ts | 7 - .../employee/employee-functions.controller.js | 72 -- .../employee-functions.controller.js.map | 1 - .../employee/employee-functions.controller.ts | 74 -- .../src/app/employee/employee-functions.html | 70 -- .../app/employee/employee-list.component.js | 9 - .../employee/employee-list.component.js.map | 1 - .../app/employee/employee-list.component.ts | 7 - .../app/employee/employee-list.controller.js | 85 -- .../employee/employee-list.controller.js.map | 1 - .../app/employee/employee-list.controller.ts | 88 -- .../src/app/employee/employee-list.html | 38 - .../app/employee/employee-list.resolver.js | 7 - .../employee/employee-list.resolver.js.map | 1 - .../app/employee/employee-list.resolver.ts | 3 - .../src/app/employee/employee.component.js | 9 - .../app/employee/employee.component.js.map | 1 - .../src/app/employee/employee.component.ts | 7 - .../src/app/employee/employee.controller.js | 80 -- .../app/employee/employee.controller.js.map | 1 - .../src/app/employee/employee.controller.ts | 80 -- .../src/app/employee/employee.resolver.js | 8 - .../src/app/employee/employee.resolver.js.map | 1 - .../src/app/employee/employee.resolver.ts | 4 - .../src/app/employee/employee.service.js | 10 - .../src/app/employee/employee.service.js.map | 1 - .../src/app/employee/employee.service.ts | 7 - .../static/src/app/group/group-detail.html | 28 - .../src/app/group/group-list.component.js | 9 - .../src/app/group/group-list.component.js.map | 1 - .../src/app/group/group-list.component.ts | 7 - .../src/app/group/group-list.controller.js | 13 - .../app/group/group-list.controller.js.map | 1 - .../src/app/group/group-list.controller.ts | 12 - brewman/static/src/app/group/group-list.html | 20 - .../src/app/group/group-list.resolver.js | 7 - .../src/app/group/group-list.resolver.js.map | 1 - .../src/app/group/group-list.resolver.ts | 3 - .../static/src/app/group/group.component.js | 9 - .../src/app/group/group.component.js.map | 1 - .../static/src/app/group/group.component.ts | 7 - .../static/src/app/group/group.controller.js | 33 - .../src/app/group/group.controller.js.map | 1 - .../static/src/app/group/group.controller.ts | 28 - .../static/src/app/group/group.resolver.js | 8 - .../src/app/group/group.resolver.js.map | 1 - .../static/src/app/group/group.resolver.ts | 4 - brewman/static/src/app/group/group.service.js | 9 - .../static/src/app/group/group.service.js.map | 1 - brewman/static/src/app/group/group.service.ts | 6 - brewman/static/src/app/home/home.component.js | 9 - .../static/src/app/home/home.component.js.map | 1 - brewman/static/src/app/home/home.component.ts | 7 - .../static/src/app/home/home.controller.js | 11 - .../src/app/home/home.controller.js.map | 1 - .../static/src/app/home/home.controller.ts | 6 - .../incentive/incentive-voucher.resolver.js | 14 - .../incentive-voucher.resolver.js.map | 1 - .../incentive/incentive-voucher.resolver.ts | 11 - .../src/app/incentive/incentive.component.js | 9 - .../app/incentive/incentive.component.js.map | 1 - .../src/app/incentive/incentive.component.ts | 7 - .../src/app/incentive/incentive.controller.js | 129 --- .../app/incentive/incentive.controller.js.map | 1 - .../src/app/incentive/incentive.controller.ts | 127 --- .../static/src/app/incentive/incentive.html | 79 -- brewman/static/src/app/issue/batch.service.js | 9 - .../static/src/app/issue/batch.service.js.map | 1 - brewman/static/src/app/issue/batch.service.ts | 5 - .../src/app/issue/issue-grid.resolver.js | 17 - .../src/app/issue/issue-grid.resolver.js.map | 1 - .../src/app/issue/issue-grid.resolver.ts | 15 - .../src/app/issue/issue-grid.service.js | 7 - .../src/app/issue/issue-grid.service.js.map | 1 - .../src/app/issue/issue-grid.service.ts | 3 - .../src/app/issue/issue-modal.controller.js | 29 - .../app/issue/issue-modal.controller.js.map | 1 - .../src/app/issue/issue-modal.controller.ts | 26 - brewman/static/src/app/issue/issue-modal.html | 24 - .../src/app/issue/issue-voucher.resolver.js | 17 - .../app/issue/issue-voucher.resolver.js.map | 1 - .../src/app/issue/issue-voucher.resolver.ts | 15 - .../static/src/app/issue/issue.component.js | 9 - .../src/app/issue/issue.component.js.map | 1 - .../static/src/app/issue/issue.component.ts | 7 - .../static/src/app/issue/issue.controller.js | 274 ------- .../src/app/issue/issue.controller.js.map | 1 - .../static/src/app/issue/issue.controller.ts | 284 ------- brewman/static/src/app/issue/issue.html | 123 --- .../app/journal/journal-modal.controller.js | 35 - .../journal/journal-modal.controller.js.map | 1 - .../app/journal/journal-modal.controller.ts | 32 - .../static/src/app/journal/journal-modal.html | 33 - .../app/journal/journal-voucher.resolver.js | 14 - .../journal/journal-voucher.resolver.js.map | 1 - .../app/journal/journal-voucher.resolver.ts | 10 - .../src/app/journal/journal.component.js | 9 - .../src/app/journal/journal.component.js.map | 1 - .../src/app/journal/journal.component.ts | 7 - .../src/app/journal/journal.controller.js | 222 ----- .../src/app/journal/journal.controller.js.map | 1 - .../src/app/journal/journal.controller.ts | 229 ------ brewman/static/src/app/journal/journal.html | 117 --- .../static/src/app/ledger/ledger.component.js | 9 - .../src/app/ledger/ledger.component.js.map | 1 - .../static/src/app/ledger/ledger.component.ts | 9 - .../src/app/ledger/ledger.controller.js | 158 ---- .../src/app/ledger/ledger.controller.js.map | 1 - .../src/app/ledger/ledger.controller.ts | 168 ---- brewman/static/src/app/ledger/ledger.html | 87 -- .../static/src/app/ledger/ledger.resolver.js | 14 - .../src/app/ledger/ledger.resolver.js.map | 1 - .../static/src/app/ledger/ledger.resolver.ts | 13 - .../static/src/app/ledger/ledger.service.js | 7 - .../src/app/ledger/ledger.service.js.map | 1 - .../static/src/app/ledger/ledger.service.ts | 3 - .../static/src/app/login/login.component.js | 9 - .../src/app/login/login.component.js.map | 1 - .../static/src/app/login/login.component.ts | 7 - .../static/src/app/login/login.controller.js | 43 - .../src/app/login/login.controller.js.map | 1 - .../static/src/app/login/login.controller.ts | 41 - brewman/static/src/app/login/login.html | 48 -- .../static/src/app/login/logout.component.js | 9 - .../src/app/login/logout.component.js.map | 1 - .../static/src/app/login/logout.component.ts | 7 - .../static/src/app/login/logout.controller.js | 21 - .../src/app/login/logout.controller.js.map | 1 - .../static/src/app/login/logout.controller.ts | 12 - .../net-transactions.component.js | 9 - .../net-transactions.component.js.map | 1 - .../net-transactions.component.ts | 7 - .../net-transactions.controller.js | 39 - .../net-transactions.controller.js.map | 1 - .../net-transactions.controller.ts | 39 - .../net-transactions/net-transactions.html | 49 -- .../net-transactions.resolver.js | 14 - .../net-transactions.resolver.js.map | 1 - .../net-transactions.resolver.ts | 12 - .../net-transactions.service.js | 7 - .../net-transactions.service.js.map | 1 - .../net-transactions.service.ts | 3 - brewman/static/src/app/overlord.app.js | 36 - brewman/static/src/app/overlord.app.js.map | 1 - brewman/static/src/app/overlord.app.ts | 35 - brewman/static/src/app/overlord.components.js | 100 --- .../static/src/app/overlord.components.js.map | 1 - brewman/static/src/app/overlord.components.ts | 99 --- brewman/static/src/app/overlord.config.js | 32 - brewman/static/src/app/overlord.config.js.map | 1 - brewman/static/src/app/overlord.config.ts | 32 - brewman/static/src/app/overlord.directive.js | 26 - .../static/src/app/overlord.directive.js.map | 1 - brewman/static/src/app/overlord.directive.ts | 23 - brewman/static/src/app/overlord.filters.js | 28 - .../static/src/app/overlord.filters.js.map | 1 - brewman/static/src/app/overlord.filters.ts | 26 - brewman/static/src/app/overlord.routes.js | 476 ----------- brewman/static/src/app/overlord.routes.js.map | 1 - brewman/static/src/app/overlord.routes.ts | 474 ----------- brewman/static/src/app/overlord.services.js | 86 -- .../static/src/app/overlord.services.js.map | 1 - brewman/static/src/app/overlord.services.ts | 84 -- .../app/payment/payment-modal.controller.js | 25 - .../payment/payment-modal.controller.js.map | 1 - .../app/payment/payment-modal.controller.ts | 21 - .../static/src/app/payment/payment-modal.html | 27 - .../app/payment/payment-voucher.resolver.js | 18 - .../payment/payment-voucher.resolver.js.map | 1 - .../app/payment/payment-voucher.resolver.ts | 16 - .../src/app/payment/payment.component.js | 9 - .../src/app/payment/payment.component.js.map | 1 - .../src/app/payment/payment.component.ts | 7 - .../src/app/payment/payment.controller.js | 217 ----- .../src/app/payment/payment.controller.js.map | 1 - .../src/app/payment/payment.controller.ts | 223 ----- brewman/static/src/app/payment/payment.html | 117 --- .../product-group/product-group-detail.html | 16 - .../product-group-list.component.js | 9 - .../product-group-list.component.js.map | 1 - .../product-group-list.component.ts | 7 - .../product-group-list.controller.js | 13 - .../product-group-list.controller.js.map | 1 - .../product-group-list.controller.ts | 10 - .../app/product-group/product-group-list.html | 13 - .../product-group-list.resolver.js | 7 - .../product-group-list.resolver.js.map | 1 - .../product-group-list.resolver.ts | 3 - .../product-group/product-group.component.js | 9 - .../product-group.component.js.map | 1 - .../product-group/product-group.component.ts | 7 - .../product-group/product-group.controller.js | 33 - .../product-group.controller.js.map | 1 - .../product-group/product-group.controller.ts | 28 - .../product-group/product-group.resolver.js | 8 - .../product-group.resolver.js.map | 1 - .../product-group/product-group.resolver.ts | 4 - .../product-group/product-group.service.js | 9 - .../product-group.service.js.map | 1 - .../product-group/product-group.service.ts | 6 - .../product-ledger.component.js | 9 - .../product-ledger.component.js.map | 1 - .../product-ledger.component.ts | 7 - .../product-ledger.controller.js | 61 -- .../product-ledger.controller.js.map | 1 - .../product-ledger.controller.ts | 61 -- .../app/product-ledger/product-ledger.html | 93 --- .../product-ledger/product-ledger.resolver.js | 14 - .../product-ledger.resolver.js.map | 1 - .../product-ledger/product-ledger.resolver.ts | 13 - .../product-ledger/product-ledger.service.js | 7 - .../product-ledger.service.js.map | 1 - .../product-ledger/product-ledger.service.ts | 3 - .../src/app/product/product-detail.html | 63 -- .../src/app/product/product-list.component.js | 9 - .../app/product/product-list.component.js.map | 1 - .../src/app/product/product-list.component.ts | 7 - .../app/product/product-list.controller.js | 123 --- .../product/product-list.controller.js.map | 1 - .../app/product/product-list.controller.ts | 140 ---- .../static/src/app/product/product-list.html | 80 -- .../src/app/product/product-list.resolver.js | 7 - .../app/product/product-list.resolver.js.map | 1 - .../src/app/product/product-list.resolver.ts | 3 - .../src/app/product/product.component.js | 9 - .../src/app/product/product.component.js.map | 1 - .../src/app/product/product.component.ts | 7 - .../src/app/product/product.controller.js | 60 -- .../src/app/product/product.controller.js.map | 1 - .../src/app/product/product.controller.ts | 53 -- .../src/app/product/product.resolver.js | 8 - .../src/app/product/product.resolver.js.map | 1 - .../src/app/product/product.resolver.ts | 4 - .../static/src/app/product/product.service.js | 10 - .../src/app/product/product.service.js.map | 1 - .../static/src/app/product/product.service.ts | 7 - .../app/profit-loss/profit-loss.component.js | 9 - .../profit-loss/profit-loss.component.js.map | 1 - .../app/profit-loss/profit-loss.component.ts | 7 - .../app/profit-loss/profit-loss.controller.js | 36 - .../profit-loss/profit-loss.controller.js.map | 1 - .../app/profit-loss/profit-loss.controller.ts | 36 - .../src/app/profit-loss/profit-loss.html | 58 -- .../app/profit-loss/profit-loss.resolver.js | 14 - .../profit-loss/profit-loss.resolver.js.map | 1 - .../app/profit-loss/profit-loss.resolver.ts | 12 - .../app/profit-loss/profit-loss.service.js | 7 - .../profit-loss/profit-loss.service.js.map | 1 - .../app/profit-loss/profit-loss.service.ts | 3 - .../purchase-entries.component.js | 9 - .../purchase-entries.component.js.map | 1 - .../purchase-entries.component.ts | 7 - .../purchase-entries.controller.js | 39 - .../purchase-entries.controller.js.map | 1 - .../purchase-entries.controller.ts | 39 - .../purchase-entries/purchase-entries.html | 55 -- .../purchase-entries.resolver.js | 14 - .../purchase-entries.resolver.js.map | 1 - .../purchase-entries.resolver.ts | 12 - .../purchase-entries.service.js | 7 - .../purchase-entries.service.js.map | 1 - .../purchase-entries.service.ts | 3 - .../purchase-return-modal.controller.js | 29 - .../purchase-return-modal.controller.js.map | 1 - .../purchase-return-modal.controller.ts | 26 - .../purchase-return-modal.html | 24 - .../purchase-return-voucher.resolver.js | 14 - .../purchase-return-voucher.resolver.js.map | 1 - .../purchase-return-voucher.resolver.ts | 10 - .../purchase-return.component.js | 9 - .../purchase-return.component.js.map | 1 - .../purchase-return.component.ts | 7 - .../purchase-return.controller.js | 209 ----- .../purchase-return.controller.js.map | 1 - .../purchase-return.controller.ts | 221 ----- .../app/purchase-return/purchase-return.html | 117 --- .../app/purchase/purchase-modal.controller.js | 28 - .../purchase/purchase-modal.controller.js.map | 1 - .../app/purchase/purchase-modal.controller.ts | 25 - .../src/app/purchase/purchase-modal.html | 33 - .../app/purchase/purchase-voucher.resolver.js | 14 - .../purchase/purchase-voucher.resolver.js.map | 1 - .../app/purchase/purchase-voucher.resolver.ts | 11 - .../src/app/purchase/purchase.component.js | 9 - .../app/purchase/purchase.component.js.map | 1 - .../src/app/purchase/purchase.component.ts | 7 - .../src/app/purchase/purchase.controller.js | 208 ----- .../app/purchase/purchase.controller.js.map | 1 - .../src/app/purchase/purchase.controller.ts | 223 ----- brewman/static/src/app/purchase/purchase.html | 123 --- .../src/app/purchases/purchases.component.js | 9 - .../app/purchases/purchases.component.js.map | 1 - .../src/app/purchases/purchases.component.ts | 7 - .../src/app/purchases/purchases.controller.js | 36 - .../app/purchases/purchases.controller.js.map | 1 - .../src/app/purchases/purchases.controller.ts | 34 - .../static/src/app/purchases/purchases.html | 58 -- .../src/app/purchases/purchases.resolver.js | 14 - .../app/purchases/purchases.resolver.js.map | 1 - .../src/app/purchases/purchases.resolver.ts | 12 - .../src/app/purchases/purchases.service.js | 7 - .../app/purchases/purchases.service.js.map | 1 - .../src/app/purchases/purchases.service.ts | 3 - .../raw-material-cost-detail.html | 51 -- .../raw-material-cost.component.js | 9 - .../raw-material-cost.component.js.map | 1 - .../raw-material-cost.component.ts | 7 - .../raw-material-cost.controller.js | 39 - .../raw-material-cost.controller.js.map | 1 - .../raw-material-cost.controller.ts | 39 - .../raw-material-cost/raw-material-cost.html | 57 -- .../raw-material-cost.resolver.js | 17 - .../raw-material-cost.resolver.js.map | 1 - .../raw-material-cost.resolver.ts | 15 - .../raw-material-cost.service.js | 7 - .../raw-material-cost.service.js.map | 1 - .../raw-material-cost.service.ts | 3 - .../app/receipt/receipt-modal.controller.js | 25 - .../receipt/receipt-modal.controller.js.map | 1 - .../app/receipt/receipt-modal.controller.ts | 21 - .../static/src/app/receipt/receipt-modal.html | 27 - .../app/receipt/receipt-voucher.resolver.js | 18 - .../receipt/receipt-voucher.resolver.js.map | 1 - .../app/receipt/receipt-voucher.resolver.ts | 16 - .../src/app/receipt/receipt.component.js | 9 - .../src/app/receipt/receipt.component.js.map | 1 - .../src/app/receipt/receipt.component.ts | 7 - .../src/app/receipt/receipt.controller.js | 219 ----- .../src/app/receipt/receipt.controller.js.map | 1 - .../src/app/receipt/receipt.controller.ts | 223 ----- brewman/static/src/app/receipt/receipt.html | 117 --- .../static/src/app/recipe/recipe-detail.html | 102 --- .../static/src/app/recipe/recipe-list.html | 52 -- .../static/src/app/recipe/recipe.service.js | 9 - .../src/app/recipe/recipe.service.js.map | 1 - .../static/src/app/recipe/recipe.service.ts | 6 - .../src/app/reconcile/reconcile.component.js | 9 - .../app/reconcile/reconcile.component.js.map | 1 - .../src/app/reconcile/reconcile.component.ts | 7 - .../src/app/reconcile/reconcile.controller.js | 148 ---- .../app/reconcile/reconcile.controller.js.map | 1 - .../src/app/reconcile/reconcile.controller.ts | 157 ---- .../static/src/app/reconcile/reconcile.html | 102 --- .../src/app/reconcile/reconcile.resolver.js | 14 - .../app/reconcile/reconcile.resolver.js.map | 1 - .../src/app/reconcile/reconcile.resolver.ts | 13 - .../src/app/reconcile/reconcile.service.js | 7 - .../app/reconcile/reconcile.service.js.map | 1 - .../src/app/reconcile/reconcile.service.ts | 3 - .../salary-deduction-voucher.resolver.js | 14 - .../salary-deduction-voucher.resolver.js.map | 1 - .../salary-deduction-voucher.resolver.ts | 11 - .../salary-deduction.component.js | 9 - .../salary-deduction.component.js.map | 1 - .../salary-deduction.component.ts | 7 - .../salary-deduction.controller.js | 164 ---- .../salary-deduction.controller.js.map | 1 - .../salary-deduction.controller.ts | 182 ----- .../salary-deduction/salary-deduction.html | 88 -- .../src/app/settings/lock-info.resolver.js | 13 - .../app/settings/lock-info.resolver.js.map | 1 - .../src/app/settings/lock-info.resolver.ts | 9 - .../src/app/settings/maintenance.resolver.js | 13 - .../app/settings/maintenance.resolver.js.map | 1 - .../src/app/settings/maintenance.resolver.ts | 9 - .../src/app/settings/settings.component.js | 9 - .../app/settings/settings.component.js.map | 1 - .../src/app/settings/settings.component.ts | 7 - .../src/app/settings/settings.controller.js | 182 ----- .../app/settings/settings.controller.js.map | 1 - .../src/app/settings/settings.controller.ts | 194 ----- brewman/static/src/app/settings/settings.html | 156 ---- .../stock-movement.component.js | 9 - .../stock-movement.component.js.map | 1 - .../stock-movement.component.ts | 7 - .../stock-movement.controller.js | 39 - .../stock-movement.controller.js.map | 1 - .../stock-movement.controller.ts | 39 - .../app/stock-movement/stock-movement.html | 54 -- .../stock-movement/stock-movement.resolver.js | 14 - .../stock-movement.resolver.js.map | 1 - .../stock-movement/stock-movement.resolver.ts | 12 - .../stock-movement/stock-movement.service.js | 7 - .../stock-movement.service.js.map | 1 - .../stock-movement/stock-movement.service.ts | 3 - brewman/static/src/app/systemjs.config.js | 86 -- .../trial-balance/trial-balance.component.js | 9 - .../trial-balance.component.js.map | 1 - .../trial-balance/trial-balance.component.ts | 7 - .../trial-balance/trial-balance.controller.js | 28 - .../trial-balance.controller.js.map | 1 - .../trial-balance/trial-balance.controller.ts | 26 - .../src/app/trial-balance/trial-balance.html | 39 - .../trial-balance/trial-balance.resolver.js | 14 - .../trial-balance.resolver.js.map | 1 - .../trial-balance/trial-balance.resolver.ts | 11 - .../trial-balance/trial-balance.service.js | 7 - .../trial-balance.service.js.map | 1 - .../trial-balance/trial-balance.service.ts | 3 - .../src/app/unposted/unposted.component.js | 9 - .../app/unposted/unposted.component.js.map | 1 - .../src/app/unposted/unposted.component.ts | 7 - .../src/app/unposted/unposted.controller.js | 19 - .../app/unposted/unposted.controller.js.map | 1 - .../src/app/unposted/unposted.controller.ts | 14 - brewman/static/src/app/unposted/unposted.html | 30 - .../src/app/unposted/unposted.resolver.js | 7 - .../src/app/unposted/unposted.resolver.js.map | 1 - .../src/app/unposted/unposted.resolver.ts | 6 - .../src/app/unposted/unposted.service.js | 7 - .../src/app/unposted/unposted.service.js.map | 1 - .../src/app/unposted/unposted.service.ts | 3 - brewman/static/src/app/user/user-detail.html | 46 -- .../src/app/user/user-list.component.js | 9 - .../src/app/user/user-list.component.js.map | 1 - .../src/app/user/user-list.component.ts | 7 - .../src/app/user/user-list.controller.js | 13 - .../src/app/user/user-list.controller.js.map | 1 - .../src/app/user/user-list.controller.ts | 10 - brewman/static/src/app/user/user-list.html | 22 - .../static/src/app/user/user-list.resolver.js | 7 - .../src/app/user/user-list.resolver.js.map | 1 - .../static/src/app/user/user-list.resolver.ts | 4 - brewman/static/src/app/user/user.component.js | 9 - .../static/src/app/user/user.component.js.map | 1 - brewman/static/src/app/user/user.component.ts | 7 - .../static/src/app/user/user.controller.js | 33 - .../src/app/user/user.controller.js.map | 1 - .../static/src/app/user/user.controller.ts | 28 - brewman/static/src/app/user/user.resolver.js | 8 - .../static/src/app/user/user.resolver.js.map | 1 - brewman/static/src/app/user/user.resolver.ts | 4 - brewman/static/src/app/user/user.service.js | 10 - .../static/src/app/user/user.service.js.map | 1 - brewman/static/src/app/user/user.service.ts | 7 - brewman/static/src/css/chosen.min.css | 3 - brewman/static/src/css/loading-bar.min.css | 1 - brewman/static/src/css/nv.d3.css | 769 ------------------ brewman/static/src/css/spinner.css | 119 --- brewman/static/src/css/table.css | 73 -- brewman/static/src/favicon.ico | Bin 3126 -> 0 bytes .../fonts/glyphicons-halflings-regular.eot | Bin 20335 -> 0 bytes .../fonts/glyphicons-halflings-regular.svg | 229 ------ .../fonts/glyphicons-halflings-regular.ttf | Bin 41280 -> 0 bytes .../fonts/glyphicons-halflings-regular.woff | Bin 23320 -> 0 bytes .../apple-touch-icon-114x114-precomposed.png | Bin 7410 -> 0 bytes .../apple-touch-icon-57x57-precomposed.png | Bin 2953 -> 0 bytes .../apple-touch-icon-72x72-precomposed.png | Bin 4137 -> 0 bytes .../src/img/apple-touch-icon-precomposed.png | Bin 2953 -> 0 bytes brewman/static/src/img/apple-touch-icon.png | Bin 2953 -> 0 bytes brewman/static/src/img/chosen-sprite.png | Bin 538 -> 0 bytes brewman/static/src/img/chosen-sprite@2x.png | Bin 738 -> 0 bytes brewman/static/src/img/favicon.ico | Bin 3126 -> 0 bytes .../src/img/glyphicons-halflings-white.png | Bin 8777 -> 0 bytes .../static/src/img/glyphicons-halflings.png | Bin 12799 -> 0 bytes brewman/static/src/index.html | 179 ---- brewman/static/src/js/jquery.scrolltoview.js | 105 --- brewman/static/src/js/loading-bar.min.js | 7 - brewman/static/src/js/mousetrap-brewman.js | 50 -- .../src/js/ui-bootstrap-custom-0.12.0.min.js | 8 - .../src/js/ui-bootstrap-tpls-2.5.0.min.js | 10 - .../src/template/modal/confirm-material.html | 10 - .../static/src/template/modal/confirm.html | 13 - brewman/static/src/template/modal/image.html | 3 - brewman/views/Management/settings.py | 52 +- brewman/views/__init__.py | 33 +- brewman/views/account.py | 60 +- brewman/views/attendance.py | 65 +- brewman/views/auth/client.py | 17 +- brewman/views/auth/group.py | 42 +- brewman/views/auth/user.py | 53 +- brewman/views/cost_centre.py | 15 +- brewman/views/employee.py | 86 +- brewman/views/fingerprint.py | 87 +- brewman/views/product.py | 112 +-- brewman/views/product_group.py | 15 +- brewman/views/recipe.py | 2 +- brewman/views/reports/balance_sheet.py | 24 +- brewman/views/reports/cash_flow.py | 50 +- brewman/views/reports/closing_stock.py | 15 +- brewman/views/reports/daybook.py | 27 +- brewman/views/reports/ledger.py | 46 +- brewman/views/reports/net_transactions.py | 18 +- brewman/views/reports/product_ledger.py | 52 +- brewman/views/reports/profit_loss.py | 39 +- brewman/views/reports/purchase_entries.py | 34 +- brewman/views/reports/purchases.py | 28 +- brewman/views/reports/raw_material_cost.py | 49 +- brewman/views/reports/reconcile.py | 2 +- brewman/views/reports/stock_movement.py | 47 +- brewman/views/reports/trial_balance.py | 15 +- brewman/views/reports/unposted.py | 13 +- brewman/views/services/batch.py | 14 +- brewman/views/services/cost_centre.py | 27 +- brewman/views/services/login.py | 23 +- brewman/views/services/session.py | 14 +- brewman/views/services/voucher/__init__.py | 220 ++--- .../views/services/voucher/credit_salary.py | 4 +- .../views/services/voucher/emptyvoucher.py | 42 +- brewman/views/services/voucher/issue.py | 40 +- brewman/views/services/voucher/journal.py | 34 +- brewman/views/services/voucher/purchase.py | 58 +- .../views/services/voucher/purchase_return.py | 34 +- .../services/voucher/salary_deduction.py | 16 +- brewman/views/services/voucher/savevoucher.py | 32 +- .../views/services/voucher/service_charge.py | 60 +- .../views/services/voucher/updatevoucher.py | 32 +- development.ini | 2 +- overlord/.editorconfig | 13 + overlord/.gitignore | 39 + overlord/README.md | 27 + overlord/angular.json | 129 +++ overlord/e2e/protractor.conf.js | 28 + overlord/e2e/src/app.e2e-spec.ts | 14 + overlord/e2e/src/app.po.ts | 11 + overlord/e2e/tsconfig.e2e.json | 13 + overlord/package.json | 54 ++ overlord/proxy.conf.json | 7 + .../account-detail.component.css | 0 .../account-detail.component.html | 56 ++ .../account-detail.component.spec.ts | 25 + .../account-detail.component.ts | 121 +++ .../account-list-resolver.service.spec.ts | 15 + .../account/account-list-resolver.service.ts | 18 + .../account-list/account-list-datasource.ts | 79 ++ .../account-list/account-list.component.css | 0 .../account-list/account-list.component.html | 61 ++ .../account-list.component.spec.ts | 23 + .../account-list/account-list.component.ts | 60 ++ .../account/account-resolver.service.spec.ts | 15 + .../app/account/account-resolver.service.ts | 19 + .../account/account-routing.module.spec.ts | 13 + .../src/app/account/account-routing.module.ts | 69 ++ .../account-type-resolver.service.spec.ts | 15 + .../account/account-type-resolver.service.ts | 18 + .../app/account/account-type.service.spec.ts | 15 + .../src/app/account/account-type.service.ts | 26 + overlord/src/app/account/account-type.ts | 9 + .../src/app/account/account.module.spec.ts | 13 + overlord/src/app/account/account.module.ts | 50 ++ .../src/app/account/account.service.spec.ts | 15 + overlord/src/app/account/account.service.ts | 97 +++ overlord/src/app/account/account.ts | 18 + overlord/src/app/app-routing.module.spec.ts | 13 + overlord/src/app/app-routing.module.ts | 27 + overlord/src/app/app.component.css | 5 + overlord/src/app/app.component.html | 4 + overlord/src/app/app.component.spec.ts | 28 + overlord/src/app/app.component.ts | 10 + overlord/src/app/app.module.ts | 142 ++++ .../app/attendance/attendance-datasource.ts | 18 + .../attendance-resolver.service.spec.ts | 15 + .../attendance/attendance-resolver.service.ts | 19 + .../attendance-routing.module.spec.ts | 13 + .../attendance/attendance-routing.module.ts | 52 ++ .../attendance-type-resolver.service.ts | 18 + .../app/attendance/attendance-type.service.ts | 23 + .../src/app/attendance/attendance-type.ts | 9 + .../app/attendance/attendance.component.css | 53 ++ .../app/attendance/attendance.component.html | 71 ++ .../attendance/attendance.component.spec.ts | 25 + .../app/attendance/attendance.component.ts | 99 +++ .../app/attendance/attendance.module.spec.ts | 13 + .../src/app/attendance/attendance.module.ts | 79 ++ .../app/attendance/attendance.service.spec.ts | 15 + .../src/app/attendance/attendance.service.ts | 35 + overlord/src/app/attendance/attendance.ts | 26 + .../src/app/auth/auth-guard.service.spec.ts | 15 + overlord/src/app/auth/auth-guard.service.ts | 41 + overlord/src/app/auth/auth.service.spec.ts | 15 + overlord/src/app/auth/auth.service.ts | 72 ++ .../src/app/auth/login/login.component.css | 8 + .../src/app/auth/login/login.component.html | 40 + .../app/auth/login/login.component.spec.ts | 25 + .../src/app/auth/login/login.component.ts | 69 ++ .../app/auth/logout/logout.component.spec.ts | 25 + .../src/app/auth/logout/logout.component.ts | 25 + .../balance-sheet/balance-sheet-datasource.ts | 58 ++ .../balance-sheet-resolver.service.spec.ts | 15 + .../balance-sheet-resolver.service.ts | 19 + .../balance-sheet-routing.module.spec.ts | 13 + .../balance-sheet-routing.module.ts | 47 ++ .../balance-sheet/balance-sheet.component.css | 4 + .../balance-sheet.component.html | 63 ++ .../balance-sheet.component.spec.ts | 25 + .../balance-sheet/balance-sheet.component.ts | 56 ++ .../balance-sheet.module.spec.ts | 13 + .../app/balance-sheet/balance-sheet.module.ts | 69 ++ .../balance-sheet.service.spec.ts | 15 + .../balance-sheet/balance-sheet.service.ts | 31 + .../src/app/balance-sheet/balance-sheet.ts | 5 + .../src/app/cash-flow/cash-flow-datasource.ts | 18 + .../cash-flow-resolver.service.spec.ts | 15 + .../cash-flow/cash-flow-resolver.service.ts | 21 + .../cash-flow-routing.module.spec.ts | 13 + .../app/cash-flow/cash-flow-routing.module.ts | 49 ++ .../src/app/cash-flow/cash-flow.component.css | 4 + .../app/cash-flow/cash-flow.component.html | 42 + .../app/cash-flow/cash-flow.component.spec.ts | 25 + .../src/app/cash-flow/cash-flow.component.ts | 62 ++ .../app/cash-flow/cash-flow.module.spec.ts | 13 + .../src/app/cash-flow/cash-flow.module.ts | 69 ++ .../app/cash-flow/cash-flow.service.spec.ts | 15 + .../src/app/cash-flow/cash-flow.service.ts | 38 + overlord/src/app/cash-flow/cash-flow.ts | 36 + .../client-detail/client-detail.component.css | 3 + .../client-detail.component.html | 40 + .../client-detail.component.spec.ts | 25 + .../client-detail/client-detail.component.ts | 110 +++ .../client-list-resolver.service.spec.ts | 15 + .../client/client-list-resolver.service.ts | 18 + .../client-list/client-list-datasource.ts | 58 ++ .../client-list/client-list.component.css | 0 .../client-list/client-list.component.html | 55 ++ .../client-list/client-list.component.spec.ts | 23 + .../client-list/client-list.component.ts | 30 + .../client/client-resolver.service.spec.ts | 15 + .../src/app/client/client-resolver.service.ts | 19 + .../app/client/client-routing.module.spec.ts | 13 + .../src/app/client/client-routing.module.ts | 50 ++ overlord/src/app/client/client.module.spec.ts | 13 + overlord/src/app/client/client.module.ts | 48 ++ .../src/app/client/client.service.spec.ts | 15 + overlord/src/app/client/client.service.ts | 50 ++ overlord/src/app/client/client.ts | 9 + .../closing-stock/closing-stock-datasource.ts | 63 ++ .../closing-stock-resolver.service.spec.ts | 15 + .../closing-stock-resolver.service.ts | 19 + .../closing-stock-routing.module.spec.ts | 13 + .../closing-stock-routing.module.ts | 47 ++ .../closing-stock/closing-stock.component.css | 4 + .../closing-stock.component.html | 58 ++ .../closing-stock.component.spec.ts | 25 + .../closing-stock/closing-stock.component.ts | 70 ++ .../closing-stock.module.spec.ts | 13 + .../app/closing-stock/closing-stock.module.ts | 71 ++ .../closing-stock.service.spec.ts | 15 + .../closing-stock/closing-stock.service.ts | 31 + .../src/app/closing-stock/closing-stock.ts | 11 + overlord/src/app/core/core.module.spec.ts | 13 + overlord/src/app/core/core.module.ts | 24 + .../src/app/core/error-logger.service.spec.ts | 15 + overlord/src/app/core/error-logger.service.ts | 36 + .../app/core/nav-bar/nav-bar.component.css | 14 + .../app/core/nav-bar/nav-bar.component.html | 89 ++ .../core/nav-bar/nav-bar.component.spec.ts | 23 + .../src/app/core/nav-bar/nav-bar.component.ts | 28 + overlord/src/app/core/toaster.service.spec.ts | 15 + overlord/src/app/core/toaster.service.ts | 17 + .../cost-centre-detail.component.css | 3 + .../cost-centre-detail.component.html | 21 + .../cost-centre-detail.component.spec.ts | 25 + .../cost-centre-detail.component.ts | 73 ++ .../cost-centre-list-resolver.service.spec.ts | 15 + .../cost-centre-list-resolver.service.ts | 18 + .../cost-centre-list-datasource.ts | 58 ++ .../cost-centre-list.component.css | 0 .../cost-centre-list.component.html | 35 + .../cost-centre-list.component.spec.ts | 23 + .../cost-centre-list.component.ts | 30 + .../cost-centre-resolver.service.spec.ts | 15 + .../cost-centre-resolver.service.ts | 19 + .../cost-centre-routing.module.spec.ts | 13 + .../cost-centre/cost-centre-routing.module.ts | 61 ++ .../cost-centre/cost-centre.module.spec.ts | 13 + .../src/app/cost-centre/cost-centre.module.ts | 44 + .../cost-centre/cost-centre.service.spec.ts | 15 + .../app/cost-centre/cost-centre.service.ts | 65 ++ overlord/src/app/cost-centre/cost-centre.ts | 5 + .../src/app/daybook/daybook-datasource.ts | 61 ++ .../daybook/daybook-resolver.service.spec.ts | 15 + .../app/daybook/daybook-resolver.service.ts | 20 + .../daybook/daybook-routing.module.spec.ts | 13 + .../src/app/daybook/daybook-routing.module.ts | 37 + .../src/app/daybook/daybook.component.css | 12 + .../src/app/daybook/daybook.component.html | 80 ++ .../src/app/daybook/daybook.component.spec.ts | 25 + overlord/src/app/daybook/daybook.component.ts | 87 ++ .../src/app/daybook/daybook.module.spec.ts | 13 + overlord/src/app/daybook/daybook.module.ts | 75 ++ .../src/app/daybook/daybook.service.spec.ts | 15 + overlord/src/app/daybook/daybook.service.ts | 37 + overlord/src/app/daybook/daybook.ts | 18 + .../employee-attendance-datasource.ts | 18 + .../employee-attendance-resolver.service.ts | 21 + .../employee-attendance-routing.module.ts | 52 ++ .../employee-attendance.component.css | 53 ++ .../employee-attendance.component.html | 71 ++ .../employee-attendance.component.ts | 146 ++++ .../employee-attendance.module.ts | 79 ++ .../employee-attendance.service.ts | 43 + .../employee-attendance.ts | 25 + .../employee-benefits-datasource.ts | 18 + .../employee-benefits-resolver.service.ts | 24 + .../employee-benefits-routing.module.ts | 49 ++ .../employee-benefits.component.css | 32 + .../employee-benefits.component.html | 124 +++ .../employee-benefits.component.ts | 236 ++++++ .../employee-benefits.module.ts | 71 ++ .../employee-functions-routing.module.ts | 30 + .../employee-functions.component.css | 32 + .../employee-functions.component.html | 58 ++ .../employee-functions.component.ts | 115 +++ .../employee-functions.module.ts | 61 ++ .../employee-functions.service.ts | 37 + .../employee-detail.component.css | 0 .../employee-detail.component.html | 68 ++ .../employee-detail.component.spec.ts | 25 + .../employee-detail.component.ts | 136 ++++ .../employee-list-resolver.service.spec.ts | 15 + .../employee-list-resolver.service.ts | 18 + .../employee-list/employee-list-datasource.ts | 91 +++ .../employee-list/employee-list.component.css | 0 .../employee-list.component.html | 79 ++ .../employee-list.component.spec.ts | 23 + .../employee-list/employee-list.component.ts | 60 ++ .../employee-resolver.service.spec.ts | 15 + .../app/employee/employee-resolver.service.ts | 19 + .../employee/employee-routing.module.spec.ts | 13 + .../app/employee/employee-routing.module.ts | 66 ++ .../src/app/employee/employee.module.spec.ts | 13 + overlord/src/app/employee/employee.module.ts | 54 ++ .../src/app/employee/employee.service.spec.ts | 15 + overlord/src/app/employee/employee.service.ts | 73 ++ overlord/src/app/employee/employee.ts | 15 + .../group-detail/group-detail.component.css | 3 + .../group-detail/group-detail.component.html | 30 + .../group-detail.component.spec.ts | 25 + .../group-detail/group-detail.component.ts | 108 +++ .../group/group-list-resolver.service.spec.ts | 15 + .../app/group/group-list-resolver.service.ts | 18 + .../group/group-list/group-list-datasource.ts | 58 ++ .../group/group-list/group-list.component.css | 0 .../group-list/group-list.component.html | 35 + .../group-list/group-list.component.spec.ts | 23 + .../group/group-list/group-list.component.ts | 30 + .../app/group/group-resolver.service.spec.ts | 15 + .../src/app/group/group-resolver.service.ts | 19 + .../app/group/group-routing.module.spec.ts | 13 + .../src/app/group/group-routing.module.ts | 61 ++ overlord/src/app/group/group.module.spec.ts | 13 + overlord/src/app/group/group.module.ts | 50 ++ overlord/src/app/group/group.service.spec.ts | 15 + overlord/src/app/group/group.service.ts | 73 ++ overlord/src/app/group/group.ts | 11 + overlord/src/app/home/home.component.css | 0 overlord/src/app/home/home.component.html | 3 + overlord/src/app/home/home.component.spec.ts | 25 + overlord/src/app/home/home.component.ts | 16 + .../src/app/incentive/incentive-datasource.ts | 18 + .../incentive-resolver.service.spec.ts | 15 + .../incentive/incentive-resolver.service.ts | 24 + .../incentive-routing.module.spec.ts | 13 + .../app/incentive/incentive-routing.module.ts | 49 ++ .../src/app/incentive/incentive.component.css | 32 + .../app/incentive/incentive.component.html | 90 ++ .../app/incentive/incentive.component.spec.ts | 25 + .../src/app/incentive/incentive.component.ts | 192 +++++ .../app/incentive/incentive.module.spec.ts | 13 + .../src/app/incentive/incentive.module.ts | 79 ++ .../app/incentive/incentive.service.spec.ts | 15 + overlord/src/app/issue/issue-datasource.ts | 18 + .../src/app/issue/issue-dialog.component.css | 0 .../src/app/issue/issue-dialog.component.html | 25 + .../app/issue/issue-dialog.component.spec.ts | 25 + .../src/app/issue/issue-dialog.component.ts | 74 ++ .../src/app/issue/issue-grid-datasource.ts | 17 + .../src/app/issue/issue-grid.service.spec.ts | 15 + overlord/src/app/issue/issue-grid.service.ts | 24 + .../app/issue/issue-resolver.service.spec.ts | 15 + .../src/app/issue/issue-resolver.service.ts | 23 + .../app/issue/issue-routing.module.spec.ts | 13 + .../src/app/issue/issue-routing.module.ts | 52 ++ overlord/src/app/issue/issue.component.css | 32 + overlord/src/app/issue/issue.component.html | 159 ++++ .../src/app/issue/issue.component.spec.ts | 25 + overlord/src/app/issue/issue.component.ts | 302 +++++++ overlord/src/app/issue/issue.module.spec.ts | 13 + overlord/src/app/issue/issue.module.ts | 84 ++ overlord/src/app/issue/issue.service.spec.ts | 15 + .../src/app/journal/journal-datasource.ts | 18 + .../app/journal/journal-dialog.component.css | 0 .../app/journal/journal-dialog.component.html | 36 + .../journal/journal-dialog.component.spec.ts | 25 + .../app/journal/journal-dialog.component.ts | 80 ++ .../journal/journal-resolver.service.spec.ts | 15 + .../app/journal/journal-resolver.service.ts | 23 + .../journal/journal-routing.module.spec.ts | 13 + .../src/app/journal/journal-routing.module.ts | 49 ++ .../src/app/journal/journal.component.css | 32 + .../src/app/journal/journal.component.html | 111 +++ .../src/app/journal/journal.component.spec.ts | 25 + overlord/src/app/journal/journal.component.ts | 320 ++++++++ .../src/app/journal/journal.module.spec.ts | 13 + overlord/src/app/journal/journal.module.ts | 84 ++ .../src/app/journal/journal.service.spec.ts | 15 + overlord/src/app/journal/voucher.service.ts | 97 +++ overlord/src/app/journal/voucher.ts | 82 ++ overlord/src/app/ledger/ledger-datasource.ts | 61 ++ .../ledger/ledger-resolver.service.spec.ts | 15 + .../src/app/ledger/ledger-resolver.service.ts | 21 + .../app/ledger/ledger-routing.module.spec.ts | 13 + .../src/app/ledger/ledger-routing.module.ts | 49 ++ overlord/src/app/ledger/ledger.component.css | 12 + overlord/src/app/ledger/ledger.component.html | 102 +++ .../src/app/ledger/ledger.component.spec.ts | 25 + overlord/src/app/ledger/ledger.component.ts | 157 ++++ overlord/src/app/ledger/ledger.module.spec.ts | 13 + overlord/src/app/ledger/ledger.module.ts | 75 ++ .../src/app/ledger/ledger.service.spec.ts | 15 + overlord/src/app/ledger/ledger.service.ts | 38 + overlord/src/app/ledger/ledger.ts | 21 + .../net-transactions-datasource.ts | 63 ++ .../net-transactions-resolver.service.spec.ts | 15 + .../net-transactions-resolver.service.ts | 20 + .../net-transactions-routing.module.spec.ts | 13 + .../net-transactions-routing.module.ts | 37 + .../net-transactions.component.css | 12 + .../net-transactions.component.html | 61 ++ .../net-transactions.component.spec.ts | 25 + .../net-transactions.component.ts | 71 ++ .../net-transactions.module.spec.ts | 13 + .../net-transactions.module.ts | 75 ++ .../net-transactions.service.spec.ts | 15 + .../net-transactions.service.ts | 37 + .../app/net-transactions/net-transactions.ts | 13 + .../payment-accounts-resolver.service.spec.ts | 15 + .../payment-accounts-resolver.service.ts | 18 + .../src/app/payment/payment-datasource.ts | 18 + .../app/payment/payment-dialog.component.css | 0 .../app/payment/payment-dialog.component.html | 31 + .../payment/payment-dialog.component.spec.ts | 25 + .../app/payment/payment-dialog.component.ts | 76 ++ .../payment/payment-resolver.service.spec.ts | 15 + .../app/payment/payment-resolver.service.ts | 26 + .../payment/payment-routing.module.spec.ts | 13 + .../src/app/payment/payment-routing.module.ts | 52 ++ .../src/app/payment/payment.component.css | 32 + .../src/app/payment/payment.component.html | 113 +++ .../src/app/payment/payment.component.spec.ts | 25 + overlord/src/app/payment/payment.component.ts | 334 ++++++++ .../src/app/payment/payment.module.spec.ts | 13 + overlord/src/app/payment/payment.module.ts | 84 ++ .../src/app/payment/payment.service.spec.ts | 15 + .../product-group-detail.component.css | 3 + .../product-group-detail.component.html | 21 + .../product-group-detail.component.spec.ts | 25 + .../product-group-detail.component.ts | 73 ++ ...roduct-group-list-resolver.service.spec.ts | 15 + .../product-group-list-resolver.service.ts | 18 + .../product-group-list-datasource.ts | 58 ++ .../product-group-list.component.css | 0 .../product-group-list.component.html | 35 + .../product-group-list.component.spec.ts | 23 + .../product-group-list.component.ts | 30 + .../product-group-resolver.service.spec.ts | 15 + .../product-group-resolver.service.ts | 19 + .../product-group-routing.module.spec.ts | 13 + .../product-group-routing.module.ts | 61 ++ .../product-group.module.spec.ts | 13 + .../app/product-group/product-group.module.ts | 44 + .../product-group.service.spec.ts | 15 + .../product-group/product-group.service.ts | 65 ++ .../src/app/product-group/product-group.ts | 5 + .../product-ledger-datasource.ts | 65 ++ .../product-ledger-resolver.service.spec.ts | 15 + .../product-ledger-resolver.service.ts | 21 + .../product-ledger-routing.module.spec.ts | 13 + .../product-ledger-routing.module.ts | 49 ++ .../product-ledger.component.css | 12 + .../product-ledger.component.html | 120 +++ .../product-ledger.component.spec.ts | 25 + .../product-ledger.component.ts | 150 ++++ .../product-ledger.module.spec.ts | 13 + .../product-ledger/product-ledger.module.ts | 75 ++ .../product-ledger.service.spec.ts | 15 + .../product-ledger/product-ledger.service.ts | 38 + .../src/app/product-ledger/product-ledger.ts | 24 + .../product-detail.component.css | 0 .../product-detail.component.html | 77 ++ .../product-detail.component.spec.ts | 25 + .../product-detail.component.ts | 136 ++++ .../product-list-resolver.service.spec.ts | 15 + .../product/product-list-resolver.service.ts | 18 + .../product-list/product-list-datasource.ts | 80 ++ .../product-list/product-list.component.css | 0 .../product-list/product-list.component.html | 83 ++ .../product-list.component.spec.ts | 23 + .../product-list/product-list.component.ts | 76 ++ .../product/product-resolver.service.spec.ts | 15 + .../app/product/product-resolver.service.ts | 19 + .../product/product-routing.module.spec.ts | 13 + .../src/app/product/product-routing.module.ts | 67 ++ .../src/app/product/product.module.spec.ts | 13 + overlord/src/app/product/product.module.ts | 50 ++ .../src/app/product/product.service.spec.ts | 15 + overlord/src/app/product/product.service.ts | 81 ++ overlord/src/app/product/product.ts | 20 + .../app/profit-loss/profit-loss-datasource.ts | 63 ++ .../profit-loss-resolver.service.spec.ts | 15 + .../profit-loss-resolver.service.ts | 20 + .../profit-loss-routing.module.spec.ts | 13 + .../profit-loss/profit-loss-routing.module.ts | 37 + .../app/profit-loss/profit-loss.component.css | 12 + .../profit-loss/profit-loss.component.html | 70 ++ .../profit-loss/profit-loss.component.spec.ts | 25 + .../app/profit-loss/profit-loss.component.ts | 71 ++ .../profit-loss/profit-loss.module.spec.ts | 13 + .../src/app/profit-loss/profit-loss.module.ts | 75 ++ .../profit-loss/profit-loss.service.spec.ts | 15 + .../app/profit-loss/profit-loss.service.ts | 37 + overlord/src/app/profit-loss/profit-loss.ts | 14 + .../purchase-entries-datasource.ts | 63 ++ .../purchase-entries-resolver.service.spec.ts | 15 + .../purchase-entries-resolver.service.ts | 20 + .../purchase-entries-routing.module.spec.ts | 13 + .../purchase-entries-routing.module.ts | 37 + .../purchase-entries.component.css | 12 + .../purchase-entries.component.html | 86 ++ .../purchase-entries.component.spec.ts | 25 + .../purchase-entries.component.ts | 70 ++ .../purchase-entries.module.spec.ts | 13 + .../purchase-entries.module.ts | 75 ++ .../purchase-entries.service.spec.ts | 15 + .../purchase-entries.service.ts | 37 + .../app/purchase-entries/purchase-entries.ts | 17 + .../src/app/purchase-return/batch.service.ts | 24 + .../purchase-return-datasource.ts | 18 + .../purchase-return-dialog.component.css | 0 .../purchase-return-dialog.component.html | 25 + .../purchase-return-dialog.component.spec.ts | 25 + .../purchase-return-dialog.component.ts | 74 ++ .../purchase-return-resolver.service.spec.ts | 15 + .../purchase-return-resolver.service.ts | 23 + .../purchase-return-routing.module.spec.ts | 13 + .../purchase-return-routing.module.ts | 49 ++ .../purchase-return.component.css | 32 + .../purchase-return.component.html | 137 ++++ .../purchase-return.component.spec.ts | 25 + .../purchase-return.component.ts | 343 ++++++++ .../purchase-return.module.spec.ts | 13 + .../purchase-return/purchase-return.module.ts | 84 ++ .../purchase-return.service.spec.ts | 15 + .../src/app/purchase/purchase-datasource.ts | 18 + .../purchase/purchase-dialog.component.css | 0 .../purchase/purchase-dialog.component.html | 37 + .../purchase-dialog.component.spec.ts | 25 + .../app/purchase/purchase-dialog.component.ts | 84 ++ .../purchase-resolver.service.spec.ts | 15 + .../app/purchase/purchase-resolver.service.ts | 23 + .../purchase/purchase-routing.module.spec.ts | 13 + .../app/purchase/purchase-routing.module.ts | 49 ++ .../src/app/purchase/purchase.component.css | 32 + .../src/app/purchase/purchase.component.html | 149 ++++ .../app/purchase/purchase.component.spec.ts | 25 + .../src/app/purchase/purchase.component.ts | 353 ++++++++ .../src/app/purchase/purchase.module.spec.ts | 13 + overlord/src/app/purchase/purchase.module.ts | 84 ++ .../src/app/purchase/purchase.service.spec.ts | 15 + .../src/app/purchases/purchases-datasource.ts | 63 ++ .../purchases-resolver.service.spec.ts | 15 + .../purchases/purchases-resolver.service.ts | 20 + .../purchases-routing.module.spec.ts | 13 + .../app/purchases/purchases-routing.module.ts | 37 + .../src/app/purchases/purchases.component.css | 12 + .../app/purchases/purchases.component.html | 74 ++ .../app/purchases/purchases.component.spec.ts | 25 + .../src/app/purchases/purchases.component.ts | 71 ++ .../app/purchases/purchases.module.spec.ts | 13 + .../src/app/purchases/purchases.module.ts | 75 ++ .../app/purchases/purchases.service.spec.ts | 15 + .../src/app/purchases/purchases.service.ts | 37 + overlord/src/app/purchases/purchases.ts | 15 + .../raw-material-cost-datasource.ts | 57 ++ ...raw-material-cost-resolver.service.spec.ts | 15 + .../raw-material-cost-resolver.service.ts | 21 + .../raw-material-cost-routing.module.spec.ts | 13 + .../raw-material-cost-routing.module.ts | 49 ++ .../raw-material-cost.component.css | 12 + .../raw-material-cost.component.html | 100 +++ .../raw-material-cost.component.spec.ts | 25 + .../raw-material-cost.component.ts | 81 ++ .../raw-material-cost.module.spec.ts | 13 + .../raw-material-cost.module.ts | 75 ++ .../raw-material-cost.service.spec.ts | 15 + .../raw-material-cost.service.ts | 37 + .../raw-material-cost/raw-material-cost.ts | 20 + .../receipt-accounts-resolver.service.spec.ts | 15 + .../receipt-accounts-resolver.service.ts | 18 + .../src/app/receipt/receipt-datasource.ts | 18 + .../app/receipt/receipt-dialog.component.css | 0 .../app/receipt/receipt-dialog.component.html | 30 + .../receipt/receipt-dialog.component.spec.ts | 25 + .../app/receipt/receipt-dialog.component.ts | 76 ++ .../receipt/receipt-resolver.service.spec.ts | 15 + .../app/receipt/receipt-resolver.service.ts | 26 + .../receipt/receipt-routing.module.spec.ts | 13 + .../src/app/receipt/receipt-routing.module.ts | 52 ++ .../src/app/receipt/receipt.component.css | 32 + .../src/app/receipt/receipt.component.html | 113 +++ .../src/app/receipt/receipt.component.spec.ts | 25 + overlord/src/app/receipt/receipt.component.ts | 333 ++++++++ .../src/app/receipt/receipt.module.spec.ts | 13 + overlord/src/app/receipt/receipt.module.ts | 84 ++ .../src/app/receipt/receipt.service.spec.ts | 15 + .../lock-information-resolver.service.ts | 17 + .../settings/maintenance-resolver.service.ts | 17 + .../app/settings/settings-routing.module.ts | 36 + .../src/app/settings/settings.component.css | 32 + .../src/app/settings/settings.component.html | 127 +++ .../src/app/settings/settings.component.ts | 238 ++++++ overlord/src/app/settings/settings.module.ts | 61 ++ overlord/src/app/settings/settings.service.ts | 87 ++ .../src/app/shared/accounting.pipe.spec.ts | 8 + overlord/src/app/shared/accounting.pipe.ts | 20 + overlord/src/app/shared/clear.pipe.spec.ts | 8 + overlord/src/app/shared/clear.pipe.ts | 12 + .../confirm-dialog.component.css | 0 .../confirm-dialog.component.html | 8 + .../confirm-dialog.component.spec.ts | 25 + .../confirm-dialog.component.ts | 16 + .../src/app/shared/cookie.service.spec.ts | 15 + overlord/src/app/shared/cookie.service.ts | 36 + .../image-dialog/image-dialog.component.css | 3 + .../image-dialog/image-dialog.component.html | 1 + .../image-dialog.component.spec.ts | 25 + .../image-dialog/image-dialog.component.ts | 20 + .../src/app/shared/local-time.pipe.spec.ts | 8 + overlord/src/app/shared/local-time.pipe.ts | 16 + overlord/src/app/shared/shared.module.spec.ts | 13 + overlord/src/app/shared/shared.module.ts | 34 + .../src/app/shared/tokenizer.service.spec.ts | 15 + overlord/src/app/shared/tokenizer.service.ts | 50 ++ .../stock-movement-datasource.ts | 67 ++ .../stock-movement-resolver.service.spec.ts | 15 + .../stock-movement-resolver.service.ts | 20 + .../stock-movement-routing.module.spec.ts | 13 + .../stock-movement-routing.module.ts | 37 + .../stock-movement.component.css | 12 + .../stock-movement.component.html | 73 ++ .../stock-movement.component.spec.ts | 25 + .../stock-movement.component.ts | 70 ++ .../stock-movement.module.spec.ts | 13 + .../stock-movement/stock-movement.module.ts | 75 ++ .../stock-movement.service.spec.ts | 15 + .../stock-movement/stock-movement.service.ts | 37 + .../src/app/stock-movement/stock-movement.ts | 15 + .../trial-balance/trial-balance-datasource.ts | 63 ++ .../trial-balance-resolver.service.spec.ts | 15 + .../trial-balance-resolver.service.ts | 19 + .../trial-balance-routing.module.spec.ts | 13 + .../trial-balance-routing.module.ts | 47 ++ .../trial-balance/trial-balance.component.css | 4 + .../trial-balance.component.html | 55 ++ .../trial-balance.component.spec.ts | 25 + .../trial-balance/trial-balance.component.ts | 56 ++ .../trial-balance.module.spec.ts | 13 + .../app/trial-balance/trial-balance.module.ts | 71 ++ .../trial-balance.service.spec.ts | 15 + .../trial-balance/trial-balance.service.ts | 31 + .../src/app/trial-balance/trial-balance.ts | 11 + .../src/app/unposted/unposted-datasource.ts | 63 ++ .../unposted-resolver.service.spec.ts | 15 + .../app/unposted/unposted-resolver.service.ts | 18 + .../unposted/unposted-routing.module.spec.ts | 13 + .../app/unposted/unposted-routing.module.ts | 36 + .../src/app/unposted/unposted.component.css | 4 + .../src/app/unposted/unposted.component.html | 65 ++ .../app/unposted/unposted.component.spec.ts | 25 + .../src/app/unposted/unposted.component.ts | 36 + .../src/app/unposted/unposted.module.spec.ts | 13 + overlord/src/app/unposted/unposted.module.ts | 56 ++ .../src/app/unposted/unposted.service.spec.ts | 15 + overlord/src/app/unposted/unposted.service.ts | 26 + overlord/src/app/unposted/unposted.ts | 11 + .../user-detail/user-detail.component.css | 3 + .../user-detail/user-detail.component.html | 42 + .../user-detail/user-detail.component.spec.ts | 25 + .../user/user-detail/user-detail.component.ts | 114 +++ .../user/user-list-resolver.service.spec.ts | 15 + .../app/user/user-list-resolver.service.ts | 18 + .../user/user-list/user-list-datasource.ts | 58 ++ .../user/user-list/user-list.component.css | 0 .../user/user-list/user-list.component.html | 41 + .../user-list/user-list.component.spec.ts | 23 + .../app/user/user-list/user-list.component.ts | 30 + .../app/user/user-resolver.service.spec.ts | 15 + .../src/app/user/user-resolver.service.ts | 19 + .../src/app/user/user-routing.module.spec.ts | 13 + overlord/src/app/user/user-routing.module.ts | 58 ++ overlord/src/app/user/user.module.spec.ts | 13 + overlord/src/app/user/user.module.ts | 50 ++ overlord/src/app/user/user.service.spec.ts | 15 + overlord/src/app/user/user.service.ts | 74 ++ overlord/src/app/user/user.ts | 19 + overlord/src/assets/.gitkeep | 0 overlord/src/browserslist | 9 + overlord/src/environments/environment.prod.ts | 3 + overlord/src/environments/environment.ts | 15 + overlord/src/favicon.ico | Bin 0 -> 5430 bytes overlord/src/index.html | 16 + overlord/src/karma.conf.js | 31 + overlord/src/main.ts | 12 + overlord/src/polyfills.ts | 80 ++ overlord/src/styles.css | 3 + overlord/src/test.ts | 20 + .../static => overlord}/src/tsconfig.app.json | 2 +- overlord/src/tsconfig.spec.json | 19 + overlord/src/tslint.json | 17 + {brewman/static => overlord}/tsconfig.json | 2 +- overlord/tslint.json | 130 +++ setup.py | 4 +- 1380 files changed, 23914 insertions(+), 18722 deletions(-) delete mode 100644 brewman/static/package.json delete mode 100644 brewman/static/src/app/404.html delete mode 100644 brewman/static/src/app/account/account-detail.html delete mode 100644 brewman/static/src/app/account/account-list.component.js delete mode 100644 brewman/static/src/app/account/account-list.component.js.map delete mode 100644 brewman/static/src/app/account/account-list.component.ts delete mode 100644 brewman/static/src/app/account/account-list.controller.js delete mode 100644 brewman/static/src/app/account/account-list.controller.js.map delete mode 100644 brewman/static/src/app/account/account-list.controller.ts delete mode 100644 brewman/static/src/app/account/account-list.html delete mode 100644 brewman/static/src/app/account/account-list.resolver.js delete mode 100644 brewman/static/src/app/account/account-list.resolver.js.map delete mode 100644 brewman/static/src/app/account/account-list.resolver.ts delete mode 100644 brewman/static/src/app/account/account-type.service.js delete mode 100644 brewman/static/src/app/account/account-type.service.js.map delete mode 100644 brewman/static/src/app/account/account-type.service.ts delete mode 100644 brewman/static/src/app/account/account-types.resolver.js delete mode 100644 brewman/static/src/app/account/account-types.resolver.js.map delete mode 100644 brewman/static/src/app/account/account-types.resolver.ts delete mode 100644 brewman/static/src/app/account/account.component.js delete mode 100644 brewman/static/src/app/account/account.component.js.map delete mode 100644 brewman/static/src/app/account/account.component.ts delete mode 100644 brewman/static/src/app/account/account.controller.js delete mode 100644 brewman/static/src/app/account/account.controller.js.map delete mode 100644 brewman/static/src/app/account/account.controller.ts delete mode 100644 brewman/static/src/app/account/account.resolver.js delete mode 100644 brewman/static/src/app/account/account.resolver.js.map delete mode 100644 brewman/static/src/app/account/account.resolver.ts delete mode 100644 brewman/static/src/app/account/account.service.js delete mode 100644 brewman/static/src/app/account/account.service.js.map delete mode 100644 brewman/static/src/app/account/account.service.ts delete mode 100644 brewman/static/src/app/account/payment-accounts.resolver.js delete mode 100644 brewman/static/src/app/account/payment-accounts.resolver.js.map delete mode 100644 brewman/static/src/app/account/payment-accounts.resolver.ts delete mode 100644 brewman/static/src/app/account/receipt-accounts.resolver.js delete mode 100644 brewman/static/src/app/account/receipt-accounts.resolver.js.map delete mode 100644 brewman/static/src/app/account/receipt-accounts.resolver.ts delete mode 100644 brewman/static/src/app/app.module.js delete mode 100644 brewman/static/src/app/app.module.js.map delete mode 100644 brewman/static/src/app/app.module.ts delete mode 100644 brewman/static/src/app/attendance/attendance-info.resolver.js delete mode 100644 brewman/static/src/app/attendance/attendance-info.resolver.js.map delete mode 100644 brewman/static/src/app/attendance/attendance-info.resolver.ts delete mode 100644 brewman/static/src/app/attendance/attendance-sub.controller.js delete mode 100644 brewman/static/src/app/attendance/attendance-sub.controller.js.map delete mode 100644 brewman/static/src/app/attendance/attendance-sub.controller.ts delete mode 100644 brewman/static/src/app/attendance/attendance-sub.directive.js delete mode 100644 brewman/static/src/app/attendance/attendance-sub.directive.js.map delete mode 100644 brewman/static/src/app/attendance/attendance-sub.directive.ts delete mode 100644 brewman/static/src/app/attendance/attendance-sub.html delete mode 100644 brewman/static/src/app/attendance/attendance-types.resolver.js delete mode 100644 brewman/static/src/app/attendance/attendance-types.resolver.js.map delete mode 100644 brewman/static/src/app/attendance/attendance-types.resolver.ts delete mode 100644 brewman/static/src/app/attendance/attendance-types.service.js delete mode 100644 brewman/static/src/app/attendance/attendance-types.service.js.map delete mode 100644 brewman/static/src/app/attendance/attendance-types.service.ts delete mode 100644 brewman/static/src/app/attendance/attendance.component.js delete mode 100644 brewman/static/src/app/attendance/attendance.component.js.map delete mode 100644 brewman/static/src/app/attendance/attendance.component.ts delete mode 100644 brewman/static/src/app/attendance/attendance.controller.js delete mode 100644 brewman/static/src/app/attendance/attendance.controller.js.map delete mode 100644 brewman/static/src/app/attendance/attendance.controller.ts delete mode 100644 brewman/static/src/app/attendance/attendance.html delete mode 100644 brewman/static/src/app/attendance/attendance.service.js delete mode 100644 brewman/static/src/app/attendance/attendance.service.js.map delete mode 100644 brewman/static/src/app/attendance/attendance.service.ts delete mode 100644 brewman/static/src/app/balance-sheet/balance-sheet.component.js delete mode 100644 brewman/static/src/app/balance-sheet/balance-sheet.component.js.map delete mode 100644 brewman/static/src/app/balance-sheet/balance-sheet.component.ts delete mode 100644 brewman/static/src/app/balance-sheet/balance-sheet.controller.js delete mode 100644 brewman/static/src/app/balance-sheet/balance-sheet.controller.js.map delete mode 100644 brewman/static/src/app/balance-sheet/balance-sheet.controller.ts delete mode 100644 brewman/static/src/app/balance-sheet/balance-sheet.html delete mode 100644 brewman/static/src/app/balance-sheet/balance-sheet.resolver.js delete mode 100644 brewman/static/src/app/balance-sheet/balance-sheet.resolver.js.map delete mode 100644 brewman/static/src/app/balance-sheet/balance-sheet.resolver.ts delete mode 100644 brewman/static/src/app/balance-sheet/balance-sheet.service.js delete mode 100644 brewman/static/src/app/balance-sheet/balance-sheet.service.js.map delete mode 100644 brewman/static/src/app/balance-sheet/balance-sheet.service.ts delete mode 100644 brewman/static/src/app/base.controller.js delete mode 100644 brewman/static/src/app/base.controller.js.map delete mode 100644 brewman/static/src/app/base.controller.ts delete mode 100644 brewman/static/src/app/cash-flow/cash-flow.component.js delete mode 100644 brewman/static/src/app/cash-flow/cash-flow.component.js.map delete mode 100644 brewman/static/src/app/cash-flow/cash-flow.component.ts delete mode 100644 brewman/static/src/app/cash-flow/cash-flow.controller.js delete mode 100644 brewman/static/src/app/cash-flow/cash-flow.controller.js.map delete mode 100644 brewman/static/src/app/cash-flow/cash-flow.controller.ts delete mode 100644 brewman/static/src/app/cash-flow/cash-flow.html delete mode 100644 brewman/static/src/app/cash-flow/cash-flow.resolver.js delete mode 100644 brewman/static/src/app/cash-flow/cash-flow.resolver.js.map delete mode 100644 brewman/static/src/app/cash-flow/cash-flow.resolver.ts delete mode 100644 brewman/static/src/app/cash-flow/cash-flow.service.js delete mode 100644 brewman/static/src/app/cash-flow/cash-flow.service.js.map delete mode 100644 brewman/static/src/app/cash-flow/cash-flow.service.ts delete mode 100644 brewman/static/src/app/client/client-detail.html delete mode 100644 brewman/static/src/app/client/client-list.component.js delete mode 100644 brewman/static/src/app/client/client-list.component.js.map delete mode 100644 brewman/static/src/app/client/client-list.component.ts delete mode 100644 brewman/static/src/app/client/client-list.controller.js delete mode 100644 brewman/static/src/app/client/client-list.controller.js.map delete mode 100644 brewman/static/src/app/client/client-list.controller.ts delete mode 100644 brewman/static/src/app/client/client-list.html delete mode 100644 brewman/static/src/app/client/client-list.resolver.js delete mode 100644 brewman/static/src/app/client/client-list.resolver.js.map delete mode 100644 brewman/static/src/app/client/client-list.resolver.ts delete mode 100644 brewman/static/src/app/client/client.component.js delete mode 100644 brewman/static/src/app/client/client.component.js.map delete mode 100644 brewman/static/src/app/client/client.component.ts delete mode 100644 brewman/static/src/app/client/client.controller.js delete mode 100644 brewman/static/src/app/client/client.controller.js.map delete mode 100644 brewman/static/src/app/client/client.controller.ts delete mode 100644 brewman/static/src/app/client/client.resolver.js delete mode 100644 brewman/static/src/app/client/client.resolver.js.map delete mode 100644 brewman/static/src/app/client/client.resolver.ts delete mode 100644 brewman/static/src/app/client/client.service.js delete mode 100644 brewman/static/src/app/client/client.service.js.map delete mode 100644 brewman/static/src/app/client/client.service.ts delete mode 100644 brewman/static/src/app/closing-stock/closing-stock.component.js delete mode 100644 brewman/static/src/app/closing-stock/closing-stock.component.js.map delete mode 100644 brewman/static/src/app/closing-stock/closing-stock.component.ts delete mode 100644 brewman/static/src/app/closing-stock/closing-stock.controller.js delete mode 100644 brewman/static/src/app/closing-stock/closing-stock.controller.js.map delete mode 100644 brewman/static/src/app/closing-stock/closing-stock.controller.ts delete mode 100644 brewman/static/src/app/closing-stock/closing-stock.html delete mode 100644 brewman/static/src/app/closing-stock/closing-stock.resolver.js delete mode 100644 brewman/static/src/app/closing-stock/closing-stock.resolver.js.map delete mode 100644 brewman/static/src/app/closing-stock/closing-stock.resolver.ts delete mode 100644 brewman/static/src/app/closing-stock/closing-stock.service.js delete mode 100644 brewman/static/src/app/closing-stock/closing-stock.service.js.map delete mode 100644 brewman/static/src/app/closing-stock/closing-stock.service.ts delete mode 100644 brewman/static/src/app/common/accounting.filter.js delete mode 100644 brewman/static/src/app/common/accounting.filter.js.map delete mode 100644 brewman/static/src/app/common/accounting.filter.ts delete mode 100644 brewman/static/src/app/common/as-date.filter.js delete mode 100644 brewman/static/src/app/common/as-date.filter.js.map delete mode 100644 brewman/static/src/app/common/as-date.filter.ts delete mode 100644 brewman/static/src/app/common/auth.service.js delete mode 100644 brewman/static/src/app/common/auth.service.js.map delete mode 100644 brewman/static/src/app/common/auth.service.ts delete mode 100644 brewman/static/src/app/common/clr.filter.js delete mode 100644 brewman/static/src/app/common/clr.filter.js.map delete mode 100644 brewman/static/src/app/common/clr.filter.ts delete mode 100644 brewman/static/src/app/common/credentials.service.js delete mode 100644 brewman/static/src/app/common/credentials.service.js.map delete mode 100644 brewman/static/src/app/common/credentials.service.ts delete mode 100644 brewman/static/src/app/common/debit.filter.js delete mode 100644 brewman/static/src/app/common/debit.filter.js.map delete mode 100644 brewman/static/src/app/common/debit.filter.ts delete mode 100644 brewman/static/src/app/common/fadey.directive.js delete mode 100644 brewman/static/src/app/common/fadey.directive.js.map delete mode 100644 brewman/static/src/app/common/fadey.directive.ts delete mode 100644 brewman/static/src/app/common/file-upload.directive.js delete mode 100644 brewman/static/src/app/common/file-upload.directive.js.map delete mode 100644 brewman/static/src/app/common/file-upload.directive.ts delete mode 100644 brewman/static/src/app/common/focus-on.directive.js delete mode 100644 brewman/static/src/app/common/focus-on.directive.js.map delete mode 100644 brewman/static/src/app/common/focus-on.directive.ts delete mode 100644 brewman/static/src/app/common/growl.service.js delete mode 100644 brewman/static/src/app/common/growl.service.js.map delete mode 100644 brewman/static/src/app/common/growl.service.ts delete mode 100644 brewman/static/src/app/common/journal-debit.filter.js delete mode 100644 brewman/static/src/app/common/journal-debit.filter.js.map delete mode 100644 brewman/static/src/app/common/journal-debit.filter.ts delete mode 100644 brewman/static/src/app/common/keypress.directive.js delete mode 100644 brewman/static/src/app/common/keypress.directive.js.map delete mode 100644 brewman/static/src/app/common/keypress.directive.ts delete mode 100644 brewman/static/src/app/common/local-time.filter.js delete mode 100644 brewman/static/src/app/common/local-time.filter.js.map delete mode 100644 brewman/static/src/app/common/local-time.filter.ts delete mode 100644 brewman/static/src/app/common/math-solver.service.js delete mode 100644 brewman/static/src/app/common/math-solver.service.js.map delete mode 100644 brewman/static/src/app/common/math-solver.service.ts delete mode 100644 brewman/static/src/app/common/md.filter.js delete mode 100644 brewman/static/src/app/common/md.filter.js.map delete mode 100644 brewman/static/src/app/common/md.filter.ts delete mode 100644 brewman/static/src/app/common/message.service.js delete mode 100644 brewman/static/src/app/common/message.service.js.map delete mode 100644 brewman/static/src/app/common/message.service.ts delete mode 100644 brewman/static/src/app/common/ng-growl.directive.js delete mode 100644 brewman/static/src/app/common/ng-growl.directive.js.map delete mode 100644 brewman/static/src/app/common/ng-growl.directive.ts delete mode 100644 brewman/static/src/app/common/on-return.directive.js delete mode 100644 brewman/static/src/app/common/on-return.directive.js.map delete mode 100644 brewman/static/src/app/common/on-return.directive.ts delete mode 100644 brewman/static/src/app/common/percent.filter.js delete mode 100644 brewman/static/src/app/common/percent.filter.js.map delete mode 100644 brewman/static/src/app/common/percent.filter.ts delete mode 100644 brewman/static/src/app/common/posted.filter.js delete mode 100644 brewman/static/src/app/common/posted.filter.js.map delete mode 100644 brewman/static/src/app/common/posted.filter.ts delete mode 100644 brewman/static/src/app/common/reader-promise.service.js delete mode 100644 brewman/static/src/app/common/reader-promise.service.js.map delete mode 100644 brewman/static/src/app/common/reader-promise.service.ts delete mode 100644 brewman/static/src/app/common/saveButtonText.filter.js delete mode 100644 brewman/static/src/app/common/saveButtonText.filter.js.map delete mode 100644 brewman/static/src/app/common/saveButtonText.filter.ts delete mode 100644 brewman/static/src/app/common/tan-click.directive.js delete mode 100644 brewman/static/src/app/common/tan-click.directive.js.map delete mode 100644 brewman/static/src/app/common/tan-click.directive.ts delete mode 100644 brewman/static/src/app/common/tokenizer.service.js delete mode 100644 brewman/static/src/app/common/tokenizer.service.js.map delete mode 100644 brewman/static/src/app/common/tokenizer.service.ts delete mode 100644 brewman/static/src/app/common/upload-image-resizer.service.js delete mode 100644 brewman/static/src/app/common/upload-image-resizer.service.js.map delete mode 100644 brewman/static/src/app/common/upload-image-resizer.service.ts delete mode 100644 brewman/static/src/app/common/voucher.service.js delete mode 100644 brewman/static/src/app/common/voucher.service.js.map delete mode 100644 brewman/static/src/app/common/voucher.service.ts delete mode 100644 brewman/static/src/app/cost-centre/cost-centre-detail.html delete mode 100644 brewman/static/src/app/cost-centre/cost-centre-list.component.js delete mode 100644 brewman/static/src/app/cost-centre/cost-centre-list.component.js.map delete mode 100644 brewman/static/src/app/cost-centre/cost-centre-list.component.ts delete mode 100644 brewman/static/src/app/cost-centre/cost-centre-list.controller.js delete mode 100644 brewman/static/src/app/cost-centre/cost-centre-list.controller.js.map delete mode 100644 brewman/static/src/app/cost-centre/cost-centre-list.controller.ts delete mode 100644 brewman/static/src/app/cost-centre/cost-centre-list.html delete mode 100644 brewman/static/src/app/cost-centre/cost-centre-list.resolver.js delete mode 100644 brewman/static/src/app/cost-centre/cost-centre-list.resolver.js.map delete mode 100644 brewman/static/src/app/cost-centre/cost-centre-list.resolver.ts delete mode 100644 brewman/static/src/app/cost-centre/cost-centre.component.js delete mode 100644 brewman/static/src/app/cost-centre/cost-centre.component.js.map delete mode 100644 brewman/static/src/app/cost-centre/cost-centre.component.ts delete mode 100644 brewman/static/src/app/cost-centre/cost-centre.controller.js delete mode 100644 brewman/static/src/app/cost-centre/cost-centre.controller.js.map delete mode 100644 brewman/static/src/app/cost-centre/cost-centre.controller.ts delete mode 100644 brewman/static/src/app/cost-centre/cost-centre.resolver.js delete mode 100644 brewman/static/src/app/cost-centre/cost-centre.resolver.js.map delete mode 100644 brewman/static/src/app/cost-centre/cost-centre.resolver.ts delete mode 100644 brewman/static/src/app/cost-centre/cost-centre.service.js delete mode 100644 brewman/static/src/app/cost-centre/cost-centre.service.js.map delete mode 100644 brewman/static/src/app/cost-centre/cost-centre.service.ts delete mode 100644 brewman/static/src/app/daybook/daybook.component.js delete mode 100644 brewman/static/src/app/daybook/daybook.component.js.map delete mode 100644 brewman/static/src/app/daybook/daybook.component.ts delete mode 100644 brewman/static/src/app/daybook/daybook.controller.js delete mode 100644 brewman/static/src/app/daybook/daybook.controller.js.map delete mode 100644 brewman/static/src/app/daybook/daybook.controller.ts delete mode 100644 brewman/static/src/app/daybook/daybook.html delete mode 100644 brewman/static/src/app/daybook/daybook.resolver.js delete mode 100644 brewman/static/src/app/daybook/daybook.resolver.js.map delete mode 100644 brewman/static/src/app/daybook/daybook.resolver.ts delete mode 100644 brewman/static/src/app/daybook/daybook.service.js delete mode 100644 brewman/static/src/app/daybook/daybook.service.js.map delete mode 100644 brewman/static/src/app/daybook/daybook.service.ts delete mode 100644 brewman/static/src/app/employee/employee-attendance-info.resolver.js delete mode 100644 brewman/static/src/app/employee/employee-attendance-info.resolver.js.map delete mode 100644 brewman/static/src/app/employee/employee-attendance-info.resolver.ts delete mode 100644 brewman/static/src/app/employee/employee-attendance-sub.directive.js delete mode 100644 brewman/static/src/app/employee/employee-attendance-sub.directive.js.map delete mode 100644 brewman/static/src/app/employee/employee-attendance-sub.directive.ts delete mode 100644 brewman/static/src/app/employee/employee-attendance-sub.html delete mode 100644 brewman/static/src/app/employee/employee-attendance.component.js delete mode 100644 brewman/static/src/app/employee/employee-attendance.component.js.map delete mode 100644 brewman/static/src/app/employee/employee-attendance.component.ts delete mode 100644 brewman/static/src/app/employee/employee-attendance.controller.js delete mode 100644 brewman/static/src/app/employee/employee-attendance.controller.js.map delete mode 100644 brewman/static/src/app/employee/employee-attendance.controller.ts delete mode 100644 brewman/static/src/app/employee/employee-attendance.html delete mode 100644 brewman/static/src/app/employee/employee-attendance.service.js delete mode 100644 brewman/static/src/app/employee/employee-attendance.service.js.map delete mode 100644 brewman/static/src/app/employee/employee-attendance.service.ts delete mode 100644 brewman/static/src/app/employee/employee-detail.html delete mode 100644 brewman/static/src/app/employee/employee-functions.component.js delete mode 100644 brewman/static/src/app/employee/employee-functions.component.js.map delete mode 100644 brewman/static/src/app/employee/employee-functions.component.ts delete mode 100644 brewman/static/src/app/employee/employee-functions.controller.js delete mode 100644 brewman/static/src/app/employee/employee-functions.controller.js.map delete mode 100644 brewman/static/src/app/employee/employee-functions.controller.ts delete mode 100644 brewman/static/src/app/employee/employee-functions.html delete mode 100644 brewman/static/src/app/employee/employee-list.component.js delete mode 100644 brewman/static/src/app/employee/employee-list.component.js.map delete mode 100644 brewman/static/src/app/employee/employee-list.component.ts delete mode 100644 brewman/static/src/app/employee/employee-list.controller.js delete mode 100644 brewman/static/src/app/employee/employee-list.controller.js.map delete mode 100644 brewman/static/src/app/employee/employee-list.controller.ts delete mode 100644 brewman/static/src/app/employee/employee-list.html delete mode 100644 brewman/static/src/app/employee/employee-list.resolver.js delete mode 100644 brewman/static/src/app/employee/employee-list.resolver.js.map delete mode 100644 brewman/static/src/app/employee/employee-list.resolver.ts delete mode 100644 brewman/static/src/app/employee/employee.component.js delete mode 100644 brewman/static/src/app/employee/employee.component.js.map delete mode 100644 brewman/static/src/app/employee/employee.component.ts delete mode 100644 brewman/static/src/app/employee/employee.controller.js delete mode 100644 brewman/static/src/app/employee/employee.controller.js.map delete mode 100644 brewman/static/src/app/employee/employee.controller.ts delete mode 100644 brewman/static/src/app/employee/employee.resolver.js delete mode 100644 brewman/static/src/app/employee/employee.resolver.js.map delete mode 100644 brewman/static/src/app/employee/employee.resolver.ts delete mode 100644 brewman/static/src/app/employee/employee.service.js delete mode 100644 brewman/static/src/app/employee/employee.service.js.map delete mode 100644 brewman/static/src/app/employee/employee.service.ts delete mode 100644 brewman/static/src/app/group/group-detail.html delete mode 100644 brewman/static/src/app/group/group-list.component.js delete mode 100644 brewman/static/src/app/group/group-list.component.js.map delete mode 100644 brewman/static/src/app/group/group-list.component.ts delete mode 100644 brewman/static/src/app/group/group-list.controller.js delete mode 100644 brewman/static/src/app/group/group-list.controller.js.map delete mode 100644 brewman/static/src/app/group/group-list.controller.ts delete mode 100644 brewman/static/src/app/group/group-list.html delete mode 100644 brewman/static/src/app/group/group-list.resolver.js delete mode 100644 brewman/static/src/app/group/group-list.resolver.js.map delete mode 100644 brewman/static/src/app/group/group-list.resolver.ts delete mode 100644 brewman/static/src/app/group/group.component.js delete mode 100644 brewman/static/src/app/group/group.component.js.map delete mode 100644 brewman/static/src/app/group/group.component.ts delete mode 100644 brewman/static/src/app/group/group.controller.js delete mode 100644 brewman/static/src/app/group/group.controller.js.map delete mode 100644 brewman/static/src/app/group/group.controller.ts delete mode 100644 brewman/static/src/app/group/group.resolver.js delete mode 100644 brewman/static/src/app/group/group.resolver.js.map delete mode 100644 brewman/static/src/app/group/group.resolver.ts delete mode 100644 brewman/static/src/app/group/group.service.js delete mode 100644 brewman/static/src/app/group/group.service.js.map delete mode 100644 brewman/static/src/app/group/group.service.ts delete mode 100644 brewman/static/src/app/home/home.component.js delete mode 100644 brewman/static/src/app/home/home.component.js.map delete mode 100644 brewman/static/src/app/home/home.component.ts delete mode 100644 brewman/static/src/app/home/home.controller.js delete mode 100644 brewman/static/src/app/home/home.controller.js.map delete mode 100644 brewman/static/src/app/home/home.controller.ts delete mode 100644 brewman/static/src/app/incentive/incentive-voucher.resolver.js delete mode 100644 brewman/static/src/app/incentive/incentive-voucher.resolver.js.map delete mode 100644 brewman/static/src/app/incentive/incentive-voucher.resolver.ts delete mode 100644 brewman/static/src/app/incentive/incentive.component.js delete mode 100644 brewman/static/src/app/incentive/incentive.component.js.map delete mode 100644 brewman/static/src/app/incentive/incentive.component.ts delete mode 100644 brewman/static/src/app/incentive/incentive.controller.js delete mode 100644 brewman/static/src/app/incentive/incentive.controller.js.map delete mode 100644 brewman/static/src/app/incentive/incentive.controller.ts delete mode 100644 brewman/static/src/app/incentive/incentive.html delete mode 100644 brewman/static/src/app/issue/batch.service.js delete mode 100644 brewman/static/src/app/issue/batch.service.js.map delete mode 100644 brewman/static/src/app/issue/batch.service.ts delete mode 100644 brewman/static/src/app/issue/issue-grid.resolver.js delete mode 100644 brewman/static/src/app/issue/issue-grid.resolver.js.map delete mode 100644 brewman/static/src/app/issue/issue-grid.resolver.ts delete mode 100644 brewman/static/src/app/issue/issue-grid.service.js delete mode 100644 brewman/static/src/app/issue/issue-grid.service.js.map delete mode 100644 brewman/static/src/app/issue/issue-grid.service.ts delete mode 100644 brewman/static/src/app/issue/issue-modal.controller.js delete mode 100644 brewman/static/src/app/issue/issue-modal.controller.js.map delete mode 100644 brewman/static/src/app/issue/issue-modal.controller.ts delete mode 100644 brewman/static/src/app/issue/issue-modal.html delete mode 100644 brewman/static/src/app/issue/issue-voucher.resolver.js delete mode 100644 brewman/static/src/app/issue/issue-voucher.resolver.js.map delete mode 100644 brewman/static/src/app/issue/issue-voucher.resolver.ts delete mode 100644 brewman/static/src/app/issue/issue.component.js delete mode 100644 brewman/static/src/app/issue/issue.component.js.map delete mode 100644 brewman/static/src/app/issue/issue.component.ts delete mode 100644 brewman/static/src/app/issue/issue.controller.js delete mode 100644 brewman/static/src/app/issue/issue.controller.js.map delete mode 100644 brewman/static/src/app/issue/issue.controller.ts delete mode 100644 brewman/static/src/app/issue/issue.html delete mode 100644 brewman/static/src/app/journal/journal-modal.controller.js delete mode 100644 brewman/static/src/app/journal/journal-modal.controller.js.map delete mode 100644 brewman/static/src/app/journal/journal-modal.controller.ts delete mode 100644 brewman/static/src/app/journal/journal-modal.html delete mode 100644 brewman/static/src/app/journal/journal-voucher.resolver.js delete mode 100644 brewman/static/src/app/journal/journal-voucher.resolver.js.map delete mode 100644 brewman/static/src/app/journal/journal-voucher.resolver.ts delete mode 100644 brewman/static/src/app/journal/journal.component.js delete mode 100644 brewman/static/src/app/journal/journal.component.js.map delete mode 100644 brewman/static/src/app/journal/journal.component.ts delete mode 100644 brewman/static/src/app/journal/journal.controller.js delete mode 100644 brewman/static/src/app/journal/journal.controller.js.map delete mode 100644 brewman/static/src/app/journal/journal.controller.ts delete mode 100644 brewman/static/src/app/journal/journal.html delete mode 100644 brewman/static/src/app/ledger/ledger.component.js delete mode 100644 brewman/static/src/app/ledger/ledger.component.js.map delete mode 100644 brewman/static/src/app/ledger/ledger.component.ts delete mode 100644 brewman/static/src/app/ledger/ledger.controller.js delete mode 100644 brewman/static/src/app/ledger/ledger.controller.js.map delete mode 100644 brewman/static/src/app/ledger/ledger.controller.ts delete mode 100644 brewman/static/src/app/ledger/ledger.html delete mode 100644 brewman/static/src/app/ledger/ledger.resolver.js delete mode 100644 brewman/static/src/app/ledger/ledger.resolver.js.map delete mode 100644 brewman/static/src/app/ledger/ledger.resolver.ts delete mode 100644 brewman/static/src/app/ledger/ledger.service.js delete mode 100644 brewman/static/src/app/ledger/ledger.service.js.map delete mode 100644 brewman/static/src/app/ledger/ledger.service.ts delete mode 100644 brewman/static/src/app/login/login.component.js delete mode 100644 brewman/static/src/app/login/login.component.js.map delete mode 100644 brewman/static/src/app/login/login.component.ts delete mode 100644 brewman/static/src/app/login/login.controller.js delete mode 100644 brewman/static/src/app/login/login.controller.js.map delete mode 100644 brewman/static/src/app/login/login.controller.ts delete mode 100644 brewman/static/src/app/login/login.html delete mode 100644 brewman/static/src/app/login/logout.component.js delete mode 100644 brewman/static/src/app/login/logout.component.js.map delete mode 100644 brewman/static/src/app/login/logout.component.ts delete mode 100644 brewman/static/src/app/login/logout.controller.js delete mode 100644 brewman/static/src/app/login/logout.controller.js.map delete mode 100644 brewman/static/src/app/login/logout.controller.ts delete mode 100644 brewman/static/src/app/net-transactions/net-transactions.component.js delete mode 100644 brewman/static/src/app/net-transactions/net-transactions.component.js.map delete mode 100644 brewman/static/src/app/net-transactions/net-transactions.component.ts delete mode 100644 brewman/static/src/app/net-transactions/net-transactions.controller.js delete mode 100644 brewman/static/src/app/net-transactions/net-transactions.controller.js.map delete mode 100644 brewman/static/src/app/net-transactions/net-transactions.controller.ts delete mode 100644 brewman/static/src/app/net-transactions/net-transactions.html delete mode 100644 brewman/static/src/app/net-transactions/net-transactions.resolver.js delete mode 100644 brewman/static/src/app/net-transactions/net-transactions.resolver.js.map delete mode 100644 brewman/static/src/app/net-transactions/net-transactions.resolver.ts delete mode 100644 brewman/static/src/app/net-transactions/net-transactions.service.js delete mode 100644 brewman/static/src/app/net-transactions/net-transactions.service.js.map delete mode 100644 brewman/static/src/app/net-transactions/net-transactions.service.ts delete mode 100644 brewman/static/src/app/overlord.app.js delete mode 100644 brewman/static/src/app/overlord.app.js.map delete mode 100644 brewman/static/src/app/overlord.app.ts delete mode 100644 brewman/static/src/app/overlord.components.js delete mode 100644 brewman/static/src/app/overlord.components.js.map delete mode 100644 brewman/static/src/app/overlord.components.ts delete mode 100644 brewman/static/src/app/overlord.config.js delete mode 100644 brewman/static/src/app/overlord.config.js.map delete mode 100644 brewman/static/src/app/overlord.config.ts delete mode 100644 brewman/static/src/app/overlord.directive.js delete mode 100644 brewman/static/src/app/overlord.directive.js.map delete mode 100644 brewman/static/src/app/overlord.directive.ts delete mode 100644 brewman/static/src/app/overlord.filters.js delete mode 100644 brewman/static/src/app/overlord.filters.js.map delete mode 100644 brewman/static/src/app/overlord.filters.ts delete mode 100644 brewman/static/src/app/overlord.routes.js delete mode 100644 brewman/static/src/app/overlord.routes.js.map delete mode 100644 brewman/static/src/app/overlord.routes.ts delete mode 100644 brewman/static/src/app/overlord.services.js delete mode 100644 brewman/static/src/app/overlord.services.js.map delete mode 100644 brewman/static/src/app/overlord.services.ts delete mode 100644 brewman/static/src/app/payment/payment-modal.controller.js delete mode 100644 brewman/static/src/app/payment/payment-modal.controller.js.map delete mode 100644 brewman/static/src/app/payment/payment-modal.controller.ts delete mode 100644 brewman/static/src/app/payment/payment-modal.html delete mode 100644 brewman/static/src/app/payment/payment-voucher.resolver.js delete mode 100644 brewman/static/src/app/payment/payment-voucher.resolver.js.map delete mode 100644 brewman/static/src/app/payment/payment-voucher.resolver.ts delete mode 100644 brewman/static/src/app/payment/payment.component.js delete mode 100644 brewman/static/src/app/payment/payment.component.js.map delete mode 100644 brewman/static/src/app/payment/payment.component.ts delete mode 100644 brewman/static/src/app/payment/payment.controller.js delete mode 100644 brewman/static/src/app/payment/payment.controller.js.map delete mode 100644 brewman/static/src/app/payment/payment.controller.ts delete mode 100644 brewman/static/src/app/payment/payment.html delete mode 100644 brewman/static/src/app/product-group/product-group-detail.html delete mode 100644 brewman/static/src/app/product-group/product-group-list.component.js delete mode 100644 brewman/static/src/app/product-group/product-group-list.component.js.map delete mode 100644 brewman/static/src/app/product-group/product-group-list.component.ts delete mode 100644 brewman/static/src/app/product-group/product-group-list.controller.js delete mode 100644 brewman/static/src/app/product-group/product-group-list.controller.js.map delete mode 100644 brewman/static/src/app/product-group/product-group-list.controller.ts delete mode 100644 brewman/static/src/app/product-group/product-group-list.html delete mode 100644 brewman/static/src/app/product-group/product-group-list.resolver.js delete mode 100644 brewman/static/src/app/product-group/product-group-list.resolver.js.map delete mode 100644 brewman/static/src/app/product-group/product-group-list.resolver.ts delete mode 100644 brewman/static/src/app/product-group/product-group.component.js delete mode 100644 brewman/static/src/app/product-group/product-group.component.js.map delete mode 100644 brewman/static/src/app/product-group/product-group.component.ts delete mode 100644 brewman/static/src/app/product-group/product-group.controller.js delete mode 100644 brewman/static/src/app/product-group/product-group.controller.js.map delete mode 100644 brewman/static/src/app/product-group/product-group.controller.ts delete mode 100644 brewman/static/src/app/product-group/product-group.resolver.js delete mode 100644 brewman/static/src/app/product-group/product-group.resolver.js.map delete mode 100644 brewman/static/src/app/product-group/product-group.resolver.ts delete mode 100644 brewman/static/src/app/product-group/product-group.service.js delete mode 100644 brewman/static/src/app/product-group/product-group.service.js.map delete mode 100644 brewman/static/src/app/product-group/product-group.service.ts delete mode 100644 brewman/static/src/app/product-ledger/product-ledger.component.js delete mode 100644 brewman/static/src/app/product-ledger/product-ledger.component.js.map delete mode 100644 brewman/static/src/app/product-ledger/product-ledger.component.ts delete mode 100644 brewman/static/src/app/product-ledger/product-ledger.controller.js delete mode 100644 brewman/static/src/app/product-ledger/product-ledger.controller.js.map delete mode 100644 brewman/static/src/app/product-ledger/product-ledger.controller.ts delete mode 100644 brewman/static/src/app/product-ledger/product-ledger.html delete mode 100644 brewman/static/src/app/product-ledger/product-ledger.resolver.js delete mode 100644 brewman/static/src/app/product-ledger/product-ledger.resolver.js.map delete mode 100644 brewman/static/src/app/product-ledger/product-ledger.resolver.ts delete mode 100644 brewman/static/src/app/product-ledger/product-ledger.service.js delete mode 100644 brewman/static/src/app/product-ledger/product-ledger.service.js.map delete mode 100644 brewman/static/src/app/product-ledger/product-ledger.service.ts delete mode 100644 brewman/static/src/app/product/product-detail.html delete mode 100644 brewman/static/src/app/product/product-list.component.js delete mode 100644 brewman/static/src/app/product/product-list.component.js.map delete mode 100644 brewman/static/src/app/product/product-list.component.ts delete mode 100644 brewman/static/src/app/product/product-list.controller.js delete mode 100644 brewman/static/src/app/product/product-list.controller.js.map delete mode 100644 brewman/static/src/app/product/product-list.controller.ts delete mode 100644 brewman/static/src/app/product/product-list.html delete mode 100644 brewman/static/src/app/product/product-list.resolver.js delete mode 100644 brewman/static/src/app/product/product-list.resolver.js.map delete mode 100644 brewman/static/src/app/product/product-list.resolver.ts delete mode 100644 brewman/static/src/app/product/product.component.js delete mode 100644 brewman/static/src/app/product/product.component.js.map delete mode 100644 brewman/static/src/app/product/product.component.ts delete mode 100644 brewman/static/src/app/product/product.controller.js delete mode 100644 brewman/static/src/app/product/product.controller.js.map delete mode 100644 brewman/static/src/app/product/product.controller.ts delete mode 100644 brewman/static/src/app/product/product.resolver.js delete mode 100644 brewman/static/src/app/product/product.resolver.js.map delete mode 100644 brewman/static/src/app/product/product.resolver.ts delete mode 100644 brewman/static/src/app/product/product.service.js delete mode 100644 brewman/static/src/app/product/product.service.js.map delete mode 100644 brewman/static/src/app/product/product.service.ts delete mode 100644 brewman/static/src/app/profit-loss/profit-loss.component.js delete mode 100644 brewman/static/src/app/profit-loss/profit-loss.component.js.map delete mode 100644 brewman/static/src/app/profit-loss/profit-loss.component.ts delete mode 100644 brewman/static/src/app/profit-loss/profit-loss.controller.js delete mode 100644 brewman/static/src/app/profit-loss/profit-loss.controller.js.map delete mode 100644 brewman/static/src/app/profit-loss/profit-loss.controller.ts delete mode 100644 brewman/static/src/app/profit-loss/profit-loss.html delete mode 100644 brewman/static/src/app/profit-loss/profit-loss.resolver.js delete mode 100644 brewman/static/src/app/profit-loss/profit-loss.resolver.js.map delete mode 100644 brewman/static/src/app/profit-loss/profit-loss.resolver.ts delete mode 100644 brewman/static/src/app/profit-loss/profit-loss.service.js delete mode 100644 brewman/static/src/app/profit-loss/profit-loss.service.js.map delete mode 100644 brewman/static/src/app/profit-loss/profit-loss.service.ts delete mode 100644 brewman/static/src/app/purchase-entries/purchase-entries.component.js delete mode 100644 brewman/static/src/app/purchase-entries/purchase-entries.component.js.map delete mode 100644 brewman/static/src/app/purchase-entries/purchase-entries.component.ts delete mode 100644 brewman/static/src/app/purchase-entries/purchase-entries.controller.js delete mode 100644 brewman/static/src/app/purchase-entries/purchase-entries.controller.js.map delete mode 100644 brewman/static/src/app/purchase-entries/purchase-entries.controller.ts delete mode 100644 brewman/static/src/app/purchase-entries/purchase-entries.html delete mode 100644 brewman/static/src/app/purchase-entries/purchase-entries.resolver.js delete mode 100644 brewman/static/src/app/purchase-entries/purchase-entries.resolver.js.map delete mode 100644 brewman/static/src/app/purchase-entries/purchase-entries.resolver.ts delete mode 100644 brewman/static/src/app/purchase-entries/purchase-entries.service.js delete mode 100644 brewman/static/src/app/purchase-entries/purchase-entries.service.js.map delete mode 100644 brewman/static/src/app/purchase-entries/purchase-entries.service.ts delete mode 100644 brewman/static/src/app/purchase-return/purchase-return-modal.controller.js delete mode 100644 brewman/static/src/app/purchase-return/purchase-return-modal.controller.js.map delete mode 100644 brewman/static/src/app/purchase-return/purchase-return-modal.controller.ts delete mode 100644 brewman/static/src/app/purchase-return/purchase-return-modal.html delete mode 100644 brewman/static/src/app/purchase-return/purchase-return-voucher.resolver.js delete mode 100644 brewman/static/src/app/purchase-return/purchase-return-voucher.resolver.js.map delete mode 100644 brewman/static/src/app/purchase-return/purchase-return-voucher.resolver.ts delete mode 100644 brewman/static/src/app/purchase-return/purchase-return.component.js delete mode 100644 brewman/static/src/app/purchase-return/purchase-return.component.js.map delete mode 100644 brewman/static/src/app/purchase-return/purchase-return.component.ts delete mode 100644 brewman/static/src/app/purchase-return/purchase-return.controller.js delete mode 100644 brewman/static/src/app/purchase-return/purchase-return.controller.js.map delete mode 100644 brewman/static/src/app/purchase-return/purchase-return.controller.ts delete mode 100644 brewman/static/src/app/purchase-return/purchase-return.html delete mode 100644 brewman/static/src/app/purchase/purchase-modal.controller.js delete mode 100644 brewman/static/src/app/purchase/purchase-modal.controller.js.map delete mode 100644 brewman/static/src/app/purchase/purchase-modal.controller.ts delete mode 100644 brewman/static/src/app/purchase/purchase-modal.html delete mode 100644 brewman/static/src/app/purchase/purchase-voucher.resolver.js delete mode 100644 brewman/static/src/app/purchase/purchase-voucher.resolver.js.map delete mode 100644 brewman/static/src/app/purchase/purchase-voucher.resolver.ts delete mode 100644 brewman/static/src/app/purchase/purchase.component.js delete mode 100644 brewman/static/src/app/purchase/purchase.component.js.map delete mode 100644 brewman/static/src/app/purchase/purchase.component.ts delete mode 100644 brewman/static/src/app/purchase/purchase.controller.js delete mode 100644 brewman/static/src/app/purchase/purchase.controller.js.map delete mode 100644 brewman/static/src/app/purchase/purchase.controller.ts delete mode 100644 brewman/static/src/app/purchase/purchase.html delete mode 100644 brewman/static/src/app/purchases/purchases.component.js delete mode 100644 brewman/static/src/app/purchases/purchases.component.js.map delete mode 100644 brewman/static/src/app/purchases/purchases.component.ts delete mode 100644 brewman/static/src/app/purchases/purchases.controller.js delete mode 100644 brewman/static/src/app/purchases/purchases.controller.js.map delete mode 100644 brewman/static/src/app/purchases/purchases.controller.ts delete mode 100644 brewman/static/src/app/purchases/purchases.html delete mode 100644 brewman/static/src/app/purchases/purchases.resolver.js delete mode 100644 brewman/static/src/app/purchases/purchases.resolver.js.map delete mode 100644 brewman/static/src/app/purchases/purchases.resolver.ts delete mode 100644 brewman/static/src/app/purchases/purchases.service.js delete mode 100644 brewman/static/src/app/purchases/purchases.service.js.map delete mode 100644 brewman/static/src/app/purchases/purchases.service.ts delete mode 100644 brewman/static/src/app/raw-material-cost/raw-material-cost-detail.html delete mode 100644 brewman/static/src/app/raw-material-cost/raw-material-cost.component.js delete mode 100644 brewman/static/src/app/raw-material-cost/raw-material-cost.component.js.map delete mode 100644 brewman/static/src/app/raw-material-cost/raw-material-cost.component.ts delete mode 100644 brewman/static/src/app/raw-material-cost/raw-material-cost.controller.js delete mode 100644 brewman/static/src/app/raw-material-cost/raw-material-cost.controller.js.map delete mode 100644 brewman/static/src/app/raw-material-cost/raw-material-cost.controller.ts delete mode 100644 brewman/static/src/app/raw-material-cost/raw-material-cost.html delete mode 100644 brewman/static/src/app/raw-material-cost/raw-material-cost.resolver.js delete mode 100644 brewman/static/src/app/raw-material-cost/raw-material-cost.resolver.js.map delete mode 100644 brewman/static/src/app/raw-material-cost/raw-material-cost.resolver.ts delete mode 100644 brewman/static/src/app/raw-material-cost/raw-material-cost.service.js delete mode 100644 brewman/static/src/app/raw-material-cost/raw-material-cost.service.js.map delete mode 100644 brewman/static/src/app/raw-material-cost/raw-material-cost.service.ts delete mode 100644 brewman/static/src/app/receipt/receipt-modal.controller.js delete mode 100644 brewman/static/src/app/receipt/receipt-modal.controller.js.map delete mode 100644 brewman/static/src/app/receipt/receipt-modal.controller.ts delete mode 100644 brewman/static/src/app/receipt/receipt-modal.html delete mode 100644 brewman/static/src/app/receipt/receipt-voucher.resolver.js delete mode 100644 brewman/static/src/app/receipt/receipt-voucher.resolver.js.map delete mode 100644 brewman/static/src/app/receipt/receipt-voucher.resolver.ts delete mode 100644 brewman/static/src/app/receipt/receipt.component.js delete mode 100644 brewman/static/src/app/receipt/receipt.component.js.map delete mode 100644 brewman/static/src/app/receipt/receipt.component.ts delete mode 100644 brewman/static/src/app/receipt/receipt.controller.js delete mode 100644 brewman/static/src/app/receipt/receipt.controller.js.map delete mode 100644 brewman/static/src/app/receipt/receipt.controller.ts delete mode 100644 brewman/static/src/app/receipt/receipt.html delete mode 100644 brewman/static/src/app/recipe/recipe-detail.html delete mode 100644 brewman/static/src/app/recipe/recipe-list.html delete mode 100644 brewman/static/src/app/recipe/recipe.service.js delete mode 100644 brewman/static/src/app/recipe/recipe.service.js.map delete mode 100644 brewman/static/src/app/recipe/recipe.service.ts delete mode 100644 brewman/static/src/app/reconcile/reconcile.component.js delete mode 100644 brewman/static/src/app/reconcile/reconcile.component.js.map delete mode 100644 brewman/static/src/app/reconcile/reconcile.component.ts delete mode 100644 brewman/static/src/app/reconcile/reconcile.controller.js delete mode 100644 brewman/static/src/app/reconcile/reconcile.controller.js.map delete mode 100644 brewman/static/src/app/reconcile/reconcile.controller.ts delete mode 100644 brewman/static/src/app/reconcile/reconcile.html delete mode 100644 brewman/static/src/app/reconcile/reconcile.resolver.js delete mode 100644 brewman/static/src/app/reconcile/reconcile.resolver.js.map delete mode 100644 brewman/static/src/app/reconcile/reconcile.resolver.ts delete mode 100644 brewman/static/src/app/reconcile/reconcile.service.js delete mode 100644 brewman/static/src/app/reconcile/reconcile.service.js.map delete mode 100644 brewman/static/src/app/reconcile/reconcile.service.ts delete mode 100644 brewman/static/src/app/salary-deduction/salary-deduction-voucher.resolver.js delete mode 100644 brewman/static/src/app/salary-deduction/salary-deduction-voucher.resolver.js.map delete mode 100644 brewman/static/src/app/salary-deduction/salary-deduction-voucher.resolver.ts delete mode 100644 brewman/static/src/app/salary-deduction/salary-deduction.component.js delete mode 100644 brewman/static/src/app/salary-deduction/salary-deduction.component.js.map delete mode 100644 brewman/static/src/app/salary-deduction/salary-deduction.component.ts delete mode 100644 brewman/static/src/app/salary-deduction/salary-deduction.controller.js delete mode 100644 brewman/static/src/app/salary-deduction/salary-deduction.controller.js.map delete mode 100644 brewman/static/src/app/salary-deduction/salary-deduction.controller.ts delete mode 100644 brewman/static/src/app/salary-deduction/salary-deduction.html delete mode 100644 brewman/static/src/app/settings/lock-info.resolver.js delete mode 100644 brewman/static/src/app/settings/lock-info.resolver.js.map delete mode 100644 brewman/static/src/app/settings/lock-info.resolver.ts delete mode 100644 brewman/static/src/app/settings/maintenance.resolver.js delete mode 100644 brewman/static/src/app/settings/maintenance.resolver.js.map delete mode 100644 brewman/static/src/app/settings/maintenance.resolver.ts delete mode 100644 brewman/static/src/app/settings/settings.component.js delete mode 100644 brewman/static/src/app/settings/settings.component.js.map delete mode 100644 brewman/static/src/app/settings/settings.component.ts delete mode 100644 brewman/static/src/app/settings/settings.controller.js delete mode 100644 brewman/static/src/app/settings/settings.controller.js.map delete mode 100644 brewman/static/src/app/settings/settings.controller.ts delete mode 100644 brewman/static/src/app/settings/settings.html delete mode 100644 brewman/static/src/app/stock-movement/stock-movement.component.js delete mode 100644 brewman/static/src/app/stock-movement/stock-movement.component.js.map delete mode 100644 brewman/static/src/app/stock-movement/stock-movement.component.ts delete mode 100644 brewman/static/src/app/stock-movement/stock-movement.controller.js delete mode 100644 brewman/static/src/app/stock-movement/stock-movement.controller.js.map delete mode 100644 brewman/static/src/app/stock-movement/stock-movement.controller.ts delete mode 100644 brewman/static/src/app/stock-movement/stock-movement.html delete mode 100644 brewman/static/src/app/stock-movement/stock-movement.resolver.js delete mode 100644 brewman/static/src/app/stock-movement/stock-movement.resolver.js.map delete mode 100644 brewman/static/src/app/stock-movement/stock-movement.resolver.ts delete mode 100644 brewman/static/src/app/stock-movement/stock-movement.service.js delete mode 100644 brewman/static/src/app/stock-movement/stock-movement.service.js.map delete mode 100644 brewman/static/src/app/stock-movement/stock-movement.service.ts delete mode 100644 brewman/static/src/app/systemjs.config.js delete mode 100644 brewman/static/src/app/trial-balance/trial-balance.component.js delete mode 100644 brewman/static/src/app/trial-balance/trial-balance.component.js.map delete mode 100644 brewman/static/src/app/trial-balance/trial-balance.component.ts delete mode 100644 brewman/static/src/app/trial-balance/trial-balance.controller.js delete mode 100644 brewman/static/src/app/trial-balance/trial-balance.controller.js.map delete mode 100644 brewman/static/src/app/trial-balance/trial-balance.controller.ts delete mode 100644 brewman/static/src/app/trial-balance/trial-balance.html delete mode 100644 brewman/static/src/app/trial-balance/trial-balance.resolver.js delete mode 100644 brewman/static/src/app/trial-balance/trial-balance.resolver.js.map delete mode 100644 brewman/static/src/app/trial-balance/trial-balance.resolver.ts delete mode 100644 brewman/static/src/app/trial-balance/trial-balance.service.js delete mode 100644 brewman/static/src/app/trial-balance/trial-balance.service.js.map delete mode 100644 brewman/static/src/app/trial-balance/trial-balance.service.ts delete mode 100644 brewman/static/src/app/unposted/unposted.component.js delete mode 100644 brewman/static/src/app/unposted/unposted.component.js.map delete mode 100644 brewman/static/src/app/unposted/unposted.component.ts delete mode 100644 brewman/static/src/app/unposted/unposted.controller.js delete mode 100644 brewman/static/src/app/unposted/unposted.controller.js.map delete mode 100644 brewman/static/src/app/unposted/unposted.controller.ts delete mode 100644 brewman/static/src/app/unposted/unposted.html delete mode 100644 brewman/static/src/app/unposted/unposted.resolver.js delete mode 100644 brewman/static/src/app/unposted/unposted.resolver.js.map delete mode 100644 brewman/static/src/app/unposted/unposted.resolver.ts delete mode 100644 brewman/static/src/app/unposted/unposted.service.js delete mode 100644 brewman/static/src/app/unposted/unposted.service.js.map delete mode 100644 brewman/static/src/app/unposted/unposted.service.ts delete mode 100644 brewman/static/src/app/user/user-detail.html delete mode 100644 brewman/static/src/app/user/user-list.component.js delete mode 100644 brewman/static/src/app/user/user-list.component.js.map delete mode 100644 brewman/static/src/app/user/user-list.component.ts delete mode 100644 brewman/static/src/app/user/user-list.controller.js delete mode 100644 brewman/static/src/app/user/user-list.controller.js.map delete mode 100644 brewman/static/src/app/user/user-list.controller.ts delete mode 100644 brewman/static/src/app/user/user-list.html delete mode 100644 brewman/static/src/app/user/user-list.resolver.js delete mode 100644 brewman/static/src/app/user/user-list.resolver.js.map delete mode 100644 brewman/static/src/app/user/user-list.resolver.ts delete mode 100644 brewman/static/src/app/user/user.component.js delete mode 100644 brewman/static/src/app/user/user.component.js.map delete mode 100644 brewman/static/src/app/user/user.component.ts delete mode 100644 brewman/static/src/app/user/user.controller.js delete mode 100644 brewman/static/src/app/user/user.controller.js.map delete mode 100644 brewman/static/src/app/user/user.controller.ts delete mode 100644 brewman/static/src/app/user/user.resolver.js delete mode 100644 brewman/static/src/app/user/user.resolver.js.map delete mode 100644 brewman/static/src/app/user/user.resolver.ts delete mode 100644 brewman/static/src/app/user/user.service.js delete mode 100644 brewman/static/src/app/user/user.service.js.map delete mode 100644 brewman/static/src/app/user/user.service.ts delete mode 100644 brewman/static/src/css/chosen.min.css delete mode 100644 brewman/static/src/css/loading-bar.min.css delete mode 100644 brewman/static/src/css/nv.d3.css delete mode 100644 brewman/static/src/css/spinner.css delete mode 100644 brewman/static/src/css/table.css delete mode 100644 brewman/static/src/favicon.ico delete mode 100644 brewman/static/src/fonts/glyphicons-halflings-regular.eot delete mode 100644 brewman/static/src/fonts/glyphicons-halflings-regular.svg delete mode 100644 brewman/static/src/fonts/glyphicons-halflings-regular.ttf delete mode 100644 brewman/static/src/fonts/glyphicons-halflings-regular.woff delete mode 100644 brewman/static/src/img/apple-touch-icon-114x114-precomposed.png delete mode 100644 brewman/static/src/img/apple-touch-icon-57x57-precomposed.png delete mode 100644 brewman/static/src/img/apple-touch-icon-72x72-precomposed.png delete mode 100644 brewman/static/src/img/apple-touch-icon-precomposed.png delete mode 100644 brewman/static/src/img/apple-touch-icon.png delete mode 100644 brewman/static/src/img/chosen-sprite.png delete mode 100644 brewman/static/src/img/chosen-sprite@2x.png delete mode 100644 brewman/static/src/img/favicon.ico delete mode 100644 brewman/static/src/img/glyphicons-halflings-white.png delete mode 100644 brewman/static/src/img/glyphicons-halflings.png delete mode 100644 brewman/static/src/index.html delete mode 100644 brewman/static/src/js/jquery.scrolltoview.js delete mode 100644 brewman/static/src/js/loading-bar.min.js delete mode 100644 brewman/static/src/js/mousetrap-brewman.js delete mode 100644 brewman/static/src/js/ui-bootstrap-custom-0.12.0.min.js delete mode 100644 brewman/static/src/js/ui-bootstrap-tpls-2.5.0.min.js delete mode 100644 brewman/static/src/template/modal/confirm-material.html delete mode 100644 brewman/static/src/template/modal/confirm.html delete mode 100644 brewman/static/src/template/modal/image.html create mode 100644 overlord/.editorconfig create mode 100644 overlord/.gitignore create mode 100644 overlord/README.md create mode 100644 overlord/angular.json create mode 100644 overlord/e2e/protractor.conf.js create mode 100644 overlord/e2e/src/app.e2e-spec.ts create mode 100644 overlord/e2e/src/app.po.ts create mode 100644 overlord/e2e/tsconfig.e2e.json create mode 100644 overlord/package.json create mode 100644 overlord/proxy.conf.json rename brewman/static/src/app/home/home.html => overlord/src/app/account/account-detail/account-detail.component.css (100%) create mode 100644 overlord/src/app/account/account-detail/account-detail.component.html create mode 100644 overlord/src/app/account/account-detail/account-detail.component.spec.ts create mode 100644 overlord/src/app/account/account-detail/account-detail.component.ts create mode 100644 overlord/src/app/account/account-list-resolver.service.spec.ts create mode 100644 overlord/src/app/account/account-list-resolver.service.ts create mode 100644 overlord/src/app/account/account-list/account-list-datasource.ts create mode 100644 overlord/src/app/account/account-list/account-list.component.css create mode 100644 overlord/src/app/account/account-list/account-list.component.html create mode 100644 overlord/src/app/account/account-list/account-list.component.spec.ts create mode 100644 overlord/src/app/account/account-list/account-list.component.ts create mode 100644 overlord/src/app/account/account-resolver.service.spec.ts create mode 100644 overlord/src/app/account/account-resolver.service.ts create mode 100644 overlord/src/app/account/account-routing.module.spec.ts create mode 100644 overlord/src/app/account/account-routing.module.ts create mode 100644 overlord/src/app/account/account-type-resolver.service.spec.ts create mode 100644 overlord/src/app/account/account-type-resolver.service.ts create mode 100644 overlord/src/app/account/account-type.service.spec.ts create mode 100644 overlord/src/app/account/account-type.service.ts create mode 100644 overlord/src/app/account/account-type.ts create mode 100644 overlord/src/app/account/account.module.spec.ts create mode 100644 overlord/src/app/account/account.module.ts create mode 100644 overlord/src/app/account/account.service.spec.ts create mode 100644 overlord/src/app/account/account.service.ts create mode 100644 overlord/src/app/account/account.ts create mode 100644 overlord/src/app/app-routing.module.spec.ts create mode 100644 overlord/src/app/app-routing.module.ts create mode 100644 overlord/src/app/app.component.css create mode 100644 overlord/src/app/app.component.html create mode 100644 overlord/src/app/app.component.spec.ts create mode 100644 overlord/src/app/app.component.ts create mode 100644 overlord/src/app/app.module.ts create mode 100644 overlord/src/app/attendance/attendance-datasource.ts create mode 100644 overlord/src/app/attendance/attendance-resolver.service.spec.ts create mode 100644 overlord/src/app/attendance/attendance-resolver.service.ts create mode 100644 overlord/src/app/attendance/attendance-routing.module.spec.ts create mode 100644 overlord/src/app/attendance/attendance-routing.module.ts create mode 100644 overlord/src/app/attendance/attendance-type-resolver.service.ts create mode 100644 overlord/src/app/attendance/attendance-type.service.ts create mode 100644 overlord/src/app/attendance/attendance-type.ts create mode 100644 overlord/src/app/attendance/attendance.component.css create mode 100644 overlord/src/app/attendance/attendance.component.html create mode 100644 overlord/src/app/attendance/attendance.component.spec.ts create mode 100644 overlord/src/app/attendance/attendance.component.ts create mode 100644 overlord/src/app/attendance/attendance.module.spec.ts create mode 100644 overlord/src/app/attendance/attendance.module.ts create mode 100644 overlord/src/app/attendance/attendance.service.spec.ts create mode 100644 overlord/src/app/attendance/attendance.service.ts create mode 100644 overlord/src/app/attendance/attendance.ts create mode 100644 overlord/src/app/auth/auth-guard.service.spec.ts create mode 100644 overlord/src/app/auth/auth-guard.service.ts create mode 100644 overlord/src/app/auth/auth.service.spec.ts create mode 100644 overlord/src/app/auth/auth.service.ts create mode 100644 overlord/src/app/auth/login/login.component.css create mode 100644 overlord/src/app/auth/login/login.component.html create mode 100644 overlord/src/app/auth/login/login.component.spec.ts create mode 100644 overlord/src/app/auth/login/login.component.ts create mode 100644 overlord/src/app/auth/logout/logout.component.spec.ts create mode 100644 overlord/src/app/auth/logout/logout.component.ts create mode 100644 overlord/src/app/balance-sheet/balance-sheet-datasource.ts create mode 100644 overlord/src/app/balance-sheet/balance-sheet-resolver.service.spec.ts create mode 100644 overlord/src/app/balance-sheet/balance-sheet-resolver.service.ts create mode 100644 overlord/src/app/balance-sheet/balance-sheet-routing.module.spec.ts create mode 100644 overlord/src/app/balance-sheet/balance-sheet-routing.module.ts create mode 100644 overlord/src/app/balance-sheet/balance-sheet.component.css create mode 100644 overlord/src/app/balance-sheet/balance-sheet.component.html create mode 100644 overlord/src/app/balance-sheet/balance-sheet.component.spec.ts create mode 100644 overlord/src/app/balance-sheet/balance-sheet.component.ts create mode 100644 overlord/src/app/balance-sheet/balance-sheet.module.spec.ts create mode 100644 overlord/src/app/balance-sheet/balance-sheet.module.ts create mode 100644 overlord/src/app/balance-sheet/balance-sheet.service.spec.ts create mode 100644 overlord/src/app/balance-sheet/balance-sheet.service.ts create mode 100644 overlord/src/app/balance-sheet/balance-sheet.ts create mode 100644 overlord/src/app/cash-flow/cash-flow-datasource.ts create mode 100644 overlord/src/app/cash-flow/cash-flow-resolver.service.spec.ts create mode 100644 overlord/src/app/cash-flow/cash-flow-resolver.service.ts create mode 100644 overlord/src/app/cash-flow/cash-flow-routing.module.spec.ts create mode 100644 overlord/src/app/cash-flow/cash-flow-routing.module.ts create mode 100644 overlord/src/app/cash-flow/cash-flow.component.css create mode 100644 overlord/src/app/cash-flow/cash-flow.component.html create mode 100644 overlord/src/app/cash-flow/cash-flow.component.spec.ts create mode 100644 overlord/src/app/cash-flow/cash-flow.component.ts create mode 100644 overlord/src/app/cash-flow/cash-flow.module.spec.ts create mode 100644 overlord/src/app/cash-flow/cash-flow.module.ts create mode 100644 overlord/src/app/cash-flow/cash-flow.service.spec.ts create mode 100644 overlord/src/app/cash-flow/cash-flow.service.ts create mode 100644 overlord/src/app/cash-flow/cash-flow.ts create mode 100644 overlord/src/app/client/client-detail/client-detail.component.css create mode 100644 overlord/src/app/client/client-detail/client-detail.component.html create mode 100644 overlord/src/app/client/client-detail/client-detail.component.spec.ts create mode 100644 overlord/src/app/client/client-detail/client-detail.component.ts create mode 100644 overlord/src/app/client/client-list-resolver.service.spec.ts create mode 100644 overlord/src/app/client/client-list-resolver.service.ts create mode 100644 overlord/src/app/client/client-list/client-list-datasource.ts create mode 100644 overlord/src/app/client/client-list/client-list.component.css create mode 100644 overlord/src/app/client/client-list/client-list.component.html create mode 100644 overlord/src/app/client/client-list/client-list.component.spec.ts create mode 100644 overlord/src/app/client/client-list/client-list.component.ts create mode 100644 overlord/src/app/client/client-resolver.service.spec.ts create mode 100644 overlord/src/app/client/client-resolver.service.ts create mode 100644 overlord/src/app/client/client-routing.module.spec.ts create mode 100644 overlord/src/app/client/client-routing.module.ts create mode 100644 overlord/src/app/client/client.module.spec.ts create mode 100644 overlord/src/app/client/client.module.ts create mode 100644 overlord/src/app/client/client.service.spec.ts create mode 100644 overlord/src/app/client/client.service.ts create mode 100644 overlord/src/app/client/client.ts create mode 100644 overlord/src/app/closing-stock/closing-stock-datasource.ts create mode 100644 overlord/src/app/closing-stock/closing-stock-resolver.service.spec.ts create mode 100644 overlord/src/app/closing-stock/closing-stock-resolver.service.ts create mode 100644 overlord/src/app/closing-stock/closing-stock-routing.module.spec.ts create mode 100644 overlord/src/app/closing-stock/closing-stock-routing.module.ts create mode 100644 overlord/src/app/closing-stock/closing-stock.component.css create mode 100644 overlord/src/app/closing-stock/closing-stock.component.html create mode 100644 overlord/src/app/closing-stock/closing-stock.component.spec.ts create mode 100644 overlord/src/app/closing-stock/closing-stock.component.ts create mode 100644 overlord/src/app/closing-stock/closing-stock.module.spec.ts create mode 100644 overlord/src/app/closing-stock/closing-stock.module.ts create mode 100644 overlord/src/app/closing-stock/closing-stock.service.spec.ts create mode 100644 overlord/src/app/closing-stock/closing-stock.service.ts create mode 100644 overlord/src/app/closing-stock/closing-stock.ts create mode 100644 overlord/src/app/core/core.module.spec.ts create mode 100644 overlord/src/app/core/core.module.ts create mode 100644 overlord/src/app/core/error-logger.service.spec.ts create mode 100644 overlord/src/app/core/error-logger.service.ts create mode 100644 overlord/src/app/core/nav-bar/nav-bar.component.css create mode 100644 overlord/src/app/core/nav-bar/nav-bar.component.html create mode 100644 overlord/src/app/core/nav-bar/nav-bar.component.spec.ts create mode 100644 overlord/src/app/core/nav-bar/nav-bar.component.ts create mode 100644 overlord/src/app/core/toaster.service.spec.ts create mode 100644 overlord/src/app/core/toaster.service.ts create mode 100644 overlord/src/app/cost-centre/cost-centre-detail/cost-centre-detail.component.css create mode 100644 overlord/src/app/cost-centre/cost-centre-detail/cost-centre-detail.component.html create mode 100644 overlord/src/app/cost-centre/cost-centre-detail/cost-centre-detail.component.spec.ts create mode 100644 overlord/src/app/cost-centre/cost-centre-detail/cost-centre-detail.component.ts create mode 100644 overlord/src/app/cost-centre/cost-centre-list-resolver.service.spec.ts create mode 100644 overlord/src/app/cost-centre/cost-centre-list-resolver.service.ts create mode 100644 overlord/src/app/cost-centre/cost-centre-list/cost-centre-list-datasource.ts create mode 100644 overlord/src/app/cost-centre/cost-centre-list/cost-centre-list.component.css create mode 100644 overlord/src/app/cost-centre/cost-centre-list/cost-centre-list.component.html create mode 100644 overlord/src/app/cost-centre/cost-centre-list/cost-centre-list.component.spec.ts create mode 100644 overlord/src/app/cost-centre/cost-centre-list/cost-centre-list.component.ts create mode 100644 overlord/src/app/cost-centre/cost-centre-resolver.service.spec.ts create mode 100644 overlord/src/app/cost-centre/cost-centre-resolver.service.ts create mode 100644 overlord/src/app/cost-centre/cost-centre-routing.module.spec.ts create mode 100644 overlord/src/app/cost-centre/cost-centre-routing.module.ts create mode 100644 overlord/src/app/cost-centre/cost-centre.module.spec.ts create mode 100644 overlord/src/app/cost-centre/cost-centre.module.ts create mode 100644 overlord/src/app/cost-centre/cost-centre.service.spec.ts create mode 100644 overlord/src/app/cost-centre/cost-centre.service.ts create mode 100644 overlord/src/app/cost-centre/cost-centre.ts create mode 100644 overlord/src/app/daybook/daybook-datasource.ts create mode 100644 overlord/src/app/daybook/daybook-resolver.service.spec.ts create mode 100644 overlord/src/app/daybook/daybook-resolver.service.ts create mode 100644 overlord/src/app/daybook/daybook-routing.module.spec.ts create mode 100644 overlord/src/app/daybook/daybook-routing.module.ts create mode 100644 overlord/src/app/daybook/daybook.component.css create mode 100644 overlord/src/app/daybook/daybook.component.html create mode 100644 overlord/src/app/daybook/daybook.component.spec.ts create mode 100644 overlord/src/app/daybook/daybook.component.ts create mode 100644 overlord/src/app/daybook/daybook.module.spec.ts create mode 100644 overlord/src/app/daybook/daybook.module.ts create mode 100644 overlord/src/app/daybook/daybook.service.spec.ts create mode 100644 overlord/src/app/daybook/daybook.service.ts create mode 100644 overlord/src/app/daybook/daybook.ts create mode 100644 overlord/src/app/employee-attendance/employee-attendance-datasource.ts create mode 100644 overlord/src/app/employee-attendance/employee-attendance-resolver.service.ts create mode 100644 overlord/src/app/employee-attendance/employee-attendance-routing.module.ts create mode 100644 overlord/src/app/employee-attendance/employee-attendance.component.css create mode 100644 overlord/src/app/employee-attendance/employee-attendance.component.html create mode 100644 overlord/src/app/employee-attendance/employee-attendance.component.ts create mode 100644 overlord/src/app/employee-attendance/employee-attendance.module.ts create mode 100644 overlord/src/app/employee-attendance/employee-attendance.service.ts create mode 100644 overlord/src/app/employee-attendance/employee-attendance.ts create mode 100644 overlord/src/app/employee-benefits/employee-benefits-datasource.ts create mode 100644 overlord/src/app/employee-benefits/employee-benefits-resolver.service.ts create mode 100644 overlord/src/app/employee-benefits/employee-benefits-routing.module.ts create mode 100644 overlord/src/app/employee-benefits/employee-benefits.component.css create mode 100644 overlord/src/app/employee-benefits/employee-benefits.component.html create mode 100644 overlord/src/app/employee-benefits/employee-benefits.component.ts create mode 100644 overlord/src/app/employee-benefits/employee-benefits.module.ts create mode 100644 overlord/src/app/employee-functions/employee-functions-routing.module.ts create mode 100644 overlord/src/app/employee-functions/employee-functions.component.css create mode 100644 overlord/src/app/employee-functions/employee-functions.component.html create mode 100644 overlord/src/app/employee-functions/employee-functions.component.ts create mode 100644 overlord/src/app/employee-functions/employee-functions.module.ts create mode 100644 overlord/src/app/employee-functions/employee-functions.service.ts create mode 100644 overlord/src/app/employee/employee-detail/employee-detail.component.css create mode 100644 overlord/src/app/employee/employee-detail/employee-detail.component.html create mode 100644 overlord/src/app/employee/employee-detail/employee-detail.component.spec.ts create mode 100644 overlord/src/app/employee/employee-detail/employee-detail.component.ts create mode 100644 overlord/src/app/employee/employee-list-resolver.service.spec.ts create mode 100644 overlord/src/app/employee/employee-list-resolver.service.ts create mode 100644 overlord/src/app/employee/employee-list/employee-list-datasource.ts create mode 100644 overlord/src/app/employee/employee-list/employee-list.component.css create mode 100644 overlord/src/app/employee/employee-list/employee-list.component.html create mode 100644 overlord/src/app/employee/employee-list/employee-list.component.spec.ts create mode 100644 overlord/src/app/employee/employee-list/employee-list.component.ts create mode 100644 overlord/src/app/employee/employee-resolver.service.spec.ts create mode 100644 overlord/src/app/employee/employee-resolver.service.ts create mode 100644 overlord/src/app/employee/employee-routing.module.spec.ts create mode 100644 overlord/src/app/employee/employee-routing.module.ts create mode 100644 overlord/src/app/employee/employee.module.spec.ts create mode 100644 overlord/src/app/employee/employee.module.ts create mode 100644 overlord/src/app/employee/employee.service.spec.ts create mode 100644 overlord/src/app/employee/employee.service.ts create mode 100644 overlord/src/app/employee/employee.ts create mode 100644 overlord/src/app/group/group-detail/group-detail.component.css create mode 100644 overlord/src/app/group/group-detail/group-detail.component.html create mode 100644 overlord/src/app/group/group-detail/group-detail.component.spec.ts create mode 100644 overlord/src/app/group/group-detail/group-detail.component.ts create mode 100644 overlord/src/app/group/group-list-resolver.service.spec.ts create mode 100644 overlord/src/app/group/group-list-resolver.service.ts create mode 100644 overlord/src/app/group/group-list/group-list-datasource.ts create mode 100644 overlord/src/app/group/group-list/group-list.component.css create mode 100644 overlord/src/app/group/group-list/group-list.component.html create mode 100644 overlord/src/app/group/group-list/group-list.component.spec.ts create mode 100644 overlord/src/app/group/group-list/group-list.component.ts create mode 100644 overlord/src/app/group/group-resolver.service.spec.ts create mode 100644 overlord/src/app/group/group-resolver.service.ts create mode 100644 overlord/src/app/group/group-routing.module.spec.ts create mode 100644 overlord/src/app/group/group-routing.module.ts create mode 100644 overlord/src/app/group/group.module.spec.ts create mode 100644 overlord/src/app/group/group.module.ts create mode 100644 overlord/src/app/group/group.service.spec.ts create mode 100644 overlord/src/app/group/group.service.ts create mode 100644 overlord/src/app/group/group.ts create mode 100644 overlord/src/app/home/home.component.css create mode 100644 overlord/src/app/home/home.component.html create mode 100644 overlord/src/app/home/home.component.spec.ts create mode 100644 overlord/src/app/home/home.component.ts create mode 100644 overlord/src/app/incentive/incentive-datasource.ts create mode 100644 overlord/src/app/incentive/incentive-resolver.service.spec.ts create mode 100644 overlord/src/app/incentive/incentive-resolver.service.ts create mode 100644 overlord/src/app/incentive/incentive-routing.module.spec.ts create mode 100644 overlord/src/app/incentive/incentive-routing.module.ts create mode 100644 overlord/src/app/incentive/incentive.component.css create mode 100644 overlord/src/app/incentive/incentive.component.html create mode 100644 overlord/src/app/incentive/incentive.component.spec.ts create mode 100644 overlord/src/app/incentive/incentive.component.ts create mode 100644 overlord/src/app/incentive/incentive.module.spec.ts create mode 100644 overlord/src/app/incentive/incentive.module.ts create mode 100644 overlord/src/app/incentive/incentive.service.spec.ts create mode 100644 overlord/src/app/issue/issue-datasource.ts create mode 100644 overlord/src/app/issue/issue-dialog.component.css create mode 100644 overlord/src/app/issue/issue-dialog.component.html create mode 100644 overlord/src/app/issue/issue-dialog.component.spec.ts create mode 100644 overlord/src/app/issue/issue-dialog.component.ts create mode 100644 overlord/src/app/issue/issue-grid-datasource.ts create mode 100644 overlord/src/app/issue/issue-grid.service.spec.ts create mode 100644 overlord/src/app/issue/issue-grid.service.ts create mode 100644 overlord/src/app/issue/issue-resolver.service.spec.ts create mode 100644 overlord/src/app/issue/issue-resolver.service.ts create mode 100644 overlord/src/app/issue/issue-routing.module.spec.ts create mode 100644 overlord/src/app/issue/issue-routing.module.ts create mode 100644 overlord/src/app/issue/issue.component.css create mode 100644 overlord/src/app/issue/issue.component.html create mode 100644 overlord/src/app/issue/issue.component.spec.ts create mode 100644 overlord/src/app/issue/issue.component.ts create mode 100644 overlord/src/app/issue/issue.module.spec.ts create mode 100644 overlord/src/app/issue/issue.module.ts create mode 100644 overlord/src/app/issue/issue.service.spec.ts create mode 100644 overlord/src/app/journal/journal-datasource.ts create mode 100644 overlord/src/app/journal/journal-dialog.component.css create mode 100644 overlord/src/app/journal/journal-dialog.component.html create mode 100644 overlord/src/app/journal/journal-dialog.component.spec.ts create mode 100644 overlord/src/app/journal/journal-dialog.component.ts create mode 100644 overlord/src/app/journal/journal-resolver.service.spec.ts create mode 100644 overlord/src/app/journal/journal-resolver.service.ts create mode 100644 overlord/src/app/journal/journal-routing.module.spec.ts create mode 100644 overlord/src/app/journal/journal-routing.module.ts create mode 100644 overlord/src/app/journal/journal.component.css create mode 100644 overlord/src/app/journal/journal.component.html create mode 100644 overlord/src/app/journal/journal.component.spec.ts create mode 100644 overlord/src/app/journal/journal.component.ts create mode 100644 overlord/src/app/journal/journal.module.spec.ts create mode 100644 overlord/src/app/journal/journal.module.ts create mode 100644 overlord/src/app/journal/journal.service.spec.ts create mode 100644 overlord/src/app/journal/voucher.service.ts create mode 100644 overlord/src/app/journal/voucher.ts create mode 100644 overlord/src/app/ledger/ledger-datasource.ts create mode 100644 overlord/src/app/ledger/ledger-resolver.service.spec.ts create mode 100644 overlord/src/app/ledger/ledger-resolver.service.ts create mode 100644 overlord/src/app/ledger/ledger-routing.module.spec.ts create mode 100644 overlord/src/app/ledger/ledger-routing.module.ts create mode 100644 overlord/src/app/ledger/ledger.component.css create mode 100644 overlord/src/app/ledger/ledger.component.html create mode 100644 overlord/src/app/ledger/ledger.component.spec.ts create mode 100644 overlord/src/app/ledger/ledger.component.ts create mode 100644 overlord/src/app/ledger/ledger.module.spec.ts create mode 100644 overlord/src/app/ledger/ledger.module.ts create mode 100644 overlord/src/app/ledger/ledger.service.spec.ts create mode 100644 overlord/src/app/ledger/ledger.service.ts create mode 100644 overlord/src/app/ledger/ledger.ts create mode 100644 overlord/src/app/net-transactions/net-transactions-datasource.ts create mode 100644 overlord/src/app/net-transactions/net-transactions-resolver.service.spec.ts create mode 100644 overlord/src/app/net-transactions/net-transactions-resolver.service.ts create mode 100644 overlord/src/app/net-transactions/net-transactions-routing.module.spec.ts create mode 100644 overlord/src/app/net-transactions/net-transactions-routing.module.ts create mode 100644 overlord/src/app/net-transactions/net-transactions.component.css create mode 100644 overlord/src/app/net-transactions/net-transactions.component.html create mode 100644 overlord/src/app/net-transactions/net-transactions.component.spec.ts create mode 100644 overlord/src/app/net-transactions/net-transactions.component.ts create mode 100644 overlord/src/app/net-transactions/net-transactions.module.spec.ts create mode 100644 overlord/src/app/net-transactions/net-transactions.module.ts create mode 100644 overlord/src/app/net-transactions/net-transactions.service.spec.ts create mode 100644 overlord/src/app/net-transactions/net-transactions.service.ts create mode 100644 overlord/src/app/net-transactions/net-transactions.ts create mode 100644 overlord/src/app/payment/payment-accounts-resolver.service.spec.ts create mode 100644 overlord/src/app/payment/payment-accounts-resolver.service.ts create mode 100644 overlord/src/app/payment/payment-datasource.ts create mode 100644 overlord/src/app/payment/payment-dialog.component.css create mode 100644 overlord/src/app/payment/payment-dialog.component.html create mode 100644 overlord/src/app/payment/payment-dialog.component.spec.ts create mode 100644 overlord/src/app/payment/payment-dialog.component.ts create mode 100644 overlord/src/app/payment/payment-resolver.service.spec.ts create mode 100644 overlord/src/app/payment/payment-resolver.service.ts create mode 100644 overlord/src/app/payment/payment-routing.module.spec.ts create mode 100644 overlord/src/app/payment/payment-routing.module.ts create mode 100644 overlord/src/app/payment/payment.component.css create mode 100644 overlord/src/app/payment/payment.component.html create mode 100644 overlord/src/app/payment/payment.component.spec.ts create mode 100644 overlord/src/app/payment/payment.component.ts create mode 100644 overlord/src/app/payment/payment.module.spec.ts create mode 100644 overlord/src/app/payment/payment.module.ts create mode 100644 overlord/src/app/payment/payment.service.spec.ts create mode 100644 overlord/src/app/product-group/product-group-detail/product-group-detail.component.css create mode 100644 overlord/src/app/product-group/product-group-detail/product-group-detail.component.html create mode 100644 overlord/src/app/product-group/product-group-detail/product-group-detail.component.spec.ts create mode 100644 overlord/src/app/product-group/product-group-detail/product-group-detail.component.ts create mode 100644 overlord/src/app/product-group/product-group-list-resolver.service.spec.ts create mode 100644 overlord/src/app/product-group/product-group-list-resolver.service.ts create mode 100644 overlord/src/app/product-group/product-group-list/product-group-list-datasource.ts create mode 100644 overlord/src/app/product-group/product-group-list/product-group-list.component.css create mode 100644 overlord/src/app/product-group/product-group-list/product-group-list.component.html create mode 100644 overlord/src/app/product-group/product-group-list/product-group-list.component.spec.ts create mode 100644 overlord/src/app/product-group/product-group-list/product-group-list.component.ts create mode 100644 overlord/src/app/product-group/product-group-resolver.service.spec.ts create mode 100644 overlord/src/app/product-group/product-group-resolver.service.ts create mode 100644 overlord/src/app/product-group/product-group-routing.module.spec.ts create mode 100644 overlord/src/app/product-group/product-group-routing.module.ts create mode 100644 overlord/src/app/product-group/product-group.module.spec.ts create mode 100644 overlord/src/app/product-group/product-group.module.ts create mode 100644 overlord/src/app/product-group/product-group.service.spec.ts create mode 100644 overlord/src/app/product-group/product-group.service.ts create mode 100644 overlord/src/app/product-group/product-group.ts create mode 100644 overlord/src/app/product-ledger/product-ledger-datasource.ts create mode 100644 overlord/src/app/product-ledger/product-ledger-resolver.service.spec.ts create mode 100644 overlord/src/app/product-ledger/product-ledger-resolver.service.ts create mode 100644 overlord/src/app/product-ledger/product-ledger-routing.module.spec.ts create mode 100644 overlord/src/app/product-ledger/product-ledger-routing.module.ts create mode 100644 overlord/src/app/product-ledger/product-ledger.component.css create mode 100644 overlord/src/app/product-ledger/product-ledger.component.html create mode 100644 overlord/src/app/product-ledger/product-ledger.component.spec.ts create mode 100644 overlord/src/app/product-ledger/product-ledger.component.ts create mode 100644 overlord/src/app/product-ledger/product-ledger.module.spec.ts create mode 100644 overlord/src/app/product-ledger/product-ledger.module.ts create mode 100644 overlord/src/app/product-ledger/product-ledger.service.spec.ts create mode 100644 overlord/src/app/product-ledger/product-ledger.service.ts create mode 100644 overlord/src/app/product-ledger/product-ledger.ts create mode 100644 overlord/src/app/product/product-detail/product-detail.component.css create mode 100644 overlord/src/app/product/product-detail/product-detail.component.html create mode 100644 overlord/src/app/product/product-detail/product-detail.component.spec.ts create mode 100644 overlord/src/app/product/product-detail/product-detail.component.ts create mode 100644 overlord/src/app/product/product-list-resolver.service.spec.ts create mode 100644 overlord/src/app/product/product-list-resolver.service.ts create mode 100644 overlord/src/app/product/product-list/product-list-datasource.ts create mode 100644 overlord/src/app/product/product-list/product-list.component.css create mode 100644 overlord/src/app/product/product-list/product-list.component.html create mode 100644 overlord/src/app/product/product-list/product-list.component.spec.ts create mode 100644 overlord/src/app/product/product-list/product-list.component.ts create mode 100644 overlord/src/app/product/product-resolver.service.spec.ts create mode 100644 overlord/src/app/product/product-resolver.service.ts create mode 100644 overlord/src/app/product/product-routing.module.spec.ts create mode 100644 overlord/src/app/product/product-routing.module.ts create mode 100644 overlord/src/app/product/product.module.spec.ts create mode 100644 overlord/src/app/product/product.module.ts create mode 100644 overlord/src/app/product/product.service.spec.ts create mode 100644 overlord/src/app/product/product.service.ts create mode 100644 overlord/src/app/product/product.ts create mode 100644 overlord/src/app/profit-loss/profit-loss-datasource.ts create mode 100644 overlord/src/app/profit-loss/profit-loss-resolver.service.spec.ts create mode 100644 overlord/src/app/profit-loss/profit-loss-resolver.service.ts create mode 100644 overlord/src/app/profit-loss/profit-loss-routing.module.spec.ts create mode 100644 overlord/src/app/profit-loss/profit-loss-routing.module.ts create mode 100644 overlord/src/app/profit-loss/profit-loss.component.css create mode 100644 overlord/src/app/profit-loss/profit-loss.component.html create mode 100644 overlord/src/app/profit-loss/profit-loss.component.spec.ts create mode 100644 overlord/src/app/profit-loss/profit-loss.component.ts create mode 100644 overlord/src/app/profit-loss/profit-loss.module.spec.ts create mode 100644 overlord/src/app/profit-loss/profit-loss.module.ts create mode 100644 overlord/src/app/profit-loss/profit-loss.service.spec.ts create mode 100644 overlord/src/app/profit-loss/profit-loss.service.ts create mode 100644 overlord/src/app/profit-loss/profit-loss.ts create mode 100644 overlord/src/app/purchase-entries/purchase-entries-datasource.ts create mode 100644 overlord/src/app/purchase-entries/purchase-entries-resolver.service.spec.ts create mode 100644 overlord/src/app/purchase-entries/purchase-entries-resolver.service.ts create mode 100644 overlord/src/app/purchase-entries/purchase-entries-routing.module.spec.ts create mode 100644 overlord/src/app/purchase-entries/purchase-entries-routing.module.ts create mode 100644 overlord/src/app/purchase-entries/purchase-entries.component.css create mode 100644 overlord/src/app/purchase-entries/purchase-entries.component.html create mode 100644 overlord/src/app/purchase-entries/purchase-entries.component.spec.ts create mode 100644 overlord/src/app/purchase-entries/purchase-entries.component.ts create mode 100644 overlord/src/app/purchase-entries/purchase-entries.module.spec.ts create mode 100644 overlord/src/app/purchase-entries/purchase-entries.module.ts create mode 100644 overlord/src/app/purchase-entries/purchase-entries.service.spec.ts create mode 100644 overlord/src/app/purchase-entries/purchase-entries.service.ts create mode 100644 overlord/src/app/purchase-entries/purchase-entries.ts create mode 100644 overlord/src/app/purchase-return/batch.service.ts create mode 100644 overlord/src/app/purchase-return/purchase-return-datasource.ts create mode 100644 overlord/src/app/purchase-return/purchase-return-dialog.component.css create mode 100644 overlord/src/app/purchase-return/purchase-return-dialog.component.html create mode 100644 overlord/src/app/purchase-return/purchase-return-dialog.component.spec.ts create mode 100644 overlord/src/app/purchase-return/purchase-return-dialog.component.ts create mode 100644 overlord/src/app/purchase-return/purchase-return-resolver.service.spec.ts create mode 100644 overlord/src/app/purchase-return/purchase-return-resolver.service.ts create mode 100644 overlord/src/app/purchase-return/purchase-return-routing.module.spec.ts create mode 100644 overlord/src/app/purchase-return/purchase-return-routing.module.ts create mode 100644 overlord/src/app/purchase-return/purchase-return.component.css create mode 100644 overlord/src/app/purchase-return/purchase-return.component.html create mode 100644 overlord/src/app/purchase-return/purchase-return.component.spec.ts create mode 100644 overlord/src/app/purchase-return/purchase-return.component.ts create mode 100644 overlord/src/app/purchase-return/purchase-return.module.spec.ts create mode 100644 overlord/src/app/purchase-return/purchase-return.module.ts create mode 100644 overlord/src/app/purchase-return/purchase-return.service.spec.ts create mode 100644 overlord/src/app/purchase/purchase-datasource.ts create mode 100644 overlord/src/app/purchase/purchase-dialog.component.css create mode 100644 overlord/src/app/purchase/purchase-dialog.component.html create mode 100644 overlord/src/app/purchase/purchase-dialog.component.spec.ts create mode 100644 overlord/src/app/purchase/purchase-dialog.component.ts create mode 100644 overlord/src/app/purchase/purchase-resolver.service.spec.ts create mode 100644 overlord/src/app/purchase/purchase-resolver.service.ts create mode 100644 overlord/src/app/purchase/purchase-routing.module.spec.ts create mode 100644 overlord/src/app/purchase/purchase-routing.module.ts create mode 100644 overlord/src/app/purchase/purchase.component.css create mode 100644 overlord/src/app/purchase/purchase.component.html create mode 100644 overlord/src/app/purchase/purchase.component.spec.ts create mode 100644 overlord/src/app/purchase/purchase.component.ts create mode 100644 overlord/src/app/purchase/purchase.module.spec.ts create mode 100644 overlord/src/app/purchase/purchase.module.ts create mode 100644 overlord/src/app/purchase/purchase.service.spec.ts create mode 100644 overlord/src/app/purchases/purchases-datasource.ts create mode 100644 overlord/src/app/purchases/purchases-resolver.service.spec.ts create mode 100644 overlord/src/app/purchases/purchases-resolver.service.ts create mode 100644 overlord/src/app/purchases/purchases-routing.module.spec.ts create mode 100644 overlord/src/app/purchases/purchases-routing.module.ts create mode 100644 overlord/src/app/purchases/purchases.component.css create mode 100644 overlord/src/app/purchases/purchases.component.html create mode 100644 overlord/src/app/purchases/purchases.component.spec.ts create mode 100644 overlord/src/app/purchases/purchases.component.ts create mode 100644 overlord/src/app/purchases/purchases.module.spec.ts create mode 100644 overlord/src/app/purchases/purchases.module.ts create mode 100644 overlord/src/app/purchases/purchases.service.spec.ts create mode 100644 overlord/src/app/purchases/purchases.service.ts create mode 100644 overlord/src/app/purchases/purchases.ts create mode 100644 overlord/src/app/raw-material-cost/raw-material-cost-datasource.ts create mode 100644 overlord/src/app/raw-material-cost/raw-material-cost-resolver.service.spec.ts create mode 100644 overlord/src/app/raw-material-cost/raw-material-cost-resolver.service.ts create mode 100644 overlord/src/app/raw-material-cost/raw-material-cost-routing.module.spec.ts create mode 100644 overlord/src/app/raw-material-cost/raw-material-cost-routing.module.ts create mode 100644 overlord/src/app/raw-material-cost/raw-material-cost.component.css create mode 100644 overlord/src/app/raw-material-cost/raw-material-cost.component.html create mode 100644 overlord/src/app/raw-material-cost/raw-material-cost.component.spec.ts create mode 100644 overlord/src/app/raw-material-cost/raw-material-cost.component.ts create mode 100644 overlord/src/app/raw-material-cost/raw-material-cost.module.spec.ts create mode 100644 overlord/src/app/raw-material-cost/raw-material-cost.module.ts create mode 100644 overlord/src/app/raw-material-cost/raw-material-cost.service.spec.ts create mode 100644 overlord/src/app/raw-material-cost/raw-material-cost.service.ts create mode 100644 overlord/src/app/raw-material-cost/raw-material-cost.ts create mode 100644 overlord/src/app/receipt/receipt-accounts-resolver.service.spec.ts create mode 100644 overlord/src/app/receipt/receipt-accounts-resolver.service.ts create mode 100644 overlord/src/app/receipt/receipt-datasource.ts create mode 100644 overlord/src/app/receipt/receipt-dialog.component.css create mode 100644 overlord/src/app/receipt/receipt-dialog.component.html create mode 100644 overlord/src/app/receipt/receipt-dialog.component.spec.ts create mode 100644 overlord/src/app/receipt/receipt-dialog.component.ts create mode 100644 overlord/src/app/receipt/receipt-resolver.service.spec.ts create mode 100644 overlord/src/app/receipt/receipt-resolver.service.ts create mode 100644 overlord/src/app/receipt/receipt-routing.module.spec.ts create mode 100644 overlord/src/app/receipt/receipt-routing.module.ts create mode 100644 overlord/src/app/receipt/receipt.component.css create mode 100644 overlord/src/app/receipt/receipt.component.html create mode 100644 overlord/src/app/receipt/receipt.component.spec.ts create mode 100644 overlord/src/app/receipt/receipt.component.ts create mode 100644 overlord/src/app/receipt/receipt.module.spec.ts create mode 100644 overlord/src/app/receipt/receipt.module.ts create mode 100644 overlord/src/app/receipt/receipt.service.spec.ts create mode 100644 overlord/src/app/settings/lock-information-resolver.service.ts create mode 100644 overlord/src/app/settings/maintenance-resolver.service.ts create mode 100644 overlord/src/app/settings/settings-routing.module.ts create mode 100644 overlord/src/app/settings/settings.component.css create mode 100644 overlord/src/app/settings/settings.component.html create mode 100644 overlord/src/app/settings/settings.component.ts create mode 100644 overlord/src/app/settings/settings.module.ts create mode 100644 overlord/src/app/settings/settings.service.ts create mode 100644 overlord/src/app/shared/accounting.pipe.spec.ts create mode 100644 overlord/src/app/shared/accounting.pipe.ts create mode 100644 overlord/src/app/shared/clear.pipe.spec.ts create mode 100644 overlord/src/app/shared/clear.pipe.ts create mode 100644 overlord/src/app/shared/confirm-dialog/confirm-dialog.component.css create mode 100644 overlord/src/app/shared/confirm-dialog/confirm-dialog.component.html create mode 100644 overlord/src/app/shared/confirm-dialog/confirm-dialog.component.spec.ts create mode 100644 overlord/src/app/shared/confirm-dialog/confirm-dialog.component.ts create mode 100644 overlord/src/app/shared/cookie.service.spec.ts create mode 100644 overlord/src/app/shared/cookie.service.ts create mode 100644 overlord/src/app/shared/image-dialog/image-dialog.component.css create mode 100644 overlord/src/app/shared/image-dialog/image-dialog.component.html create mode 100644 overlord/src/app/shared/image-dialog/image-dialog.component.spec.ts create mode 100644 overlord/src/app/shared/image-dialog/image-dialog.component.ts create mode 100644 overlord/src/app/shared/local-time.pipe.spec.ts create mode 100644 overlord/src/app/shared/local-time.pipe.ts create mode 100644 overlord/src/app/shared/shared.module.spec.ts create mode 100644 overlord/src/app/shared/shared.module.ts create mode 100644 overlord/src/app/shared/tokenizer.service.spec.ts create mode 100644 overlord/src/app/shared/tokenizer.service.ts create mode 100644 overlord/src/app/stock-movement/stock-movement-datasource.ts create mode 100644 overlord/src/app/stock-movement/stock-movement-resolver.service.spec.ts create mode 100644 overlord/src/app/stock-movement/stock-movement-resolver.service.ts create mode 100644 overlord/src/app/stock-movement/stock-movement-routing.module.spec.ts create mode 100644 overlord/src/app/stock-movement/stock-movement-routing.module.ts create mode 100644 overlord/src/app/stock-movement/stock-movement.component.css create mode 100644 overlord/src/app/stock-movement/stock-movement.component.html create mode 100644 overlord/src/app/stock-movement/stock-movement.component.spec.ts create mode 100644 overlord/src/app/stock-movement/stock-movement.component.ts create mode 100644 overlord/src/app/stock-movement/stock-movement.module.spec.ts create mode 100644 overlord/src/app/stock-movement/stock-movement.module.ts create mode 100644 overlord/src/app/stock-movement/stock-movement.service.spec.ts create mode 100644 overlord/src/app/stock-movement/stock-movement.service.ts create mode 100644 overlord/src/app/stock-movement/stock-movement.ts create mode 100644 overlord/src/app/trial-balance/trial-balance-datasource.ts create mode 100644 overlord/src/app/trial-balance/trial-balance-resolver.service.spec.ts create mode 100644 overlord/src/app/trial-balance/trial-balance-resolver.service.ts create mode 100644 overlord/src/app/trial-balance/trial-balance-routing.module.spec.ts create mode 100644 overlord/src/app/trial-balance/trial-balance-routing.module.ts create mode 100644 overlord/src/app/trial-balance/trial-balance.component.css create mode 100644 overlord/src/app/trial-balance/trial-balance.component.html create mode 100644 overlord/src/app/trial-balance/trial-balance.component.spec.ts create mode 100644 overlord/src/app/trial-balance/trial-balance.component.ts create mode 100644 overlord/src/app/trial-balance/trial-balance.module.spec.ts create mode 100644 overlord/src/app/trial-balance/trial-balance.module.ts create mode 100644 overlord/src/app/trial-balance/trial-balance.service.spec.ts create mode 100644 overlord/src/app/trial-balance/trial-balance.service.ts create mode 100644 overlord/src/app/trial-balance/trial-balance.ts create mode 100644 overlord/src/app/unposted/unposted-datasource.ts create mode 100644 overlord/src/app/unposted/unposted-resolver.service.spec.ts create mode 100644 overlord/src/app/unposted/unposted-resolver.service.ts create mode 100644 overlord/src/app/unposted/unposted-routing.module.spec.ts create mode 100644 overlord/src/app/unposted/unposted-routing.module.ts create mode 100644 overlord/src/app/unposted/unposted.component.css create mode 100644 overlord/src/app/unposted/unposted.component.html create mode 100644 overlord/src/app/unposted/unposted.component.spec.ts create mode 100644 overlord/src/app/unposted/unposted.component.ts create mode 100644 overlord/src/app/unposted/unposted.module.spec.ts create mode 100644 overlord/src/app/unposted/unposted.module.ts create mode 100644 overlord/src/app/unposted/unposted.service.spec.ts create mode 100644 overlord/src/app/unposted/unposted.service.ts create mode 100644 overlord/src/app/unposted/unposted.ts create mode 100644 overlord/src/app/user/user-detail/user-detail.component.css create mode 100644 overlord/src/app/user/user-detail/user-detail.component.html create mode 100644 overlord/src/app/user/user-detail/user-detail.component.spec.ts create mode 100644 overlord/src/app/user/user-detail/user-detail.component.ts create mode 100644 overlord/src/app/user/user-list-resolver.service.spec.ts create mode 100644 overlord/src/app/user/user-list-resolver.service.ts create mode 100644 overlord/src/app/user/user-list/user-list-datasource.ts create mode 100644 overlord/src/app/user/user-list/user-list.component.css create mode 100644 overlord/src/app/user/user-list/user-list.component.html create mode 100644 overlord/src/app/user/user-list/user-list.component.spec.ts create mode 100644 overlord/src/app/user/user-list/user-list.component.ts create mode 100644 overlord/src/app/user/user-resolver.service.spec.ts create mode 100644 overlord/src/app/user/user-resolver.service.ts create mode 100644 overlord/src/app/user/user-routing.module.spec.ts create mode 100644 overlord/src/app/user/user-routing.module.ts create mode 100644 overlord/src/app/user/user.module.spec.ts create mode 100644 overlord/src/app/user/user.module.ts create mode 100644 overlord/src/app/user/user.service.spec.ts create mode 100644 overlord/src/app/user/user.service.ts create mode 100644 overlord/src/app/user/user.ts create mode 100644 overlord/src/assets/.gitkeep create mode 100644 overlord/src/browserslist create mode 100644 overlord/src/environments/environment.prod.ts create mode 100644 overlord/src/environments/environment.ts create mode 100644 overlord/src/favicon.ico create mode 100644 overlord/src/index.html create mode 100644 overlord/src/karma.conf.js create mode 100644 overlord/src/main.ts create mode 100644 overlord/src/polyfills.ts create mode 100644 overlord/src/styles.css create mode 100644 overlord/src/test.ts rename {brewman/static => overlord}/src/tsconfig.app.json (81%) create mode 100644 overlord/src/tsconfig.spec.json create mode 100644 overlord/src/tslint.json rename {brewman/static => overlord}/tsconfig.json (90%) create mode 100644 overlord/tslint.json diff --git a/.gitignore b/.gitignore index d088e83e..8c43f529 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ env */__pycache__/ .idea/ *.egg-info/ +brewman/static/ brewman/static/node_modules brewman/static/app/**/*.js brewman/static/app/**/*.map diff --git a/brewman/models/master.py b/brewman/models/master.py index e461d743..346ad01a 100644 --- a/brewman/models/master.py +++ b/brewman/models/master.py @@ -201,7 +201,7 @@ class CostCentre(Base): @classmethod def overall(cls): - return {'CostCentreID': uuid.UUID('36f59436-522a-0746-ae94-e0f746bf6c0d'), 'Name': 'Overall'} + return {'id': uuid.UUID('36f59436-522a-0746-ae94-e0f746bf6c0d'), 'name': 'Overall'} class LedgerBase(Base): @@ -285,19 +285,19 @@ class LedgerBase(Base): @classmethod def cash_in_hand(cls): - return {'LedgerID': 'ed2341bb-80b8-9649-90db-f9aaca183bb3', 'Name': 'Cash in Hand'} + return {'id': 'ed2341bb-80b8-9649-90db-f9aaca183bb3', 'name': 'Cash in Hand'} @classmethod def local_purchase(cls): - return {'LedgerID': 'd2b75912-505f-2548-9093-466dfff6a0f9', 'Name': 'Local Purchase'} + return {'id': 'd2b75912-505f-2548-9093-466dfff6a0f9', 'name': 'Local Purchase'} @classmethod def salary(cls): - return {'LedgerID': '5c2b54d0-c174-004d-a0d5-92cdaadcefa7', 'Name': 'Staff Salary'} + return {'id': '5c2b54d0-c174-004d-a0d5-92cdaadcefa7', 'name': 'Staff Salary'} @classmethod def service_charge(cls): - return {'LedgerID': 'b7eff754-e8ba-e047-ab06-9132c15c7640', 'Name': 'Service Charges'} + return {'id': 'b7eff754-e8ba-e047-ab06-9132c15c7640', 'name': 'Service Charges'} @classmethod def service_charge_id(cls): diff --git a/brewman/routes.py b/brewman/routes.py index 76bde406..0d022dff 100644 --- a/brewman/routes.py +++ b/brewman/routes.py @@ -2,15 +2,6 @@ import datetime def includeme(config): - config.add_static_view('fonts', 'brewman:static/src/fonts', cache_max_age=get_age(10)) - config.add_static_view('img', 'brewman:static/src/img', cache_max_age=get_age(10)) - config.add_static_view('js', 'brewman:static/src/js', cache_max_age=get_age(10)) - config.add_static_view('css', 'brewman:static/src/css', cache_max_age=get_age(10)) - config.add_static_view('template', 'brewman:static/src/template', cache_max_age=get_age(10)) - config.add_static_view('src', 'brewman:static/src', cache_max_age=get_age(10)) - config.add_static_view('app', 'brewman:static/src/app', cache_max_age=get_age(10)) - config.add_static_view('node_modules', 'brewman:static/node_modules', cache_max_age=get_age(10)) - config.add_route('api_dashboard', '/api/Dashboard') config.add_route('dashboard', '/Dashboard') @@ -18,11 +9,9 @@ def includeme(config): config.add_route('api_login', '/api/login') config.add_route('login', '/login') config.add_route('logout', '/logout') + config.add_route('api_logout', '/api/logout') config.add_route('home', '/') - # config.add_route('tsconfig', '/tsconfig.json') - config.add_route('systemjs', '/systemjs.config.js') - # config.add_route('main.js', '/main.js') config.add_route('api_account_type_list', '/api/AccountTypes') @@ -48,11 +37,11 @@ def includeme(config): config.add_route('receipt', '/Receipt') config.add_route('issue_id', '/Issue/{id}') config.add_route('issue', '/Issue') - config.add_route('api_issues_grid', '/api/Issues/Services/{date}') - config.add_route('salary_deduction_id', '/SalaryDeduction/{id}') - config.add_route('salary_deduction', '/SalaryDeduction') - config.add_route('service_charge_id', '/ServiceCharge/{id}') - config.add_route('service_charge', '/ServiceCharge') + config.add_route('api_issue_grid', '/api/IssueGrid/{date}') + config.add_route('employee_benefits_id', '/EmployeeBenefits/{id}') + config.add_route('employee_benefits', '/EmployeeBenefits') + config.add_route('incentive_id', '/Incentive/{id}') + config.add_route('incentive', '/Incentive') config.add_route('db_image', '/api/DbImage/{id}/{type}') config.add_route('api_voucher_id', '/api/Voucher/{id}') @@ -65,7 +54,7 @@ def includeme(config): config.add_route('api_tag_list', '/api/Tags') config.add_route('settings', '/Settings') - config.add_route('api_lock_info', '/api/LockInfo') + config.add_route('api_lock_information', '/api/LockInformation') config.add_route('api_maintenance', '/api/Maintenance') add_route(config, 'attendance', '/Attendance', has_list=False, variable='date') @@ -115,7 +104,7 @@ def includeme(config): config.add_route('api_batch', '/api/Batch') - config.add_route('favicon', '/favicon.ico') + config.add_static_view('', 'brewman:static') def add_route(config, name, url, has_list=True, variable='id'): diff --git a/brewman/static/package.json b/brewman/static/package.json deleted file mode 100644 index 529450ae..00000000 --- a/brewman/static/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "scripts": { - "start": "tsc -w", - "tsc": "tsc", - "test": "echo \"Error: no test specified\" && exit 1", - "postinstall": "tsc" - }, - "dependencies": { - "@angular/animations": "^6.0.1", - "@angular/common": "^6.0.1", - "@angular/compiler": "^6.0.1", - "@angular/core": "^6.0.1", - "@angular/forms": "^6.0.1", - "@angular/platform-browser": "^6.0.1", - "@angular/platform-browser-dynamic": "^6.0.1", - "@angular/router": "^6.0.1", - "@angular/upgrade": "^6.0.1", - "angular": "^1.6.10", - "angular-animate": "^1.6.10", - "angular-aria": "^1.6.10", - "angular-cookies": "^1.6.10", - "angular-i18n": "^1.7.0", - "angular-messages": "^1.6.10", - "angular-resource": "^1.6.10", - "angular-route": "^1.6.10", - "angular-sanitize": "^1.6.10", - "angular-ui-bootstrap": "^2.5.6", - "bootstrap": "^3.3.7", - "core-js": "^2.5.6", - "jquery": "^3.3.1", - "lodash": "^4.17.10", - "mathjs": "^4.2.2", - "moment": "^2.22.1", - "mousetrap": "^1.6.1", - "reflect-metadata": "^0.1.12", - "rxjs": "^6.1.0", - "showdown": "^1.8.6", - "zone.js": "^0.8.26" - }, - "devDependencies": { - "typescript": "^2.8.3" - } -} diff --git a/brewman/static/src/app/404.html b/brewman/static/src/app/404.html deleted file mode 100644 index 5cf0c35e..00000000 --- a/brewman/static/src/app/404.html +++ /dev/null @@ -1,7 +0,0 @@ -
-
-

404

- -

It looks like that page you were looking has been lost, sorry.

-
-
diff --git a/brewman/static/src/app/account/account-detail.html b/brewman/static/src/app/account/account-detail.html deleted file mode 100644 index d310f408..00000000 --- a/brewman/static/src/app/account/account-detail.html +++ /dev/null @@ -1,54 +0,0 @@ -
-

Account Detail

- -
- - -
- -
-
-
- - -
- -
-
-
- - -
- - -
-
-
-
- -
-
- -
-
-
- - -
- - -
-
-
-
- - -
-
-
diff --git a/brewman/static/src/app/account/account-list.component.js b/brewman/static/src/app/account/account-list.component.js deleted file mode 100644 index cd244cf9..00000000 --- a/brewman/static/src/app/account/account-list.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var account_list_controller_1 = require("./account-list.controller"); -exports.AccountListComponent = { - templateUrl: '/app/account/account-list.html', - controller: account_list_controller_1.AccountListController, - controllerAs: 'vm' -}; -//# sourceMappingURL=account-list.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/account/account-list.component.js.map b/brewman/static/src/app/account/account-list.component.js.map deleted file mode 100644 index 58a9a776..00000000 --- a/brewman/static/src/app/account/account-list.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"account-list.component.js","sourceRoot":"","sources":["account-list.component.ts"],"names":[],"mappings":";;AAAA,qEAAgE;AAEnD,QAAA,oBAAoB,GAAG;IAChC,WAAW,EAAE,gCAAgC;IAC7C,UAAU,EAAE,+CAAqB;IACjC,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/account/account-list.component.ts b/brewman/static/src/app/account/account-list.component.ts deleted file mode 100644 index 1a1e6b80..00000000 --- a/brewman/static/src/app/account/account-list.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {AccountListController} from './account-list.controller'; - -export const AccountListComponent = { - templateUrl: '/app/account/account-list.html', - controller: AccountListController, - controllerAs: 'vm' -}; \ No newline at end of file diff --git a/brewman/static/src/app/account/account-list.controller.js b/brewman/static/src/app/account/account-list.controller.js deleted file mode 100644 index fa0606e0..00000000 --- a/brewman/static/src/app/account/account-list.controller.js +++ /dev/null @@ -1,84 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var _ = require("lodash"); -var $ = require("jquery"); -require("jqScrollIntoView"); -var AccountListController = /** @class */ (function () { - function AccountListController($scope, $location, $routeParams, Tokenizer) { - var _this = this; - this.$scope = $scope; - this.$location = $location; - this.$routeParams = $routeParams; - this.Tokenizer = Tokenizer; - this.accounts = $scope.$parent.res.accounts; - this.search = $routeParams.q || ''; - this.info = this.accounts; - $scope.$watch('vm.search', function (value) { - _this.filterAccounts(value); - }, true); - $scope.$on('$destroy', function () { - _this.Tokenizer.doFilter.cache = {}; - }); - this.searchInfo = { - comparator: { - 'n': { 'Col': 'Name', 'Comparator': 'text' }, - 't': { 'Col': 'Type', 'Comparator': 'text' }, - 'a': { 'Col': 'IsActive', 'Comparator': 'boolean' }, - 'r': { 'Col': 'IsReconcilable', 'Comparator': 'boolean' }, - 'c': { 'Col': 'CostCentre', 'Comparator': 'text' } - }, - def: 'n', - sorter: { - 'n': 'Name', - 't': 'Type', - 'a': 'IsActive', - 'r': 'IsReconcilable', - 'c': 'CostCentre' - } - }; - this.filterAccounts = _.debounce(function (q) { - if (q !== $scope._search) { - $scope._search = q; - if (angular.isUndefined(q) || q === '') { - _this.$location.path('/Accounts').search('q', null).replace(); - } - else { - _this.$location.path('/Accounts').search({ 'q': q }).replace(); - } - $scope.$apply(function () { - var matches = Tokenizer.parseFilterString(q, _this.searchInfo); - _this.accounts = Tokenizer.doFilter(q, _this.info, matches); - }); - } - }, 350); - this.selected = -1; - this.shortcuts = { - 'up': function (e) { - if (_this.selected > 0) { - _this.$scope.$apply(function () { - _this.selected = Math.min(Math.max(0, _this.selected - 1), _this.accounts.length - 1); - }); - $("#" + _this.selected).scrollintoview(); - e.preventDefault(); - } - }, - 'down': function (e) { - if (_this.selected < _this.accounts.length - 1) { - _this.$scope.$apply(function () { - _this.selected = Math.min(Math.max(0, _this.selected + 1), _this.accounts.length - 1); - }); - $("#" + _this.selected).scrollintoview(); - e.preventDefault(); - } - } - }; - } - AccountListController.prototype.setSelected = function (index) { - this.selected = Math.min(Math.max(0, index), this.accounts.length - 1); - }; - AccountListController.$inject = ['$scope', '$location', '$routeParams', 'Tokenizer']; - return AccountListController; -}()); -exports.AccountListController = AccountListController; -//# sourceMappingURL=account-list.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/account/account-list.controller.js.map b/brewman/static/src/app/account/account-list.controller.js.map deleted file mode 100644 index c0c64858..00000000 --- a/brewman/static/src/app/account/account-list.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"account-list.controller.js","sourceRoot":"","sources":["account-list.controller.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AACnC,0BAA4B;AAC5B,0BAA4B;AAC5B,4BAA0B;AAE1B;IAUI,+BAAmB,MAAM,EAAS,SAAS,EAAS,YAAY,EAAS,SAAS;QAAlF,iBAkEC;QAlEkB,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,iBAAY,GAAZ,YAAY,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAC9E,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;QAC5C,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC,CAAC,IAAI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MAAM,CAAC;wBACf,KAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,EAAE,KAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;oBACvF,CAAC,CAAC,CAAC;oBACH,CAAC,CAAC,GAAG,GAAG,KAAI,CAAC,QAAQ,CAAC,CAAC,cAAc,EAAE,CAAC;oBACxC,CAAC,CAAC,cAAc,EAAE,CAAC;iBACtB;YACL,CAAC;SACJ,CAAC;IACN,CAAC;IAED,2CAAW,GAAX,UAAY,KAAK;QACb,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC3E,CAAC;IA/EM,6BAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;IAgF1E,4BAAC;CAAA,AAjFD,IAiFC;AAjFY,sDAAqB"} \ No newline at end of file diff --git a/brewman/static/src/app/account/account-list.controller.ts b/brewman/static/src/app/account/account-list.controller.ts deleted file mode 100644 index c90303ec..00000000 --- a/brewman/static/src/app/account/account-list.controller.ts +++ /dev/null @@ -1,87 +0,0 @@ -import * as angular from 'angular'; -import * as _ from 'lodash'; -import * as $ from 'jquery'; -import 'jqScrollIntoView'; - -export class AccountListController { - static $inject = ['$scope', '$location', '$routeParams', 'Tokenizer']; - search: any; - info: any; - searchInfo: any; - filterAccounts: any; - selected: any; - shortcuts: any; - accounts: any; - - constructor(public $scope, public $location, public $routeParams, public Tokenizer) { - this.accounts = $scope.$parent.res.accounts; - this.search = $routeParams.q || ''; - this.info = this.accounts; - - $scope.$watch('vm.search', (value) => { - this.filterAccounts(value); - }, true); - - $scope.$on('$destroy', () => { - this.Tokenizer.doFilter.cache = {}; - }); - this.searchInfo = { - comparator: { - 'n': {'Col': 'Name', 'Comparator': 'text'}, - 't': {'Col': 'Type', 'Comparator': 'text'}, - 'a': {'Col': 'IsActive', 'Comparator': 'boolean'}, - 'r': {'Col': 'IsReconcilable', 'Comparator': 'boolean'}, - 'c': {'Col': 'CostCentre', 'Comparator': 'text'} - }, - def: 'n', - sorter: { - 'n': 'Name', - 't': 'Type', - 'a': 'IsActive', - 'r': 'IsReconcilable', - 'c': 'CostCentre' - } - }; - this.filterAccounts = _.debounce((q) => { - if (q !== $scope._search) { - $scope._search = q; - if (angular.isUndefined(q) || q === '') { - this.$location.path('/Accounts').search('q', null).replace(); - } else { - this.$location.path('/Accounts').search({'q': q}).replace(); - } - $scope.$apply(() => { - let matches = Tokenizer.parseFilterString(q, this.searchInfo); - this.accounts = Tokenizer.doFilter(q, this.info, matches); - - }); - } - }, 350); - - this.selected = -1; - this.shortcuts = { - 'up': (e) => { - if (this.selected > 0) { - this.$scope.$apply(() => { - this.selected = Math.min(Math.max(0, this.selected - 1), this.accounts.length - 1); - }); - $("#" + this.selected).scrollintoview(); - e.preventDefault(); - } - }, - 'down': (e) => { - if (this.selected < this.accounts.length - 1) { - this.$scope.$apply(() => { - this.selected = Math.min(Math.max(0, this.selected + 1), this.accounts.length - 1); - }); - $("#" + this.selected).scrollintoview(); - e.preventDefault(); - } - } - }; - } - - setSelected(index) { - this.selected = Math.min(Math.max(0, index), this.accounts.length - 1); - } -} diff --git a/brewman/static/src/app/account/account-list.html b/brewman/static/src/app/account/account-list.html deleted file mode 100644 index 22d810e3..00000000 --- a/brewman/static/src/app/account/account-list.html +++ /dev/null @@ -1,34 +0,0 @@ -

Accounts -
-
- -
-
- Add -
-
-

- - - - - - - - - - - - - - - - - - - -
NameTypeIs Active?Is Reconcilable?Cost Centre
{{item.Name}}{{item.Type}}{{item.IsActive}}{{item.IsReconcilable}}{{item.CostCentre}}
diff --git a/brewman/static/src/app/account/account-list.resolver.js b/brewman/static/src/app/account/account-list.resolver.js deleted file mode 100644 index 956f3152..00000000 --- a/brewman/static/src/app/account/account-list.resolver.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function AccountListResolver(Account) { - return Account.query({}).$promise; -} -exports.AccountListResolver = AccountListResolver; -//# sourceMappingURL=account-list.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/account/account-list.resolver.js.map b/brewman/static/src/app/account/account-list.resolver.js.map deleted file mode 100644 index a09f12fe..00000000 --- a/brewman/static/src/app/account/account-list.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"account-list.resolver.js","sourceRoot":"","sources":["account-list.resolver.ts"],"names":[],"mappings":";;AAAA,6BAAoC,OAAO;IACvC,OAAO,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;AACtC,CAAC;AAFD,kDAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/account/account-list.resolver.ts b/brewman/static/src/app/account/account-list.resolver.ts deleted file mode 100644 index b17bda36..00000000 --- a/brewman/static/src/app/account/account-list.resolver.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function AccountListResolver(Account) { - return Account.query({}).$promise; -} diff --git a/brewman/static/src/app/account/account-type.service.js b/brewman/static/src/app/account/account-type.service.js deleted file mode 100644 index a42cd6d2..00000000 --- a/brewman/static/src/app/account/account-type.service.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function AccountType($resource) { - return $resource('/api/AccountTypes'); -} -exports.AccountType = AccountType; -//# sourceMappingURL=account-type.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/account/account-type.service.js.map b/brewman/static/src/app/account/account-type.service.js.map deleted file mode 100644 index c575b99a..00000000 --- a/brewman/static/src/app/account/account-type.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"account-type.service.js","sourceRoot":"","sources":["account-type.service.ts"],"names":[],"mappings":";;AAAA,qBAA4B,SAAS;IACjC,OAAO,SAAS,CAAC,mBAAmB,CAAC,CAAC;AAC1C,CAAC;AAFD,kCAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/account/account-type.service.ts b/brewman/static/src/app/account/account-type.service.ts deleted file mode 100644 index 6a3f37b8..00000000 --- a/brewman/static/src/app/account/account-type.service.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function AccountType($resource) { - return $resource('/api/AccountTypes'); -} diff --git a/brewman/static/src/app/account/account-types.resolver.js b/brewman/static/src/app/account/account-types.resolver.js deleted file mode 100644 index 76acbbf8..00000000 --- a/brewman/static/src/app/account/account-types.resolver.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function AccountTypesResolver(AccountType) { - return AccountType.query({}).$promise; -} -exports.AccountTypesResolver = AccountTypesResolver; -//# sourceMappingURL=account-types.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/account/account-types.resolver.js.map b/brewman/static/src/app/account/account-types.resolver.js.map deleted file mode 100644 index bf3b72c0..00000000 --- a/brewman/static/src/app/account/account-types.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"account-types.resolver.js","sourceRoot":"","sources":["account-types.resolver.ts"],"names":[],"mappings":";;AAAA,8BAAqC,WAAW;IAC5C,OAAO,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;AAC1C,CAAC;AAFD,oDAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/account/account-types.resolver.ts b/brewman/static/src/app/account/account-types.resolver.ts deleted file mode 100644 index b3829ac7..00000000 --- a/brewman/static/src/app/account/account-types.resolver.ts +++ /dev/null @@ -1,4 +0,0 @@ -export function AccountTypesResolver(AccountType) { - return AccountType.query({}).$promise; -} - diff --git a/brewman/static/src/app/account/account.component.js b/brewman/static/src/app/account/account.component.js deleted file mode 100644 index a9e8b146..00000000 --- a/brewman/static/src/app/account/account.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var account_controller_1 = require("./account.controller"); -exports.AccountComponent = { - templateUrl: '/app/account/account-detail.html', - controller: account_controller_1.AccountController, - controllerAs: 'vm' -}; -//# sourceMappingURL=account.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/account/account.component.js.map b/brewman/static/src/app/account/account.component.js.map deleted file mode 100644 index 31bfb88f..00000000 --- a/brewman/static/src/app/account/account.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"account.component.js","sourceRoot":"","sources":["account.component.ts"],"names":[],"mappings":";;AAAA,2DAAuD;AAE1C,QAAA,gBAAgB,GAAG;IAC5B,WAAW,EAAE,kCAAkC;IAC/C,UAAU,EAAE,sCAAiB;IAC7B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/account/account.component.ts b/brewman/static/src/app/account/account.component.ts deleted file mode 100644 index 9356eb6a..00000000 --- a/brewman/static/src/app/account/account.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {AccountController} from './account.controller'; - -export const AccountComponent = { - templateUrl: '/app/account/account-detail.html', - controller: AccountController, - controllerAs: 'vm' -}; \ No newline at end of file diff --git a/brewman/static/src/app/account/account.controller.js b/brewman/static/src/app/account/account.controller.js deleted file mode 100644 index acf59ff8..00000000 --- a/brewman/static/src/app/account/account.controller.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var AccountController = /** @class */ (function () { - function AccountController($scope, $location, $modal, Messages) { - this.$scope = $scope; - this.$location = $location; - this.$modal = $modal; - this.Messages = Messages; - this.account = $scope.$parent.res.account; - this.accountTypes = $scope.$parent.res.accountTypes; - this.costCentres = $scope.$parent.res.costCentres; - this.foName = true; - } - AccountController.prototype.save = function () { - var _this = this; - this.account.$save(function () { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/Accounts'); - }, function (data) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - AccountController.prototype.delete = function () { - var _this = this; - this.account.$delete(function () { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/Accounts'); - }, function (data) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - AccountController.prototype.confirm = function () { - var _this = this; - var modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', /** @class */ (function () { - function class_1($modalInstance) { - this.$modalInstance = $modalInstance; - this.title = "Delete Account"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - class_1.prototype.ok = function () { - this.$modalInstance.close(); - }; - class_1.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - return class_1; - }())] - }); - modalInstance.result.then(function () { - _this.delete(); - }); - }; - AccountController.$inject = ['$scope', '$location', '$uibModal', 'Messages']; - return AccountController; -}()); -exports.AccountController = AccountController; -//# sourceMappingURL=account.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/account/account.controller.js.map b/brewman/static/src/app/account/account.controller.js.map deleted file mode 100644 index 21d2cb13..00000000 --- a/brewman/static/src/app/account/account.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"account.controller.js","sourceRoot":"","sources":["account.controller.ts"],"names":[],"mappings":";;AAAA;IAOI,2BAAmB,MAAM,EAAS,SAAS,EAAS,MAAM,EAAS,QAAQ;QAAxD,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,aAAQ,GAAR,QAAQ,CAAA;QACvE,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;QAC1C,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;QACpD,IAAI,CAAC,WAAW,GAA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IAAI,CAAC,KAAK,GAAG,gBAAgB,CAAC;wBAC9B,IAAI,CAAC,IAAI,GAAG,sCAAsC,CAAC;wBACnD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;oBACzB,CAAC;oBAED,oBAAE,GAAF;wBACI,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;oBAChC,CAAC;oBAED,wBAAM,GAAN;wBACI,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;oBAC1C,CAAC;oBACL,cAAC;gBAAD,CAAC,AAlBiC,IAkBhC;SACL,CAAC,CAAC;QACH,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC;YACtB,KAAI,CAAC,MAAM,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACP,CAAC;IA3DM,yBAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;IA4DtE,wBAAC;CAAA,AA7DD,IA6DC;AA7DY,8CAAiB"} \ No newline at end of file diff --git a/brewman/static/src/app/account/account.controller.ts b/brewman/static/src/app/account/account.controller.ts deleted file mode 100644 index ec93be41..00000000 --- a/brewman/static/src/app/account/account.controller.ts +++ /dev/null @@ -1,62 +0,0 @@ -export class AccountController { - static $inject = ['$scope', '$location', '$uibModal', 'Messages']; - foName: any; - account: any; - accountTypes: any; - costCentres: any; - - constructor(public $scope, public $location, public $modal, public Messages) { - this.account = $scope.$parent.res.account; - this.accountTypes = $scope.$parent.res.accountTypes; - this.costCentres = $scope.$parent.res.costCentres; - this.foName = true; - } - - save() { - this.account.$save(() => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/Accounts'); - }, (data) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - delete() { - this.account.$delete(() => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/Accounts'); - }, (data) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - confirm() { - let modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', class { - title: any; - body: any; - isDelete: boolean; - - constructor(public $modalInstance) { - this.title = "Delete Account"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - - ok() { - this.$modalInstance.close(); - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - }] - }); - modalInstance.result.then(() => { - this.delete(); - }); - } -} diff --git a/brewman/static/src/app/account/account.resolver.js b/brewman/static/src/app/account/account.resolver.js deleted file mode 100644 index 640d74e4..00000000 --- a/brewman/static/src/app/account/account.resolver.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function AccountResolver($route, Account) { - var id = $route.current.params.id; - return Account.get({ id: id }).$promise; -} -exports.AccountResolver = AccountResolver; -//# sourceMappingURL=account.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/account/account.resolver.js.map b/brewman/static/src/app/account/account.resolver.js.map deleted file mode 100644 index 4669b759..00000000 --- a/brewman/static/src/app/account/account.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"account.resolver.js","sourceRoot":"","sources":["account.resolver.ts"],"names":[],"mappings":";;AAAA,yBAAgC,MAAM,EAAE,OAAO;IAC3C,IAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IACpC,OAAO,OAAO,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;AAC1C,CAAC;AAHD,0CAGC"} \ No newline at end of file diff --git a/brewman/static/src/app/account/account.resolver.ts b/brewman/static/src/app/account/account.resolver.ts deleted file mode 100644 index 3e486d81..00000000 --- a/brewman/static/src/app/account/account.resolver.ts +++ /dev/null @@ -1,4 +0,0 @@ -export function AccountResolver($route, Account) { - const id = $route.current.params.id; - return Account.get({id: id}).$promise; -} diff --git a/brewman/static/src/app/account/account.service.js b/brewman/static/src/app/account/account.service.js deleted file mode 100644 index 971472e9..00000000 --- a/brewman/static/src/app/account/account.service.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function Account($resource) { - return $resource('/api/Account/:id', { id: '@LedgerID' }, { - query: { method: 'GET', params: { list: true }, isArray: true }, - autocomplete: { method: 'GET', params: { term: '' }, isArray: true }, - balance: { method: 'GET', params: { b: true, d: '' } } - }); -} -exports.Account = Account; -//# sourceMappingURL=account.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/account/account.service.js.map b/brewman/static/src/app/account/account.service.js.map deleted file mode 100644 index e7c5eb25..00000000 --- a/brewman/static/src/app/account/account.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"account.service.js","sourceRoot":"","sources":["account.service.ts"],"names":[],"mappings":";;AAAA,iBAAwB,SAAS;IAC7B,OAAO,SAAS,CAAC,kBAAkB,EAC/B,EAAC,EAAE,EAAE,WAAW,EAAC,EAAE;QACf,KAAK,EAAE,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,EAAE,OAAO,EAAE,IAAI,EAAC;QAC3D,YAAY,EAAE,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAC,IAAI,EAAE,EAAE,EAAC,EAAE,OAAO,EAAE,IAAI,EAAC;QAChE,OAAO,EAAE,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAC,EAAC;KACrD,CAAC,CAAC;AACX,CAAC;AAPD,0BAOC"} \ No newline at end of file diff --git a/brewman/static/src/app/account/account.service.ts b/brewman/static/src/app/account/account.service.ts deleted file mode 100644 index 655835e1..00000000 --- a/brewman/static/src/app/account/account.service.ts +++ /dev/null @@ -1,8 +0,0 @@ -export function Account($resource) { - return $resource('/api/Account/:id', - {id: '@LedgerID'}, { - query: {method: 'GET', params: {list: true}, isArray: true}, - autocomplete: {method: 'GET', params: {term: ''}, isArray: true}, - balance: {method: 'GET', params: {b: true, d: ''}} - }); -} diff --git a/brewman/static/src/app/account/payment-accounts.resolver.js b/brewman/static/src/app/account/payment-accounts.resolver.js deleted file mode 100644 index 85610ad6..00000000 --- a/brewman/static/src/app/account/payment-accounts.resolver.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function PaymentAccountsResolver(Account) { - return Account.autocomplete({ term: '', type: 1 }).$promise; -} -exports.PaymentAccountsResolver = PaymentAccountsResolver; -//# sourceMappingURL=payment-accounts.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/account/payment-accounts.resolver.js.map b/brewman/static/src/app/account/payment-accounts.resolver.js.map deleted file mode 100644 index b4c4eb4a..00000000 --- a/brewman/static/src/app/account/payment-accounts.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"payment-accounts.resolver.js","sourceRoot":"","sources":["payment-accounts.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAwC,OAAO;IAC3C,OAAO,OAAO,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC,QAAQ,CAAC;AAC9D,CAAC;AAFD,0DAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/account/payment-accounts.resolver.ts b/brewman/static/src/app/account/payment-accounts.resolver.ts deleted file mode 100644 index 0927b23a..00000000 --- a/brewman/static/src/app/account/payment-accounts.resolver.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function PaymentAccountsResolver(Account) { - return Account.autocomplete({term: '', type: 1}).$promise; -} diff --git a/brewman/static/src/app/account/receipt-accounts.resolver.js b/brewman/static/src/app/account/receipt-accounts.resolver.js deleted file mode 100644 index b42db1b3..00000000 --- a/brewman/static/src/app/account/receipt-accounts.resolver.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function ReceiptAccountsResolver(Account) { - return Account.autocomplete({ term: '', type: 1 }).$promise; -} -exports.ReceiptAccountsResolver = ReceiptAccountsResolver; -//# sourceMappingURL=receipt-accounts.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/account/receipt-accounts.resolver.js.map b/brewman/static/src/app/account/receipt-accounts.resolver.js.map deleted file mode 100644 index 35abe0ce..00000000 --- a/brewman/static/src/app/account/receipt-accounts.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"receipt-accounts.resolver.js","sourceRoot":"","sources":["receipt-accounts.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAwC,OAAO;IAC3C,OAAO,OAAO,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAC,CAAC,CAAC,QAAQ,CAAC;AAC9D,CAAC;AAFD,0DAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/account/receipt-accounts.resolver.ts b/brewman/static/src/app/account/receipt-accounts.resolver.ts deleted file mode 100644 index 27e21657..00000000 --- a/brewman/static/src/app/account/receipt-accounts.resolver.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function ReceiptAccountsResolver(Account) { - return Account.autocomplete({term: '', type: 1}).$promise; -} diff --git a/brewman/static/src/app/app.module.js b/brewman/static/src/app/app.module.js deleted file mode 100644 index fdbdf7d6..00000000 --- a/brewman/static/src/app/app.module.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -require("./overlord.app"); -angular.bootstrap(document.body, ['overlord'], { strictDi: false }); -//# sourceMappingURL=app.module.js.map \ No newline at end of file diff --git a/brewman/static/src/app/app.module.js.map b/brewman/static/src/app/app.module.js.map deleted file mode 100644 index 4c05a561..00000000 --- a/brewman/static/src/app/app.module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"app.module.js","sourceRoot":"","sources":["app.module.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AACnC,0BAAwB;AAExB,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE,EAAC,QAAQ,EAAE,KAAK,EAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/app.module.ts b/brewman/static/src/app/app.module.ts deleted file mode 100644 index cd6f468f..00000000 --- a/brewman/static/src/app/app.module.ts +++ /dev/null @@ -1,4 +0,0 @@ -import * as angular from 'angular'; -import './overlord.app'; - -angular.bootstrap(document.body, ['overlord'], {strictDi: false}); diff --git a/brewman/static/src/app/attendance/attendance-info.resolver.js b/brewman/static/src/app/attendance/attendance-info.resolver.js deleted file mode 100644 index 57689ed2..00000000 --- a/brewman/static/src/app/attendance/attendance-info.resolver.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function AttendanceInfoResolver($route, Attendance) { - var date = $route.current.params.date; - if (angular.isUndefined(date)) { - return Attendance.get({}).$promise; - } - else { - return Attendance.get({ date: date }).$promise; - } -} -exports.AttendanceInfoResolver = AttendanceInfoResolver; -//# sourceMappingURL=attendance-info.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/attendance/attendance-info.resolver.js.map b/brewman/static/src/app/attendance/attendance-info.resolver.js.map deleted file mode 100644 index e2dece67..00000000 --- a/brewman/static/src/app/attendance/attendance-info.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"attendance-info.resolver.js","sourceRoot":"","sources":["attendance-info.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,gCAAuC,MAAM,EAAE,UAAU;IACrD,IAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;IACxC,IAAI,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;QAC3B,OAAO,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;KACtC;SAAM;QACH,OAAO,UAAU,CAAC,GAAG,CAAC,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC,QAAQ,CAAC;KAChD;AACL,CAAC;AAPD,wDAOC"} \ No newline at end of file diff --git a/brewman/static/src/app/attendance/attendance-info.resolver.ts b/brewman/static/src/app/attendance/attendance-info.resolver.ts deleted file mode 100644 index 0df0d09a..00000000 --- a/brewman/static/src/app/attendance/attendance-info.resolver.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as angular from 'angular'; - -export function AttendanceInfoResolver($route, Attendance) { - const date = $route.current.params.date; - if (angular.isUndefined(date)) { - return Attendance.get({}).$promise; - } else { - return Attendance.get({date: date}).$promise; - } -} diff --git a/brewman/static/src/app/attendance/attendance-sub.controller.js b/brewman/static/src/app/attendance/attendance-sub.controller.js deleted file mode 100644 index 0f0cec1d..00000000 --- a/brewman/static/src/app/attendance/attendance-sub.controller.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var AttendanceSubController = /** @class */ (function () { - function AttendanceSubController($scope) { - this.$scope = $scope; - this.attendanceTypes = $scope.attendanceTypes; - this.item = $scope.item; - this.original = {}; - angular.copy(this.item, this.original); - } - AttendanceSubController.prototype.isLabel = function () { - return true; - }; - AttendanceSubController.prototype.isError = function () { - return this.item.Worked === 'Error'; - }; - AttendanceSubController.prototype.isGood = function () { - return this.item.Worked === true; - }; - AttendanceSubController.prototype.isBad = function () { - return this.item.Worked === false; - }; - AttendanceSubController.prototype.isDirty = function () { - return !angular.equals(this.original, this.item); - }; - AttendanceSubController.$inject = ['$scope']; - return AttendanceSubController; -}()); -exports.AttendanceSubController = AttendanceSubController; -//# sourceMappingURL=attendance-sub.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/attendance/attendance-sub.controller.js.map b/brewman/static/src/app/attendance/attendance-sub.controller.js.map deleted file mode 100644 index 6f8a7f70..00000000 --- a/brewman/static/src/app/attendance/attendance-sub.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"attendance-sub.controller.js","sourceRoot":"","sources":["attendance-sub.controller.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC;IAMI,iCAAmB,MAAM;QAAN,WAAM,GAAN,MAAM,CAAA;QACrB,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;QAC9C,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;IAED,yCAAO,GAAP;QACI,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,yCAAO,GAAP;QACI,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,OAAO,CAAC;IACxC,CAAC;IAED,wCAAM,GAAN;QACI,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC;IACrC,CAAC;IAED,uCAAK,GAAL;QACI,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC;IACtC,CAAC;IAED,yCAAO,GAAP;QACI,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;IA9BM,+BAAO,GAAG,CAAC,QAAQ,CAAC,CAAC;IA+BhC,8BAAC;CAAA,AAhCD,IAgCC;AAhCY,0DAAuB"} \ No newline at end of file diff --git a/brewman/static/src/app/attendance/attendance-sub.controller.ts b/brewman/static/src/app/attendance/attendance-sub.controller.ts deleted file mode 100644 index f3aec9a9..00000000 --- a/brewman/static/src/app/attendance/attendance-sub.controller.ts +++ /dev/null @@ -1,35 +0,0 @@ -import * as angular from 'angular'; - -export class AttendanceSubController { - static $inject = ['$scope']; - item: any; - original: any; - attendanceTypes: any; - - constructor(public $scope) { - this.attendanceTypes = $scope.attendanceTypes; - this.item = $scope.item; - this.original = {}; - angular.copy(this.item, this.original); - } - - isLabel() { - return true; - } - - isError() { - return this.item.Worked === 'Error'; - } - - isGood() { - return this.item.Worked === true; - } - - isBad() { - return this.item.Worked === false; - } - - isDirty() { - return !angular.equals(this.original, this.item); - } -} diff --git a/brewman/static/src/app/attendance/attendance-sub.directive.js b/brewman/static/src/app/attendance/attendance-sub.directive.js deleted file mode 100644 index 94222d16..00000000 --- a/brewman/static/src/app/attendance/attendance-sub.directive.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var attendance_sub_controller_1 = require("./attendance-sub.controller"); -function AttendanceSubDirective() { - return { - scope: { - item: '=attendanceSub', - attendanceTypes: '=attendanceTypes' - }, - restrict: 'A', - templateUrl: '/app/attendance/attendance-sub.html', - controller: attendance_sub_controller_1.AttendanceSubController, - controllerAs: 'vmSub', - }; -} -exports.AttendanceSubDirective = AttendanceSubDirective; -//# sourceMappingURL=attendance-sub.directive.js.map \ No newline at end of file diff --git a/brewman/static/src/app/attendance/attendance-sub.directive.js.map b/brewman/static/src/app/attendance/attendance-sub.directive.js.map deleted file mode 100644 index 04d1992c..00000000 --- a/brewman/static/src/app/attendance/attendance-sub.directive.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"attendance-sub.directive.js","sourceRoot":"","sources":["attendance-sub.directive.ts"],"names":[],"mappings":";;AAAA,yEAAoE;AAEpE;IACI,OAAO;QACH,KAAK,EAAE;YACH,IAAI,EAAE,gBAAgB;YACtB,eAAe,EAAE,kBAAkB;SACtC;QACD,QAAQ,EAAE,GAAG;QACb,WAAW,EAAE,qCAAqC;QAClD,UAAU,EAAE,mDAAuB;QACnC,YAAY,EAAE,OAAO;KACxB,CAAC;AACN,CAAC;AAXD,wDAWC"} \ No newline at end of file diff --git a/brewman/static/src/app/attendance/attendance-sub.directive.ts b/brewman/static/src/app/attendance/attendance-sub.directive.ts deleted file mode 100644 index a0b01bc8..00000000 --- a/brewman/static/src/app/attendance/attendance-sub.directive.ts +++ /dev/null @@ -1,14 +0,0 @@ -import {AttendanceSubController} from './attendance-sub.controller'; - -export function AttendanceSubDirective() { - return { - scope: { - item: '=attendanceSub', - attendanceTypes: '=attendanceTypes' - }, - restrict: 'A', - templateUrl: '/app/attendance/attendance-sub.html', - controller: AttendanceSubController, - controllerAs: 'vmSub', - }; -} diff --git a/brewman/static/src/app/attendance/attendance-sub.html b/brewman/static/src/app/attendance/attendance-sub.html deleted file mode 100644 index fda3d8aa..00000000 --- a/brewman/static/src/app/attendance/attendance-sub.html +++ /dev/null @@ -1,12 +0,0 @@ - {{item.Code}} - {{item.Name}} - {{item.Designation}} - {{item.Department}} - - - - {{item.Prints}} - {{item.Hours}} - diff --git a/brewman/static/src/app/attendance/attendance-types.resolver.js b/brewman/static/src/app/attendance/attendance-types.resolver.js deleted file mode 100644 index 99b1c405..00000000 --- a/brewman/static/src/app/attendance/attendance-types.resolver.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function AttendanceTypesResolver(AttendanceTypes) { - return AttendanceTypes.query({}).$promise; -} -exports.AttendanceTypesResolver = AttendanceTypesResolver; -//# sourceMappingURL=attendance-types.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/attendance/attendance-types.resolver.js.map b/brewman/static/src/app/attendance/attendance-types.resolver.js.map deleted file mode 100644 index 65cb08e9..00000000 --- a/brewman/static/src/app/attendance/attendance-types.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"attendance-types.resolver.js","sourceRoot":"","sources":["attendance-types.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAwC,eAAe;IACnD,OAAO,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;AAC9C,CAAC;AAFD,0DAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/attendance/attendance-types.resolver.ts b/brewman/static/src/app/attendance/attendance-types.resolver.ts deleted file mode 100644 index 3dd4c02d..00000000 --- a/brewman/static/src/app/attendance/attendance-types.resolver.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function AttendanceTypesResolver(AttendanceTypes) { - return AttendanceTypes.query({}).$promise; -} diff --git a/brewman/static/src/app/attendance/attendance-types.service.js b/brewman/static/src/app/attendance/attendance-types.service.js deleted file mode 100644 index 2a38a65b..00000000 --- a/brewman/static/src/app/attendance/attendance-types.service.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function AttendanceTypes($resource) { - return $resource('/api/AttendanceTypes'); -} -exports.AttendanceTypes = AttendanceTypes; -//# sourceMappingURL=attendance-types.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/attendance/attendance-types.service.js.map b/brewman/static/src/app/attendance/attendance-types.service.js.map deleted file mode 100644 index 6514d3f2..00000000 --- a/brewman/static/src/app/attendance/attendance-types.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"attendance-types.service.js","sourceRoot":"","sources":["attendance-types.service.ts"],"names":[],"mappings":";;AAAA,yBAAgC,SAAS;IACrC,OAAO,SAAS,CAAC,sBAAsB,CAAC,CAAC;AAC7C,CAAC;AAFD,0CAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/attendance/attendance-types.service.ts b/brewman/static/src/app/attendance/attendance-types.service.ts deleted file mode 100644 index f19542fa..00000000 --- a/brewman/static/src/app/attendance/attendance-types.service.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function AttendanceTypes($resource) { - return $resource('/api/AttendanceTypes'); -} diff --git a/brewman/static/src/app/attendance/attendance.component.js b/brewman/static/src/app/attendance/attendance.component.js deleted file mode 100644 index c31b5604..00000000 --- a/brewman/static/src/app/attendance/attendance.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var attendance_controller_1 = require("./attendance.controller"); -exports.AttendanceComponent = { - templateUrl: '/app/attendance/attendance.html', - controller: attendance_controller_1.AttendanceController, - controllerAs: 'vm', -}; -//# sourceMappingURL=attendance.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/attendance/attendance.component.js.map b/brewman/static/src/app/attendance/attendance.component.js.map deleted file mode 100644 index 16e11983..00000000 --- a/brewman/static/src/app/attendance/attendance.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"attendance.component.js","sourceRoot":"","sources":["attendance.component.ts"],"names":[],"mappings":";;AAAA,iEAA6D;AAEhD,QAAA,mBAAmB,GAAG;IAC/B,WAAW,EAAE,iCAAiC;IAC9C,UAAU,EAAE,4CAAoB;IAChC,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/attendance/attendance.component.ts b/brewman/static/src/app/attendance/attendance.component.ts deleted file mode 100644 index 38763032..00000000 --- a/brewman/static/src/app/attendance/attendance.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {AttendanceController} from './attendance.controller'; - -export const AttendanceComponent = { - templateUrl: '/app/attendance/attendance.html', - controller: AttendanceController, - controllerAs: 'vm', -}; \ No newline at end of file diff --git a/brewman/static/src/app/attendance/attendance.controller.js b/brewman/static/src/app/attendance/attendance.controller.js deleted file mode 100644 index 63ac6cd9..00000000 --- a/brewman/static/src/app/attendance/attendance.controller.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var AttendanceController = /** @class */ (function () { - function AttendanceController($scope, $location, asDate, Attendance, dateParser, Messages) { - this.$scope = $scope; - this.$location = $location; - this.asDate = asDate; - this.Attendance = Attendance; - this.dateParser = dateParser; - this.Messages = Messages; - this.attendanceTypes = $scope.$parent.res.attendanceTypes; - this.info = $scope.$parent.res.info; - this._info_Date = dateParser.parse(this.info.Date, "dd-MMM-yyyy"); - this.foDate = true; - } - AttendanceController.prototype.info_Date = function (value) { - if (arguments.length) { - this.info.Date = this.asDate(value); - this._info_Date = value; - } - return this._info_Date; - }; - AttendanceController.prototype.show = function () { - this.$location.path('/Attendance/' + this.info.Date); - }; - AttendanceController.prototype.save = function () { - var _this = this; - return this.info.$save(function (u) { - _this.Messages.push({ Type: 'Success', Message: u.Code }); - }, function (data) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - AttendanceController.$inject = ['$scope', '$location', 'asDateFilter', 'Attendance', 'uibDateParser', 'Messages']; - return AttendanceController; -}()); -exports.AttendanceController = AttendanceController; -//# sourceMappingURL=attendance.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/attendance/attendance.controller.js.map b/brewman/static/src/app/attendance/attendance.controller.js.map deleted file mode 100644 index 12f3723b..00000000 --- a/brewman/static/src/app/attendance/attendance.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"attendance.controller.js","sourceRoot":"","sources":["attendance.controller.ts"],"names":[],"mappings":";;AAAA;IAOI,8BAAmB,MAAM,EAAS,SAAS,EAAS,MAAM,EAAS,UAAU,EAAS,UAAU,EAAS,QAAQ;QAA9F,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QAAS,aAAQ,GAAR,QAAQ,CAAA;QAC7G,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;QAC1D,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QAClE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;IAED,wCAAS,GAAT,UAAU,KAAK;QACX,IAAI,SAAS,CAAC,MAAM,EAAE;YAClB,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACpC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;SAC3B;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,mCAAI,GAAJ;QACI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzD,CAAC;IAED,mCAAI,GAAJ;QAAA,iBAMC;QALG,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAC,CAAC;YACrB,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC,IAAI,EAAC,CAAC,CAAC;QAC3D,CAAC,EAAE,UAAC,IAAI;YACJ,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,EAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACP,CAAC;IA/BM,4BAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;IAgCxG,2BAAC;CAAA,AAjCD,IAiCC;AAjCY,oDAAoB"} \ No newline at end of file diff --git a/brewman/static/src/app/attendance/attendance.controller.ts b/brewman/static/src/app/attendance/attendance.controller.ts deleted file mode 100644 index a8ad6525..00000000 --- a/brewman/static/src/app/attendance/attendance.controller.ts +++ /dev/null @@ -1,34 +0,0 @@ -export class AttendanceController { - static $inject = ['$scope', '$location', 'asDateFilter', 'Attendance', 'uibDateParser', 'Messages']; - _info_Date: any; - foDate: boolean; - attendanceTypes: any; - info: any; - - constructor(public $scope, public $location, public asDate, public Attendance, public dateParser, public Messages) { - this.attendanceTypes = $scope.$parent.res.attendanceTypes; - this.info = $scope.$parent.res.info; - this._info_Date = dateParser.parse(this.info.Date, "dd-MMM-yyyy"); - this.foDate = true; - } - - info_Date(value) { - if (arguments.length) { - this.info.Date = this.asDate(value); - this._info_Date = value; - } - return this._info_Date; - } - - show() { - this.$location.path('/Attendance/' + this.info.Date); - } - - save() { - return this.info.$save((u) => { - this.Messages.push({Type: 'Success', Message: u.Code}); - }, (data) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } -} diff --git a/brewman/static/src/app/attendance/attendance.html b/brewman/static/src/app/attendance/attendance.html deleted file mode 100644 index f720ad92..00000000 --- a/brewman/static/src/app/attendance/attendance.html +++ /dev/null @@ -1,44 +0,0 @@ -
-

Attendance

- -
- - -
-
- - - - -
-
- -
- -
-
- - - - - - - - - - - - - - - -
CodeNameDesignationDepartmentStatusPrints
-
-
- -
-
-
diff --git a/brewman/static/src/app/attendance/attendance.service.js b/brewman/static/src/app/attendance/attendance.service.js deleted file mode 100644 index 50a13b0f..00000000 --- a/brewman/static/src/app/attendance/attendance.service.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function Attendance($resource) { - return $resource('/api/Attendance/:date', { date: '@Date' }); -} -exports.Attendance = Attendance; -//# sourceMappingURL=attendance.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/attendance/attendance.service.js.map b/brewman/static/src/app/attendance/attendance.service.js.map deleted file mode 100644 index 73330c5c..00000000 --- a/brewman/static/src/app/attendance/attendance.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"attendance.service.js","sourceRoot":"","sources":["attendance.service.ts"],"names":[],"mappings":";;AAAA,oBAA2B,SAAS;IAChC,OAAO,SAAS,CAAC,uBAAuB,EAAE,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC,CAAC;AAC/D,CAAC;AAFD,gCAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/attendance/attendance.service.ts b/brewman/static/src/app/attendance/attendance.service.ts deleted file mode 100644 index 670158aa..00000000 --- a/brewman/static/src/app/attendance/attendance.service.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function Attendance($resource) { - return $resource('/api/Attendance/:date', {date: '@Date'}); -} \ No newline at end of file diff --git a/brewman/static/src/app/balance-sheet/balance-sheet.component.js b/brewman/static/src/app/balance-sheet/balance-sheet.component.js deleted file mode 100644 index d247c671..00000000 --- a/brewman/static/src/app/balance-sheet/balance-sheet.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var balance_sheet_controller_1 = require("./balance-sheet.controller"); -exports.BalanceSheetComponent = { - templateUrl: '/app/balance-sheet/balance-sheet.html', - controller: balance_sheet_controller_1.BalanceSheetController, - controllerAs: 'vm' -}; -//# sourceMappingURL=balance-sheet.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/balance-sheet/balance-sheet.component.js.map b/brewman/static/src/app/balance-sheet/balance-sheet.component.js.map deleted file mode 100644 index ec95ecc5..00000000 --- a/brewman/static/src/app/balance-sheet/balance-sheet.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"balance-sheet.component.js","sourceRoot":"","sources":["balance-sheet.component.ts"],"names":[],"mappings":";;AAAA,uEAAkE;AAErD,QAAA,qBAAqB,GAAG;IACjC,WAAW,EAAE,uCAAuC;IACpD,UAAU,EAAE,iDAAsB;IAClC,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/balance-sheet/balance-sheet.component.ts b/brewman/static/src/app/balance-sheet/balance-sheet.component.ts deleted file mode 100644 index a1e05d13..00000000 --- a/brewman/static/src/app/balance-sheet/balance-sheet.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {BalanceSheetController} from './balance-sheet.controller'; - -export const BalanceSheetComponent = { - templateUrl: '/app/balance-sheet/balance-sheet.html', - controller: BalanceSheetController, - controllerAs: 'vm' -}; \ No newline at end of file diff --git a/brewman/static/src/app/balance-sheet/balance-sheet.controller.js b/brewman/static/src/app/balance-sheet/balance-sheet.controller.js deleted file mode 100644 index e7e5d8ce..00000000 --- a/brewman/static/src/app/balance-sheet/balance-sheet.controller.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var BalanceSheetController = /** @class */ (function () { - function BalanceSheetController($scope, $location, asDate, dateParser) { - this.$scope = $scope; - this.$location = $location; - this.asDate = asDate; - this.dateParser = dateParser; - this.info = $scope.$parent.res.info; - this._info_Date = dateParser.parse(this.info.Date, "dd-MMM-yyyy"); - this.foDate = true; - } - BalanceSheetController.prototype.info_Date = function (value) { - if (arguments.length) { - this.info.Date = this.asDate(value); - this._info_Date = value; - } - return this._info_Date; - }; - BalanceSheetController.prototype.show = function () { - this.$location.path('/BalanceSheet/' + this.info.Date); - }; - BalanceSheetController.$inject = ['$scope', '$location', 'asDateFilter', 'uibDateParser']; - return BalanceSheetController; -}()); -exports.BalanceSheetController = BalanceSheetController; -//# sourceMappingURL=balance-sheet.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/balance-sheet/balance-sheet.controller.js.map b/brewman/static/src/app/balance-sheet/balance-sheet.controller.js.map deleted file mode 100644 index 95ad5c0c..00000000 --- a/brewman/static/src/app/balance-sheet/balance-sheet.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"balance-sheet.controller.js","sourceRoot":"","sources":["balance-sheet.controller.ts"],"names":[],"mappings":";;AAAA;IAMI,gCAAmB,MAAM,EAAS,SAAS,EAAS,MAAM,EAAS,UAAU;QAA1D,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QACzE,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QAClE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;IAED,0CAAS,GAAT,UAAU,KAAK;QACX,IAAI,SAAS,CAAC,MAAM,EAAE;YAClB,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACpC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;SAC3B;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,qCAAI,GAAJ;QACI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3D,CAAC;IArBM,8BAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC;IAsB9E,6BAAC;CAAA,AAvBD,IAuBC;AAvBY,wDAAsB"} \ No newline at end of file diff --git a/brewman/static/src/app/balance-sheet/balance-sheet.controller.ts b/brewman/static/src/app/balance-sheet/balance-sheet.controller.ts deleted file mode 100644 index dfe2c6ad..00000000 --- a/brewman/static/src/app/balance-sheet/balance-sheet.controller.ts +++ /dev/null @@ -1,24 +0,0 @@ -export class BalanceSheetController { - static $inject = ['$scope', '$location', 'asDateFilter', 'uibDateParser']; - _info_Date: any; - foDate: boolean; - info: any; - - constructor(public $scope, public $location, public asDate, public dateParser) { - this.info = $scope.$parent.res.info; - this._info_Date = dateParser.parse(this.info.Date, "dd-MMM-yyyy"); - this.foDate = true; - } - - info_Date(value) { - if (arguments.length) { - this.info.Date = this.asDate(value); - this._info_Date = value; - } - return this._info_Date; - } - - show() { - this.$location.path('/BalanceSheet/' + this.info.Date); - } -} diff --git a/brewman/static/src/app/balance-sheet/balance-sheet.html b/brewman/static/src/app/balance-sheet/balance-sheet.html deleted file mode 100644 index a42bbc8d..00000000 --- a/brewman/static/src/app/balance-sheet/balance-sheet.html +++ /dev/null @@ -1,48 +0,0 @@ -
-

Balance Sheet

- -
- - -
-
- - - - -
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupNameAmountTotal
{{item.Group}}{{item.Name}}{{item.SubAmount | currency | clr}}{{item.Amount | currency | clr}}
{{item.Group}}{{item.Name}}{{item.SubAmount | currency | clr}}{{item.Amount | currency | clr}}
-
diff --git a/brewman/static/src/app/balance-sheet/balance-sheet.resolver.js b/brewman/static/src/app/balance-sheet/balance-sheet.resolver.js deleted file mode 100644 index 8dd6a3eb..00000000 --- a/brewman/static/src/app/balance-sheet/balance-sheet.resolver.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function BalanceSheetResolver($route, BalanceSheet) { - var date = $route.current.params.date; - if (angular.isUndefined(date)) { - return BalanceSheet.get({}).$promise; - } - else { - return BalanceSheet.get({ date: date }).$promise; - } -} -exports.BalanceSheetResolver = BalanceSheetResolver; -//# sourceMappingURL=balance-sheet.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/balance-sheet/balance-sheet.resolver.js.map b/brewman/static/src/app/balance-sheet/balance-sheet.resolver.js.map deleted file mode 100644 index efb5b7aa..00000000 --- a/brewman/static/src/app/balance-sheet/balance-sheet.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"balance-sheet.resolver.js","sourceRoot":"","sources":["balance-sheet.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,8BAAqC,MAAM,EAAE,YAAY;IACrD,IAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;IAExC,IAAI,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;QAC3B,OAAO,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;KACxC;SAAM;QACH,OAAO,YAAY,CAAC,GAAG,CAAC,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC,QAAQ,CAAC;KAClD;AACL,CAAC;AARD,oDAQC"} \ No newline at end of file diff --git a/brewman/static/src/app/balance-sheet/balance-sheet.resolver.ts b/brewman/static/src/app/balance-sheet/balance-sheet.resolver.ts deleted file mode 100644 index 30828245..00000000 --- a/brewman/static/src/app/balance-sheet/balance-sheet.resolver.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as angular from 'angular'; - -export function BalanceSheetResolver($route, BalanceSheet) { - const date = $route.current.params.date; - - if (angular.isUndefined(date)) { - return BalanceSheet.get({}).$promise; - } else { - return BalanceSheet.get({date: date}).$promise; - } -} diff --git a/brewman/static/src/app/balance-sheet/balance-sheet.service.js b/brewman/static/src/app/balance-sheet/balance-sheet.service.js deleted file mode 100644 index 9d2a71e8..00000000 --- a/brewman/static/src/app/balance-sheet/balance-sheet.service.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function BalanceSheet($resource) { - return $resource('/api/BalanceSheet/:date'); -} -exports.BalanceSheet = BalanceSheet; -//# sourceMappingURL=balance-sheet.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/balance-sheet/balance-sheet.service.js.map b/brewman/static/src/app/balance-sheet/balance-sheet.service.js.map deleted file mode 100644 index 3e11a964..00000000 --- a/brewman/static/src/app/balance-sheet/balance-sheet.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"balance-sheet.service.js","sourceRoot":"","sources":["balance-sheet.service.ts"],"names":[],"mappings":";;AAAA,sBAA6B,SAAS;IAClC,OAAO,SAAS,CAAC,yBAAyB,CAAC,CAAC;AAChD,CAAC;AAFD,oCAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/balance-sheet/balance-sheet.service.ts b/brewman/static/src/app/balance-sheet/balance-sheet.service.ts deleted file mode 100644 index 4ca2b41f..00000000 --- a/brewman/static/src/app/balance-sheet/balance-sheet.service.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function BalanceSheet($resource) { - return $resource('/api/BalanceSheet/:date'); -} diff --git a/brewman/static/src/app/base.controller.js b/brewman/static/src/app/base.controller.js deleted file mode 100644 index 624eb0e5..00000000 --- a/brewman/static/src/app/base.controller.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var BaseController = /** @class */ (function () { - function BaseController($rootScope, Auth, $location, $routeParams, Messages, Credentials) { - var _this = this; - this.$rootScope = $rootScope; - this.Auth = Auth; - this.$location = $location; - this.$routeParams = $routeParams; - this.Messages = Messages; - this.Credentials = Credentials; - $rootScope.$on('loginRequired', function () { - if (_this.Credentials.Auth.isAuthenticated) { - _this.$location.path('/'); - } - else { - var came_from = _this.$routeParams.came_from; - if (angular.isUndefined(came_from) && $location.path() !== '/login') { - came_from = $location.url(); - } - _this.$location.path('/login').search({ came_from: came_from }); - } - }); - $rootScope.$on("$routeChangeStart", function (event, next, current) { - _this.Auth.get(function (u, putResponseHeaders) { - _this.Credentials.Auth = u; - _this.Credentials.Perms = u.perms; - }); - }); - } - BaseController.prototype.clearToast = function (item) { - var idx = this.Messages.indexOf(item); - if (idx !== -1) { - this.Messages.splice(idx, 1); - } - }; - BaseController.$inject = ['$rootScope', 'Auth', '$location', '$routeParams', 'Messages', 'Credentials']; - return BaseController; -}()); -exports.BaseController = BaseController; -//# sourceMappingURL=base.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/base.controller.js.map b/brewman/static/src/app/base.controller.js.map deleted file mode 100644 index ad5bf2fb..00000000 --- a/brewman/static/src/app/base.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base.controller.js","sourceRoot":"","sources":["base.controller.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC;IAGI,wBAAmB,UAAU,EAAS,IAAI,EAAS,SAAS,EAAS,YAAY,EAAS,QAAQ,EAAS,WAAW;QAAtH,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CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;SAChC;IACL,CAAC;IA3BM,sBAAO,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;IA4BpG,qBAAC;CAAA,AA7BD,IA6BC;AA7BY,wCAAc"} \ No newline at end of file diff --git a/brewman/static/src/app/base.controller.ts b/brewman/static/src/app/base.controller.ts deleted file mode 100644 index a435e38e..00000000 --- a/brewman/static/src/app/base.controller.ts +++ /dev/null @@ -1,32 +0,0 @@ -import * as angular from 'angular'; - -export class BaseController { - static $inject = ['$rootScope', 'Auth', '$location', '$routeParams', 'Messages', 'Credentials']; - - constructor(public $rootScope, public Auth, public $location, public $routeParams, public Messages, public Credentials) { - $rootScope.$on('loginRequired', () => { - if (this.Credentials.Auth.isAuthenticated) { - this.$location.path('/'); - } else { - var came_from = this.$routeParams.came_from; - if (angular.isUndefined(came_from) && $location.path() !== '/login') { - came_from = $location.url(); - } - this.$location.path('/login').search({came_from: came_from}); - } - }); - $rootScope.$on("$routeChangeStart", (event, next, current) => { - this.Auth.get((u, putResponseHeaders) => { - this.Credentials.Auth = u; - this.Credentials.Perms = u.perms; - }); - }); - } - - clearToast(item) { - var idx = this.Messages.indexOf(item); - if (idx !== -1) { - this.Messages.splice(idx, 1); - } - } -} diff --git a/brewman/static/src/app/cash-flow/cash-flow.component.js b/brewman/static/src/app/cash-flow/cash-flow.component.js deleted file mode 100644 index 29c24eb3..00000000 --- a/brewman/static/src/app/cash-flow/cash-flow.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var cash_flow_controller_1 = require("./cash-flow.controller"); -exports.CashFlowComponent = { - templateUrl: '/app/cash-flow/cash-flow.html', - controller: cash_flow_controller_1.CashFlowController, - controllerAs: 'vm', -}; -//# sourceMappingURL=cash-flow.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/cash-flow/cash-flow.component.js.map b/brewman/static/src/app/cash-flow/cash-flow.component.js.map deleted file mode 100644 index f5bce0d7..00000000 --- a/brewman/static/src/app/cash-flow/cash-flow.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cash-flow.component.js","sourceRoot":"","sources":["cash-flow.component.ts"],"names":[],"mappings":";;AAAA,+DAA0D;AAE7C,QAAA,iBAAiB,GAAG;IAC7B,WAAW,EAAE,+BAA+B;IAC5C,UAAU,EAAE,yCAAkB;IAC9B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/cash-flow/cash-flow.component.ts b/brewman/static/src/app/cash-flow/cash-flow.component.ts deleted file mode 100644 index f5d8fac6..00000000 --- a/brewman/static/src/app/cash-flow/cash-flow.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {CashFlowController} from './cash-flow.controller'; - -export const CashFlowComponent = { - templateUrl: '/app/cash-flow/cash-flow.html', - controller: CashFlowController, - controllerAs: 'vm', -}; \ No newline at end of file diff --git a/brewman/static/src/app/cash-flow/cash-flow.controller.js b/brewman/static/src/app/cash-flow/cash-flow.controller.js deleted file mode 100644 index 4ed89d1f..00000000 --- a/brewman/static/src/app/cash-flow/cash-flow.controller.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var CashFlowController = /** @class */ (function () { - function CashFlowController($scope, $routeParams, $location, asDate, dateParser) { - this.$scope = $scope; - this.$routeParams = $routeParams; - this.$location = $location; - this.asDate = asDate; - this.dateParser = dateParser; - this.cashFlow = $scope.$parent.res.cashFlow; - this._info_StartDate = dateParser.parse(this.cashFlow.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.cashFlow.FinishDate, "dd-MMM-yyyy"); - this.info = this.cashFlow; - this.foDate = true; - } - CashFlowController.prototype.info_StartDate = function (value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - }; - CashFlowController.prototype.info_FinishDate = function (value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - }; - CashFlowController.prototype.show = function () { - this.$location.path('/CashFlow').search({ StartDate: this.info.StartDate, FinishDate: this.info.FinishDate }); - }; - CashFlowController.prototype.total = function (type) { - return this.info.Body[type].reduce(function (accumulator, current) { - return accumulator + current.Amount; - }, 0); - }; - CashFlowController.$inject = ['$scope', '$routeParams', '$location', 'asDateFilter', 'uibDateParser']; - return CashFlowController; -}()); -exports.CashFlowController = CashFlowController; -//# sourceMappingURL=cash-flow.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/cash-flow/cash-flow.controller.js.map b/brewman/static/src/app/cash-flow/cash-flow.controller.js.map deleted file mode 100644 index fbf077b8..00000000 --- a/brewman/static/src/app/cash-flow/cash-flow.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cash-flow.controller.js","sourceRoot":"","sources":["cash-flow.controller.ts"],"names":[],"mappings":";;AAAA;IAQI,4BAAmB,MAAM,EAAS,YAAY,EAAS,SAAS,EAAS,MAAM,EAAS,UAAU;QAA/E,WAAM,GAAN,MAAM,CAAA;QAAS,iBAAY,GAAZ,YAAY,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QAC9F,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;QAC5C,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QAChF,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;QAClF,IAAI,CAAC,IAAI,GAAG,IAAI,CA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/cash-flow.controller.ts deleted file mode 100644 index cc134aec..00000000 --- a/brewman/static/src/app/cash-flow/cash-flow.controller.ts +++ /dev/null @@ -1,42 +0,0 @@ -export class CashFlowController { - static $inject = ['$scope', '$routeParams', '$location', 'asDateFilter', 'uibDateParser']; - _info_StartDate: any; - _info_FinishDate: any; - cashFlow: any; - info: any; - foDate: boolean; - - constructor(public $scope, public $routeParams, public $location, public asDate, public dateParser) { - this.cashFlow = $scope.$parent.res.cashFlow; - this._info_StartDate = dateParser.parse(this.cashFlow.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.cashFlow.FinishDate, "dd-MMM-yyyy"); - this.info = this.cashFlow; - this.foDate = true; - } - - info_StartDate(value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - } - - info_FinishDate(value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - } - - show() { - this.$location.path('/CashFlow').search({StartDate: this.info.StartDate, FinishDate: this.info.FinishDate}); - } - - total(type) { - return this.info.Body[type].reduce(function (accumulator, current) { - return accumulator + current.Amount; - }, 0); - } -} diff --git a/brewman/static/src/app/cash-flow/cash-flow.html b/brewman/static/src/app/cash-flow/cash-flow.html deleted file mode 100644 index d15e5e7f..00000000 --- a/brewman/static/src/app/cash-flow/cash-flow.html +++ /dev/null @@ -1,87 +0,0 @@ -
-

Cash Flow

- -
- - -
-
- - - - -
-
-
-
- - - - -
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameSubtotalTotal
{{item.Name}}{{item.Amount | currency | clr}}
Cash flows from Operating activities{{vm.total('Operating') | currency | clr}}
{{item.Name}}{{item.Amount | currency | clr}}
Cash flows from Investing activities{{vm.total('Investing') | currency | clr}}
{{item.Name}}{{item.Amount | currency | clr}}
Cash flows from Financing activities{{vm.total('Financing') | currency | clr}}
{{item.Name}}{{item.Amount | currency | clr}}
{{item.Name}}{{item.Amount | currency | clr}}
-
diff --git a/brewman/static/src/app/cash-flow/cash-flow.resolver.js b/brewman/static/src/app/cash-flow/cash-flow.resolver.js deleted file mode 100644 index 07802889..00000000 --- a/brewman/static/src/app/cash-flow/cash-flow.resolver.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function CashFlowResolver($route, CashFlow) { - var id = $route.current.params.id, startDate = $route.current.params.StartDate, finishDate = $route.current.params.FinishDate; - if (angular.isUndefined(startDate) || angular.isUndefined(finishDate)) { - return CashFlow.get({}).$promise; - } - else if (angular.isUndefined(id)) { - return CashFlow.get({ StartDate: startDate, FinishDate: finishDate }).$promise; - } - else { - return CashFlow.get({ id: id, StartDate: startDate, FinishDate: finishDate }).$promise; - } -} -exports.CashFlowResolver = CashFlowResolver; -//# sourceMappingURL=cash-flow.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/cash-flow/cash-flow.resolver.js.map b/brewman/static/src/app/cash-flow/cash-flow.resolver.js.map deleted file mode 100644 index 41ad924d..00000000 --- a/brewman/static/src/app/cash-flow/cash-flow.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cash-flow.resolver.js","sourceRoot":"","sources":["cash-flow.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,0BAAiC,MAAM,EAAE,QAAQ;IAC7C,IAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAC/B,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAC3C,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;IAElD,IAAI,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE;QACnE,OAAO,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;KACpC;SAAM,IAAI,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;QAChC,OAAO,QAAQ,CAAC,GAAG,CAAC,EAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAC,CAAC,CAAC,QAAQ,CAAC;KAChF;SAAM;QACH,OAAO,QAAQ,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAC,CAAC,CAAC,QAAQ,CAAC;KACxF;AACL,CAAC;AAZD,4CAYC"} \ No newline at end of file diff --git a/brewman/static/src/app/cash-flow/cash-flow.resolver.ts b/brewman/static/src/app/cash-flow/cash-flow.resolver.ts deleted file mode 100644 index 90affb4d..00000000 --- a/brewman/static/src/app/cash-flow/cash-flow.resolver.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as angular from 'angular'; - -export function CashFlowResolver($route, CashFlow) { - const id = $route.current.params.id, - startDate = $route.current.params.StartDate, - finishDate = $route.current.params.FinishDate; - - if (angular.isUndefined(startDate) || angular.isUndefined(finishDate)) { - return CashFlow.get({}).$promise; - } else if (angular.isUndefined(id)) { - return CashFlow.get({StartDate: startDate, FinishDate: finishDate}).$promise; - } else { - return CashFlow.get({id: id, StartDate: startDate, FinishDate: finishDate}).$promise; - } -} diff --git a/brewman/static/src/app/cash-flow/cash-flow.service.js b/brewman/static/src/app/cash-flow/cash-flow.service.js deleted file mode 100644 index 2e7f0af2..00000000 --- a/brewman/static/src/app/cash-flow/cash-flow.service.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function CashFlow($resource) { - return $resource('/api/CashFlow/:id'); -} -exports.CashFlow = CashFlow; -//# sourceMappingURL=cash-flow.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/cash-flow/cash-flow.service.js.map b/brewman/static/src/app/cash-flow/cash-flow.service.js.map deleted file mode 100644 index efe396e1..00000000 --- a/brewman/static/src/app/cash-flow/cash-flow.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cash-flow.service.js","sourceRoot":"","sources":["cash-flow.service.ts"],"names":[],"mappings":";;AAAA,kBAAyB,SAAS;IAC9B,OAAO,SAAS,CAAC,mBAAmB,CAAC,CAAC;AAC1C,CAAC;AAFD,4BAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/cash-flow/cash-flow.service.ts b/brewman/static/src/app/cash-flow/cash-flow.service.ts deleted file mode 100644 index 5739a971..00000000 --- a/brewman/static/src/app/cash-flow/cash-flow.service.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function CashFlow($resource) { - return $resource('/api/CashFlow/:id'); -} diff --git a/brewman/static/src/app/client/client-detail.html b/brewman/static/src/app/client/client-detail.html deleted file mode 100644 index 5f1d9c77..00000000 --- a/brewman/static/src/app/client/client-detail.html +++ /dev/null @@ -1,42 +0,0 @@ -
-

Client Detail

- -
- - -
- -
-
-
- - -
- -
-
-
-
-
- -
-
-
- -
- - -
- -
-
- -
-
- - -
-
-
\ No newline at end of file diff --git a/brewman/static/src/app/client/client-list.component.js b/brewman/static/src/app/client/client-list.component.js deleted file mode 100644 index 8c7197f2..00000000 --- a/brewman/static/src/app/client/client-list.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var client_list_controller_1 = require("./client-list.controller"); -exports.ClientListComponent = { - templateUrl: '/app/client/client-list.html', - controller: client_list_controller_1.ClientListController, - controllerAs: 'vm' -}; -//# sourceMappingURL=client-list.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/client/client-list.component.js.map b/brewman/static/src/app/client/client-list.component.js.map deleted file mode 100644 index c4ec4bf1..00000000 --- a/brewman/static/src/app/client/client-list.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"client-list.component.js","sourceRoot":"","sources":["client-list.component.ts"],"names":[],"mappings":";;AAAA,mEAA8D;AAEjD,QAAA,mBAAmB,GAAG;IAC/B,WAAW,EAAE,8BAA8B;IAC3C,UAAU,EAAE,6CAAoB;IAChC,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/client/client-list.component.ts b/brewman/static/src/app/client/client-list.component.ts deleted file mode 100644 index db6525a8..00000000 --- a/brewman/static/src/app/client/client-list.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {ClientListController} from './client-list.controller'; - -export const ClientListComponent = { - templateUrl: '/app/client/client-list.html', - controller: ClientListController, - controllerAs: 'vm' -}; \ No newline at end of file diff --git a/brewman/static/src/app/client/client-list.controller.js b/brewman/static/src/app/client/client-list.controller.js deleted file mode 100644 index fac74385..00000000 --- a/brewman/static/src/app/client/client-list.controller.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var ClientListController = /** @class */ (function () { - function ClientListController($scope) { - this.$scope = $scope; - this.clients = $scope.$parent.res.clients; - this.info = this.clients; - } - ClientListController.$inject = ['$scope']; - return ClientListController; -}()); -exports.ClientListController = ClientListController; -//# sourceMappingURL=client-list.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/client/client-list.controller.js.map b/brewman/static/src/app/client/client-list.controller.js.map deleted file mode 100644 index c2cde1f1..00000000 --- a/brewman/static/src/app/client/client-list.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"client-list.controller.js","sourceRoot":"","sources":["client-list.controller.ts"],"names":[],"mappings":";;AAAA;IAKI,8BAAmB,MAAM;QAAN,WAAM,GAAN,MAAM,CAAA;QACrB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC;IAC7B,CAAC;IAPM,4BAAO,GAAG,CAAC,QAAQ,CAAC,CAAC;IAQhC,2BAAC;CAAA,AATD,IASC;AATY,oDAAoB"} \ No newline at end of file diff --git a/brewman/static/src/app/client/client-list.controller.ts b/brewman/static/src/app/client/client-list.controller.ts deleted file mode 100644 index a656b337..00000000 --- a/brewman/static/src/app/client/client-list.controller.ts +++ /dev/null @@ -1,10 +0,0 @@ -export class ClientListController { - static $inject = ['$scope']; - info: any; - clients: any; - - constructor(public $scope) { - this.clients = $scope.$parent.res.clients; - this.info = this.clients; - } -} diff --git a/brewman/static/src/app/client/client-list.html b/brewman/static/src/app/client/client-list.html deleted file mode 100644 index c77d1343..00000000 --- a/brewman/static/src/app/client/client-list.html +++ /dev/null @@ -1,24 +0,0 @@ -

Clients

- - - - - - - - - - - - - - - - - - - - - -
CodeNameEnabledOTPCreatedLast Login
{{item.Code}}{{item.Name}}{{item.Enabled}}{{item.OTP}}{{item.CreationDate | localTime}}{{item.LastLogin | localTime}}
- diff --git a/brewman/static/src/app/client/client-list.resolver.js b/brewman/static/src/app/client/client-list.resolver.js deleted file mode 100644 index cef10787..00000000 --- a/brewman/static/src/app/client/client-list.resolver.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function ClientListResolver(Client) { - return Client.query({}).$promise; -} -exports.ClientListResolver = ClientListResolver; -//# sourceMappingURL=client-list.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/client/client-list.resolver.js.map b/brewman/static/src/app/client/client-list.resolver.js.map deleted file mode 100644 index 6bb8ff2f..00000000 --- a/brewman/static/src/app/client/client-list.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"client-list.resolver.js","sourceRoot":"","sources":["client-list.resolver.ts"],"names":[],"mappings":";;AAAA,4BAAmC,MAAM;IACrC,OAAO,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;AACrC,CAAC;AAFD,gDAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/client/client-list.resolver.ts b/brewman/static/src/app/client/client-list.resolver.ts deleted file mode 100644 index 48bb77dd..00000000 --- a/brewman/static/src/app/client/client-list.resolver.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function ClientListResolver(Client) { - return Client.query({}).$promise; -} diff --git a/brewman/static/src/app/client/client.component.js b/brewman/static/src/app/client/client.component.js deleted file mode 100644 index 57f2e72c..00000000 --- a/brewman/static/src/app/client/client.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var client_controller_1 = require("./client.controller"); -exports.ClientComponent = { - templateUrl: '/app/client/client-detail.html', - controller: client_controller_1.ClientController, - controllerAs: 'vm' -}; -//# sourceMappingURL=client.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/client/client.component.js.map b/brewman/static/src/app/client/client.component.js.map deleted file mode 100644 index 45ffc810..00000000 --- a/brewman/static/src/app/client/client.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"client.component.js","sourceRoot":"","sources":["client.component.ts"],"names":[],"mappings":";;AAAA,yDAAqD;AAExC,QAAA,eAAe,GAAG;IAC3B,WAAW,EAAE,gCAAgC;IAC7C,UAAU,EAAE,oCAAgB;IAC5B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/client/client.component.ts b/brewman/static/src/app/client/client.component.ts deleted file mode 100644 index 8d6bc1b7..00000000 --- a/brewman/static/src/app/client/client.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {ClientController} from './client.controller'; - -export const ClientComponent = { - templateUrl: '/app/client/client-detail.html', - controller: ClientController, - controllerAs: 'vm' -}; \ No newline at end of file diff --git a/brewman/static/src/app/client/client.controller.js b/brewman/static/src/app/client/client.controller.js deleted file mode 100644 index dafc3b7a..00000000 --- a/brewman/static/src/app/client/client.controller.js +++ /dev/null @@ -1,60 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var ClientController = /** @class */ (function () { - function ClientController($scope, $location, $modal, Messages) { - this.$scope = $scope; - this.$location = $location; - this.$modal = $modal; - this.Messages = Messages; - this.client = $scope.$parent.res.client; - this.foName = true; - } - ClientController.prototype.save = function () { - var _this = this; - this.client.$save(function () { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/Clients'); - }, function (data) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - ClientController.prototype.delete = function () { - var _this = this; - this.client.$delete(function () { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/Clients'); - }, function (data) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - ClientController.prototype.confirm = function () { - var _this = this; - var modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', /** @class */ (function () { - function class_1($modalInstance) { - this.$modalInstance = $modalInstance; - this.title = "Delete Client"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - class_1.prototype.ok = function () { - this.$modalInstance.close(); - }; - class_1.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - return class_1; - }())] - }); - modalInstance.result.then(function () { - _this.delete(); - }); - }; - ClientController.$inject = ['$scope', '$location', '$uibModal', 'Messages']; - return ClientController; -}()); -exports.ClientController = ClientController; -//# sourceMappingURL=client.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/client/client.controller.js.map b/brewman/static/src/app/client/client.controller.js.map deleted file mode 100644 index b8df0852..00000000 --- a/brewman/static/src/app/client/client.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"client.controller.js","sourceRoot":"","sources":["client.controller.ts"],"names":[],"mappings":";;AAAA;IAKI,0BAAmB,MAAM,EAAS,SAAS,EAAS,MAAM,EAAS,QAAQ;QAAxD,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,aAAQ,GAAR,QAAQ,CAAA;QACvE,IAAI,CAAC,MAAM,GAAG,MAAM,CA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,KAAK,GAAG,eAAe,CAAC;wBAC7B,IAAI,CAAC,IAAI,GAAG,sCAAsC,CAAC;wBACnD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;oBACzB,CAAC;oBAED,oBAAE,GAAF;wBACI,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;oBAChC,CAAC;oBAED,wBAAM,GAAN;wBACI,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;oBAC1C,CAAC;oBACL,cAAC;gBAAD,CAAC,AAlBiC,IAkBhC;SACL,CAAC,CAAC;QACH,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC;YACtB,KAAI,CAAC,MAAM,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACP,CAAC;IAvDM,wBAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;IAwDtE,uBAAC;CAAA,AAzDD,IAyDC;AAzDY,4CAAgB"} \ No newline at end of file diff --git a/brewman/static/src/app/client/client.controller.ts b/brewman/static/src/app/client/client.controller.ts deleted file mode 100644 index 6c5f4dca..00000000 --- a/brewman/static/src/app/client/client.controller.ts +++ /dev/null @@ -1,58 +0,0 @@ -export class ClientController { - static $inject = ['$scope', '$location', '$uibModal', 'Messages']; - foName: boolean; - client: any; - - constructor(public $scope, public $location, public $modal, public Messages) { - this.client = $scope.$parent.res.client; - this.foName = true; - } - - save() { - this.client.$save(() => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/Clients'); - }, (data) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - delete() { - this.client.$delete(() => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/Clients'); - }, (data) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - confirm() { - const modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', class { - title: any; - body: any; - isDelete: boolean; - - constructor(public $modalInstance) { - this.title = "Delete Client"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - - ok() { - this.$modalInstance.close(); - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - }] - }); - modalInstance.result.then(() => { - this.delete(); - }); - } -} diff --git a/brewman/static/src/app/client/client.resolver.js b/brewman/static/src/app/client/client.resolver.js deleted file mode 100644 index dd3f25ad..00000000 --- a/brewman/static/src/app/client/client.resolver.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function ClientResolver($route, Client) { - var id = $route.current.params.id; - return Client.get({ id: id }).$promise; -} -exports.ClientResolver = ClientResolver; -//# sourceMappingURL=client.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/client/client.resolver.js.map b/brewman/static/src/app/client/client.resolver.js.map deleted file mode 100644 index a2895e49..00000000 --- a/brewman/static/src/app/client/client.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"client.resolver.js","sourceRoot":"","sources":["client.resolver.ts"],"names":[],"mappings":";;AAAA,wBAA+B,MAAM,EAAE,MAAM;IACzC,IAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IACpC,OAAO,MAAM,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;AACzC,CAAC;AAHD,wCAGC"} \ No newline at end of file diff --git a/brewman/static/src/app/client/client.resolver.ts b/brewman/static/src/app/client/client.resolver.ts deleted file mode 100644 index b546ad2d..00000000 --- a/brewman/static/src/app/client/client.resolver.ts +++ /dev/null @@ -1,4 +0,0 @@ -export function ClientResolver($route, Client) { - const id = $route.current.params.id; - return Client.get({id: id}).$promise; -} diff --git a/brewman/static/src/app/client/client.service.js b/brewman/static/src/app/client/client.service.js deleted file mode 100644 index 4bed3831..00000000 --- a/brewman/static/src/app/client/client.service.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function Client($resource) { - return $resource('/api/Client/:id', { id: '@ClientID' }, { - query: { method: 'GET', params: { list: true }, isArray: true } - }); -} -exports.Client = Client; -//# sourceMappingURL=client.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/client/client.service.js.map b/brewman/static/src/app/client/client.service.js.map deleted file mode 100644 index 5a1030e7..00000000 --- a/brewman/static/src/app/client/client.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"client.service.js","sourceRoot":"","sources":["client.service.ts"],"names":[],"mappings":";;AAAA,gBAAuB,SAAS;IAC5B,OAAO,SAAS,CAAC,iBAAiB,EAC9B,EAAC,EAAE,EAAE,WAAW,EAAC,EAAE;QACf,KAAK,EAAE,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,EAAE,OAAO,EAAE,IAAI,EAAC;KAC9D,CAAC,CAAC;AACX,CAAC;AALD,wBAKC"} \ No newline at end of file diff --git a/brewman/static/src/app/client/client.service.ts b/brewman/static/src/app/client/client.service.ts deleted file mode 100644 index 5aa95ecd..00000000 --- a/brewman/static/src/app/client/client.service.ts +++ /dev/null @@ -1,6 +0,0 @@ -export function Client($resource) { - return $resource('/api/Client/:id', - {id: '@ClientID'}, { - query: {method: 'GET', params: {list: true}, isArray: true} - }); -} diff --git a/brewman/static/src/app/closing-stock/closing-stock.component.js b/brewman/static/src/app/closing-stock/closing-stock.component.js deleted file mode 100644 index 4c6833f4..00000000 --- a/brewman/static/src/app/closing-stock/closing-stock.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var closing_stock_controller_1 = require("./closing-stock.controller"); -exports.ClosingStockComponent = { - templateUrl: '/app/closing-stock/closing-stock.html', - controller: closing_stock_controller_1.ClosingStockController, - controllerAs: 'vm', -}; -//# sourceMappingURL=closing-stock.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/closing-stock/closing-stock.component.js.map b/brewman/static/src/app/closing-stock/closing-stock.component.js.map deleted file mode 100644 index f343285f..00000000 --- a/brewman/static/src/app/closing-stock/closing-stock.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"closing-stock.component.js","sourceRoot":"","sources":["closing-stock.component.ts"],"names":[],"mappings":";;AAAA,uEAAkE;AAErD,QAAA,qBAAqB,GAAG;IACjC,WAAW,EAAE,uCAAuC;IACpD,UAAU,EAAE,iDAAsB;IAClC,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/closing-stock/closing-stock.component.ts b/brewman/static/src/app/closing-stock/closing-stock.component.ts deleted file mode 100644 index a7e2809b..00000000 --- a/brewman/static/src/app/closing-stock/closing-stock.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {ClosingStockController} from './closing-stock.controller'; - -export const ClosingStockComponent = { - templateUrl: '/app/closing-stock/closing-stock.html', - controller: ClosingStockController, - controllerAs: 'vm', -}; \ No newline at end of file diff --git a/brewman/static/src/app/closing-stock/closing-stock.controller.js b/brewman/static/src/app/closing-stock/closing-stock.controller.js deleted file mode 100644 index 20d72f7b..00000000 --- a/brewman/static/src/app/closing-stock/closing-stock.controller.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var ClosingStockController = /** @class */ (function () { - function ClosingStockController($scope, $location, asDate, dateParser) { - this.$scope = $scope; - this.$location = $location; - this.asDate = asDate; - this.dateParser = dateParser; - this.info = $scope.$parent.res.info; - this._info_Date = dateParser.parse(this.info.Date, "dd-MMM-yyyy"); - this.foDate = true; - } - ClosingStockController.prototype.info_Date = function (value) { - if (arguments.length) { - this.info.Date = this.asDate(value); - this._info_Date = value; - } - return this._info_Date; - }; - ClosingStockController.prototype.show = function () { - this.$location.path('/ClosingStock/' + this.info.Date); - }; - ClosingStockController.$inject = ['$scope', '$location', 'asDateFilter', 'uibDateParser']; - return ClosingStockController; -}()); -exports.ClosingStockController = ClosingStockController; -//# sourceMappingURL=closing-stock.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/closing-stock/closing-stock.controller.js.map b/brewman/static/src/app/closing-stock/closing-stock.controller.js.map deleted file mode 100644 index 701b1042..00000000 --- a/brewman/static/src/app/closing-stock/closing-stock.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"closing-stock.controller.js","sourceRoot":"","sources":["closing-stock.controller.ts"],"names":[],"mappings":";;AAAA;IAMI,gCAAmB,MAAM,EAAS,SAAS,EAAS,MAAM,EAAS,UAAU;QAA1D,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QACzE,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QAClE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;IAED,0CAAS,GAAT,UAAU,KAAK;QACX,IAAI,SAAS,CAAC,MAAM,EAAE;YAClB,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACpC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;SAC3B;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,qCAAI,GAAJ;QACI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3D,CAAC;IArBM,8BAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC;IAsB9E,6BAAC;CAAA,AAvBD,IAuBC;AAvBY,wDAAsB"} \ No newline at end of file diff --git a/brewman/static/src/app/closing-stock/closing-stock.controller.ts b/brewman/static/src/app/closing-stock/closing-stock.controller.ts deleted file mode 100644 index 93875294..00000000 --- a/brewman/static/src/app/closing-stock/closing-stock.controller.ts +++ /dev/null @@ -1,24 +0,0 @@ -export class ClosingStockController { - static $inject = ['$scope', '$location', 'asDateFilter', 'uibDateParser']; - _info_Date: any; - foDate: boolean; - info: any; - - constructor(public $scope, public $location, public asDate, public dateParser) { - this.info = $scope.$parent.res.info; - this._info_Date = dateParser.parse(this.info.Date, "dd-MMM-yyyy"); - this.foDate = true; - } - - info_Date(value) { - if (arguments.length) { - this.info.Date = this.asDate(value); - this._info_Date = value; - } - return this._info_Date; - } - - show() { - this.$location.path('/ClosingStock/' + this.info.Date); - } -} diff --git a/brewman/static/src/app/closing-stock/closing-stock.html b/brewman/static/src/app/closing-stock/closing-stock.html deleted file mode 100644 index a0a5fc93..00000000 --- a/brewman/static/src/app/closing-stock/closing-stock.html +++ /dev/null @@ -1,40 +0,0 @@ -
-

Closing Stock

- -
- - -
-
- - - - -
-
-
- -
-
- - - - - - - - - - - - - - - - - - -
ProductGroupQuantityAmount
{{item.Product}}{{item.Group}}{{item.Quantity | number:2}}{{item.Amount | currency}}
-
diff --git a/brewman/static/src/app/closing-stock/closing-stock.resolver.js b/brewman/static/src/app/closing-stock/closing-stock.resolver.js deleted file mode 100644 index 3399fd4f..00000000 --- a/brewman/static/src/app/closing-stock/closing-stock.resolver.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function ClosingStockResolver($route, ClosingStock) { - var date = $route.current.params.date; - if (angular.isUndefined(date)) { - return ClosingStock.get({}).$promise; - } - else { - return ClosingStock.get({ date: date }).$promise; - } -} -exports.ClosingStockResolver = ClosingStockResolver; -//# sourceMappingURL=closing-stock.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/closing-stock/closing-stock.resolver.js.map b/brewman/static/src/app/closing-stock/closing-stock.resolver.js.map deleted file mode 100644 index cd30569d..00000000 --- a/brewman/static/src/app/closing-stock/closing-stock.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"closing-stock.resolver.js","sourceRoot":"","sources":["closing-stock.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,8BAAqC,MAAM,EAAE,YAAY;IACrD,IAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;IAExC,IAAI,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;QAC3B,OAAO,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;KACxC;SAAM;QACH,OAAO,YAAY,CAAC,GAAG,CAAC,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC,QAAQ,CAAC;KAClD;AACL,CAAC;AARD,oDAQC"} \ No newline at end of file diff --git a/brewman/static/src/app/closing-stock/closing-stock.resolver.ts b/brewman/static/src/app/closing-stock/closing-stock.resolver.ts deleted file mode 100644 index 96da5c17..00000000 --- a/brewman/static/src/app/closing-stock/closing-stock.resolver.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as angular from 'angular'; - -export function ClosingStockResolver($route, ClosingStock) { - const date = $route.current.params.date; - - if (angular.isUndefined(date)) { - return ClosingStock.get({}).$promise; - } else { - return ClosingStock.get({date: date}).$promise; - } -} diff --git a/brewman/static/src/app/closing-stock/closing-stock.service.js b/brewman/static/src/app/closing-stock/closing-stock.service.js deleted file mode 100644 index 8f439efe..00000000 --- a/brewman/static/src/app/closing-stock/closing-stock.service.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function ClosingStock($resource) { - return $resource('/api/ClosingStock/:date'); -} -exports.ClosingStock = ClosingStock; -//# sourceMappingURL=closing-stock.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/closing-stock/closing-stock.service.js.map b/brewman/static/src/app/closing-stock/closing-stock.service.js.map deleted file mode 100644 index 8fc4db3a..00000000 --- a/brewman/static/src/app/closing-stock/closing-stock.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"closing-stock.service.js","sourceRoot":"","sources":["closing-stock.service.ts"],"names":[],"mappings":";;AAAA,sBAA6B,SAAS;IAClC,OAAO,SAAS,CAAC,yBAAyB,CAAC,CAAC;AAChD,CAAC;AAFD,oCAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/closing-stock/closing-stock.service.ts b/brewman/static/src/app/closing-stock/closing-stock.service.ts deleted file mode 100644 index b6e9e9f9..00000000 --- a/brewman/static/src/app/closing-stock/closing-stock.service.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function ClosingStock($resource) { - return $resource('/api/ClosingStock/:date'); -} diff --git a/brewman/static/src/app/common/accounting.filter.js b/brewman/static/src/app/common/accounting.filter.js deleted file mode 100644 index 5fb65589..00000000 --- a/brewman/static/src/app/common/accounting.filter.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function Accounting(currencyFilter) { - return function (amount) { - amount = currencyFilter(amount); - if (angular.isUndefined(amount) || amount === '') { - return ''; - } - if (amount.indexOf('-') !== -1) { - return amount.replace('-', '') + '\u00A0Cr'; - } - else { - return amount + '\u00A0Dr'; - } - }; -} -exports.Accounting = Accounting; -//# sourceMappingURL=accounting.filter.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/accounting.filter.js.map b/brewman/static/src/app/common/accounting.filter.js.map deleted file mode 100644 index 319f6aba..00000000 --- a/brewman/static/src/app/common/accounting.filter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"accounting.filter.js","sourceRoot":"","sources":["accounting.filter.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,oBAA2B,cAAc;IACrC,OAAO,UAAU,MAAM;QACnB,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;QAChC,IAAI,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,MAAM,KAAK,EAAE,EAAE;YAC9C,OAAO,EAAE,CAAC;SACb;QACD,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE;YAC5B,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,UAAU,CAAC;SAC/C;aAAM;YACH,OAAO,MAAM,GAAG,UAAU,CAAC;SAC9B;IACL,CAAC,CAAC;AACN,CAAC;AAZD,gCAYC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/accounting.filter.ts b/brewman/static/src/app/common/accounting.filter.ts deleted file mode 100644 index 82e28b57..00000000 --- a/brewman/static/src/app/common/accounting.filter.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as angular from 'angular'; - -export function Accounting(currencyFilter) { - return function (amount) { - amount = currencyFilter(amount); - if (angular.isUndefined(amount) || amount === '') { - return ''; - } - if (amount.indexOf('-') !== -1) { - return amount.replace('-', '') + '\u00A0Cr'; - } else { - return amount + '\u00A0Dr'; - } - }; -} \ No newline at end of file diff --git a/brewman/static/src/app/common/as-date.filter.js b/brewman/static/src/app/common/as-date.filter.js deleted file mode 100644 index 088dde95..00000000 --- a/brewman/static/src/app/common/as-date.filter.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function AsDate(dateFilter) { - return function (input) { - return angular.isDate(input) ? dateFilter(input, 'dd-MMM-yyyy') : input; - }; -} -exports.AsDate = AsDate; -//# sourceMappingURL=as-date.filter.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/as-date.filter.js.map b/brewman/static/src/app/common/as-date.filter.js.map deleted file mode 100644 index 0db702f2..00000000 --- a/brewman/static/src/app/common/as-date.filter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"as-date.filter.js","sourceRoot":"","sources":["as-date.filter.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,gBAAuB,UAAU;IAC7B,OAAO,UAAU,KAAK;QAClB,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC5E,CAAC,CAAC;AACN,CAAC;AAJD,wBAIC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/as-date.filter.ts b/brewman/static/src/app/common/as-date.filter.ts deleted file mode 100644 index 525961ad..00000000 --- a/brewman/static/src/app/common/as-date.filter.ts +++ /dev/null @@ -1,7 +0,0 @@ -import * as angular from 'angular'; - -export function AsDate(dateFilter) { - return function (input) { - return angular.isDate(input) ? dateFilter(input, 'dd-MMM-yyyy') : input; - }; -} diff --git a/brewman/static/src/app/common/auth.service.js b/brewman/static/src/app/common/auth.service.js deleted file mode 100644 index 03848900..00000000 --- a/brewman/static/src/app/common/auth.service.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function Auth($resource) { - return $resource('/api/Auth', {}, { - login: { method: 'GET', params: { list: true }, isArray: true } - }); -} -exports.Auth = Auth; -//# sourceMappingURL=auth.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/auth.service.js.map b/brewman/static/src/app/common/auth.service.js.map deleted file mode 100644 index 0da59625..00000000 --- a/brewman/static/src/app/common/auth.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth.service.js","sourceRoot":"","sources":["auth.service.ts"],"names":[],"mappings":";;AAAA,cAAqB,SAAS;IAC1B,OAAO,SAAS,CAAC,WAAW,EAAE,EAAE,EAAE;QAC9B,KAAK,EAAE,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,EAAE,OAAO,EAAE,IAAI,EAAC;KAC9D,CAAC,CAAC;AACP,CAAC;AAJD,oBAIC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/auth.service.ts b/brewman/static/src/app/common/auth.service.ts deleted file mode 100644 index ea91e750..00000000 --- a/brewman/static/src/app/common/auth.service.ts +++ /dev/null @@ -1,5 +0,0 @@ -export function Auth($resource) { - return $resource('/api/Auth', {}, { - login: {method: 'GET', params: {list: true}, isArray: true} - }); -} diff --git a/brewman/static/src/app/common/clr.filter.js b/brewman/static/src/app/common/clr.filter.js deleted file mode 100644 index 6f6cfa3f..00000000 --- a/brewman/static/src/app/common/clr.filter.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function Clr() { - return function (input) { - if (input === '\u20B9\u00A00.00' || input === '0.00') { - return ''; - } - return input; - }; -} -exports.Clr = Clr; -//# sourceMappingURL=clr.filter.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/clr.filter.js.map b/brewman/static/src/app/common/clr.filter.js.map deleted file mode 100644 index bbdc0b05..00000000 --- a/brewman/static/src/app/common/clr.filter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"clr.filter.js","sourceRoot":"","sources":["clr.filter.ts"],"names":[],"mappings":";;AAEA;IACI,OAAO,UAAU,KAAK;QAClB,IAAI,KAAK,KAAK,kBAAkB,IAAI,KAAK,KAAK,MAAM,EAAE;YAClD,OAAO,EAAE,CAAC;SACb;QACD,OAAO,KAAK,CAAC;IACjB,CAAC,CAAC;AACN,CAAC;AAPD,kBAOC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/clr.filter.ts b/brewman/static/src/app/common/clr.filter.ts deleted file mode 100644 index 616ed498..00000000 --- a/brewman/static/src/app/common/clr.filter.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as angular from 'angular'; - -export function Clr() { - return function (input) { - if (input === '\u20B9\u00A00.00' || input === '0.00') { - return ''; - } - return input; - }; -} \ No newline at end of file diff --git a/brewman/static/src/app/common/credentials.service.js b/brewman/static/src/app/common/credentials.service.js deleted file mode 100644 index 3f59d718..00000000 --- a/brewman/static/src/app/common/credentials.service.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function Credentials() { - return { - Auth: {}, - Perms: [] - }; -} -exports.Credentials = Credentials; -//# sourceMappingURL=credentials.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/credentials.service.js.map b/brewman/static/src/app/common/credentials.service.js.map deleted file mode 100644 index 5bb4bd52..00000000 --- a/brewman/static/src/app/common/credentials.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"credentials.service.js","sourceRoot":"","sources":["credentials.service.ts"],"names":[],"mappings":";;AAAA;IACI,OAAO;QACH,IAAI,EAAC,EAAE;QACP,KAAK,EAAC,EAAE;KACX,CAAC;AACN,CAAC;AALD,kCAKC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/credentials.service.ts b/brewman/static/src/app/common/credentials.service.ts deleted file mode 100644 index 7b409feb..00000000 --- a/brewman/static/src/app/common/credentials.service.ts +++ /dev/null @@ -1,6 +0,0 @@ -export function Credentials() { - return { - Auth:{}, - Perms:[] - }; -} diff --git a/brewman/static/src/app/common/debit.filter.js b/brewman/static/src/app/common/debit.filter.js deleted file mode 100644 index 1637c69b..00000000 --- a/brewman/static/src/app/common/debit.filter.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function Debit() { - return function (input) { - if (input === -1) { - return 'Cr'; - } - else if (input === 1) { - return 'Dr'; - } - else { - return ''; - } - }; -} -exports.Debit = Debit; -//# sourceMappingURL=debit.filter.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/debit.filter.js.map b/brewman/static/src/app/common/debit.filter.js.map deleted file mode 100644 index 6426dfd4..00000000 --- a/brewman/static/src/app/common/debit.filter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"debit.filter.js","sourceRoot":"","sources":["debit.filter.ts"],"names":[],"mappings":";;AAAA;IACI,OAAO,UAAU,KAAK;QAClB,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YACd,OAAO,IAAI,CAAC;SACf;aAAM,IAAI,KAAK,KAAK,CAAC,EAAE;YACpB,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,EAAE,CAAC;SACb;IACL,CAAC,CAAC;AACN,CAAC;AAVD,sBAUC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/debit.filter.ts b/brewman/static/src/app/common/debit.filter.ts deleted file mode 100644 index 224b03a5..00000000 --- a/brewman/static/src/app/common/debit.filter.ts +++ /dev/null @@ -1,11 +0,0 @@ -export function Debit () { - return function (input) { - if (input === -1) { - return 'Cr'; - } else if (input === 1) { - return 'Dr'; - } else { - return ''; - } - }; -} \ No newline at end of file diff --git a/brewman/static/src/app/common/fadey.directive.js b/brewman/static/src/app/common/fadey.directive.js deleted file mode 100644 index eb49704d..00000000 --- a/brewman/static/src/app/common/fadey.directive.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var $ = require("jquery"); -function Fadey() { - return { - restrict: 'A', - link: function (scope, element, attrs) { - var duration = 500; - element = $(element); - element.hide(); - element.fadeIn(duration); - scope.destroy = function (complete) { - element.fadeOut(duration, function () { - if (complete) { - complete.apply(scope); - } - }); - }; - } - }; -} -exports.Fadey = Fadey; -//# sourceMappingURL=fadey.directive.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/fadey.directive.js.map b/brewman/static/src/app/common/fadey.directive.js.map deleted file mode 100644 index d927d844..00000000 --- a/brewman/static/src/app/common/fadey.directive.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fadey.directive.js","sourceRoot":"","sources":["fadey.directive.ts"],"names":[],"mappings":";;AAAA,0BAA4B;AAE5B;IACI,OAAO;QACH,QAAQ,EAAE,GAAG;QACb,IAAI,EAAE,UAAU,KAAK,EAAE,OAAO,EAAE,KAAK;YACjC,IAAM,QAAQ,GAAG,GAAG,CAAC;YACrB,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC;YACrB,OAAO,CAAC,IAAI,EAAE,CAAC;YACf,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAEzB,KAAK,CAAC,OAAO,GAAG,UAAU,QAAQ;gBAC9B,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE;oBACtB,IAAI,QAAQ,EAAE;wBACV,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;qBACzB;gBACL,CAAC,CAAC,CAAC;YACP,CAAC,CAAC;QACN,CAAC;KACJ,CAAC;AACN,CAAC;AAlBD,sBAkBC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/fadey.directive.ts b/brewman/static/src/app/common/fadey.directive.ts deleted file mode 100644 index 3642dbac..00000000 --- a/brewman/static/src/app/common/fadey.directive.ts +++ /dev/null @@ -1,21 +0,0 @@ -import * as $ from 'jquery'; - -export function Fadey() { - return { - restrict: 'A', - link: function (scope, element, attrs) { - const duration = 500; - element = $(element); - element.hide(); - element.fadeIn(duration); - - scope.destroy = function (complete) { - element.fadeOut(duration, function () { - if (complete) { - complete.apply(scope); - } - }); - }; - } - }; -} \ No newline at end of file diff --git a/brewman/static/src/app/common/file-upload.directive.js b/brewman/static/src/app/common/file-upload.directive.js deleted file mode 100644 index e35ff1e9..00000000 --- a/brewman/static/src/app/common/file-upload.directive.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function FileUpload() { - return { - scope: true, - link: function (scope, el, attrs) { - el.bind('change', function (event) { - var files = event.target.files; - //iterate files since 'multiple' may be specified on the element - for (var i = 0; i < files.length; i++) { - //emit event upward - scope.$emit("fileSelected", { file: files[i] }); - } - }); - } - }; -} -exports.FileUpload = FileUpload; -//# sourceMappingURL=file-upload.directive.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/file-upload.directive.js.map b/brewman/static/src/app/common/file-upload.directive.js.map deleted file mode 100644 index 662cc98d..00000000 --- a/brewman/static/src/app/common/file-upload.directive.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"file-upload.directive.js","sourceRoot":"","sources":["file-upload.directive.ts"],"names":[],"mappings":";;AAAA;IACI,OAAO;QACH,KAAK,EAAE,IAAI;QACX,IAAI,EAAE,UAAU,KAAK,EAAE,EAAE,EAAE,KAAK;YAC5B,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,KAAK;gBAC7B,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;gBAC/B,gEAAgE;gBAChE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBACnC,mBAAmB;oBACnB,KAAK,CAAC,KAAK,CAAC,cAAc,EAAE,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC;iBACjD;YACL,CAAC,CAAC,CAAC;QACP,CAAC;KACJ,CAAC;AACN,CAAC;AAdD,gCAcC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/file-upload.directive.ts b/brewman/static/src/app/common/file-upload.directive.ts deleted file mode 100644 index 9b1dc9a5..00000000 --- a/brewman/static/src/app/common/file-upload.directive.ts +++ /dev/null @@ -1,15 +0,0 @@ -export function FileUpload() { - return { - scope: true, //create a new scope - link: function (scope, el, attrs) { - el.bind('change', function (event) { - var files = event.target.files; - //iterate files since 'multiple' may be specified on the element - for (var i = 0; i < files.length; i++) { - //emit event upward - scope.$emit("fileSelected", {file: files[i]}); - } - }); - } - }; -} \ No newline at end of file diff --git a/brewman/static/src/app/common/focus-on.directive.js b/brewman/static/src/app/common/focus-on.directive.js deleted file mode 100644 index e1bb0a0d..00000000 --- a/brewman/static/src/app/common/focus-on.directive.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function FocusOn($timeout, $parse) { - return { - restrict: 'A', - link: function (scope, element, attrs) { - scope.$watch(attrs.focusOn, function (value) { - if (value === true) { - var getter = $parse(attrs.focusOn); - var setter = getter.assign; - setter(scope, false); - $timeout(function () { - element[0].focus(); - }); - } - }); - } - }; -} -exports.FocusOn = FocusOn; -//# sourceMappingURL=focus-on.directive.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/focus-on.directive.js.map b/brewman/static/src/app/common/focus-on.directive.js.map deleted file mode 100644 index dac6c686..00000000 --- a/brewman/static/src/app/common/focus-on.directive.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"focus-on.directive.js","sourceRoot":"","sources":["focus-on.directive.ts"],"names":[],"mappings":";;AAAA,iBAAwB,QAAQ,EAAE,MAAM;IACpC,OAAO;QACH,QAAQ,EAAE,GAAG;QACb,IAAI,EAAE,UAAU,KAAK,EAAE,OAAO,EAAE,KAAK;YACjC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,UAAU,KAAK;gBACvC,IAAI,KAAK,KAAK,IAAI,EAAE;oBAChB,IAAI,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;oBACnC,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;oBAC3B,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;oBACrB,QAAQ,CAAC;wBACL,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;oBACvB,CAAC,CAAC,CAAC;iBACN;YACL,CAAC,CAAC,CAAC;QACP,CAAC;KACJ,CAAC;AACN,CAAC;AAhBD,0BAgBC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/focus-on.directive.ts b/brewman/static/src/app/common/focus-on.directive.ts deleted file mode 100644 index 50ce994a..00000000 --- a/brewman/static/src/app/common/focus-on.directive.ts +++ /dev/null @@ -1,17 +0,0 @@ -export function FocusOn($timeout, $parse) { - return { - restrict: 'A', - link: function (scope, element, attrs) { - scope.$watch(attrs.focusOn, function (value) { - if (value === true) { - var getter = $parse(attrs.focusOn); - var setter = getter.assign; - setter(scope, false); - $timeout(function () { - element[0].focus(); - }); - } - }); - } - }; -} \ No newline at end of file diff --git a/brewman/static/src/app/common/growl.service.js b/brewman/static/src/app/common/growl.service.js deleted file mode 100644 index 2c2ae410..00000000 --- a/brewman/static/src/app/common/growl.service.js +++ /dev/null @@ -1,65 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var $ = require("jquery"); -function Growl($http, $compile, $timeout) { - var growl = {}; - growl.defaultOptions = { - offset: { - from: "top", - amount: 20 - }, - align: "right", - width: 250, - duration: 500, - delay: 4000, - stackup_spacing: 10 - }; - growl.show = function (element, scope, options) { - var options = $.extend({}, growl.defaultOptions, options); - if (options.top_offset) { - options.offset = { - from: "top", - amount: options.top_offset - }; - } - var offsetAmount = options.offset.amount; - $(".bootstrap-growl").each(function (index) { - var offset = parseInt($(this).css(options.offset.from)) + $(this).outerHeight() + options.stackup_spacing; - if (isNaN(offset)) { - offset = 0; - } - return offsetAmount = Math.max(offsetAmount, offset); - }); - element.css("position", "fixed"); - element.css("margin", 0); - element.css("z-index", "9999"); - element.css("display", "none"); - element.css(options.offset.from, offsetAmount + "px"); - if (options.width !== "auto") { - element.css("width", options.width + "px"); - } - switch (options.align) { - case "center": - element.css("left", "50%"); - element.css("margin-left", "-" + (element.outerWidth() / 2) + "px"); - break; - case "left": - element.css("left", "20px"); - break; - default: - element.css("right", "20px"); - } - element.fadeIn(options.duration); - if (options.delay > 0) { - $timeout(function () { - element.fadeOut(options.duration, function () { - scope.$eval(options.dismissFunction); - }); - }, options.delay); - } - return element; - }; - return growl; -} -exports.Growl = Growl; -//# sourceMappingURL=growl.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/growl.service.js.map b/brewman/static/src/app/common/growl.service.js.map deleted file mode 100644 index a5989532..00000000 --- a/brewman/static/src/app/common/growl.service.js.map +++ /dev/null @@ -1 +0,0 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C,CAAC;IACF,OAAO,KAAK,CAAC;AACjB,CAAC;AA5DD,sBA4DC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/growl.service.ts b/brewman/static/src/app/common/growl.service.ts deleted file mode 100644 index a46a7f06..00000000 --- a/brewman/static/src/app/common/growl.service.ts +++ /dev/null @@ -1,63 +0,0 @@ -import * as $ from 'jquery'; - -export function Growl($http, $compile, $timeout) { - var growl:any = {}; - growl.defaultOptions = { - offset: { - from: "top", - amount: 20 - }, - align: "right", - width: 250, - duration: 500, - delay: 4000, - stackup_spacing: 10 - }; - - growl.show = function (element, scope, options) { - var options = $.extend({}, growl.defaultOptions, options); - if (options.top_offset) { - options.offset = { - from: "top", - amount: options.top_offset - }; - } - var offsetAmount = options.offset.amount; - $(".bootstrap-growl").each(function (index) { - var offset = parseInt($(this).css(options.offset.from)) + $(this).outerHeight() + options.stackup_spacing; - if (isNaN(offset)) { - offset = 0; - } - return offsetAmount = Math.max(offsetAmount, offset); - }); - element.css("position", "fixed"); - element.css("margin", 0); - element.css("z-index", "9999"); - element.css("display", "none"); - element.css(options.offset.from, offsetAmount + "px"); - if (options.width !== "auto") { - element.css("width", options.width + "px"); - } - switch (options.align) { - case "center": - element.css("left", "50%"); - element.css("margin-left", "-" + (element.outerWidth() / 2) + "px"); - break; - case "left": - element.css("left", "20px"); - break; - default: - element.css("right", "20px"); - } - element.fadeIn(options.duration); - if (options.delay > 0) { - $timeout(function () { - element.fadeOut(options.duration, function () { - scope.$eval(options.dismissFunction); - }); - }, options.delay); - } - return element; - }; - return growl; -} diff --git a/brewman/static/src/app/common/journal-debit.filter.js b/brewman/static/src/app/common/journal-debit.filter.js deleted file mode 100644 index 269a8608..00000000 --- a/brewman/static/src/app/common/journal-debit.filter.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function JournalDebit() { - return function (input, debit) { - var list = []; - if (!angular.isUndefined(input)) { - for (var i = 0, l = input.length; i < l; i++) { - if (input[i].Debit === debit) { - list.push(input[i]); - } - } - } - return list; - }; -} -exports.JournalDebit = JournalDebit; -//# sourceMappingURL=journal-debit.filter.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/journal-debit.filter.js.map b/brewman/static/src/app/common/journal-debit.filter.js.map deleted file mode 100644 index 259cbe47..00000000 --- a/brewman/static/src/app/common/journal-debit.filter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"journal-debit.filter.js","sourceRoot":"","sources":["journal-debit.filter.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC;IACI,OAAO,UAAU,KAAK,EAAE,KAAK;QACzB,IAAI,IAAI,GAAG,EAAE,CAAC;QACd,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE;YAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;gBAC1C,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,EAAE;oBAC1B,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;iBACvB;aACJ;SACJ;QACD,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC;AACN,CAAC;AAZD,oCAYC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/journal-debit.filter.ts b/brewman/static/src/app/common/journal-debit.filter.ts deleted file mode 100644 index 8cdb8888..00000000 --- a/brewman/static/src/app/common/journal-debit.filter.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as angular from 'angular'; - -export function JournalDebit () { - return function (input, debit) { - let list = []; - if (!angular.isUndefined(input)) { - for (let i = 0, l = input.length; i < l; i++) { - if (input[i].Debit === debit) { - list.push(input[i]); - } - } - } - return list; - }; -} diff --git a/brewman/static/src/app/common/keypress.directive.js b/brewman/static/src/app/common/keypress.directive.js deleted file mode 100644 index 931f38f5..00000000 --- a/brewman/static/src/app/common/keypress.directive.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var Mousetrap = require("mousetrap"); -var _ = require("lodash"); -require("bmMousetrap"); -// export function Keypress() { -// return { -// link: function (scope, element, attrs) { -// const keypress = scope.$eval(attrs.keypress || '{}'); -// Mousetrap.bind(keypress); -// element.on('$destroy', function () { -// Mousetrap.unbind(keypress); -// }); -// -// } -// } -// } -function Keypress() { - return function (scope, element, attrs) { - var keypress = scope.$eval(attrs.keypress || '{}'); - _.forEach(keypress, function (value, key) { - Mousetrap.bind(key, value); - }); - element.on('$destroy', function () { - _.forEach(keypress, function (value, key) { - Mousetrap.unbind(key, value); - }); - }); - }; -} -exports.Keypress = Keypress; -//# sourceMappingURL=keypress.directive.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/keypress.directive.js.map b/brewman/static/src/app/common/keypress.directive.js.map deleted file mode 100644 index 70ad3a1a..00000000 --- a/brewman/static/src/app/common/keypress.directive.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"keypress.directive.js","sourceRoot":"","sources":["keypress.directive.ts"],"names":[],"mappings":";;AAAA,qCAAuC;AACvC,0BAA4B;AAC5B,uBAAqB;AAErB,+BAA+B;AAC/B,eAAe;AACf,mDAAmD;AACnD,oEAAoE;AACpE,wCAAwC;AACxC,mDAAmD;AACnD,8CAA8C;AAC9C,kBAAkB;AAClB,EAAE;AACF,YAAY;AACZ,QAAQ;AACR,IAAI;AAEJ;IACI,OAAO,UAAU,KAAK,EAAE,OAAO,EAAE,KAAK;QAClC,IAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC,CAAC;QACrD,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,UAAU,KAAK,EAAE,GAAG;YACpC,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE;YACnB,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,UAAU,KAAK,EAAE,GAAG;gBACpC,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YACjC,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IAEP,CAAC,CAAC;AACN,CAAC;AAbD,4BAaC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/keypress.directive.ts b/brewman/static/src/app/common/keypress.directive.ts deleted file mode 100644 index d4e55319..00000000 --- a/brewman/static/src/app/common/keypress.directive.ts +++ /dev/null @@ -1,31 +0,0 @@ -import * as Mousetrap from 'mousetrap'; -import * as _ from 'lodash'; -import 'bmMousetrap'; - -// export function Keypress() { -// return { -// link: function (scope, element, attrs) { -// const keypress = scope.$eval(attrs.keypress || '{}'); -// Mousetrap.bind(keypress); -// element.on('$destroy', function () { -// Mousetrap.unbind(keypress); -// }); -// -// } -// } -// } - -export function Keypress() { - return function (scope, element, attrs) { - const keypress = scope.$eval(attrs.keypress || '{}'); - _.forEach(keypress, function (value, key) { - Mousetrap.bind(key, value); - }); - element.on('$destroy', function () { - _.forEach(keypress, function (value, key) { - Mousetrap.unbind(key, value); - }); - }); - - }; -} \ No newline at end of file diff --git a/brewman/static/src/app/common/local-time.filter.js b/brewman/static/src/app/common/local-time.filter.js deleted file mode 100644 index 8179c01d..00000000 --- a/brewman/static/src/app/common/local-time.filter.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function LocalTime() { - var months = { - Jan: 1, - Feb: 2, - Mar: 3, - Apr: 4, - May: 5, - Jun: 6, - Jul: 7, - Aug: 8, - Sep: 9, - Oct: 10, - Nov: 11, - Dec: 12 - }; - var monthsReverse = { - 1: 'Jan', - 2: 'Feb', - 3: 'Mar', - 4: 'Apr', - 5: 'May', - 6: 'Jun', - 7: 'Jul', - 8: 'Aug', - 9: 'Sep', - 10: 'Oct', - 11: 'Nov', - 12: 'Dec' - }; - function padNumber(input, width) { - input = input + ''; - width = width || 2; - return input.length >= width ? input : new Array(width - input.length + 1).join('0') + input; - } - return function (input) { - if (angular.isUndefined(input)) { - return ''; - } - var d = input.match(/(\w+)/g); - if (d.length !== 5) { - return input; - } - var dateInt = new Date(parseInt(d[2]), months[d[1]] - 1, parseInt(d[0]), parseInt(d[3]), parseInt(d[4])).getTime(); - var date = new Date(dateInt - (new Date().getTimezoneOffset() * 60000)); - return padNumber(date.getDate()) + '-' + monthsReverse[date.getMonth() + 1] + '-' + date.getFullYear() + ' ' + padNumber(date.getHours()) + ':' + padNumber(date.getMinutes()); - }; -} -exports.LocalTime = LocalTime; -//# sourceMappingURL=local-time.filter.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/local-time.filter.js.map b/brewman/static/src/app/common/local-time.filter.js.map deleted file mode 100644 index 63205b15..00000000 --- a/brewman/static/src/app/common/local-time.filter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"local-time.filter.js","sourceRoot":"","sources":["local-time.filter.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC;IACI,IAAM,MAAM,GAAG;QACX,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,EAAE;QACP,GAAG,EAAE,EAAE;QACP,GAAG,EAAE,EAAE;KACV,CAAC;IACF,IAAM,aAAa,GAAG;QAClB,CAAC,EAAE,KAAK;QACR,CAAC,EAAE,KAAK;QACR,CAAC,EAAE,KAAK;QACR,CAAC,EAAE,KAAK;QACR,CAAC,EAAE,KAAK;QACR,CAAC,EAAE,KAAK;QACR,CAAC,EAAE,KAAK;QAC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,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,WAAW,EAAE,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;IACnL,CAAC,CAAC;AACN,CAAC;AAhDD,8BAgDC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/local-time.filter.ts b/brewman/static/src/app/common/local-time.filter.ts deleted file mode 100644 index 63b9d621..00000000 --- a/brewman/static/src/app/common/local-time.filter.ts +++ /dev/null @@ -1,51 +0,0 @@ -import * as angular from 'angular'; - -export function LocalTime() { - const months = { - Jan: 1, - Feb: 2, - Mar: 3, - Apr: 4, - May: 5, - Jun: 6, - Jul: 7, - Aug: 8, - Sep: 9, - Oct: 10, - Nov: 11, - Dec: 12 - }; - const monthsReverse = { - 1: 'Jan', - 2: 'Feb', - 3: 'Mar', - 4: 'Apr', - 5: 'May', - 6: 'Jun', - 7: 'Jul', - 8: 'Aug', - 9: 'Sep', - 10: 'Oct', - 11: 'Nov', - 12: 'Dec' - }; - - function padNumber(input, width?: number) { - input = input + ''; - width = width || 2; - return input.length >= width ? input : new Array(width - input.length + 1).join('0') + input; - } - - return function (input) { - if (angular.isUndefined(input)) { - return ''; - } - const d = input.match(/(\w+)/g); - if (d.length !== 5) { - return input; - } - const dateInt = new Date(parseInt(d[2]), months[d[1]] - 1, parseInt(d[0]), parseInt(d[3]), parseInt(d[4])).getTime(); - const date = new Date(dateInt - (new Date().getTimezoneOffset() * 60000)); - return padNumber(date.getDate()) + '-' + monthsReverse[date.getMonth() + 1] + '-' + date.getFullYear() + ' ' + padNumber(date.getHours()) + ':' + padNumber(date.getMinutes()); - }; -} diff --git a/brewman/static/src/app/common/math-solver.service.js b/brewman/static/src/app/common/math-solver.service.js deleted file mode 100644 index c442fd09..00000000 --- a/brewman/static/src/app/common/math-solver.service.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var math = require("mathjs"); -function MathSolver() { - return function Test(expr) { - var ans; - try { - if (typeof expr === 'number') { - ans = expr; - } - else { - ans = math.eval(expr.trim().replace(',', '')); - } - } - catch (e) { - ans = Number.NaN; - } - finally { - return ans; - } - }; -} -exports.MathSolver = MathSolver; -//# sourceMappingURL=math-solver.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/math-solver.service.js.map b/brewman/static/src/app/common/math-solver.service.js.map deleted file mode 100644 index 9085fdec..00000000 --- a/brewman/static/src/app/common/math-solver.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"math-solver.service.js","sourceRoot":"","sources":["math-solver.service.ts"],"names":[],"mappings":";;AAAA,6BAA+B;AAE/B;IACI,OAAO,cAAc,IAAI;QACrB,IAAI,GAAG,CAAC;QACR,IAAI;YACA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;gBAC1B,GAAG,GAAG,IAAI,CAAC;aACd;iBAAM;gBACH,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC;aACjD;SACJ;QACD,OAAO,CAAC,EAAE;YACN,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;SACpB;gBACO;YACJ,OAAO,GAAG,CAAC;SACd;IACL,CAAC,CAAC;AACN,CAAC;AAjBD,gCAiBC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/math-solver.service.ts b/brewman/static/src/app/common/math-solver.service.ts deleted file mode 100644 index 2ea31272..00000000 --- a/brewman/static/src/app/common/math-solver.service.ts +++ /dev/null @@ -1,20 +0,0 @@ -import * as math from 'mathjs'; - -export function MathSolver() { - return function Test(expr) { - var ans; - try { - if (typeof expr === 'number') { - ans = expr; - } else { - ans = math.eval(expr.trim().replace(',', '')); - } - } - catch (e) { - ans = Number.NaN; - } - finally { - return ans; - } - }; -} diff --git a/brewman/static/src/app/common/md.filter.js b/brewman/static/src/app/common/md.filter.js deleted file mode 100644 index 56103735..00000000 --- a/brewman/static/src/app/common/md.filter.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var showdown_1 = require("showdown"); -function Md() { - var converter = new showdown_1.Showdown.converter(); - return function (input) { - return converter.makeHtml(input || ''); - }; -} -exports.Md = Md; -//# sourceMappingURL=md.filter.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/md.filter.js.map b/brewman/static/src/app/common/md.filter.js.map deleted file mode 100644 index 29c2d9f4..00000000 --- a/brewman/static/src/app/common/md.filter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"md.filter.js","sourceRoot":"","sources":["md.filter.ts"],"names":[],"mappings":";;AAAA,qCAAkC;AAElC;IACI,IAAI,SAAS,GAAG,IAAI,mBAAQ,CAAC,SAAS,EAAE,CAAC;IACzC,OAAO,UAAU,KAAK;QAClB,OAAO,SAAS,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IAC3C,CAAC,CAAC;AACN,CAAC;AALD,gBAKC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/md.filter.ts b/brewman/static/src/app/common/md.filter.ts deleted file mode 100644 index 63b49906..00000000 --- a/brewman/static/src/app/common/md.filter.ts +++ /dev/null @@ -1,8 +0,0 @@ -import {Showdown} from 'showdown'; - -export function Md() { - var converter = new Showdown.converter(); - return function (input) { - return converter.makeHtml(input || ''); - }; -} \ No newline at end of file diff --git a/brewman/static/src/app/common/message.service.js b/brewman/static/src/app/common/message.service.js deleted file mode 100644 index 3e485707..00000000 --- a/brewman/static/src/app/common/message.service.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function Messages() { - return []; -} -exports.Messages = Messages; -//# sourceMappingURL=message.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/message.service.js.map b/brewman/static/src/app/common/message.service.js.map deleted file mode 100644 index c8bdb28b..00000000 --- a/brewman/static/src/app/common/message.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"message.service.js","sourceRoot":"","sources":["message.service.ts"],"names":[],"mappings":";;AAAA;IACI,OAAO,EAAE,CAAC;AACd,CAAC;AAFD,4BAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/message.service.ts b/brewman/static/src/app/common/message.service.ts deleted file mode 100644 index dc10a193..00000000 --- a/brewman/static/src/app/common/message.service.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function Messages() { - return []; -} diff --git a/brewman/static/src/app/common/ng-growl.directive.js b/brewman/static/src/app/common/ng-growl.directive.js deleted file mode 100644 index 18635291..00000000 --- a/brewman/static/src/app/common/ng-growl.directive.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function NgGrowl(growl, $parse) { - return { - restrict: 'A', - link: function (scope, element, attrs) { - var options = { - dismissFunction: attrs["toClose"] - }; - growl.show(element, scope, options); - } - }; -} -exports.NgGrowl = NgGrowl; -//# sourceMappingURL=ng-growl.directive.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/ng-growl.directive.js.map b/brewman/static/src/app/common/ng-growl.directive.js.map deleted file mode 100644 index 38ac0a37..00000000 --- a/brewman/static/src/app/common/ng-growl.directive.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ng-growl.directive.js","sourceRoot":"","sources":["ng-growl.directive.ts"],"names":[],"mappings":";;AAAA,iBAAwB,KAAK,EAAE,MAAM;IACjC,OAAO;QACH,QAAQ,EAAE,GAAG;QACb,IAAI,EAAE,UAAU,KAAK,EAAE,OAAO,EAAE,KAAK;YACjC,IAAI,OAAO,GAAG;gBACV,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC;aACpC,CAAC;YACF,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QACxC,CAAC;KACJ,CAAC;AACN,CAAC;AAVD,0BAUC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/ng-growl.directive.ts b/brewman/static/src/app/common/ng-growl.directive.ts deleted file mode 100644 index 0545f8c8..00000000 --- a/brewman/static/src/app/common/ng-growl.directive.ts +++ /dev/null @@ -1,11 +0,0 @@ -export function NgGrowl(growl, $parse) { - return { - restrict: 'A', - link: function (scope, element, attrs) { - var options = { - dismissFunction: attrs["toClose"] - }; - growl.show(element, scope, options); - } - }; -} \ No newline at end of file diff --git a/brewman/static/src/app/common/on-return.directive.js b/brewman/static/src/app/common/on-return.directive.js deleted file mode 100644 index 2e955bbb..00000000 --- a/brewman/static/src/app/common/on-return.directive.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function OnReturn($parse) { - return { - compile: function ($element, attr) { - var fn = $parse(attr.onReturn); - return function (scope, element) { - element.on("keypress", function (event) { - if (event.which === 13) { - scope.$apply(function () { - fn(scope, { $event: event }); - }); - event.preventDefault(); - } - }); - }; - } - }; -} -exports.OnReturn = OnReturn; -//# sourceMappingURL=on-return.directive.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/on-return.directive.js.map b/brewman/static/src/app/common/on-return.directive.js.map deleted file mode 100644 index 1cd1aca2..00000000 --- a/brewman/static/src/app/common/on-return.directive.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"on-return.directive.js","sourceRoot":"","sources":["on-return.directive.ts"],"names":[],"mappings":";;AAAA,kBAAyB,MAAM;IAC3B,OAAO;QACH,OAAO,EAAE,UAAU,QAAQ,EAAE,IAAI;YAC7B,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC/B,OAAO,UAAU,KAAK,EAAE,OAAO;gBAC3B,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK;oBAClC,IAAI,KAAK,CAAC,KAAK,KAAK,EAAE,EAAE;wBACpB,KAAK,CAAC,MAAM,CAAC;4BACT,EAAE,CAAC,KAAK,EAAE,EAAC,MAAM,EAAE,KAAK,EAAC,CAAC,CAAC;wBAC/B,CAAC,CAAC,CAAC;wBACH,KAAK,CAAC,cAAc,EAAE,CAAC;qBAC1B;gBACL,CAAC,CAAC,CAAC;YACP,CAAC,CAAC;QACN,CAAC;KACJ,CAAC;AACN,CAAC;AAhBD,4BAgBC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/on-return.directive.ts b/brewman/static/src/app/common/on-return.directive.ts deleted file mode 100644 index ace30ef1..00000000 --- a/brewman/static/src/app/common/on-return.directive.ts +++ /dev/null @@ -1,17 +0,0 @@ -export function OnReturn($parse) { - return { - compile: function ($element, attr) { - var fn = $parse(attr.onReturn); - return function (scope, element) { - element.on("keypress", function (event) { - if (event.which === 13) { - scope.$apply(function () { - fn(scope, {$event: event}); - }); - event.preventDefault(); - } - }); - }; - } - }; -} \ No newline at end of file diff --git a/brewman/static/src/app/common/percent.filter.js b/brewman/static/src/app/common/percent.filter.js deleted file mode 100644 index c9d3854d..00000000 --- a/brewman/static/src/app/common/percent.filter.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function Percent(numberFilter) { - return function (input) { - if (!angular.isNumber(input)) { - return input; - } - return numberFilter(input * 100, 2) + '%'; - }; -} -exports.Percent = Percent; -//# sourceMappingURL=percent.filter.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/percent.filter.js.map b/brewman/static/src/app/common/percent.filter.js.map deleted file mode 100644 index 69bf7361..00000000 --- a/brewman/static/src/app/common/percent.filter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"percent.filter.js","sourceRoot":"","sources":["percent.filter.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,iBAAwB,YAAY;IAChC,OAAO,UAAU,KAAK;QAClB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YAC1B,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,YAAY,CAAC,KAAK,GAAG,GAAG,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC;IAC9C,CAAC,CAAC;AACN,CAAC;AAPD,0BAOC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/percent.filter.ts b/brewman/static/src/app/common/percent.filter.ts deleted file mode 100644 index 396f77c8..00000000 --- a/brewman/static/src/app/common/percent.filter.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as angular from 'angular'; - -export function Percent(numberFilter) { - return function (input) { - if (!angular.isNumber(input)) { - return input; - } - return numberFilter(input * 100, 2) + '%'; - }; -} diff --git a/brewman/static/src/app/common/posted.filter.js b/brewman/static/src/app/common/posted.filter.js deleted file mode 100644 index fabcd153..00000000 --- a/brewman/static/src/app/common/posted.filter.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function Posted() { - return function (input) { - return input === true ? 'Posted' : 'Post'; - }; -} -exports.Posted = Posted; -//# sourceMappingURL=posted.filter.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/posted.filter.js.map b/brewman/static/src/app/common/posted.filter.js.map deleted file mode 100644 index b059b5c5..00000000 --- a/brewman/static/src/app/common/posted.filter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"posted.filter.js","sourceRoot":"","sources":["posted.filter.ts"],"names":[],"mappings":";;AAAA;IACI,OAAO,UAAU,KAAK;QAClB,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;IAC9C,CAAC,CAAC;AACN,CAAC;AAJD,wBAIC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/posted.filter.ts b/brewman/static/src/app/common/posted.filter.ts deleted file mode 100644 index 758bbf4c..00000000 --- a/brewman/static/src/app/common/posted.filter.ts +++ /dev/null @@ -1,5 +0,0 @@ -export function Posted () { - return function (input) { - return input === true ? 'Posted' : 'Post'; - }; -} \ No newline at end of file diff --git a/brewman/static/src/app/common/reader-promise.service.js b/brewman/static/src/app/common/reader-promise.service.js deleted file mode 100644 index fba022d0..00000000 --- a/brewman/static/src/app/common/reader-promise.service.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function ReaderPromise($q) { - var onLoad = function (reader, deferred) { - return function () { - deferred.resolve(reader.result); - }; - }; - var onError = function (reader, deferred) { - return function () { - deferred.reject(reader.result); - }; - }; - var onProgress = function (reader, scope) { - return function (event) { - scope.$emit("fileProgress", { - total: event.total, - loaded: event.loaded - }); - }; - }; - var getReader = function (deferred, scope) { - var reader = new FileReader(); - reader.onload = onLoad(reader, deferred); - reader.onerror = onError(reader, deferred); - if (!angular.isUndefined(scope)) { - reader.onprogress = onProgress(reader, scope); - } - return reader; - }; - var readAsDataURL = function (file, scope) { - var deferred = $q.defer(), reader = getReader(deferred, scope); - reader.readAsDataURL(file); - return deferred.promise; - }; - return { - readAsDataURL: readAsDataURL - }; -} -exports.ReaderPromise = ReaderPromise; -//# sourceMappingURL=reader-promise.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/reader-promise.service.js.map b/brewman/static/src/app/common/reader-promise.service.js.map deleted file mode 100644 index e946b9bb..00000000 --- a/brewman/static/src/app/common/reader-promise.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"reader-promise.service.js","sourceRoot":"","sources":["reader-promise.service.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,uBAA8B,EAAE;IAC5B,IAAM,MAAM,GAAG,UAAU,MAAM,EAAE,QAAQ;QACrC,OAAO;YACH,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACpC,CAAC,CAAC;IACN,CAAC,CAAC;IAEF,IAAM,OAAO,GAAG,UAAU,MAAM,EAAE,QAAQ;QACtC,OAAO;YACH,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC,CAAC;IACN,CAAC,CAAC;IAEF,IAAM,UAAU,GAAG,UAAU,MAAM,EAAE,KAAK;QACtC,OAAO,UAAU,KAAK;YAClB,KAAK,CAAC,KAAK,CAAC,cAAc,EACtB;gBACI,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,MAAM,EAAE,KAAK,CAAC,MAAM;aACvB,CAAC,CAAC;QACX,CAAC,CAAC;IACN,CAAC,CAAC;IAEF,IAAM,SAAS,GAAG,UAAU,QAAQ,EAAE,KAAK;QACvC,IAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAChC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACzC,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAC3C,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE;YAC7B,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;SACjD;QACD,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC;IAEF,IAAM,aAAa,GAAG,UAAU,IAAI,EAAE,KAAK;QACvC,IAAM,QAAQ,GAAG,EAAE,CAAC,KAAK,EAAE,EACvB,MAAM,GAAG,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QACxC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC3B,OAAO,QAAQ,CAAC,OAAO,CAAC;IAC5B,CAAC,CAAC;IAEF,OAAO;QACH,aAAa,EAAE,aAAa;KAC/B,CAAC;AACN,CAAC;AA3CD,sCA2CC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/reader-promise.service.ts b/brewman/static/src/app/common/reader-promise.service.ts deleted file mode 100644 index b7c91ca5..00000000 --- a/brewman/static/src/app/common/reader-promise.service.ts +++ /dev/null @@ -1,46 +0,0 @@ -import * as angular from 'angular'; - -export function ReaderPromise($q) { - const onLoad = function (reader, deferred) { - return function () { - deferred.resolve(reader.result); - }; - }; - - const onError = function (reader, deferred) { - return function () { - deferred.reject(reader.result); - }; - }; - - const onProgress = function (reader, scope) { - return function (event) { - scope.$emit("fileProgress", - { - total: event.total, - loaded: event.loaded - }); - }; - }; - - const getReader = function (deferred, scope) { - const reader = new FileReader(); - reader.onload = onLoad(reader, deferred); - reader.onerror = onError(reader, deferred); - if (!angular.isUndefined(scope)) { - reader.onprogress = onProgress(reader, scope); - } - return reader; - }; - - const readAsDataURL = function (file, scope) { - const deferred = $q.defer(), - reader = getReader(deferred, scope); - reader.readAsDataURL(file); - return deferred.promise; - }; - - return { - readAsDataURL: readAsDataURL - }; -} diff --git a/brewman/static/src/app/common/saveButtonText.filter.js b/brewman/static/src/app/common/saveButtonText.filter.js deleted file mode 100644 index 02910977..00000000 --- a/brewman/static/src/app/common/saveButtonText.filter.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function SaveButtonText() { - return function (input) { - return (!input) ? 'Save' : 'Update'; - }; -} -exports.SaveButtonText = SaveButtonText; -//# sourceMappingURL=saveButtonText.filter.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/saveButtonText.filter.js.map b/brewman/static/src/app/common/saveButtonText.filter.js.map deleted file mode 100644 index 1a4654cc..00000000 --- a/brewman/static/src/app/common/saveButtonText.filter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"saveButtonText.filter.js","sourceRoot":"","sources":["saveButtonText.filter.ts"],"names":[],"mappings":";;AAAA;IACI,OAAO,UAAU,KAAK;QAClB,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;IACxC,CAAC,CAAC;AACN,CAAC;AAJD,wCAIC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/saveButtonText.filter.ts b/brewman/static/src/app/common/saveButtonText.filter.ts deleted file mode 100644 index d7604188..00000000 --- a/brewman/static/src/app/common/saveButtonText.filter.ts +++ /dev/null @@ -1,5 +0,0 @@ -export function SaveButtonText() { - return function (input) { - return (!input) ? 'Save' : 'Update'; - }; -} diff --git a/brewman/static/src/app/common/tan-click.directive.js b/brewman/static/src/app/common/tan-click.directive.js deleted file mode 100644 index a7638f76..00000000 --- a/brewman/static/src/app/common/tan-click.directive.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function TanClick($parse, $timeout) { - return { - compile: function ($element, attr) { - var fn = $parse(attr.tanClick); - return function (scope, element, attr) { - element.on('click', function (event) { - scope.$apply(function () { - var disabled = attr.ngDisabled ? $parse(attr.ngDisabled) : angular.noop; - attr.$set('disabled', true); - var v = fn(scope, { $event: event }) || angular.noop; - if (v && v.then) { - v.finally(function () { - attr.$set('disabled', !!disabled(scope) || false); - }); - } - else { - $timeout(function () { - attr.$set('disabled', !!disabled(scope) || false); - }, 5000); - } - }); - }); - }; - } - }; -} -exports.TanClick = TanClick; -//# sourceMappingURL=tan-click.directive.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/tan-click.directive.js.map b/brewman/static/src/app/common/tan-click.directive.js.map deleted file mode 100644 index cfa35d95..00000000 --- a/brewman/static/src/app/common/tan-click.directive.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tan-click.directive.js","sourceRoot":"","sources":["tan-click.directive.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,kBAAyB,MAAM,EAAE,QAAQ;IACrC,OAAO;QACH,OAAO,EAAE,UAAU,QAAQ,EAAE,IAAI;YAC7B,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC/B,OAAO,UAAU,KAAK,EAAE,OAAO,EAAE,IAAI;gBACjC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK;oBAC/B,KAAK,CAAC,MAAM,CAAC;wBACT,IAAI,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;wBACxE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;wBAC5B,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,EAAC,MAAM,EAAE,KAAK,EAAC,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC;wBACnD,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE;4BACb,CAAC,CAAC,OAAO,CAAC;gCACN,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC;4BACtD,CAAC,CAAC,CAAC;yBACN;6BAAM;4BACH,QAAQ,CAAC;gCACL,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC;4BACtD,CAAC,EAAE,IAAI,CAAC,CAAC;yBACZ;oBACL,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;YACP,CAAC,CAAC;QACN,CAAC;KACJ,CAAC;AACN,CAAC;AAxBD,4BAwBC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/tan-click.directive.ts b/brewman/static/src/app/common/tan-click.directive.ts deleted file mode 100644 index c458cd94..00000000 --- a/brewman/static/src/app/common/tan-click.directive.ts +++ /dev/null @@ -1,27 +0,0 @@ -import * as angular from 'angular'; - -export function TanClick($parse, $timeout) { - return { - compile: function ($element, attr) { - var fn = $parse(attr.tanClick); - return function (scope, element, attr) { - element.on('click', function (event) { - scope.$apply(function () { - var disabled = attr.ngDisabled ? $parse(attr.ngDisabled) : angular.noop; - attr.$set('disabled', true); - var v = fn(scope, {$event: event}) || angular.noop; - if (v && v.then) { - v.finally(function () { - attr.$set('disabled', !!disabled(scope) || false); - }); - } else { - $timeout(function () { - attr.$set('disabled', !!disabled(scope) || false); - }, 5000); - } - }); - }); - }; - } - }; -} \ No newline at end of file diff --git a/brewman/static/src/app/common/tokenizer.service.js b/brewman/static/src/app/common/tokenizer.service.js deleted file mode 100644 index 84a02324..00000000 --- a/brewman/static/src/app/common/tokenizer.service.js +++ /dev/null @@ -1,129 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var moment = require("moment"); -var _ = require("lodash"); -function Tokenizer($filter) { - var parseFilterString = function (q, searchInfo) { - // '[^']+'|"[^"]+"|[^ ]+ == Match a space delimited string or quoted string. ms for short - // ((ms\s*:\s*ms)|ms) == Match string : Match string OR Match string - var re = /((('[^']+'|"[^"]+"|[^\s]+)\s*:\s*('[^']+'|"[^"]+"|[^\s]+))|('[^']+'|"[^"]+"|[^\s]+))/g, comparator = searchInfo.comparator || {}, sorter = searchInfo.sorter || {}, flagger = searchInfo.flags || {}, defaultKey = searchInfo.def, matches = [], sorting = [], flags = {}, operators = { - '<': function (a, b) { - return a < b; - }, - '>': function (a, b) { - return a > b; - }, - '<=': function (a, b) { - return a <= b; - }, - '>=': function (a, b) { - return a >= b; - }, - '==': function (a, b) { - return a === b; - }, - '!=': function (a, b) { - return a !== b; - } - }, comparators = { - 'text': function (obj, text) { - if (text.indexOf('!') === 0) { - return !obj.toLowerCase().includes(text.substr(1).toLowerCase()); - } - else { - return obj.toLowerCase().includes(text.toLowerCase()); - } - }, - 'date': function (obj, text) { - var obDate = moment(obj, 'DD-MMM-YYYY'), op = operatorLength(text), operator = op ? text.substr(0, op) : '==', textDate = op ? moment(text.substr(op).trim(), 'DD-MMM-YYYY') : moment(text, 'DD-MMM-YYYY'); - return !obDate.isValid() || !textDate.isValid() || operators[operator](obDate.valueOf(), textDate.valueOf()); - }, - 'boolean': function (obj, text) { - return obj === isTrue(text); - }, - 'numeric': function (obj, text) { - var op = operatorLength(text); - if (op) { - return operators[text.substr(0, op)](obj, Number(text.substr(op).trim())); - } - else { - return obj.toString().indexOf(text) > -1; - } - }, - 'true': function () { - return true; - } - }; - function isTrue(value) { - return !_.any(['f', 'fa', 'fal', 'fals', 'false', 'n', 'no', '0'], function (item) { - return item === value; - }); - } - function is(ch, chars) { - return chars.indexOf(ch) !== -1; - } - function pushObject(comparator, value) { - return { 'Col': comparator.Col, 'Comparator': comparators[comparator.Comparator], 'Value': value }; - } - function operatorLength(operator) { - var i, ops = ['<=', '<', '>=', '>', '==', '!=']; - for (i = 0; i < ops.length; i++) { - if (operator.indexOf(ops[i]) === 0) { - return ops[i].length; - } - } - return 0; - } - _(q.match(re)) - .reduce(function (accumulator, item) { - var key, value; - if (item.indexOf(':') === -1) { - key = ''; - value = item; - } - else { - key = item.substr(0, item.indexOf(':')).trim(); - value = item.substr(item.indexOf(':') + 1, item.length).trim(); - } - if (key.indexOf("'") !== -1 || key.indexOf('"') !== -1) { - key = key.substring(1, key.length - 1).trim(); - } - if (value.indexOf("'") !== -1 || value.indexOf('"') !== -1) { - value = value.substring(1, value.length - 1).trim(); - } - if (value !== '') { - accumulator.push({ Key: key, Value: value }); - } - return accumulator; - }, []) - .forEach(function (item) { - var key = item.Key, value = item.Value; - if (key === '' && value.length > 1 && is(value.charAt(0), '+-') && value.substr(1) in sorter) { - sorting.push(value.charAt(0) + sorter[value.substr(1).toLowerCase()]); - } - else { - key = key || defaultKey; - if (key in comparator) { - matches.push(pushObject(comparator[key], value)); - } - else if (key in flagger) { - flags[key] = value; - } - } - }); - return { 'q': matches, 'o': sorting, 'f': flags }; - }; - var doFilter = function (q, array, matches) { - var filterExpressions = matches.q, sortPredicates = matches.o, filterCount = filterExpressions.length; - var arrayCopy = filterCount === 0 ? array : _.filter(array, function (item) { - return _.every(filterExpressions, function (expression) { - return expression.Comparator(item[expression.Col], expression.Value); - }); - }); - arrayCopy = $filter('orderBy')(arrayCopy, sortPredicates); - return arrayCopy; - }; - return { parseFilterString: parseFilterString, doFilter: doFilter }; -} -exports.Tokenizer = Tokenizer; -//# sourceMappingURL=tokenizer.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/tokenizer.service.js.map b/brewman/static/src/app/common/tokenizer.service.js.map deleted file mode 100644 index f09abfbe..00000000 --- a/brewman/static/src/app/common/tokenizer.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tokenizer.service.js","sourceRoot":"","sources":["tokenizer.service.ts"],"names":[],"mappings":";;AAAA,+BAAiC;AACjC,0BAA4B;AAE5B,mBAA0B,OAAO;IAC7B,IAAI,iBAAiB,GAAG,UAAU,CAAC,EAAE,UAAU;QAC3C,yFAAyF;QACzF,oEAAoE;QACpE,IAAI,EAAE,GAAG,uFAAuF,EAC5F,UAAU,GAAG,UAAU,CAAC,UAAU,IAAI,EAAE,EACxC,MAAM,GAAG,UAAU,CAAC,MAAM,IAAI,EAAE,EAChC,OAAO,GAAG,UAAU,CAAC,KAAK,IAAI,EAAE,EAChC,UAAU,GAAG,UAAU,CAAC,GAAG,EAC3B,OAAO,GAAG,EAAE,EACZ,OAAO,GAAG,EAAE,EACZ,KAAK,GAAG,EAAE,EACV,SAAS,GAAG;YACR,GAAG,EAAE,UAAU,CAAC,EAAE,CAAC;gBACf,OAAO,CAAC,GAAG,CAAC,CAAC;YACjB,CAAC;YACD,GAAG,EAAE,UAAU,CAAC,EAAE,CAAC;gBACf,OAAO,CAAC,GAAG,CAAC,CAAC;YACjB,CAAC;YACD,IAAI,EAAE,UAAU,CAAC,EAAE,CAAC;gBAChB,OAAO,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC;YACD,IAAI,EAAE,UAAU,CAAC,EAAE,CAAC;gBAChB,OAAO,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC;YACD,IAAI,EAAE,UAAU,CAAC,EAAE,CAAC;gBAChB,OAAO,CAAC,KAAK,CAAC,CAAC;YACnB,CAAC;YACD,IAAI,EAAE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OAAO,CAAC,CAAC,EAC7B,cAAc,GAAG,OAAO,CAAC,CAAC,EAC1B,WAAW,GAAG,iBAAiB,CAAC,MAAM,CAAC;QAC3C,IAAI,SAAS,GAAG,WAAW,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,UAAU,IAAI;YACtE,OAAO,CAAC,CAAC,KAAK,CAAC,iBAAiB,EAAE,UAAU,UAAU;gBAClD,OAAO,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;YACzE,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QACH,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QAC1D,OAAO,SAAS,CAAC;IACrB,CAAC,CAAC;IAEF,OAAO,EAAC,iBAAiB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,EAAC,CAAC;AACtE,CAAC;AA7ID,8BA6IC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/tokenizer.service.ts b/brewman/static/src/app/common/tokenizer.service.ts deleted file mode 100644 index 75fd8127..00000000 --- a/brewman/static/src/app/common/tokenizer.service.ts +++ /dev/null @@ -1,145 +0,0 @@ -import * as moment from 'moment'; -import * as _ from 'lodash'; - -export function Tokenizer($filter) { - var parseFilterString = function (q, searchInfo) { - // '[^']+'|"[^"]+"|[^ ]+ == Match a space delimited string or quoted string. ms for short - // ((ms\s*:\s*ms)|ms) == Match string : Match string OR Match string - var re = /((('[^']+'|"[^"]+"|[^\s]+)\s*:\s*('[^']+'|"[^"]+"|[^\s]+))|('[^']+'|"[^"]+"|[^\s]+))/g, - comparator = searchInfo.comparator || {}, - sorter = searchInfo.sorter || {}, - flagger = searchInfo.flags || {}, - defaultKey = searchInfo.def, - matches = [], - sorting = [], - flags = {}, - operators = { - '<': function (a, b) { - return a < b; - }, - '>': function (a, b) { - return a > b; - }, - '<=': function (a, b) { - return a <= b; - }, - '>=': function (a, b) { - return a >= b; - }, - '==': function (a, b) { - return a === b; - }, - '!=': function (a, b) { - return a !== b; - } - }, - comparators = { - 'text': function (obj, text) { - if (text.indexOf('!') === 0) { - return !obj.toLowerCase().includes(text.substr(1).toLowerCase()); - } else { - return obj.toLowerCase().includes(text.toLowerCase()); - } - }, - 'date': function (obj, text) { - var obDate = moment(obj, 'DD-MMM-YYYY'), - op = operatorLength(text), - operator = op ? text.substr(0, op) : '==', - textDate = op ? moment(text.substr(op).trim(), 'DD-MMM-YYYY') : moment(text, 'DD-MMM-YYYY'); - return !obDate.isValid() || !textDate.isValid() || operators[operator](obDate.valueOf(), textDate.valueOf()); - }, - 'boolean': function (obj, text) { - return obj === isTrue(text); - }, - 'numeric': function (obj, text) { - var op = operatorLength(text); - if (op) { - return operators[text.substr(0, op)](obj, Number(text.substr(op).trim())); - } else { - return obj.toString().indexOf(text) > -1; - } - }, - 'true': function () { - return true; - } - }; - - function isTrue(value) { - return !_.any(['f', 'fa', 'fal', 'fals', 'false', 'n', 'no', '0'], function (item) { - return item === value; - }); - } - - function is(ch, chars) { - return chars.indexOf(ch) !== -1; - } - - function pushObject(comparator, value) { - return {'Col': comparator.Col, 'Comparator': comparators[comparator.Comparator], 'Value': value}; - } - - function operatorLength(operator) { - var i, - ops = ['<=', '<', '>=', '>', '==', '!=']; - for (i = 0; i < ops.length; i++) { - if (operator.indexOf(ops[i]) === 0) { - return ops[i].length; - } - } - return 0; - } - - _(q.match(re)) - .reduce(function (accumulator, item) { - var key, - value; - if (item.indexOf(':') === -1) { - key = ''; - value = item; - } else { - key = item.substr(0, item.indexOf(':')).trim(); - value = item.substr(item.indexOf(':') + 1, item.length).trim(); - } - if (key.indexOf("'") !== -1 || key.indexOf('"') !== -1) { - key = key.substring(1, key.length - 1).trim(); - } - if (value.indexOf("'") !== -1 || value.indexOf('"') !== -1) { - value = value.substring(1, value.length - 1).trim(); - } - if (value !== '') { - accumulator.push({Key: key, Value: value}); - } - return accumulator; - }, []) - .forEach(function (item) { - var key = item.Key, - value = item.Value; - - if (key === '' && value.length > 1 && is(value.charAt(0), '+-') && value.substr(1) in sorter) { - sorting.push(value.charAt(0) + sorter[value.substr(1).toLowerCase()]); - } else { - key = key || defaultKey; - if (key in comparator) { - matches.push(pushObject(comparator[key], value)); - } else if (key in flagger) { - flags[key] = value; - } - } - }); - return {'q': matches, 'o': sorting, 'f': flags}; - }; - var doFilter = function (q, array, matches) { - var filterExpressions = matches.q, - sortPredicates = matches.o, - filterCount = filterExpressions.length; - var arrayCopy = filterCount === 0 ? array : _.filter(array, function (item) { - return _.every(filterExpressions, function (expression) { - return expression.Comparator(item[expression.Col], expression.Value); - }); - }); - arrayCopy = $filter('orderBy')(arrayCopy, sortPredicates); - return arrayCopy; - }; - - return {parseFilterString: parseFilterString, doFilter: doFilter}; -} diff --git a/brewman/static/src/app/common/upload-image-resizer.service.js b/brewman/static/src/app/common/upload-image-resizer.service.js deleted file mode 100644 index 424a9450..00000000 --- a/brewman/static/src/app/common/upload-image-resizer.service.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var _ = require("lodash"); -function UploadedImageResizer($q, ReaderPromise) { - function resizeImage(file, MAX_WIDTH, MAX_HEIGHT) { - var image = file, canvas = document.createElement('canvas'), ctx = canvas.getContext("2d"), img = document.createElement("img"), ratio = 1; - img.src = image; - var width = img.width, height = img.height; - if (width > MAX_WIDTH) { - ratio = MAX_WIDTH / width; - } - if (height > MAX_HEIGHT && MAX_HEIGHT / height < ratio) { - ratio = MAX_HEIGHT / height; - } - if (ratio === 1) { - return file; - } - width *= ratio; - height *= ratio; - canvas.width = width; - canvas.height = height; - ctx.drawImage(img, 0, 0, width, height); - return canvas.toDataURL("image/jpeg", 0.95); - } - var ProcessUpload = function (uploadedFile, oldFiles) { - var file = { File: uploadedFile.file }, exists = _.some(oldFiles, function (value) { - return angular.equals(value.File, file.File); - }); - if (exists) { - return; - } - ReaderPromise.readAsDataURL(uploadedFile.file).then(function (result) { - file.Original = result; - file.Thumbnail = resizeImage(result, 100, 150); - file.Resized = resizeImage(result, 825, 1170); - }); - oldFiles.push(file); - }; - return ProcessUpload; -} -exports.UploadedImageResizer = UploadedImageResizer; -//# sourceMappingURL=upload-image-resizer.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/upload-image-resizer.service.js.map b/brewman/static/src/app/common/upload-image-resizer.service.js.map deleted file mode 100644 index d9f81c0b..00000000 --- a/brewman/static/src/app/common/upload-image-resizer.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"upload-image-resizer.service.js","sourceRoot":"","sources":["upload-image-resizer.service.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AACnC,0BAA4B;AAE5B,8BAAqC,EAAE,EAAE,aAAa;IAClD,qBAAqB,IAAI,EAAE,SAAS,EAAE,UAAU;QAC5C,IAAI,KAAK,GAAG,IAAI,EACZ,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,EACzC,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,EAC7B,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,EACnC,KAAK,GAAG,CAAC,CAAC;QAEd,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC;QAChB,IAAI,KAAK,GAAG,GAAG,CAAC,KAAK,EACjB,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;QAExB,IAAI,KAAK,GAAG,SAAS,EAAE;YACnB,KAAK,GAAG,SAAS,GAAG,KAAK,CAAC;SAC7B;QACD,IAAI,MAAM,GAAG,UAAU,IAAI,UAAU,GAAG,MAAM,GAAG,KAAK,EAAE;YACpD,KAAK,GAAG,UAAU,GAAG,MAAM,CAAC;SAC/B;QACD,IAAI,KAAK,KAAK,CAAC,EAAE;YACb,OAAO,IAAI,CAAC;SACf;QAED,KAAK,IAAI,KAAK,CAAC;QACf,MAAM,IAAI,KAAK,CAAC;QAEhB,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;QACrB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;QACvB,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QACxC,OAAO,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAChD,CAAC;IAED,IAAI,aAAa,GAAG,UAAU,YAAY,EAAE,QAAQ;QAChD,IAAI,IAAI,GAAO,EAAC,IAAI,EAAE,YAAY,CAAC,IAAI,EAAC,EACpC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,KAAK;YACrC,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;QAEP,IAAI,MAAM,EAAE;YACR,OAAO;SACV;QACD,aAAa,CAAC,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,MAAM;YAChE,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC;YACvB,IAAI,CAAC,SAAS,GAAG,WAAW,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;YAC/C,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;QACH,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC,CAAC;IACF,OAAO,aAAa,CAAC;AACzB,CAAC;AAhDD,oDAgDC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/upload-image-resizer.service.ts b/brewman/static/src/app/common/upload-image-resizer.service.ts deleted file mode 100644 index a16c752c..00000000 --- a/brewman/static/src/app/common/upload-image-resizer.service.ts +++ /dev/null @@ -1,52 +0,0 @@ -import * as angular from 'angular'; -import * as _ from 'lodash'; - -export function UploadedImageResizer($q, ReaderPromise) { - function resizeImage(file, MAX_WIDTH, MAX_HEIGHT) { - var image = file, - canvas = document.createElement('canvas'), - ctx = canvas.getContext("2d"), - img = document.createElement("img"), - ratio = 1; - - img.src = image; - var width = img.width, - height = img.height; - - if (width > MAX_WIDTH) { - ratio = MAX_WIDTH / width; - } - if (height > MAX_HEIGHT && MAX_HEIGHT / height < ratio) { - ratio = MAX_HEIGHT / height; - } - if (ratio === 1) { - return file; - } - - width *= ratio; - height *= ratio; - - canvas.width = width; - canvas.height = height; - ctx.drawImage(img, 0, 0, width, height); - return canvas.toDataURL("image/jpeg", 0.95); - } - - var ProcessUpload = function (uploadedFile, oldFiles) { - var file:any = {File: uploadedFile.file}, - exists = _.some(oldFiles, function (value) { - return angular.equals(value.File, file.File); - }); - - if (exists) { - return; - } - ReaderPromise.readAsDataURL(uploadedFile.file).then(function (result) { - file.Original = result; - file.Thumbnail = resizeImage(result, 100, 150); - file.Resized = resizeImage(result, 825, 1170); - }); - oldFiles.push(file); - }; - return ProcessUpload; -} diff --git a/brewman/static/src/app/common/voucher.service.js b/brewman/static/src/app/common/voucher.service.js deleted file mode 100644 index 465e6936..00000000 --- a/brewman/static/src/app/common/voucher.service.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function Voucher($resource) { - return $resource('/api/Voucher/:id', { id: '@VoucherID' }, { - post: { method: 'POST', params: { post: true } }, - save: { - method: 'POST', - headers: { 'Content-Type': undefined }, - transformRequest: function (orgData, headers) { - var data = angular.copy(orgData); - function dataURLtoBlob(dataURL) { - var re = /^data:([\w/\-\.]+);\w+,(.*)$/, m = dataURL.match(re), mimeString = m[1], byteString = atob(m[2]), ab = new ArrayBuffer(byteString.length), dw = new DataView(ab), i; - for (i = 0; i < byteString.length; i++) { - dw.setUint8(i, byteString.charCodeAt(i)); - } - return new Blob([ab], { type: mimeString }); - } - var fd = new FormData(), files = [], i; - for (i = data.Files.length - 1; i >= 0; i--) { - var item = data.Files[i]; - if (!item.ID) { - fd.append('f' + i, dataURLtoBlob(item.Resized)); - fd.append('t' + i, dataURLtoBlob(item.Thumbnail)); - data.Files.splice(i, 1); - } - } - fd.append('model', angular.toJson(data)); - return fd; - } - } - }); -} -exports.Voucher = Voucher; -//# sourceMappingURL=voucher.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/common/voucher.service.js.map b/brewman/static/src/app/common/voucher.service.js.map deleted file mode 100644 index 537bcd71..00000000 --- a/brewman/static/src/app/common/voucher.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"voucher.service.js","sourceRoot":"","sources":["voucher.service.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,iBAAwB,SAAS;IAC7B,OAAO,SAAS,CAAC,kBAAkB,EAC/B,EAAC,EAAE,EAAE,YAAY,EAAC,EAAE;QAChB,IAAI,EAAE,EAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,EAAC;QAC5C,IAAI,EAAE;YACF,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAC,cAAc,EAAE,SAAS,EAAC;YACpC,gBAAgB,EAAE,UAAU,OAAO,EAAE,OAAO;gBACxC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBAEjC,uBAAuB,OAAO;oBAC1B,IAAI,EAAE,GAAG,8BAA8B,EACnC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,EACrB,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,EACjB,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EACvB,EAAE,GAAG,IAAI,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,EACvC,EAAE,GAAG,IAAI,QAAQ,CAAC,EAAE,CAAC,EACrB,CAAC,CAAC;oBAEN,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;wBACpC,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;qBAC5C;oBACD,OAAO,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,EAAC,IAAI,EAAE,UAAU,EAAC,CAAC,CAAC;gBAC9C,CAAC;gBAED,IAAI,EAAE,GAAG,IAAI,QAAQ,EAAE,EACnB,KAAK,GAAG,EAAE,EACV,CAAC,CAAC;gBACN,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;oBACzC,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;oBACzB,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE;wBACV,EAAE,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,EAAE,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;wBAChD,EAAE,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,EAAE,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;wBAClD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;qBAC3B;iBACJ;gBACD,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;gBACzC,OAAO,EAAE,CAAC;YACd,CAAC;SACJ;KACJ,CAAC,CAAC;AACX,CAAC;AAzCD,0BAyCC"} \ No newline at end of file diff --git a/brewman/static/src/app/common/voucher.service.ts b/brewman/static/src/app/common/voucher.service.ts deleted file mode 100644 index 63bdf65a..00000000 --- a/brewman/static/src/app/common/voucher.service.ts +++ /dev/null @@ -1,44 +0,0 @@ -import * as angular from 'angular'; - -export function Voucher($resource) { - return $resource('/api/Voucher/:id', - {id: '@VoucherID'}, { - post: {method: 'POST', params: {post: true}}, - save: { - method: 'POST', - headers: {'Content-Type': undefined}, - transformRequest: function (orgData, headers) { - var data = angular.copy(orgData); - - function dataURLtoBlob(dataURL) { - var re = /^data:([\w/\-\.]+);\w+,(.*)$/, - m = dataURL.match(re), - mimeString = m[1], - byteString = atob(m[2]), - ab = new ArrayBuffer(byteString.length), - dw = new DataView(ab), - i; - - for (i = 0; i < byteString.length; i++) { - dw.setUint8(i, byteString.charCodeAt(i)); - } - return new Blob([ab], {type: mimeString}); - } - - let fd = new FormData(), - files = [], - i; - for (i = data.Files.length - 1; i >= 0; i--) { - let item = data.Files[i]; - if (!item.ID) { - fd.append('f' + i, dataURLtoBlob(item.Resized)); - fd.append('t' + i, dataURLtoBlob(item.Thumbnail)); - data.Files.splice(i, 1); - } - } - fd.append('model', angular.toJson(data)); - return fd; - } - } - }); -} diff --git a/brewman/static/src/app/cost-centre/cost-centre-detail.html b/brewman/static/src/app/cost-centre/cost-centre-detail.html deleted file mode 100644 index 9b5b8e08..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre-detail.html +++ /dev/null @@ -1,16 +0,0 @@ -
-

Cost Centre Detail

- -
- - -
- -
-
-
-
- -
-
-
diff --git a/brewman/static/src/app/cost-centre/cost-centre-list.component.js b/brewman/static/src/app/cost-centre/cost-centre-list.component.js deleted file mode 100644 index 0f31f14e..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre-list.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var cost_centre_list_controller_1 = require("./cost-centre-list.controller"); -exports.CostCentreListComponent = { - templateUrl: '/app/cost-centre/cost-centre-list.html', - controller: cost_centre_list_controller_1.CostCentreListController, - controllerAs: 'vm' -}; -//# sourceMappingURL=cost-centre-list.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/cost-centre/cost-centre-list.component.js.map b/brewman/static/src/app/cost-centre/cost-centre-list.component.js.map deleted file mode 100644 index c9ff89f6..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre-list.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cost-centre-list.component.js","sourceRoot":"","sources":["cost-centre-list.component.ts"],"names":[],"mappings":";;AAAA,6EAAuE;AAE1D,QAAA,uBAAuB,GAAG;IACnC,WAAW,EAAE,wCAAwC;IACrD,UAAU,EAAE,sDAAwB;IACpC,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/cost-centre/cost-centre-list.component.ts b/brewman/static/src/app/cost-centre/cost-centre-list.component.ts deleted file mode 100644 index 8dc04026..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre-list.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {CostCentreListController} from './cost-centre-list.controller'; - -export const CostCentreListComponent = { - templateUrl: '/app/cost-centre/cost-centre-list.html', - controller: CostCentreListController, - controllerAs: 'vm' -}; diff --git a/brewman/static/src/app/cost-centre/cost-centre-list.controller.js b/brewman/static/src/app/cost-centre/cost-centre-list.controller.js deleted file mode 100644 index 3f816705..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre-list.controller.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var CostCentreListController = /** @class */ (function () { - function CostCentreListController($scope) { - this.$scope = $scope; - this.costCentres = $scope.$parent.res.costCentres; - this.info = this.costCentres; - } - CostCentreListController.$inject = ['$scope']; - return CostCentreListController; -}()); -exports.CostCentreListController = CostCentreListController; -//# sourceMappingURL=cost-centre-list.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/cost-centre/cost-centre-list.controller.js.map b/brewman/static/src/app/cost-centre/cost-centre-list.controller.js.map deleted file mode 100644 index a51d2acc..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre-list.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cost-centre-list.controller.js","sourceRoot":"","sources":["cost-centre-list.controller.ts"],"names":[],"mappings":";;AAAA;IAKI,kCAAmB,MAAM;QAAN,WAAM,GAAN,MAAM,CAAA;QACrB,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC;IACjC,CAAC;IAPM,gCAAO,GAAG,CAAC,QAAQ,CAAC,CAAC;IAQhC,+BAAC;CAAA,AATD,IASC;AATY,4DAAwB"} \ No newline at end of file diff --git a/brewman/static/src/app/cost-centre/cost-centre-list.controller.ts b/brewman/static/src/app/cost-centre/cost-centre-list.controller.ts deleted file mode 100644 index c23afa62..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre-list.controller.ts +++ /dev/null @@ -1,10 +0,0 @@ -export class CostCentreListController { - static $inject = ['$scope']; - info: any; - costCentres: any; - - constructor(public $scope) { - this.costCentres = $scope.$parent.res.costCentres; - this.info = this.costCentres; - } -} diff --git a/brewman/static/src/app/cost-centre/cost-centre-list.html b/brewman/static/src/app/cost-centre/cost-centre-list.html deleted file mode 100644 index d93dd4ce..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre-list.html +++ /dev/null @@ -1,13 +0,0 @@ -

Cost Centres Add

- - - - - - - - - - - -
Name
{{item.Name}}
diff --git a/brewman/static/src/app/cost-centre/cost-centre-list.resolver.js b/brewman/static/src/app/cost-centre/cost-centre-list.resolver.js deleted file mode 100644 index 74cadeb0..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre-list.resolver.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function CostCentreListResolver(CostCentre) { - return CostCentre.query({}).$promise; -} -exports.CostCentreListResolver = CostCentreListResolver; -//# sourceMappingURL=cost-centre-list.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/cost-centre/cost-centre-list.resolver.js.map b/brewman/static/src/app/cost-centre/cost-centre-list.resolver.js.map deleted file mode 100644 index f4035852..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre-list.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cost-centre-list.resolver.js","sourceRoot":"","sources":["cost-centre-list.resolver.ts"],"names":[],"mappings":";;AAAA,gCAAuC,UAAU;IAC7C,OAAO,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;AACzC,CAAC;AAFD,wDAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/cost-centre/cost-centre-list.resolver.ts b/brewman/static/src/app/cost-centre/cost-centre-list.resolver.ts deleted file mode 100644 index 341c5fd6..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre-list.resolver.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function CostCentreListResolver(CostCentre) { - return CostCentre.query({}).$promise; -} diff --git a/brewman/static/src/app/cost-centre/cost-centre.component.js b/brewman/static/src/app/cost-centre/cost-centre.component.js deleted file mode 100644 index b074c0cc..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var cost_centre_controller_1 = require("./cost-centre.controller"); -exports.CostCentreComponent = { - templateUrl: '/app/cost-centre/cost-centre-detail.html', - controller: cost_centre_controller_1.CostCentreController, - controllerAs: 'vm' -}; -//# sourceMappingURL=cost-centre.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/cost-centre/cost-centre.component.js.map b/brewman/static/src/app/cost-centre/cost-centre.component.js.map deleted file mode 100644 index a5fc0355..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cost-centre.component.js","sourceRoot":"","sources":["cost-centre.component.ts"],"names":[],"mappings":";;AAAA,mEAA8D;AAEjD,QAAA,mBAAmB,GAAG;IAC/B,WAAW,EAAE,0CAA0C;IACvD,UAAU,EAAE,6CAAoB;IAChC,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/cost-centre/cost-centre.component.ts b/brewman/static/src/app/cost-centre/cost-centre.component.ts deleted file mode 100644 index ca3440ad..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {CostCentreController} from './cost-centre.controller'; - -export const CostCentreComponent = { - templateUrl: '/app/cost-centre/cost-centre-detail.html', - controller: CostCentreController, - controllerAs: 'vm' -}; \ No newline at end of file diff --git a/brewman/static/src/app/cost-centre/cost-centre.controller.js b/brewman/static/src/app/cost-centre/cost-centre.controller.js deleted file mode 100644 index 445caf37..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre.controller.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var CostCentreController = /** @class */ (function () { - function CostCentreController($scope, $routeParams, $location, Messages) { - this.$scope = $scope; - this.$routeParams = $routeParams; - this.$location = $location; - this.Messages = Messages; - this.costCentre = $scope.$parent.res.costCentre; - this.foName = true; - } - CostCentreController.prototype.save = function () { - var _this = this; - this.costCentre.$save(function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/CostCentres'); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - CostCentreController.prototype.delete = function () { - var _this = this; - this.costCentre.$delete(function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/CostCentres'); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - CostCentreController.$inject = ['$scope', '$routeParams', '$location', 'Messages']; - return CostCentreController; -}()); -exports.CostCentreController = CostCentreController; -//# sourceMappingURL=cost-centre.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/cost-centre/cost-centre.controller.js.map b/brewman/static/src/app/cost-centre/cost-centre.controller.js.map deleted file mode 100644 index 5d59f6a7..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cost-centre.controller.js","sourceRoot":"","sources":["cost-centre.controller.ts"],"names":[],"mappings":";;AAAA;IAKI,8BAAmB,MAAM,EAAS,YAAY,EAAS,SAAS,EAAS,QAAQ;QAA9D,WAAM,GAAN,MAAM,CAAA;QAAS,iBAAY,GAAZ,YAAY,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,aAAQ,GAAR,QAAQ,CAAA;QAC7E,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;QAChD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;IAED,mCAAI,GAAJ;QAAA,iBAOC;QANG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,UAAC,CAAC,EAAE,kBAAkB;YACxC,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAC,CAAC,CAAC;YACnD,KAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;QACvC,CAAC,EAAE,UAAC,IAAI,EAAE,MAAM;YACZ,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,EAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACP,CAAC;IAED,qCAAM,GAAN;QAAA,iBAOC;QANG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,UAAC,CAAC,EAAE,kBAAkB;YAC1C,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAC,CAAC,CAAC;YACnD,KAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;QACvC,CAAC,EAAE,UAAC,IAAI,EAAE,MAAM;YACZ,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,EAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACP,CAAC;IAzBM,4BAAO,GAAG,CAAC,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;IA0BzE,2BAAC;CAAA,AA3BD,IA2BC;AA3BY,oDAAoB"} \ No newline at end of file diff --git a/brewman/static/src/app/cost-centre/cost-centre.controller.ts b/brewman/static/src/app/cost-centre/cost-centre.controller.ts deleted file mode 100644 index 62d5477b..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre.controller.ts +++ /dev/null @@ -1,28 +0,0 @@ -export class CostCentreController { - static $inject = ['$scope', '$routeParams', '$location', 'Messages']; - foName: any; - costCentre: any; - - constructor(public $scope, public $routeParams, public $location, public Messages) { - this.costCentre = $scope.$parent.res.costCentre; - this.foName = true; - } - - save() { - this.costCentre.$save((u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/CostCentres') - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - delete() { - this.costCentre.$delete((u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/CostCentres') - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } -} diff --git a/brewman/static/src/app/cost-centre/cost-centre.resolver.js b/brewman/static/src/app/cost-centre/cost-centre.resolver.js deleted file mode 100644 index f9e77349..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre.resolver.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function CostCentreResolver($route, CostCentre) { - var id = $route.current.params.id; - return CostCentre.get({ id: id }).$promise; -} -exports.CostCentreResolver = CostCentreResolver; -//# sourceMappingURL=cost-centre.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/cost-centre/cost-centre.resolver.js.map b/brewman/static/src/app/cost-centre/cost-centre.resolver.js.map deleted file mode 100644 index 0d58493b..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cost-centre.resolver.js","sourceRoot":"","sources":["cost-centre.resolver.ts"],"names":[],"mappings":";;AAAA,4BAAmC,MAAM,EAAE,UAAU;IACjD,IAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IACpC,OAAO,UAAU,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;AAC7C,CAAC;AAHD,gDAGC"} \ No newline at end of file diff --git a/brewman/static/src/app/cost-centre/cost-centre.resolver.ts b/brewman/static/src/app/cost-centre/cost-centre.resolver.ts deleted file mode 100644 index 01804f2b..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre.resolver.ts +++ /dev/null @@ -1,4 +0,0 @@ -export function CostCentreResolver($route, CostCentre) { - const id = $route.current.params.id; - return CostCentre.get({id: id}).$promise; -} diff --git a/brewman/static/src/app/cost-centre/cost-centre.service.js b/brewman/static/src/app/cost-centre/cost-centre.service.js deleted file mode 100644 index acb25ba7..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre.service.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function CostCentre($resource) { - return $resource('/api/CostCentre/:id', { id: '@CostCentreID' }, { - query: { method: 'GET', params: { list: true }, isArray: true } - }); -} -exports.CostCentre = CostCentre; -//# sourceMappingURL=cost-centre.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/cost-centre/cost-centre.service.js.map b/brewman/static/src/app/cost-centre/cost-centre.service.js.map deleted file mode 100644 index a7ef96d1..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cost-centre.service.js","sourceRoot":"","sources":["cost-centre.service.ts"],"names":[],"mappings":";;AAAA,oBAA2B,SAAS;IAChC,OAAO,SAAS,CAAC,qBAAqB,EAClC,EAAC,EAAE,EAAE,eAAe,EAAC,EAAE;QACnB,KAAK,EAAE,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,EAAE,OAAO,EAAE,IAAI,EAAC;KAC9D,CAAC,CAAC;AACX,CAAC;AALD,gCAKC"} \ No newline at end of file diff --git a/brewman/static/src/app/cost-centre/cost-centre.service.ts b/brewman/static/src/app/cost-centre/cost-centre.service.ts deleted file mode 100644 index 707f91f6..00000000 --- a/brewman/static/src/app/cost-centre/cost-centre.service.ts +++ /dev/null @@ -1,6 +0,0 @@ -export function CostCentre($resource) { - return $resource('/api/CostCentre/:id', - {id: '@CostCentreID'}, { - query: {method: 'GET', params: {list: true}, isArray: true} - }); -} diff --git a/brewman/static/src/app/daybook/daybook.component.js b/brewman/static/src/app/daybook/daybook.component.js deleted file mode 100644 index 8b3f8648..00000000 --- a/brewman/static/src/app/daybook/daybook.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var daybook_controller_1 = require("./daybook.controller"); -exports.DaybookComponent = { - templateUrl: '/app/daybook/daybook.html', - controller: daybook_controller_1.DaybookController, - controllerAs: 'vm' -}; -//# sourceMappingURL=daybook.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/daybook/daybook.component.js.map b/brewman/static/src/app/daybook/daybook.component.js.map deleted file mode 100644 index 125ab41a..00000000 --- a/brewman/static/src/app/daybook/daybook.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"daybook.component.js","sourceRoot":"","sources":["daybook.component.ts"],"names":[],"mappings":";;AAAA,2DAAuD;AAE1C,QAAA,gBAAgB,GAAG;IAC5B,WAAW,EAAE,2BAA2B;IACxC,UAAU,EAAE,sCAAiB;IAC7B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/daybook/daybook.component.ts b/brewman/static/src/app/daybook/daybook.component.ts deleted file mode 100644 index 48ddcb57..00000000 --- a/brewman/static/src/app/daybook/daybook.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {DaybookController} from './daybook.controller'; - -export const DaybookComponent = { - templateUrl: '/app/daybook/daybook.html', - controller: DaybookController, - controllerAs: 'vm' -}; \ No newline at end of file diff --git a/brewman/static/src/app/daybook/daybook.controller.js b/brewman/static/src/app/daybook/daybook.controller.js deleted file mode 100644 index cd7585e0..00000000 --- a/brewman/static/src/app/daybook/daybook.controller.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var DaybookController = /** @class */ (function () { - function DaybookController($scope, $location, asDate, dateParser) { - this.$scope = $scope; - this.$location = $location; - this.asDate = asDate; - this.dateParser = dateParser; - this.info = $scope.$parent.res.info; - this._info_StartDate = dateParser.parse(this.info.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.info.FinishDate, "dd-MMM-yyyy"); - this.foDate = true; - } - DaybookController.prototype.info_StartDate = function (value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - }; - DaybookController.prototype.info_FinishDate = function (value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - }; - DaybookController.prototype.show = function () { - this.$location.path('/Daybook').search({ StartDate: this.info.StartDate, FinishDate: this.info.FinishDate }); - }; - DaybookController.$inject = ['$scope', '$location', 'asDateFilter', 'uibDateParser']; - return DaybookController; -}()); -exports.DaybookController = DaybookController; -//# sourceMappingURL=daybook.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/daybook/daybook.controller.js.map b/brewman/static/src/app/daybook/daybook.controller.js.map deleted file mode 100644 index 114a6f09..00000000 --- a/brewman/static/src/app/daybook/daybook.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"daybook.controller.js","sourceRoot":"","sources":["daybook.controller.ts"],"names":[],"mappings":";;AAEA;IAOI,2BAAmB,MAAM,EAAS,SAAS,EAAS,MAAM,EAAS,UAAU;QAA1D,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QACzE,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;QACpC,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QAC5E,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;QAC9E,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;IAED,0CAAc,GAAd,UAAe,KAAK;QAChB,IAAI,SAAS,CAAC,MAAM,EAAE;YAClB,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACzC,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;SAChC;QACD,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED,2CAAe,GAAf,UAAgB,KAAK;QACjB,IAAI,SAAS,CAAC,MAAM,EAAE;YAClB,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC1C,IAAI,CAAE,gBAAgB,GAAG,KAAK,CAAC;SAClC;QACD,OAAO,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IAED,gCAAI,GAAJ;QACI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,EAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAC,CAAC,CAAC;IAC/G,CAAC;IA/BM,yBAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC;IAgC9E,wBAAC;CAAA,AAjCD,IAiCC;AAjCY,8CAAiB"} \ No newline at end of file diff --git a/brewman/static/src/app/daybook/daybook.controller.ts b/brewman/static/src/app/daybook/daybook.controller.ts deleted file mode 100644 index 9d3d75fc..00000000 --- a/brewman/static/src/app/daybook/daybook.controller.ts +++ /dev/null @@ -1,36 +0,0 @@ -import * as angular from 'angular'; - -export class DaybookController { - static $inject = ['$scope', '$location', 'asDateFilter', 'uibDateParser']; - _info_StartDate:any; - _info_FinishDate:any; - foDate:boolean; - info:any; - - constructor(public $scope, public $location, public asDate, public dateParser) { - this.info = $scope.$parent.res.info; - this._info_StartDate = dateParser.parse(this.info.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.info.FinishDate, "dd-MMM-yyyy"); - this.foDate = true; - } - - info_StartDate(value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - } - - info_FinishDate(value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this. _info_FinishDate = value; - } - return this._info_FinishDate; - } - - show() { - this.$location.path('/Daybook').search({StartDate: this.info.StartDate, FinishDate: this.info.FinishDate}); - } -} diff --git a/brewman/static/src/app/daybook/daybook.html b/brewman/static/src/app/daybook/daybook.html deleted file mode 100644 index 8db1728b..00000000 --- a/brewman/static/src/app/daybook/daybook.html +++ /dev/null @@ -1,55 +0,0 @@ -
-

Daybook

- -
- - -
-
- - - - -
-
-
-
- - - - -
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - -
DateTypeNarrationDebitAmountCreditAmount
{{item.Date}}{{item.Type}}{{item.Narration}}{{item.DebitN}}{{item.DebitA | currency}}{{item.CreditN}}{{item.CreditA | currency}}
-
diff --git a/brewman/static/src/app/daybook/daybook.resolver.js b/brewman/static/src/app/daybook/daybook.resolver.js deleted file mode 100644 index ef97a4f7..00000000 --- a/brewman/static/src/app/daybook/daybook.resolver.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function DaybookResolver($route, Daybook) { - var startDate = $route.current.params.StartDate, finishDate = $route.current.params.FinishDate; - if (angular.isUndefined(startDate) || angular.isUndefined(finishDate)) { - return Daybook.get({}).$promise; - } - else { - return Daybook.get({ StartDate: startDate, FinishDate: finishDate }).$promise; - } -} -exports.DaybookResolver = DaybookResolver; -//# sourceMappingURL=daybook.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/daybook/daybook.resolver.js.map b/brewman/static/src/app/daybook/daybook.resolver.js.map deleted file mode 100644 index d41b7df8..00000000 --- a/brewman/static/src/app/daybook/daybook.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"daybook.resolver.js","sourceRoot":"","sources":["daybook.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,yBAAgC,MAAM,EAAE,OAAO;IAC3C,IAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAC7C,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;IAElD,IAAI,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE;QACnE,OAAO,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;KACnC;SAAM;QACH,OAAO,OAAO,CAAC,GAAG,CAAC,EAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAC,CAAC,CAAC,QAAQ,CAAC;KAC/E;AACL,CAAC;AATD,0CASC"} \ No newline at end of file diff --git a/brewman/static/src/app/daybook/daybook.resolver.ts b/brewman/static/src/app/daybook/daybook.resolver.ts deleted file mode 100644 index dd7a5055..00000000 --- a/brewman/static/src/app/daybook/daybook.resolver.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as angular from 'angular'; - -export function DaybookResolver($route, Daybook) { - const startDate = $route.current.params.StartDate, - finishDate = $route.current.params.FinishDate; - - if (angular.isUndefined(startDate) || angular.isUndefined(finishDate)) { - return Daybook.get({}).$promise; - } else { - return Daybook.get({StartDate: startDate, FinishDate: finishDate}).$promise; - } -} diff --git a/brewman/static/src/app/daybook/daybook.service.js b/brewman/static/src/app/daybook/daybook.service.js deleted file mode 100644 index 9957a3b8..00000000 --- a/brewman/static/src/app/daybook/daybook.service.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function Daybook($resource) { - return $resource('/api/Daybook'); -} -exports.Daybook = Daybook; -//# sourceMappingURL=daybook.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/daybook/daybook.service.js.map b/brewman/static/src/app/daybook/daybook.service.js.map deleted file mode 100644 index 7878de59..00000000 --- a/brewman/static/src/app/daybook/daybook.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"daybook.service.js","sourceRoot":"","sources":["daybook.service.ts"],"names":[],"mappings":";;AAAA,iBAAwB,SAAS;IAC7B,OAAO,SAAS,CAAC,cAAc,CAAC,CAAC;AACrC,CAAC;AAFD,0BAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/daybook/daybook.service.ts b/brewman/static/src/app/daybook/daybook.service.ts deleted file mode 100644 index 67637ee2..00000000 --- a/brewman/static/src/app/daybook/daybook.service.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function Daybook($resource) { - return $resource('/api/Daybook'); -} diff --git a/brewman/static/src/app/employee/employee-attendance-info.resolver.js b/brewman/static/src/app/employee/employee-attendance-info.resolver.js deleted file mode 100644 index 73123ac5..00000000 --- a/brewman/static/src/app/employee/employee-attendance-info.resolver.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function EmployeeAttendanceInfoResolver($route, EmployeeAttendance) { - var id = $route.current.params.id, startDate = $route.current.params.StartDate, finishDate = $route.current.params.FinishDate; - if (angular.isUndefined(id)) { - return EmployeeAttendance.get({}).$promise; - } - else { - return EmployeeAttendance.get({ id: id, StartDate: startDate, FinishDate: finishDate }).$promise; - } -} -exports.EmployeeAttendanceInfoResolver = EmployeeAttendanceInfoResolver; -//# sourceMappingURL=employee-attendance-info.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee-attendance-info.resolver.js.map b/brewman/static/src/app/employee/employee-attendance-info.resolver.js.map deleted file mode 100644 index 5b1d87c3..00000000 --- a/brewman/static/src/app/employee/employee-attendance-info.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"employee-attendance-info.resolver.js","sourceRoot":"","sources":["employee-attendance-info.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,wCAA+C,MAAM,EAAE,kBAAkB;IACrE,IAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAC/B,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAC3C,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;IAElD,IAAI,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;QACzB,OAAO,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;KAC9C;SAAM;QACH,OAAO,kBAAkB,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAC,CAAC,CAAC,QAAQ,CAAC;KAClG;AACL,CAAC;AAVD,wEAUC"} \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee-attendance-info.resolver.ts b/brewman/static/src/app/employee/employee-attendance-info.resolver.ts deleted file mode 100644 index 24327b5c..00000000 --- a/brewman/static/src/app/employee/employee-attendance-info.resolver.ts +++ /dev/null @@ -1,13 +0,0 @@ -import * as angular from 'angular'; - -export function EmployeeAttendanceInfoResolver($route, EmployeeAttendance) { - const id = $route.current.params.id, - startDate = $route.current.params.StartDate, - finishDate = $route.current.params.FinishDate; - - if (angular.isUndefined(id)) { - return EmployeeAttendance.get({}).$promise; - } else { - return EmployeeAttendance.get({id: id, StartDate: startDate, FinishDate: finishDate}).$promise; - } -} diff --git a/brewman/static/src/app/employee/employee-attendance-sub.directive.js b/brewman/static/src/app/employee/employee-attendance-sub.directive.js deleted file mode 100644 index 12d8346e..00000000 --- a/brewman/static/src/app/employee/employee-attendance-sub.directive.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var attendance_sub_controller_1 = require("../attendance/attendance-sub.controller"); -function EmployeeAttendanceSubDirective() { - return { - scope: { - item: '=employeeAttendanceSub', - attendanceTypes: '=attendanceTypes' - }, - restrict: 'A', - templateUrl: '/app/employee/employee-attendance-sub.html', - controller: attendance_sub_controller_1.AttendanceSubController, - controllerAs: 'vmSub', - }; -} -exports.EmployeeAttendanceSubDirective = EmployeeAttendanceSubDirective; -//# sourceMappingURL=employee-attendance-sub.directive.js.map \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee-attendance-sub.directive.js.map b/brewman/static/src/app/employee/employee-attendance-sub.directive.js.map deleted file mode 100644 index cc6c4631..00000000 --- a/brewman/static/src/app/employee/employee-attendance-sub.directive.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"employee-attendance-sub.directive.js","sourceRoot":"","sources":["employee-attendance-sub.directive.ts"],"names":[],"mappings":";;AAAA,qFAAgF;AAEhF;IACI,OAAO;QACH,KAAK,EAAE;YACH,IAAI,EAAE,wBAAwB;YAC9B,eAAe,EAAE,kBAAkB;SACtC;QACD,QAAQ,EAAE,GAAG;QACb,WAAW,EAAE,4CAA4C;QACzD,UAAU,EAAE,mDAAuB;QACnC,YAAY,EAAE,OAAO;KACxB,CAAC;AACN,CAAC;AAXD,wEAWC"} \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee-attendance-sub.directive.ts b/brewman/static/src/app/employee/employee-attendance-sub.directive.ts deleted file mode 100644 index 010aa7d5..00000000 --- a/brewman/static/src/app/employee/employee-attendance-sub.directive.ts +++ /dev/null @@ -1,14 +0,0 @@ -import {AttendanceSubController} from "../attendance/attendance-sub.controller"; - -export function EmployeeAttendanceSubDirective() { - return { - scope: { - item: '=employeeAttendanceSub', - attendanceTypes: '=attendanceTypes' - }, - restrict: 'A', - templateUrl: '/app/employee/employee-attendance-sub.html', - controller: AttendanceSubController, - controllerAs: 'vmSub', - }; -} diff --git a/brewman/static/src/app/employee/employee-attendance-sub.html b/brewman/static/src/app/employee/employee-attendance-sub.html deleted file mode 100644 index 6df01970..00000000 --- a/brewman/static/src/app/employee/employee-attendance-sub.html +++ /dev/null @@ -1,12 +0,0 @@ -{{item.Date}} - - - - -{{item.Prints}} {{item.Hours}} - - - - diff --git a/brewman/static/src/app/employee/employee-attendance.component.js b/brewman/static/src/app/employee/employee-attendance.component.js deleted file mode 100644 index 7a6fcbf3..00000000 --- a/brewman/static/src/app/employee/employee-attendance.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var employee_attendance_controller_1 = require("./employee-attendance.controller"); -exports.EmployeeAttendanceComponent = { - templateUrl: '/app/employee/employee-attendance.html', - controller: employee_attendance_controller_1.EmployeeAttendanceController, - controllerAs: 'vm', -}; -//# sourceMappingURL=employee-attendance.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee-attendance.component.js.map b/brewman/static/src/app/employee/employee-attendance.component.js.map deleted file mode 100644 index 8ef0aa2b..00000000 --- a/brewman/static/src/app/employee/employee-attendance.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"employee-attendance.component.js","sourceRoot":"","sources":["employee-attendance.component.ts"],"names":[],"mappings":";;AAAA,mFAA8E;AAEjE,QAAA,2BAA2B,GAAG;IACvC,WAAW,EAAE,wCAAwC;IACrD,UAAU,EAAE,6DAA4B;IACxC,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee-attendance.component.ts b/brewman/static/src/app/employee/employee-attendance.component.ts deleted file mode 100644 index a0120d77..00000000 --- a/brewman/static/src/app/employee/employee-attendance.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {EmployeeAttendanceController} from './employee-attendance.controller'; - -export const EmployeeAttendanceComponent = { - templateUrl: '/app/employee/employee-attendance.html', - controller: EmployeeAttendanceController, - controllerAs: 'vm', -}; \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee-attendance.controller.js b/brewman/static/src/app/employee/employee-attendance.controller.js deleted file mode 100644 index bdd033e3..00000000 --- a/brewman/static/src/app/employee/employee-attendance.controller.js +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var EmployeeAttendanceController = /** @class */ (function () { - function EmployeeAttendanceController($scope, $location, $routeParams, asDate, EmployeeAttendance, Employee, dateParser, Messages) { - this.$scope = $scope; - this.$location = $location; - this.$routeParams = $routeParams; - this.asDate = asDate; - this.EmployeeAttendance = EmployeeAttendance; - this.Employee = Employee; - this.dateParser = dateParser; - this.Messages = Messages; - this.attendanceTypes = $scope.$parent.res.attendanceTypes; - this.info = $scope.$parent.res.info; - this._info_StartDate = dateParser.parse(this.info.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.info.FinishDate, "dd-MMM-yyyy"); - this.foEmployee = true; - } - EmployeeAttendanceController.prototype.info_StartDate = function (value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - }; - EmployeeAttendanceController.prototype.info_FinishDate = function (value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - }; - EmployeeAttendanceController.prototype.show = function () { - var _this = this; - var id = this.info.Employee.LedgerID; - if (id === this.$routeParams.id && this.info.StartDate === this.$routeParams.StartDate && this.info.FinishDate === this.$routeParams.FinishDate) { - this.EmployeeAttendance.get({ - id: id, - StartDate: this.info.StartDate, - FinishDate: this.info.FinishDate - }, function (data) { - _this.info = data; - }); - } - else { - this.$location.path('/EmployeeAttendance/' + id).search({ - StartDate: this.info.StartDate, - FinishDate: this.info.FinishDate - }); - } - }; - EmployeeAttendanceController.prototype.employees = function ($viewValue) { - return this.Employee.autocomplete({ term: $viewValue, count: 20 }).$promise; - }; - EmployeeAttendanceController.prototype.save = function () { - var _this = this; - return this.info.$save(function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: 'Saved!' }); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - EmployeeAttendanceController.$inject = ['$scope', '$location', '$routeParams', 'asDateFilter', 'EmployeeAttendance', 'Employee', 'uibDateParser', 'Messages']; - return EmployeeAttendanceController; -}()); -exports.EmployeeAttendanceController = EmployeeAttendanceController; -//# sourceMappingURL=employee-attendance.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee-attendance.controller.js.map b/brewman/static/src/app/employee/employee-attendance.controller.js.map deleted file mode 100644 index bfe96463..00000000 --- a/brewman/static/src/app/employee/employee-attendance.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"employee-attendance.controller.js","sourceRoot":"","sources":["employee-attendance.controller.ts"],"names":[],"mappings":";;AAAA;IASI,sCAAmB,MAAM,EAAS,SAAS,EAAS,YAAY,EAAS,MAAM,EAAS,kBAAkB,EAAS,QAAQ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CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,EAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACP,CAAC;IA7DM,oCAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,oBAAoB,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;IA8D5I,mCAAC;CAAA,AA/DD,IA+DC;AA/DY,oEAA4B"} \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee-attendance.controller.ts b/brewman/static/src/app/employee/employee-attendance.controller.ts deleted file mode 100644 index 0d200ff6..00000000 --- a/brewman/static/src/app/employee/employee-attendance.controller.ts +++ /dev/null @@ -1,64 +0,0 @@ -export class EmployeeAttendanceController { - static $inject = ['$scope', '$location', '$routeParams', 'asDateFilter', 'EmployeeAttendance', 'Employee', 'uibDateParser', 'Messages']; - _info_StartDate: any; - _info_FinishDate: any; - foEmployee: boolean; - item: any; - attendanceTypes: any; - info: any; - - constructor(public $scope, public $location, public $routeParams, public asDate, public EmployeeAttendance, public Employee, public dateParser, public Messages) { - this.attendanceTypes = $scope.$parent.res.attendanceTypes; - this.info = $scope.$parent.res.info; - this._info_StartDate = dateParser.parse(this.info.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.info.FinishDate, "dd-MMM-yyyy"); - this.foEmployee = true; - } - - info_StartDate(value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - } - - info_FinishDate(value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - } - - show() { - const id = this.info.Employee.LedgerID; - if (id === this.$routeParams.id && this.info.StartDate === this.$routeParams.StartDate && this.info.FinishDate === this.$routeParams.FinishDate) { - this.EmployeeAttendance.get({ - id: id, - StartDate: this.info.StartDate, - FinishDate: this.info.FinishDate - }, (data) => { - this.info = data; - }); - } - else { - this.$location.path('/EmployeeAttendance/' + id).search({ - StartDate: this.info.StartDate, - FinishDate: this.info.FinishDate - }); - } - } - - employees($viewValue) { - return this.Employee.autocomplete({term: $viewValue, count: 20}).$promise; - } - - save() { - return this.info.$save((u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: 'Saved!'}); - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } -} diff --git a/brewman/static/src/app/employee/employee-attendance.html b/brewman/static/src/app/employee/employee-attendance.html deleted file mode 100644 index 2c2fadf6..00000000 --- a/brewman/static/src/app/employee/employee-attendance.html +++ /dev/null @@ -1,64 +0,0 @@ -
-

Employee Attendance

- -
- - -
-
- - - - -
-
-
-
- - - - -
-
-
-
- - -
-
- - - - -
-
-
- - - - - - - - - - - - - -
DateStatusPrintsisDirty
-
-
- -
-
-
diff --git a/brewman/static/src/app/employee/employee-attendance.service.js b/brewman/static/src/app/employee/employee-attendance.service.js deleted file mode 100644 index c5ece99e..00000000 --- a/brewman/static/src/app/employee/employee-attendance.service.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function EmployeeAttendance($resource) { - return $resource('/api/EmployeeAttendance/:id', { id: '@Employee.LedgerID' }); -} -exports.EmployeeAttendance = EmployeeAttendance; -//# sourceMappingURL=employee-attendance.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee-attendance.service.js.map b/brewman/static/src/app/employee/employee-attendance.service.js.map deleted file mode 100644 index 1dcc0369..00000000 --- a/brewman/static/src/app/employee/employee-attendance.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"employee-attendance.service.js","sourceRoot":"","sources":["employee-attendance.service.ts"],"names":[],"mappings":";;AAAA,4BAAmC,SAAS;IACxC,OAAO,SAAS,CAAC,6BAA6B,EAAE,EAAC,EAAE,EAAE,oBAAoB,EAAC,CAAC,CAAC;AAChF,CAAC;AAFD,gDAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee-attendance.service.ts b/brewman/static/src/app/employee/employee-attendance.service.ts deleted file mode 100644 index a864c7e0..00000000 --- a/brewman/static/src/app/employee/employee-attendance.service.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function EmployeeAttendance($resource) { - return $resource('/api/EmployeeAttendance/:id', {id: '@Employee.LedgerID'}); -} diff --git a/brewman/static/src/app/employee/employee-detail.html b/brewman/static/src/app/employee/employee-detail.html deleted file mode 100644 index c3a6b8b6..00000000 --- a/brewman/static/src/app/employee/employee-detail.html +++ /dev/null @@ -1,91 +0,0 @@ -
-

Employee Detail

- -
- - -
- -
-
-
- - -
- -
-
-
- - -
- -
-
-
- - -
- -
-
-
- - -
- -
-
-
-
-
- -
-
-
-
- - -
- - -
-
-
- - -
-
- - - - -
-
-
-
- - -
-
- - - - -
-
-
-
-
- - -
-
-
diff --git a/brewman/static/src/app/employee/employee-functions.component.js b/brewman/static/src/app/employee/employee-functions.component.js deleted file mode 100644 index 12986230..00000000 --- a/brewman/static/src/app/employee/employee-functions.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var employee_functions_controller_1 = require("./employee-functions.controller"); -exports.EmployeeFunctionsComponent = { - templateUrl: '/app/employee/employee-functions.html', - controller: employee_functions_controller_1.EmployeeFunctionsController, - controllerAs: 'vm', -}; -//# sourceMappingURL=employee-functions.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee-functions.component.js.map b/brewman/static/src/app/employee/employee-functions.component.js.map deleted file mode 100644 index eb2dd67e..00000000 --- a/brewman/static/src/app/employee/employee-functions.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"employee-functions.component.js","sourceRoot":"","sources":["employee-functions.component.ts"],"names":[],"mappings":";;AAAA,iFAA4E;AAE/D,QAAA,0BAA0B,GAAG;IACtC,WAAW,EAAE,uCAAuC;IACpD,UAAU,EAAE,2DAA2B;IACvC,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee-functions.component.ts b/brewman/static/src/app/employee/employee-functions.component.ts deleted file mode 100644 index 7f1b5a8a..00000000 --- a/brewman/static/src/app/employee/employee-functions.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {EmployeeFunctionsController} from './employee-functions.controller'; - -export const EmployeeFunctionsComponent = { - templateUrl: '/app/employee/employee-functions.html', - controller: EmployeeFunctionsController, - controllerAs: 'vm', -}; \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee-functions.controller.js b/brewman/static/src/app/employee/employee-functions.controller.js deleted file mode 100644 index 1cb6440e..00000000 --- a/brewman/static/src/app/employee/employee-functions.controller.js +++ /dev/null @@ -1,72 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var EmployeeFunctionsController = /** @class */ (function () { - function EmployeeFunctionsController($scope, $http, asDate, Messages) { - this.$scope = $scope; - this.$http = $http; - this.asDate = asDate; - this.Messages = Messages; - this._record_StartDate = undefined; - this._record_FinishDate = undefined; - this.record = {}; - } - EmployeeFunctionsController.prototype.record_StartDate = function (value) { - if (arguments.length) { - this.record.StartDate = this.asDate(value); - this._record_StartDate = value; - } - return this._record_StartDate; - }; - EmployeeFunctionsController.prototype.record_FinishDate = function (value) { - if (arguments.length) { - this.record.FinishDate = this.asDate(value); - this._record_FinishDate = value; - } - return this._record_FinishDate; - }; - EmployeeFunctionsController.prototype.creditSalary = function () { - var _this = this; - if (!angular.isDate(this.salaryMonth)) { - return; - } - return this.$http.post('/api/CreditSalary', { Month: this.asDate(this.salaryMonth) }).success(function (data) { - _this.Messages.push({ Type: 'Success', Message: data.message }); - }).error(function (errorMessage) { - _this.Messages.push({ Type: 'Danger', Message: errorMessage }); - }); - }; - EmployeeFunctionsController.prototype.attendanceRecordUrl = function () { - if (!this.record.StartDate || !this.record.FinishDate) { - return; - } - return '/AttendanceReport?StartDate=' + this.record.StartDate + "&FinishDate=" + this.record.FinishDate; - }; - EmployeeFunctionsController.prototype.setFile = function (element) { - this.uploadedFile = element.files[0]; - }; - EmployeeFunctionsController.prototype.uploadFingerprints = function () { - var _this = this; - if (!this.uploadedFile) { - this.Messages.push({ Type: 'Danger', Message: 'Please choose a file first!' }); - return; - } - var fd = new FormData(); - fd.append("uploadedFile", this.uploadedFile); - return this.$http - .post('/api/Fingerprint', fd, { - headers: { - 'Content-Type': undefined - }, - transformRequest: angular.identity - }).success(function () { - _this.Messages.push({ Type: 'Success', Message: 'Data uploaded' }); - }).error(function (data) { - _this.Messages.push({ Type: 'Danger', Message: data }); - }); - }; - EmployeeFunctionsController.$inject = ['$scope', '$http', 'asDateFilter', 'Messages']; - return EmployeeFunctionsController; -}()); -exports.EmployeeFunctionsController = EmployeeFunctionsController; -//# sourceMappingURL=employee-functions.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee-functions.controller.js.map b/brewman/static/src/app/employee/employee-functions.controller.js.map deleted file mode 100644 index c8ab7588..00000000 --- a/brewman/static/src/app/employee/employee-functions.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"employee-functions.controller.js","sourceRoot":"","sources":["employee-functions.controller.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC;IAQI,qCAAmB,MAAM,EAAS,KAAK,EAAS,MAAM,EAAS,QAAQ;QAApD,WAAM,GAAN,MAAM,CAAA;QAAS,UAAK,GAAL,KAAK,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,aAAQ,GAAR,QAAQ,CAAA;QACnE,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC;QACnC,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;IACrB,CAAC;IAED,sDAAgB,GAAhB,UAAiB,KAAK;QAClB,IAAI,SAAS,CAAC,MAAM,EAAE;YAClB,IAAI,CAAC,MAAM,CAAC,S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MAAM,CAAC,UAAU,CAAC;IAC5G,CAAC;IAED,6CAAO,GAAP,UAAQ,OAAO;QACX,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;IAED,wDAAkB,GAAlB;QAAA,iBAkBC;QAjBG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACpB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,6BAA6B,EAAC,CAAC,CAAC;YAC7E,OAAO;SACV;QACD,IAAI,EAAE,GAAG,IAAI,QAAQ,EAAE,CAAC;QACxB,EAAE,CAAC,MAAM,CAAC,cAAc,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAC7C,OAAO,IAAI,CAAC,KAAK;aACZ,IAAI,CAAC,kBAAkB,EAAE,EAAE,EAAE;YAC1B,OAAO,EAAE;gBACL,cAAc,EAAE,SAAS;aAC5B;YACD,gBAAgB,EAAE,OAAO,CAAC,QAAQ;SACrC,CAAC,CAAC,OAAO,CAAC;YACP,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAC,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC,KAAK,CAAC,UAAC,IAAI;YACV,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACX,CAAC;IArEM,mCAAO,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC;IAsErE,kCAAC;CAAA,AAvED,IAuEC;AAvEY,kEAA2B"} \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee-functions.controller.ts b/brewman/static/src/app/employee/employee-functions.controller.ts deleted file mode 100644 index bf47ce9c..00000000 --- a/brewman/static/src/app/employee/employee-functions.controller.ts +++ /dev/null @@ -1,74 +0,0 @@ -import * as angular from 'angular'; - -export class EmployeeFunctionsController { - static $inject = ['$scope', '$http', 'asDateFilter', 'Messages']; - _record_StartDate: any; - _record_FinishDate: any; - record: any; - uploadedFile: any; - salaryMonth: any; - - constructor(public $scope, public $http, public asDate, public Messages) { - this._record_StartDate = undefined; - this._record_FinishDate = undefined; - this.record = {}; - } - - record_StartDate(value) { - if (arguments.length) { - this.record.StartDate = this.asDate(value); - this._record_StartDate = value; - } - return this._record_StartDate; - } - - record_FinishDate(value) { - if (arguments.length) { - this.record.FinishDate = this.asDate(value); - this._record_FinishDate = value; - } - return this._record_FinishDate; - } - - creditSalary() { - if (!angular.isDate(this.salaryMonth)) { - return; - } - return this.$http.post('/api/CreditSalary', {Month: this.asDate(this.salaryMonth)}).success((data) => { - this.Messages.push({Type: 'Success', Message: data.message}); - }).error((errorMessage) => { - this.Messages.push({Type: 'Danger', Message: errorMessage}); - }); - } - - attendanceRecordUrl() { - if (!this.record.StartDate || !this.record.FinishDate) { - return; - } - return '/AttendanceReport?StartDate=' + this.record.StartDate + "&FinishDate=" + this.record.FinishDate; - } - - setFile(element) { - this.uploadedFile = element.files[0]; - } - - uploadFingerprints() { - if (!this.uploadedFile) { - this.Messages.push({Type: 'Danger', Message: 'Please choose a file first!'}); - return; - } - let fd = new FormData(); - fd.append("uploadedFile", this.uploadedFile); - return this.$http - .post('/api/Fingerprint', fd, { - headers: { - 'Content-Type': undefined - }, - transformRequest: angular.identity - }).success(() => { - this.Messages.push({Type: 'Success', Message: 'Data uploaded'}); - }).error((data) => { - this.Messages.push({Type: 'Danger', Message: data}); - }); - } -} diff --git a/brewman/static/src/app/employee/employee-functions.html b/brewman/static/src/app/employee/employee-functions.html deleted file mode 100644 index 775bd30e..00000000 --- a/brewman/static/src/app/employee/employee-functions.html +++ /dev/null @@ -1,70 +0,0 @@ -
-

Credit Salary

- -
- - -
-
- - - - -
-
-
- -
-
-

Attendance Record

- -
- - -
-
- - - - -
-
-
-
- - - - -
-
- -
- -

Upload Fingerprints

- -
- - -
-
- - -
- -
-
-
-
-
diff --git a/brewman/static/src/app/employee/employee-list.component.js b/brewman/static/src/app/employee/employee-list.component.js deleted file mode 100644 index 61677b59..00000000 --- a/brewman/static/src/app/employee/employee-list.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var employee_list_controller_1 = require("./employee-list.controller"); -exports.EmployeeListComponent = { - templateUrl: '/app/employee/employee-list.html', - controller: employee_list_controller_1.EmployeeListController, - controllerAs: 'vm' -}; -//# sourceMappingURL=employee-list.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee-list.component.js.map b/brewman/static/src/app/employee/employee-list.component.js.map deleted file mode 100644 index 370238fc..00000000 --- a/brewman/static/src/app/employee/employee-list.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"employee-list.component.js","sourceRoot":"","sources":["employee-list.component.ts"],"names":[],"mappings":";;AAAA,uEAAkE;AAErD,QAAA,qBAAqB,GAAG;IACjC,WAAW,EAAE,kCAAkC;IAC/C,UAAU,EAAE,iDAAsB;IAClC,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee-list.component.ts b/brewman/static/src/app/employee/employee-list.component.ts deleted file mode 100644 index 7734097e..00000000 --- a/brewman/static/src/app/employee/employee-list.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {EmployeeListController} from './employee-list.controller'; - -export const EmployeeListComponent = { - templateUrl: '/app/employee/employee-list.html', - controller: EmployeeListController, - controllerAs: 'vm' -}; diff --git a/brewman/static/src/app/employee/employee-list.controller.js b/brewman/static/src/app/employee/employee-list.controller.js deleted file mode 100644 index c137e56b..00000000 --- a/brewman/static/src/app/employee/employee-list.controller.js +++ /dev/null @@ -1,85 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var _ = require("lodash"); -var $ = require("jquery"); -var EmployeeListController = /** @class */ (function () { - function EmployeeListController($scope, $location, $routeParams, Tokenizer) { - var _this = this; - this.$scope = $scope; - this.$location = $location; - this.$routeParams = $routeParams; - this.Tokenizer = Tokenizer; - this.employees = $scope.$parent.res.employees; - this.search = $routeParams.q || ''; - this.info = this.employees; - $scope.$watch('vm.search', function (newValue, oldValue) { - _this.filterEmployees(newValue); - }, true); - $scope.$on('$destroy', function () { - Tokenizer.doFilter.cache = {}; - }); - this.searchInfo = { - comparator: { - 'n': { 'Col': 'Name', 'Comparator': 'text' }, - 'c': { 'Col': 'Code', 'Comparator': 'numeric' }, - 's': { 'Col': 'Salary', 'Comparator': 'numeric' }, - 'a': { 'Col': 'IsActive', 'Comparator': 'boolean' }, - 'des': { 'Col': 'Designation', 'Comparator': 'text' }, - 'dep': { 'Col': 'CostCentre', 'Comparator': 'text' } - }, - def: 'n', - sorter: { - 'n': 'Name', - 'c': 'Code', - 's': 'Salary', - 'a': 'IsActive', - 'des': 'Designation', - 'dep': 'CostCentre' - } - }; - this.filterEmployees = _.debounce(function (q) { - if (q !== $scope._search) { - $scope._search = q; - if (angular.isUndefined(q) || q === '') { - _this.$location.path('/Employees').search('q', null).replace(); - } - else { - _this.$location.path('/Employees').search({ 'q': q }).replace(); - } - $scope.$apply(function () { - var matches = Tokenizer.parseFilterString(q, _this.searchInfo); - _this.employees = Tokenizer.doFilter(q, _this.info, matches); - }); - } - }, 350); - this.selected = -1; - this.shortcuts = { - 'up': function (e) { - if (_this.selected > 0) { - $scope.$apply(function () { - _this.selected = Math.min(Math.max(0, _this.selected - 1), _this.employees.length - 1); - }); - $("#" + _this.selected).scrollintoview(); - e.preventDefault(); - } - }, - 'down': function (e) { - if (_this.selected < _this.employees.length - 1) { - $scope.$apply(function () { - _this.selected = Math.min(Math.max(0, _this.selected + 1), _this.employees.length - 1); - }); - $("#" + _this.selected).scrollintoview(); - e.preventDefault(); - } - } - }; - } - EmployeeListController.prototype.setSelected = function (index) { - this.selected = Math.min(Math.max(0, index), this.employees.length - 1); - }; - EmployeeListController.$inject = ['$scope', '$location', '$routeParams', 'Tokenizer']; - return EmployeeListController; -}()); -exports.EmployeeListController = EmployeeListController; -//# sourceMappingURL=employee-list.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee-list.controller.js.map b/brewman/static/src/app/employee/employee-list.controller.js.map deleted file mode 100644 index 1e676134..00000000 --- a/brewman/static/src/app/employee/employee-list.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"employee-list.controller.js","sourceRoot":"","sources":["employee-list.controller.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AACnC,0BAA4B;AAC5B,0BAA4B;AAE5B;IAUI,gCAAmB,MAAM,EAAS,SAAS,EAAS,YAAY,EAAS,SAAS;QAAlF,iBAoEC;QApEkB,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,iBAAY,GAAZ,YAAY,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAC9E,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC,CAAC,IAAI,EAAE,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC;QAC3B,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,UAAC,QAAQ,EAAE,QAAQ;YAC1C,KAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QACnC,CAAC,EAAE,IAAI,CAAC,CAAC;QAET,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE;YACnB,SAAS,CAAC,QAAQ,CAAC,KAAK,GAAG,EAAE,CAAC;QAClC,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,UAAU,GAAG;YACd,UAAU,EAAE;gBACR,GAAG,EAAE,EAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM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4CAAW,GAAX,UAAY,KAAK;QACb,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC5E,CAAC;IAjFM,8BAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;IAkF1E,6BAAC;CAAA,AAnFD,IAmFC;AAnFY,wDAAsB"} \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee-list.controller.ts b/brewman/static/src/app/employee/employee-list.controller.ts deleted file mode 100644 index ca3e8adb..00000000 --- a/brewman/static/src/app/employee/employee-list.controller.ts +++ /dev/null @@ -1,88 +0,0 @@ -import * as angular from 'angular'; -import * as _ from 'lodash'; -import * as $ from 'jquery'; - -export class EmployeeListController { - static $inject = ['$scope', '$location', '$routeParams', 'Tokenizer']; - search: any; - info: any; - searchInfo: any; - filterEmployees: any; - selected: any; - shortcuts: any; - employees: any; - - constructor(public $scope, public $location, public $routeParams, public Tokenizer) { - this.employees = $scope.$parent.res.employees; - this.search = $routeParams.q || ''; - this.info = this.employees; - $scope.$watch('vm.search', (newValue, oldValue) => { - this.filterEmployees(newValue); - }, true); - - $scope.$on('$destroy', () => { - Tokenizer.doFilter.cache = {}; - }); - - this.searchInfo = { - comparator: { - 'n': {'Col': 'Name', 'Comparator': 'text'}, - 'c': {'Col': 'Code', 'Comparator': 'numeric'}, - 's': {'Col': 'Salary', 'Comparator': 'numeric'}, - 'a': {'Col': 'IsActive', 'Comparator': 'boolean'}, - 'des': {'Col': 'Designation', 'Comparator': 'text'}, - 'dep': {'Col': 'CostCentre', 'Comparator': 'text'} - }, - def: 'n', - sorter: { - 'n': 'Name', - 'c': 'Code', - 's': 'Salary', - 'a': 'IsActive', - 'des': 'Designation', - 'dep': 'CostCentre' - } - }; - this.filterEmployees = _.debounce((q) => { - if (q !== $scope._search) { - $scope._search = q; - if (angular.isUndefined(q) || q === '') { - this.$location.path('/Employees').search('q', null).replace(); - } else { - this.$location.path('/Employees').search({'q': q}).replace(); - } - $scope.$apply(() => { - const matches = Tokenizer.parseFilterString(q, this.searchInfo); - this.employees = Tokenizer.doFilter(q, this.info, matches); - - }); - } - }, 350); - - this.selected = -1; - this.shortcuts = { - 'up': (e) => { - if (this.selected > 0) { - $scope.$apply(() => { - this.selected = Math.min(Math.max(0, this.selected - 1), this.employees.length - 1); - }); - $("#" + this.selected).scrollintoview(); - e.preventDefault(); - } - }, - 'down': (e) => { - if (this.selected < this.employees.length - 1) { - $scope.$apply(() => { - this.selected = Math.min(Math.max(0, this.selected + 1), this.employees.length - 1); - }); - $("#" + this.selected).scrollintoview(); - e.preventDefault(); - } - } - }; - } - - setSelected(index) { - this.selected = Math.min(Math.max(0, index), this.employees.length - 1); - } -} diff --git a/brewman/static/src/app/employee/employee-list.html b/brewman/static/src/app/employee/employee-list.html deleted file mode 100644 index 356f574b..00000000 --- a/brewman/static/src/app/employee/employee-list.html +++ /dev/null @@ -1,38 +0,0 @@ -

Employees -
-
- -
-
- Add -
-
-

- - - - - - - - - - - - - - - - - - - - - - - - - -
CodeNameDesignationSalaryService PointsDepartmentJoining DateLeaving Date
{{item.Code}}{{item.Name}}{{item.Designation}}{{item.Salary}}{{item.ServicePoints}}{{item.CostCentre}}{{item.JoiningDate}}{{item.LeavingDate}}
diff --git a/brewman/static/src/app/employee/employee-list.resolver.js b/brewman/static/src/app/employee/employee-list.resolver.js deleted file mode 100644 index f3c646d7..00000000 --- a/brewman/static/src/app/employee/employee-list.resolver.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function EmployeeListResolver(Employee) { - return Employee.query({}).$promise; -} -exports.EmployeeListResolver = EmployeeListResolver; -//# sourceMappingURL=employee-list.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee-list.resolver.js.map b/brewman/static/src/app/employee/employee-list.resolver.js.map deleted file mode 100644 index 046dcc02..00000000 --- a/brewman/static/src/app/employee/employee-list.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"employee-list.resolver.js","sourceRoot":"","sources":["employee-list.resolver.ts"],"names":[],"mappings":";;AAAA,8BAAqC,QAAQ;IACzC,OAAO,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;AACvC,CAAC;AAFD,oDAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee-list.resolver.ts b/brewman/static/src/app/employee/employee-list.resolver.ts deleted file mode 100644 index 634a621e..00000000 --- a/brewman/static/src/app/employee/employee-list.resolver.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function EmployeeListResolver(Employee) { - return Employee.query({}).$promise; -} diff --git a/brewman/static/src/app/employee/employee.component.js b/brewman/static/src/app/employee/employee.component.js deleted file mode 100644 index f8fa7002..00000000 --- a/brewman/static/src/app/employee/employee.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var employee_controller_1 = require("./employee.controller"); -exports.EmployeeComponent = { - templateUrl: '/app/employee/employee-detail.html', - controller: employee_controller_1.EmployeeController, - controllerAs: 'vm' -}; -//# sourceMappingURL=employee.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee.component.js.map b/brewman/static/src/app/employee/employee.component.js.map deleted file mode 100644 index bd322184..00000000 --- a/brewman/static/src/app/employee/employee.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"employee.component.js","sourceRoot":"","sources":["employee.component.ts"],"names":[],"mappings":";;AAAA,6DAAyD;AAE5C,QAAA,iBAAiB,GAAG;IAC7B,WAAW,EAAE,oCAAoC;IACjD,UAAU,EAAE,wCAAkB;IAC9B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee.component.ts b/brewman/static/src/app/employee/employee.component.ts deleted file mode 100644 index d5c3fbdf..00000000 --- a/brewman/static/src/app/employee/employee.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {EmployeeController} from './employee.controller'; - -export const EmployeeComponent = { - templateUrl: '/app/employee/employee-detail.html', - controller: EmployeeController, - controllerAs: 'vm' -}; \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee.controller.js b/brewman/static/src/app/employee/employee.controller.js deleted file mode 100644 index 27030c82..00000000 --- a/brewman/static/src/app/employee/employee.controller.js +++ /dev/null @@ -1,80 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var EmployeeController = /** @class */ (function () { - function EmployeeController($scope, $routeParams, $location, asDate, $modal, dateParser, Messages) { - this.$scope = $scope; - this.$routeParams = $routeParams; - this.$location = $location; - this.asDate = asDate; - this.$modal = $modal; - this.dateParser = dateParser; - this.Messages = Messages; - this.employee = $scope.$parent.res.employee; - this.costCentres = $scope.$parent.res.costCentres; - this._employee_JoiningDate = dateParser.parse(this.employee.JoiningDate, "dd-MMM-yyyy"); - this._employee_LeavingDate = dateParser.parse(this.employee.LeavingDate, "dd-MMM-yyyy"); - this.foName = true; - } - EmployeeController.prototype.employee_JoiningDate = function (value) { - if (arguments.length) { - this.employee.JoiningDate = this.asDate(value); - this._employee_JoiningDate = value; - } - return this._employee_JoiningDate; - }; - EmployeeController.prototype.employee_LeavingDate = function (value) { - if (arguments.length) { - this.employee.LeavingDate = this.asDate(value); - this._employee_LeavingDate = value; - } - return this._employee_LeavingDate; - }; - EmployeeController.prototype.save = function () { - var _this = this; - this.employee.$save(function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: u.Code }); - _this.$location.path('/Employees'); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - EmployeeController.prototype.delete = function () { - var _this = this; - this.employee.$delete(function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/Employees'); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - EmployeeController.prototype.confirm = function () { - var _this = this; - var modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', /** @class */ (function () { - function class_1($modalInstance) { - this.$modalInstance = $modalInstance; - this.title = "Delete Employee"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - class_1.prototype.ok = function () { - this.$modalInstance.close(); - }; - class_1.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - return class_1; - }())] - }); - modalInstance.result.then(function () { - _this.delete(); - }); - }; - EmployeeController.$inject = ['$scope', '$routeParams', '$location', 'asDateFilter', '$uibModal', 'uibDateParser', 'Messages']; - return EmployeeController; -}()); -exports.EmployeeController = EmployeeController; -//# sourceMappingURL=employee.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee.controller.js.map b/brewman/static/src/app/employee/employee.controller.js.map deleted file mode 100644 index ed179f99..00000000 --- a/brewman/static/src/app/employee/employee.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"employee.controller.js","sourceRoot":"","sources":["employee.controller.ts"],"names":[],"mappings":";;AAAA;IAQI,4BAAmB,MAAM,EAAS,YAAY,EAAS,SAAS,EAAS,MAAM,EAAS,MAAM,EAAS,UAAU,EAAS,QAAQ;QAA/G,WAAM,GAAN,MAAM,CAAA;QAAS,iBAAY,GAAZ,YAAY,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QAAS,aAAQ,GAAR,QAAQ,CAAA;QAC9H,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;QAC5C,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;QAClD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CAAC,CAAC,CAAC;IACP,CAAC;IA7EM,0BAAO,GAAG,CAAC,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;IA8EvH,yBAAC;CAAA,AA/ED,IA+EC;AA/EY,gDAAkB"} \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee.controller.ts b/brewman/static/src/app/employee/employee.controller.ts deleted file mode 100644 index b79e1525..00000000 --- a/brewman/static/src/app/employee/employee.controller.ts +++ /dev/null @@ -1,80 +0,0 @@ -export class EmployeeController { - static $inject = ['$scope', '$routeParams', '$location', 'asDateFilter', '$uibModal', 'uibDateParser', 'Messages']; - _employee_JoiningDate: any; - _employee_LeavingDate: any; - foName: boolean; - employee: any; - costCentres: any; - - constructor(public $scope, public $routeParams, public $location, public asDate, public $modal, public dateParser, public Messages) { - this.employee = $scope.$parent.res.employee; - this.costCentres = $scope.$parent.res.costCentres; - this._employee_JoiningDate = dateParser.parse(this.employee.JoiningDate, "dd-MMM-yyyy"); - this._employee_LeavingDate = dateParser.parse(this.employee.LeavingDate, "dd-MMM-yyyy"); - this.foName = true; - } - - employee_JoiningDate(value) { - if (arguments.length) { - this.employee.JoiningDate = this.asDate(value); - this._employee_JoiningDate = value; - } - return this._employee_JoiningDate; - } - - employee_LeavingDate(value) { - if (arguments.length) { - this.employee.LeavingDate = this.asDate(value); - this._employee_LeavingDate = value; - } - return this._employee_LeavingDate; - } - - save() { - this.employee.$save((u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: u.Code}); - this.$location.path('/Employees'); - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - delete() { - this.employee.$delete((u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/Employees'); - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - confirm() { - const modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', class { - title: any; - body: any; - isDelete: boolean; - - constructor(public $modalInstance) { - this.title = "Delete Employee"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - - ok() { - this.$modalInstance.close(); - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - }] - }); - modalInstance.result.then(() => { - this.delete(); - }); - } -} diff --git a/brewman/static/src/app/employee/employee.resolver.js b/brewman/static/src/app/employee/employee.resolver.js deleted file mode 100644 index 66a21a0c..00000000 --- a/brewman/static/src/app/employee/employee.resolver.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function EmployeeResolver($route, Employee) { - var id = $route.current.params.id; - return Employee.get({ id: id }).$promise; -} -exports.EmployeeResolver = EmployeeResolver; -//# sourceMappingURL=employee.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee.resolver.js.map b/brewman/static/src/app/employee/employee.resolver.js.map deleted file mode 100644 index c1f352d7..00000000 --- a/brewman/static/src/app/employee/employee.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"employee.resolver.js","sourceRoot":"","sources":["employee.resolver.ts"],"names":[],"mappings":";;AAAA,0BAAiC,MAAM,EAAE,QAAQ;IAC7C,IAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IACpC,OAAO,QAAQ,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;AAC3C,CAAC;AAHD,4CAGC"} \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee.resolver.ts b/brewman/static/src/app/employee/employee.resolver.ts deleted file mode 100644 index f4c03377..00000000 --- a/brewman/static/src/app/employee/employee.resolver.ts +++ /dev/null @@ -1,4 +0,0 @@ -export function EmployeeResolver($route, Employee) { - const id = $route.current.params.id; - return Employee.get({id: id}).$promise; -} diff --git a/brewman/static/src/app/employee/employee.service.js b/brewman/static/src/app/employee/employee.service.js deleted file mode 100644 index 7eeab88d..00000000 --- a/brewman/static/src/app/employee/employee.service.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function Employee($resource) { - return $resource('/api/Employee/:id', { id: '@LedgerID' }, { - query: { method: 'GET', params: { list: true }, isArray: true }, - autocomplete: { method: 'GET', params: { term: '' }, isArray: true } - }); -} -exports.Employee = Employee; -//# sourceMappingURL=employee.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee.service.js.map b/brewman/static/src/app/employee/employee.service.js.map deleted file mode 100644 index 789e9d4c..00000000 --- a/brewman/static/src/app/employee/employee.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"employee.service.js","sourceRoot":"","sources":["employee.service.ts"],"names":[],"mappings":";;AAAA,kBAAyB,SAAS;IAC9B,OAAO,SAAS,CAAC,mBAAmB,EAChC,EAAC,EAAE,EAAE,WAAW,EAAC,EAAE;QACf,KAAK,EAAE,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,EAAE,OAAO,EAAE,IAAI,EAAC;QAC3D,YAAY,EAAE,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAC,IAAI,EAAE,EAAE,EAAC,EAAE,OAAO,EAAE,IAAI,EAAC;KACnE,CAAC,CAAC;AACX,CAAC;AAND,4BAMC"} \ No newline at end of file diff --git a/brewman/static/src/app/employee/employee.service.ts b/brewman/static/src/app/employee/employee.service.ts deleted file mode 100644 index f52a9045..00000000 --- a/brewman/static/src/app/employee/employee.service.ts +++ /dev/null @@ -1,7 +0,0 @@ -export function Employee($resource) { - return $resource('/api/Employee/:id', - {id: '@LedgerID'}, { - query: {method: 'GET', params: {list: true}, isArray: true}, - autocomplete: {method: 'GET', params: {term: ''}, isArray: true} - }); -} diff --git a/brewman/static/src/app/group/group-detail.html b/brewman/static/src/app/group/group-detail.html deleted file mode 100644 index e0480d4b..00000000 --- a/brewman/static/src/app/group/group-detail.html +++ /dev/null @@ -1,28 +0,0 @@ -
-

Group Detail

- -
- - -
- -
-
-
- - -
-
- - -
-
-
-
-
- -
-
-
diff --git a/brewman/static/src/app/group/group-list.component.js b/brewman/static/src/app/group/group-list.component.js deleted file mode 100644 index 783e8b29..00000000 --- a/brewman/static/src/app/group/group-list.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var group_list_controller_1 = require("./group-list.controller"); -exports.GroupListComponent = { - templateUrl: '/app/group/group-list.html', - controller: group_list_controller_1.GroupListController, - controllerAs: 'vm' -}; -//# sourceMappingURL=group-list.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/group/group-list.component.js.map b/brewman/static/src/app/group/group-list.component.js.map deleted file mode 100644 index 6180b475..00000000 --- a/brewman/static/src/app/group/group-list.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"group-list.component.js","sourceRoot":"","sources":["group-list.component.ts"],"names":[],"mappings":";;AAAA,iEAA4D;AAE/C,QAAA,kBAAkB,GAAG;IAC9B,WAAW,EAAE,4BAA4B;IACzC,UAAU,EAAE,2CAAmB;IAC/B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/group/group-list.component.ts b/brewman/static/src/app/group/group-list.component.ts deleted file mode 100644 index 4f490b0b..00000000 --- a/brewman/static/src/app/group/group-list.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {GroupListController} from './group-list.controller'; - -export const GroupListComponent = { - templateUrl: '/app/group/group-list.html', - controller: GroupListController, - controllerAs: 'vm' -}; diff --git a/brewman/static/src/app/group/group-list.controller.js b/brewman/static/src/app/group/group-list.controller.js deleted file mode 100644 index bdeb52ad..00000000 --- a/brewman/static/src/app/group/group-list.controller.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var GroupListController = /** @class */ (function () { - function GroupListController($scope) { - this.$scope = $scope; - this.groups = $scope.$parent.res.groups; - this.info = this.groups; - } - GroupListController.$inject = ['$scope']; - return GroupListController; -}()); -exports.GroupListController = GroupListController; -//# sourceMappingURL=group-list.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/group/group-list.controller.js.map b/brewman/static/src/app/group/group-list.controller.js.map deleted file mode 100644 index 465e5780..00000000 --- a/brewman/static/src/app/group/group-list.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"group-list.controller.js","sourceRoot":"","sources":["group-list.controller.ts"],"names":[],"mappings":";;AAEA;IAKI,6BAAmB,MAAM;QAAN,WAAM,GAAN,MAAM,CAAA;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;QACxC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;IAC5B,CAAC;IAPM,2BAAO,GAAG,CAAC,QAAQ,CAAC,CAAC;IAQhC,0BAAC;CAAA,AATD,IASC;AATY,kDAAmB"} \ No newline at end of file diff --git a/brewman/static/src/app/group/group-list.controller.ts b/brewman/static/src/app/group/group-list.controller.ts deleted file mode 100644 index 5802364b..00000000 --- a/brewman/static/src/app/group/group-list.controller.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as angular from 'angular'; - -export class GroupListController { - static $inject = ['$scope']; - info:any; - groups: any; - - constructor(public $scope) { - this.groups = $scope.$parent.res.groups; - this.info = this.groups; - } -} diff --git a/brewman/static/src/app/group/group-list.html b/brewman/static/src/app/group/group-list.html deleted file mode 100644 index 183311fb..00000000 --- a/brewman/static/src/app/group/group-list.html +++ /dev/null @@ -1,20 +0,0 @@ -

Users Add

- - - - - - - - - - - - - -
NameGroups
{{item.Name}} -
    -
  • {{permission}}
  • -
-
- diff --git a/brewman/static/src/app/group/group-list.resolver.js b/brewman/static/src/app/group/group-list.resolver.js deleted file mode 100644 index 3d84604e..00000000 --- a/brewman/static/src/app/group/group-list.resolver.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function GroupListResolver(Group) { - return Group.query({}).$promise; -} -exports.GroupListResolver = GroupListResolver; -//# sourceMappingURL=group-list.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/group/group-list.resolver.js.map b/brewman/static/src/app/group/group-list.resolver.js.map deleted file mode 100644 index 58ce27e0..00000000 --- a/brewman/static/src/app/group/group-list.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"group-list.resolver.js","sourceRoot":"","sources":["group-list.resolver.ts"],"names":[],"mappings":";;AAAA,2BAAkC,KAAK;IACnC,OAAO,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;AACpC,CAAC;AAFD,8CAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/group/group-list.resolver.ts b/brewman/static/src/app/group/group-list.resolver.ts deleted file mode 100644 index 4e5ed5e9..00000000 --- a/brewman/static/src/app/group/group-list.resolver.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function GroupListResolver(Group) { - return Group.query({}).$promise; -} diff --git a/brewman/static/src/app/group/group.component.js b/brewman/static/src/app/group/group.component.js deleted file mode 100644 index 574da396..00000000 --- a/brewman/static/src/app/group/group.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var group_controller_1 = require("./group.controller"); -exports.GroupComponent = { - templateUrl: '/app/group/group-detail.html', - controller: group_controller_1.GroupController, - controllerAs: 'vm' -}; -//# sourceMappingURL=group.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/group/group.component.js.map b/brewman/static/src/app/group/group.component.js.map deleted file mode 100644 index 1850e7dd..00000000 --- a/brewman/static/src/app/group/group.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"group.component.js","sourceRoot":"","sources":["group.component.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AAEtC,QAAA,cAAc,GAAG;IAC1B,WAAW,EAAE,8BAA8B;IAC3C,UAAU,EAAE,kCAAe;IAC3B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/group/group.component.ts b/brewman/static/src/app/group/group.component.ts deleted file mode 100644 index 84e1ec83..00000000 --- a/brewman/static/src/app/group/group.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {GroupController} from './group.controller'; - -export const GroupComponent = { - templateUrl: '/app/group/group-detail.html', - controller: GroupController, - controllerAs: 'vm' -}; \ No newline at end of file diff --git a/brewman/static/src/app/group/group.controller.js b/brewman/static/src/app/group/group.controller.js deleted file mode 100644 index 3950178b..00000000 --- a/brewman/static/src/app/group/group.controller.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var GroupController = /** @class */ (function () { - function GroupController($scope, $location, Messages) { - this.$scope = $scope; - this.$location = $location; - this.Messages = Messages; - this.group = $scope.$parent.res.group; - this.foName = true; - } - GroupController.prototype.save = function () { - var _this = this; - this.group.$save(function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/Groups'); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - GroupController.prototype.delete = function () { - var _this = this; - this.group.$delete(function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/Groups'); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - GroupController.$inject = ['$scope', '$location', 'Messages']; - return GroupController; -}()); -exports.GroupController = GroupController; -//# sourceMappingURL=group.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/group/group.controller.js.map b/brewman/static/src/app/group/group.controller.js.map deleted file mode 100644 index 1d5371d0..00000000 --- a/brewman/static/src/app/group/group.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file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;QAC7D,CAAC,CAAC,CAAC;IACP,CAAC;IAzBM,uBAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;IA0BzD,sBAAC;CAAA,AA3BD,IA2BC;AA3BY,0CAAe"} \ No newline at end of file diff --git a/brewman/static/src/app/group/group.controller.ts b/brewman/static/src/app/group/group.controller.ts deleted file mode 100644 index f36bf55a..00000000 --- a/brewman/static/src/app/group/group.controller.ts +++ /dev/null @@ -1,28 +0,0 @@ -export class GroupController { - static $inject = ['$scope', '$location', 'Messages']; - foName: boolean; - group: any; - - constructor(public $scope, public $location, public Messages) { - this.group = $scope.$parent.res.group; - this.foName = true; - } - - save() { - this.group.$save((u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/Groups') - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - delete() { - this.group.$delete((u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/Groups') - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } -} diff --git a/brewman/static/src/app/group/group.resolver.js b/brewman/static/src/app/group/group.resolver.js deleted file mode 100644 index 2f300718..00000000 --- a/brewman/static/src/app/group/group.resolver.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function GroupResolver($route, Group) { - var id = $route.current.params.id; - return Group.get({ id: id }).$promise; -} -exports.GroupResolver = GroupResolver; -//# sourceMappingURL=group.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/group/group.resolver.js.map b/brewman/static/src/app/group/group.resolver.js.map deleted file mode 100644 index a5c7c033..00000000 --- a/brewman/static/src/app/group/group.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"group.resolver.js","sourceRoot":"","sources":["group.resolver.ts"],"names":[],"mappings":";;AAAA,uBAA8B,MAAM,EAAE,KAAK;IACvC,IAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IACpC,OAAO,KAAK,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;AACxC,CAAC;AAHD,sCAGC"} \ No newline at end of file diff --git a/brewman/static/src/app/group/group.resolver.ts b/brewman/static/src/app/group/group.resolver.ts deleted file mode 100644 index 771a50df..00000000 --- a/brewman/static/src/app/group/group.resolver.ts +++ /dev/null @@ -1,4 +0,0 @@ -export function GroupResolver($route, Group) { - const id = $route.current.params.id; - return Group.get({id: id}).$promise; -} diff --git a/brewman/static/src/app/group/group.service.js b/brewman/static/src/app/group/group.service.js deleted file mode 100644 index 33bc5cb4..00000000 --- a/brewman/static/src/app/group/group.service.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function Group($resource) { - return $resource('/api/Group/:id', { id: '@GroupID' }, { - query: { method: 'GET', params: { list: true }, isArray: true } - }); -} -exports.Group = Group; -//# sourceMappingURL=group.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/group/group.service.js.map b/brewman/static/src/app/group/group.service.js.map deleted file mode 100644 index 567f5961..00000000 --- a/brewman/static/src/app/group/group.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"group.service.js","sourceRoot":"","sources":["group.service.ts"],"names":[],"mappings":";;AAAA,eAAsB,SAAS;IAC3B,OAAO,SAAS,CAAC,gBAAgB,EAC7B,EAAC,EAAE,EAAE,UAAU,EAAC,EAAE;QACd,KAAK,EAAE,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,EAAE,OAAO,EAAE,IAAI,EAAC;KAC9D,CAAC,CAAC;AACX,CAAC;AALD,sBAKC"} \ No newline at end of file diff --git a/brewman/static/src/app/group/group.service.ts b/brewman/static/src/app/group/group.service.ts deleted file mode 100644 index bd3fac45..00000000 --- a/brewman/static/src/app/group/group.service.ts +++ /dev/null @@ -1,6 +0,0 @@ -export function Group($resource) { - return $resource('/api/Group/:id', - {id: '@GroupID'}, { - query: {method: 'GET', params: {list: true}, isArray: true} - }); -} diff --git a/brewman/static/src/app/home/home.component.js b/brewman/static/src/app/home/home.component.js deleted file mode 100644 index 162ad7d9..00000000 --- a/brewman/static/src/app/home/home.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var home_controller_1 = require("./home.controller"); -exports.HomeComponent = { - templateUrl: '/app/home/home.html', - controller: home_controller_1.HomeController, - controllerAs: 'vm', -}; -//# sourceMappingURL=home.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/home/home.component.js.map b/brewman/static/src/app/home/home.component.js.map deleted file mode 100644 index dee0e05d..00000000 --- a/brewman/static/src/app/home/home.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"home.component.js","sourceRoot":"","sources":["home.component.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AAEpC,QAAA,aAAa,GAAG;IACzB,WAAW,EAAE,qBAAqB;IAClC,UAAU,EAAE,gCAAc;IAC1B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/home/home.component.ts b/brewman/static/src/app/home/home.component.ts deleted file mode 100644 index dd9bd33b..00000000 --- a/brewman/static/src/app/home/home.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {HomeController} from "./home.controller"; - -export const HomeComponent = { - templateUrl: '/app/home/home.html', - controller: HomeController, - controllerAs: 'vm', -}; \ No newline at end of file diff --git a/brewman/static/src/app/home/home.controller.js b/brewman/static/src/app/home/home.controller.js deleted file mode 100644 index 172fee62..00000000 --- a/brewman/static/src/app/home/home.controller.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var HomeController = /** @class */ (function () { - function HomeController($location) { - this.$location = $location; - } - HomeController.$inject = ['$location']; - return HomeController; -}()); -exports.HomeController = HomeController; -//# sourceMappingURL=home.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/home/home.controller.js.map b/brewman/static/src/app/home/home.controller.js.map deleted file mode 100644 index d03008af..00000000 --- a/brewman/static/src/app/home/home.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"home.controller.js","sourceRoot":"","sources":["home.controller.ts"],"names":[],"mappings":";;AAAA;IAGI,wBAAmB,SAAS;QAAT,cAAS,GAAT,SAAS,CAAA;IAC5B,CAAC;IAHM,sBAAO,GAAG,CAAC,WAAW,CAAC,CAAC;IAInC,qBAAC;CAAA,AALD,IAKC;AALY,wCAAc"} \ No newline at end of file diff --git a/brewman/static/src/app/home/home.controller.ts b/brewman/static/src/app/home/home.controller.ts deleted file mode 100644 index e7f2dc3c..00000000 --- a/brewman/static/src/app/home/home.controller.ts +++ /dev/null @@ -1,6 +0,0 @@ -export class HomeController { - static $inject = ['$location']; - - constructor(public $location) { - } -} diff --git a/brewman/static/src/app/incentive/incentive-voucher.resolver.js b/brewman/static/src/app/incentive/incentive-voucher.resolver.js deleted file mode 100644 index 270b49b8..00000000 --- a/brewman/static/src/app/incentive/incentive-voucher.resolver.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function IncentiveVoucherResolver($route, Voucher) { - var id = $route.current.params.id; - if (angular.isUndefined(id)) { - return Voucher.get({ type: 'Service Charge' }).$promise; - } - else { - return Voucher.get({ id: id }).$promise; - } -} -exports.IncentiveVoucherResolver = IncentiveVoucherResolver; -//# sourceMappingURL=incentive-voucher.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/incentive/incentive-voucher.resolver.js.map b/brewman/static/src/app/incentive/incentive-voucher.resolver.js.map deleted file mode 100644 index 94637451..00000000 --- a/brewman/static/src/app/incentive/incentive-voucher.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"incentive-voucher.resolver.js","sourceRoot":"","sources":["incentive-voucher.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,kCAAyC,MAAM,EAAE,OAAO;IACpD,IAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IAEpC,IAAI,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;QACzB,OAAO,OAAO,CAAC,GAAG,CAAC,EAAC,IAAI,EAAE,gBAAgB,EAAC,CAAC,CAAC,QAAQ,CAAC;KACzD;SAAM;QACH,OAAO,OAAO,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;KACzC;AACL,CAAC;AARD,4DAQC"} \ No newline at end of file diff --git a/brewman/static/src/app/incentive/incentive-voucher.resolver.ts b/brewman/static/src/app/incentive/incentive-voucher.resolver.ts deleted file mode 100644 index c116f0d7..00000000 --- a/brewman/static/src/app/incentive/incentive-voucher.resolver.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as angular from 'angular'; - -export function IncentiveVoucherResolver($route, Voucher) { - const id = $route.current.params.id; - - if (angular.isUndefined(id)) { - return Voucher.get({type: 'Service Charge'}).$promise; - } else { - return Voucher.get({id: id}).$promise; - } -} diff --git a/brewman/static/src/app/incentive/incentive.component.js b/brewman/static/src/app/incentive/incentive.component.js deleted file mode 100644 index 049b58b5..00000000 --- a/brewman/static/src/app/incentive/incentive.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var incentive_controller_1 = require("./incentive.controller"); -exports.IncentiveComponent = { - templateUrl: '/app/incentive/incentive.html', - controller: incentive_controller_1.IncentiveController, - controllerAs: 'vm', -}; -//# sourceMappingURL=incentive.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/incentive/incentive.component.js.map b/brewman/static/src/app/incentive/incentive.component.js.map deleted file mode 100644 index 48584dc9..00000000 --- a/brewman/static/src/app/incentive/incentive.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"incentive.component.js","sourceRoot":"","sources":["incentive.component.ts"],"names":[],"mappings":";;AAAA,+DAA2D;AAE9C,QAAA,kBAAkB,GAAG;IAC9B,WAAW,EAAE,+BAA+B;IAC5C,UAAU,EAAE,0CAAmB;IAC/B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/incentive/incentive.component.ts b/brewman/static/src/app/incentive/incentive.component.ts deleted file mode 100644 index 6f4e71d9..00000000 --- a/brewman/static/src/app/incentive/incentive.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {IncentiveController} from "./incentive.controller"; - -export const IncentiveComponent = { - templateUrl: '/app/incentive/incentive.html', - controller: IncentiveController, - controllerAs: 'vm', -}; \ No newline at end of file diff --git a/brewman/static/src/app/incentive/incentive.controller.js b/brewman/static/src/app/incentive/incentive.controller.js deleted file mode 100644 index 0dc23256..00000000 --- a/brewman/static/src/app/incentive/incentive.controller.js +++ /dev/null @@ -1,129 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var _ = require("lodash"); -var IncentiveController = /** @class */ (function () { - function IncentiveController($scope, $location, $routeParams, numberFilter, asDate, $modal, dateParser, Messages, Credentials) { - var _this = this; - this.$scope = $scope; - this.$location = $location; - this.$routeParams = $routeParams; - this.numberFilter = numberFilter; - this.asDate = asDate; - this.$modal = $modal; - this.dateParser = dateParser; - this.Messages = Messages; - this.Credentials = Credentials; - this.voucher = $scope.$parent.res.voucher; - this._voucher_Date = dateParser.parse(this.voucher.Date, "dd-MMM-yyyy"); - $scope.$watch('vm.voucher.Date', function (newDate, oldDate) { - var nDate = asDate(newDate), oDate = asDate(oldDate); - if (nDate !== oDate && !angular.isUndefined(nDate)) { - if (angular.isUndefined($routeParams.id)) { - return _this.voucher.$get({ type: 'Service Charge', Date: nDate }).$promise; - } - } - }, true); - } - IncentiveController.prototype.voucher_Date = function (value) { - if (arguments.length) { - this.voucher.Date = this.asDate(value); - this._voucher_Date = value; - } - return this._voucher_Date; - }; - IncentiveController.prototype.TotalPoints = function () { - return _(this.voucher.ServiceCharges).map(function (item) { - return item.DaysWorked * Number(item.Points); - }).reduce(function (sum, item) { - return sum + item; - }); - }; - IncentiveController.prototype.PointValue = function () { - return Math.round(this.voucher.ServiceCharge * 100 / this.TotalPoints()) / 100; - }; - IncentiveController.prototype.less = function (employee) { - if (employee.Points >= 1) { - employee.Points -= 1; - } - }; - IncentiveController.prototype.more = function (employee) { - employee.Points += 1; - }; - IncentiveController.prototype.employeeAmount = function (employee) { - return Number(employee.Points) * employee.DaysWorked * this.PointValue(); - }; - IncentiveController.prototype.preventAlteration = function (voucher) { - if (angular.isUndefined(this.Credentials.Perms)) { - return false; - } - else if (angular.isUndefined(voucher.VoucherID)) { - return !this.Credentials.Perms['Service Charge']; - } - else if (voucher.Posted && !this.Credentials.Perms['Edit Posted Vouchers']) { - return true; - } - else if (voucher.User.UserID !== this.Credentials.Auth.UserID && !this.Credentials.Perms["Edit Other User's Vouchers"]) { - return true; - } - else { - return false; - } - }; - IncentiveController.prototype.save = function () { - var _this = this; - this.voucher.$save({ type: 'Service Charge' }, function (u) { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/ServiceCharge/' + u.VoucherID); - }, function (data) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - IncentiveController.prototype.delete = function () { - var _this = this; - this.voucher.$delete(function () { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/ServiceCharge').replace(); - }, function (data) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - IncentiveController.prototype.post = function () { - var _this = this; - this.voucher.$post(function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - IncentiveController.prototype.confirm = function () { - var _this = this; - var modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', /** @class */ (function () { - function class_1($modalInstance) { - this.$modalInstance = $modalInstance; - this.title = "Delete Voucher"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - class_1.prototype.ok = function () { - this.$modalInstance.close(); - }; - class_1.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - return class_1; - }())] - }); - modalInstance.result.then(function () { - _this.delete(); - }); - }; - IncentiveController.$inject = ['$scope', '$location', '$routeParams', 'numberFilter', 'asDateFilter', '$uibModal', 'uibDateParser', 'Messages', 'Credentials']; - return IncentiveController; -}()); -exports.IncentiveController = IncentiveController; -//# sourceMappingURL=incentive.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/incentive/incentive.controller.js.map b/brewman/static/src/app/incentive/incentive.controller.js.map deleted file mode 100644 index ae71fc13..00000000 --- a/brewman/static/src/app/incentive/incentive.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"incentive.controller.js","sourceRoot":"","sources":["incentive.controller.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AACnC,0BAA4B;AAE5B;IAKI,6BAAmB,MAAM,EAAS,SAAS,EAAS,YAAY,EAAS,YAAY,EAAS,MAAM,EAAS,MAAM,EAAS,UAAU,EAAS,QAAQ,EAAS,WAAW;QAA3K,iBAaC;QAbkB,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,iBAAY,GAAZ,YAAY,CAAA;QAAS,iBAAY,GAAZ,YAAY,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QAAS,aAAQ,GAAR,QAAQ,CAAA;QAAS,gBAAW,GAAX,WAAW,CAAA;QACvK,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;QAC1C,IAAI,CAAC,aAAa,G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,CAAC,CAAC,CAAC;IACP,CAAC;IAED,qCAAO,GAAP;QAAA,iBA4BC;QA3BG,IAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YACnC,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,8BAA8B;YAC3C,YAAY,EAAE,SAAS;YACvB,UAAU,EAAE,CAAC,mBAAmB;oBAK5B,iBAAmB,cAAc;wBAAd,mBAAc,GAAd,cAAc,CAAA;wBAC7B,IAAI,CAAC,KAAK,GAAG,gBAAgB,CAAC;wBAC9B,IAAI,CAAC,IAAI,GAAG,sCAAsC,CAAC;wBACnD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;oBACzB,CAAC;oBAED,oBAAE,GAAF;wBACI,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;oBAChC,CAAC;oBAED,wBAAM,GAAN;wBACI,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;oBAC1C,CAAC;oBACL,cAAC;gBAAD,CAAC,AAlBiC,IAkBhC;SACL,CAAC,CAAC;QACH,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC;YACtB,KAAI,CAAC,MAAM,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACP,CAAC;IAzHM,2BAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;IA0HtJ,0BAAC;CAAA,AA3HD,IA2HC;AA3HY,kDAAmB"} \ No newline at end of file diff --git a/brewman/static/src/app/incentive/incentive.controller.ts b/brewman/static/src/app/incentive/incentive.controller.ts deleted file mode 100644 index 9606c749..00000000 --- a/brewman/static/src/app/incentive/incentive.controller.ts +++ /dev/null @@ -1,127 +0,0 @@ -import * as angular from 'angular'; -import * as _ from 'lodash'; - -export class IncentiveController { - static $inject = ['$scope', '$location', '$routeParams', 'numberFilter', 'asDateFilter', '$uibModal', 'uibDateParser', 'Messages', 'Credentials']; - _voucher_Date: any; - voucher: any; - - constructor(public $scope, public $location, public $routeParams, public numberFilter, public asDate, public $modal, public dateParser, public Messages, public Credentials) { - this.voucher = $scope.$parent.res.voucher; - this._voucher_Date = dateParser.parse(this.voucher.Date, "dd-MMM-yyyy"); - - $scope.$watch('vm.voucher.Date', (newDate, oldDate) => { - const nDate = asDate(newDate), - oDate = asDate(oldDate); - if (nDate !== oDate && !angular.isUndefined(nDate)) { - if (angular.isUndefined($routeParams.id)) { - return this.voucher.$get({type: 'Service Charge', Date: nDate}).$promise; - } - } - }, true); - } - - voucher_Date(value) { - if (arguments.length) { - this.voucher.Date = this.asDate(value); - this._voucher_Date = value; - } - return this._voucher_Date; - } - - TotalPoints() { - return _(this.voucher.ServiceCharges).map(function (item) { - return item.DaysWorked * Number(item.Points); - }).reduce(function (sum, item) { - return sum + item; - }); - } - - PointValue() { - return Math.round(this.voucher.ServiceCharge * 100 / this.TotalPoints()) / 100; - } - - less(employee) { - if (employee.Points >= 1) { - employee.Points -= 1; - } - } - - more(employee) { - employee.Points += 1; - } - - employeeAmount(employee) { - return Number(employee.Points) * employee.DaysWorked * this.PointValue(); - } - - preventAlteration(voucher) { - if (angular.isUndefined(this.Credentials.Perms)) { - return false; - } else if (angular.isUndefined(voucher.VoucherID)) { - return !this.Credentials.Perms['Service Charge']; - } else if (voucher.Posted && !this.Credentials.Perms['Edit Posted Vouchers']) { - return true; - } else if (voucher.User.UserID !== this.Credentials.Auth.UserID && !this.Credentials.Perms["Edit Other User's Vouchers"]) { - return true; - } else { - return false; - } - } - - save() { - this.voucher.$save({type: 'Service Charge'}, (u) => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/ServiceCharge/' + u.VoucherID); - }, (data) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - delete() { - this.voucher.$delete(() => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/ServiceCharge').replace(); - }, (data) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - post() { - this.voucher.$post((u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - confirm() { - const modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', class { - title: any; - body: any; - isDelete: boolean; - - constructor(public $modalInstance) { - this.title = "Delete Voucher"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - - ok() { - this.$modalInstance.close(); - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - }] - }); - modalInstance.result.then(() => { - this.delete(); - }); - } -} diff --git a/brewman/static/src/app/incentive/incentive.html b/brewman/static/src/app/incentive/incentive.html deleted file mode 100644 index 5e4d538a..00000000 --- a/brewman/static/src/app/incentive/incentive.html +++ /dev/null @@ -1,79 +0,0 @@ -
-

Employee Service Charge

- -
- - -
-
- - - - -
-
-
-
- - -
- Total Service Charge: {{vm.voucher.ServiceCharge | number:2}} - Total Points: {{vm.TotalPoints() | number:2}} - Point Value: {{vm.PointValue() | number:2}} -
-
- - - - - - - - - - - - - - - - - - - - - -
NameDesignationDepartmentDays WorkedService PointsAmount
{{serviceCharge.Name}}{{serviceCharge.Designation}}{{serviceCharge.Department}}{{serviceCharge.DaysWorked}} -
- - - - - - - -
-
{{vm.employeeAmount(serviceCharge) | number:0}}
-
-
- - - -
-
-
- Created on {{vm.voucher.CreationDate | localTime}} and Last Edited on {{vm.voucher.LastEditDate | localTime}} - by {{vm.voucher.User.Name}}. Posted by {{vm.voucher.Poster}} - -
-
diff --git a/brewman/static/src/app/issue/batch.service.js b/brewman/static/src/app/issue/batch.service.js deleted file mode 100644 index 74706196..00000000 --- a/brewman/static/src/app/issue/batch.service.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function Batch($resource) { - return $resource('/api/Batch', {}, { - autocomplete: { method: 'GET', params: { term: '' }, isArray: true } - }); -} -exports.Batch = Batch; -//# sourceMappingURL=batch.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/issue/batch.service.js.map b/brewman/static/src/app/issue/batch.service.js.map deleted file mode 100644 index efead7ab..00000000 --- a/brewman/static/src/app/issue/batch.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"batch.service.js","sourceRoot":"","sources":["batch.service.ts"],"names":[],"mappings":";;AAAA,eAAuB,SAAS;IAC5B,OAAO,SAAS,CAAC,YAAY,EAAE,EAAE,EAAE;QAC/B,YAAY,EAAE,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAC,IAAI,EAAE,EAAE,EAAC,EAAE,OAAO,EAAE,IAAI,EAAC;KACnE,CAAC,CAAC;AACP,CAAC;AAJD,sBAIC"} \ No newline at end of file diff --git a/brewman/static/src/app/issue/batch.service.ts b/brewman/static/src/app/issue/batch.service.ts deleted file mode 100644 index 28a744aa..00000000 --- a/brewman/static/src/app/issue/batch.service.ts +++ /dev/null @@ -1,5 +0,0 @@ -export function Batch ($resource) { - return $resource('/api/Batch', {}, { - autocomplete: {method: 'GET', params: {term: ''}, isArray: true} - }); -} diff --git a/brewman/static/src/app/issue/issue-grid.resolver.js b/brewman/static/src/app/issue/issue-grid.resolver.js deleted file mode 100644 index 3ea972b4..00000000 --- a/brewman/static/src/app/issue/issue-grid.resolver.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function IssueGridResolver($route, IssueGrid) { - var id = $route.current.params.id, source = $route.current.params.Source, destination = $route.current.params.Destination; - if (!angular.isUndefined(source) && !angular.isUndefined(destination) && !angular.isUndefined(id)) { - return IssueGrid.query({ date: id, Source: source, Destination: destination }).$promise; - } - else if (angular.isUndefined(source) && angular.isUndefined(destination) && !angular.isUndefined(id)) { - return IssueGrid.query({ date: id }).$promise; - } - else { - return {}; - } -} -exports.IssueGridResolver = IssueGridResolver; -//# sourceMappingURL=issue-grid.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/issue/issue-grid.resolver.js.map b/brewman/static/src/app/issue/issue-grid.resolver.js.map deleted file mode 100644 index b49f4a1c..00000000 --- a/brewman/static/src/app/issue/issue-grid.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"issue-grid.resolver.js","sourceRoot":"","sources":["issue-grid.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,2BAAkC,MAAM,EAAE,SAAS;IAC/C,IAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAC/B,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EACrC,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC;IAEpD,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;QAC/F,OAAO,SAAS,CAAC,KAAK,CAAC,EAAC,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAC,CAAC,CAAC,QAAQ,CAAC;KACzF;SAAM,IAAI,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;QACpG,OAAO,SAAS,CAAC,KAAK,CAAC,EAAC,IAAI,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;KAC/C;SAAM;QACH,OAAO,EAAE,CAAC;KACb;AACL,CAAC;AAZD,8CAYC"} \ No newline at end of file diff --git a/brewman/static/src/app/issue/issue-grid.resolver.ts b/brewman/static/src/app/issue/issue-grid.resolver.ts deleted file mode 100644 index 22de84a5..00000000 --- a/brewman/static/src/app/issue/issue-grid.resolver.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as angular from 'angular'; - -export function IssueGridResolver($route, IssueGrid) { - const id = $route.current.params.id, - source = $route.current.params.Source, - destination = $route.current.params.Destination; - - if (!angular.isUndefined(source) && !angular.isUndefined(destination) && !angular.isUndefined(id)) { - return IssueGrid.query({date: id, Source: source, Destination: destination}).$promise; - } else if (angular.isUndefined(source) && angular.isUndefined(destination) && !angular.isUndefined(id)) { - return IssueGrid.query({date: id}).$promise; - } else { - return {}; - } -} diff --git a/brewman/static/src/app/issue/issue-grid.service.js b/brewman/static/src/app/issue/issue-grid.service.js deleted file mode 100644 index bc67386b..00000000 --- a/brewman/static/src/app/issue/issue-grid.service.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function IssueGrid($resource) { - return $resource('/api/Issues/Services/:date'); -} -exports.IssueGrid = IssueGrid; -//# sourceMappingURL=issue-grid.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/issue/issue-grid.service.js.map b/brewman/static/src/app/issue/issue-grid.service.js.map deleted file mode 100644 index d92e1ad3..00000000 --- a/brewman/static/src/app/issue/issue-grid.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"issue-grid.service.js","sourceRoot":"","sources":["issue-grid.service.ts"],"names":[],"mappings":";;AAAA,mBAA0B,SAAS;IAC/B,OAAO,SAAS,CAAC,4BAA4B,CAAC,CAAC;AACnD,CAAC;AAFD,8BAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/issue/issue-grid.service.ts b/brewman/static/src/app/issue/issue-grid.service.ts deleted file mode 100644 index a9aa9984..00000000 --- a/brewman/static/src/app/issue/issue-grid.service.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function IssueGrid($resource) { - return $resource('/api/Issues/Services/:date'); -} diff --git a/brewman/static/src/app/issue/issue-modal.controller.js b/brewman/static/src/app/issue/issue-modal.controller.js deleted file mode 100644 index c6b42145..00000000 --- a/brewman/static/src/app/issue/issue-modal.controller.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var IssueModalController = /** @class */ (function () { - function IssueModalController($scope, $modalInstance, Batch) { - this.$scope = $scope; - this.$modalInstance = $modalInstance; - this.Batch = Batch; - this.edit = $scope.$resolve.edit; - } - IssueModalController.prototype.ok = function () { - this.edit.Product = this.edit.Batch.Product; - this.edit.Quantity = Number(this.edit.Quantity); - this.edit.Tax = this.edit.Batch.Tax; - this.edit.Discount = this.edit.Batch.Discount; - this.edit.Rate = this.edit.Batch.Rate; - this.edit.Amount = this.edit.Quantity * this.edit.Rate * (1 + this.edit.Tax) * (1 - this.edit.Discount); - this.$modalInstance.close(this.edit); - }; - IssueModalController.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - IssueModalController.prototype.batches = function ($viewValue) { - return this.Batch.autocomplete({ term: $viewValue, count: 20 }).$promise; - }; - IssueModalController.$inject = ['$scope', '$uibModalInstance', 'Batch']; - return IssueModalController; -}()); -exports.IssueModalController = IssueModalController; -//# sourceMappingURL=issue-modal.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/issue/issue-modal.controller.js.map b/brewman/static/src/app/issue/issue-modal.controller.js.map deleted file mode 100644 index 71b64e9c..00000000 --- a/brewman/static/src/app/issue/issue-modal.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"issue-modal.controller.js","sourceRoot":"","sources":["issue-modal.controller.ts"],"names":[],"mappings":";;AAAA;IAII,8BAAmB,MAAM,EAAS,cAAc,EAAS,KAAK;QAA3C,WAAM,GAAN,MAAM,CAAA;QAAS,mBAAc,GAAd,cAAc,CAAA;QAAS,UAAK,GAAL,KAAK,CAAA;QAC1D,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;IACrC,CAAC;IAED,iCAAE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/static/src/app/issue/issue-modal.controller.ts deleted file mode 100644 index 19c7e244..00000000 --- a/brewman/static/src/app/issue/issue-modal.controller.ts +++ /dev/null @@ -1,26 +0,0 @@ -export class IssueModalController { - static $inject = ['$scope', '$uibModalInstance', 'Batch']; - edit:any; - - constructor(public $scope, public $modalInstance, public Batch) { - this.edit = $scope.$resolve.edit; - } - - ok() { - this.edit.Product = this.edit.Batch.Product; - this.edit.Quantity = Number(this.edit.Quantity); - this.edit.Tax = this.edit.Batch.Tax; - this.edit.Discount = this.edit.Batch.Discount; - this.edit.Rate = this.edit.Batch.Rate; - this.edit.Amount = this.edit.Quantity * this.edit.Rate * (1 + this.edit.Tax) * (1 - this.edit.Discount); - this.$modalInstance.close(this.edit); - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - - batches($viewValue) { - return this.Batch.autocomplete({term: $viewValue, count: 20}).$promise; - } -} diff --git a/brewman/static/src/app/issue/issue-modal.html b/brewman/static/src/app/issue/issue-modal.html deleted file mode 100644 index e5e05ee8..00000000 --- a/brewman/static/src/app/issue/issue-modal.html +++ /dev/null @@ -1,24 +0,0 @@ - \ No newline at end of file diff --git a/brewman/static/src/app/issue/issue-voucher.resolver.js b/brewman/static/src/app/issue/issue-voucher.resolver.js deleted file mode 100644 index af144888..00000000 --- a/brewman/static/src/app/issue/issue-voucher.resolver.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function IssueVoucherResolver($route, Voucher) { - var id = $route.current.params.id, source = $route.current.params.Source, destination = $route.current.params.Destination; - if (!angular.isUndefined(source) && !angular.isUndefined(destination) && !angular.isUndefined(id)) { - return Voucher.get({ type: 'Issue', Date: id, Source: source, Destination: destination }).$promise; - } - else if (angular.isUndefined(source) && angular.isUndefined(destination) && !angular.isUndefined(id)) { - return Voucher.get({ id: id }).$promise; - } - else { - return Voucher.get({ type: 'Issue' }).$promise; - } -} -exports.IssueVoucherResolver = IssueVoucherResolver; -//# sourceMappingURL=issue-voucher.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/issue/issue-voucher.resolver.js.map b/brewman/static/src/app/issue/issue-voucher.resolver.js.map deleted file mode 100644 index 5eb85ee2..00000000 --- a/brewman/static/src/app/issue/issue-voucher.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"issue-voucher.resolver.js","sourceRoot":"","sources":["issue-voucher.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,8BAAqC,MAAM,EAAE,OAAO;IAChD,IAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAC/B,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EACrC,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC;IAEpD,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;QAC/F,OAAO,OAAO,CAAC,GAAG,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAC,CAAC,CAAC,QAAQ,CAAC;KACpG;SAAM,IAAI,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;QACpG,OAAO,OAAO,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;KACzC;SAAM;QACH,OAAO,OAAO,CAAC,GAAG,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC,CAAC,QAAQ,CAAC;KAChD;AACL,CAAC;AAZD,oDAYC"} \ No newline at end of file diff --git a/brewman/static/src/app/issue/issue-voucher.resolver.ts b/brewman/static/src/app/issue/issue-voucher.resolver.ts deleted file mode 100644 index 2522c7de..00000000 --- a/brewman/static/src/app/issue/issue-voucher.resolver.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as angular from 'angular'; - -export function IssueVoucherResolver($route, Voucher) { - const id = $route.current.params.id, - source = $route.current.params.Source, - destination = $route.current.params.Destination; - - if (!angular.isUndefined(source) && !angular.isUndefined(destination) && !angular.isUndefined(id)) { - return Voucher.get({type: 'Issue', Date: id, Source: source, Destination: destination}).$promise; - } else if (angular.isUndefined(source) && angular.isUndefined(destination) && !angular.isUndefined(id)) { - return Voucher.get({id: id}).$promise; - } else { - return Voucher.get({type: 'Issue'}).$promise; - } -} diff --git a/brewman/static/src/app/issue/issue.component.js b/brewman/static/src/app/issue/issue.component.js deleted file mode 100644 index 6760307f..00000000 --- a/brewman/static/src/app/issue/issue.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var issue_controller_1 = require("./issue.controller"); -exports.IssueComponent = { - templateUrl: '/app/issue/issue.html', - controller: issue_controller_1.IssueController, - controllerAs: 'vm', -}; -//# sourceMappingURL=issue.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/issue/issue.component.js.map b/brewman/static/src/app/issue/issue.component.js.map deleted file mode 100644 index b81d2570..00000000 --- a/brewman/static/src/app/issue/issue.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"issue.component.js","sourceRoot":"","sources":["issue.component.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AAEtC,QAAA,cAAc,GAAG;IAC1B,WAAW,EAAE,uBAAuB;IACpC,UAAU,EAAE,kCAAe;IAC3B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/issue/issue.component.ts b/brewman/static/src/app/issue/issue.component.ts deleted file mode 100644 index 23d1fc98..00000000 --- a/brewman/static/src/app/issue/issue.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {IssueController} from "./issue.controller"; - -export const IssueComponent = { - templateUrl: '/app/issue/issue.html', - controller: IssueController, - controllerAs: 'vm', -}; \ No newline at end of file diff --git a/brewman/static/src/app/issue/issue.controller.js b/brewman/static/src/app/issue/issue.controller.js deleted file mode 100644 index 07f0a9a8..00000000 --- a/brewman/static/src/app/issue/issue.controller.js +++ /dev/null @@ -1,274 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var _ = require("lodash"); -var issue_modal_controller_1 = require("./issue-modal.controller"); -var IssueController = /** @class */ (function () { - function IssueController($scope, $routeParams, $location, asDate, IssueGrid, Voucher, $modal, Batch, dateParser, Messages, Credentials) { - var _this = this; - this.$scope = $scope; - this.$routeParams = $routeParams; - this.$location = $location; - this.asDate = asDate; - this.IssueGrid = IssueGrid; - this.Voucher = Voucher; - this.$modal = $modal; - this.Batch = Batch; - this.dateParser = dateParser; - this.Messages = Messages; - this.Credentials = Credentials; - this.voucher = $scope.$parent.res.voucher; - this.costCentres = $scope.$parent.res.costCentres; - this.smallGrid = $scope.$parent.res.smallGrid; - this._voucher_Date = dateParser.parse(this.voucher.Date, "dd-MMM-yyyy"); - if (angular.isUndefined(this.$routeParams.Source) && angular.isUndefined(this.$routeParams.Destination) && angular.isUndefined(this.$routeParams.id)) { - var date = this.voucher.Date; - var source = this.getDebitCredit(this.voucher.Journals, -1); - var destination = this.getDebitCredit(this.voucher.Journals, 1); - this.$location.path('/Issue/' + date).search({ Source: source, Destination: destination }); - } - $scope.$watch('vm.voucher.Date', function (newDate, oldDate) { - var nDate = asDate(newDate), oDate = asDate(oldDate); - if (nDate !== oDate && !angular.isUndefined(nDate)) { - if (!angular.isUndefined(_this.$routeParams.Source) && !angular.isUndefined(_this.$routeParams.Destination) && !angular.isUndefined(_this.$routeParams.id)) { - _this.$location.path('/Issue/' + nDate).search({ - Source: _this.$routeParams.Source, - Destination: _this.$routeParams.Destination - }); - } - else { - _this.smallGrid = _this.IssueGrid.query({ - date: nDate, - Source: _this.$routeParams.Source, - Destination: _this.$routeParams.Destination - }); - } - } - }, true); - $scope.$watch('vm.voucher.Journals', function (newJournals, oldJournals) { - if (angular.isUndefined(newJournals) || angular.equals(newJournals, oldJournals)) { - return; - } - if (!angular.isUndefined(oldJournals)) { - if (_this.getDebitCredit(oldJournals, -1) === _this.getDebitCredit(newJournals, -1) && _this.getDebitCredit(oldJournals, 1) === _this.getDebitCredit(newJournals, 1)) { - return; - } - } - if (!angular.isUndefined(_this.$routeParams.Source) && !angular.isUndefined(_this.$routeParams.Destination) && !angular.isUndefined(_this.$routeParams.id)) { - _this.$location.path('/Issue/' + _this.voucher.Date).search({ - Source: _this.getDebitCredit(newJournals, -1), - Destination: _this.getDebitCredit(newJournals, 1) - }); - } - else { - _this.smallGrid = _this.IssueGrid.query({ - date: _this.voucher.Date, - Source: _this.getDebitCredit(newJournals, -1), - Destination: _this.getDebitCredit(newJournals, 1) - }); - } - }, true); - $scope.$watch('vm.voucher.Inventories', function (newInventories, oldInventories) { - if (angular.isUndefined(newInventories) || angular.isUndefined(oldInventories)) { - return; - } - var amount = 0; - for (var i = 0, l = newInventories.length; i < l; i++) { - amount += newInventories[i].Amount; - } - for (i = 0, l = _this.voucher.Journals.length; i < l; i++) { - _this.voucher.Journals[i].Amount = amount; - } - }, true); - } - IssueController.prototype.voucher_Date = function (value) { - if (arguments.length) { - this.voucher.Date = this.asDate(value); - this._voucher_Date = value; - } - return this._voucher_Date; - }; - IssueController.prototype.getOld = function (productID, inventories) { - return _.find(inventories, function (inventory) { - return inventory.Product.ProductID === productID; - }); - }; - IssueController.prototype.add = function () { - var oldInventory = this.getOld(this.batch.Product.ProductID, this.voucher.Inventories), quantity = Number(this.quantity), consumption = (this.getDebitCredit(this.voucher.Journals, -1) === '7b845f95-dfef-fa4a-897c-f0baf15284a3'); - if (!this.batch || !this.batch.Product.ProductID || !quantity) { - return; - } - if (!angular.isUndefined(oldInventory) && - oldInventory.Batch.BatchID === this.batch.BatchID && - (!consumption || oldInventory.Quantity + quantity <= this.batch.QuantityRemaining)) { - oldInventory.Quantity += quantity; - delete this.batch; - delete this.quantity; - this.foBatch = true; - } - if (angular.isUndefined(oldInventory) && (!consumption || quantity <= this.batch.QuantityRemaining)) { - this.voucher.Inventories.push({ - Product: this.batch.Product, - Quantity: quantity, - Rate: this.batch.Rate, - Tax: this.batch.Tax, - Discount: this.batch.Discount, - Amount: quantity * this.batch.Rate * (1 + this.batch.Tax) * (1 - this.batch.Discount), - Batch: this.batch - }); - delete this.batch; - delete this.quantity; - this.foBatch = true; - } - }; - IssueController.prototype.removeInventory = function (inventory) { - var index = this.voucher.Inventories.indexOf(inventory); - this.voucher.Inventories.splice(index, 1); - }; - IssueController.prototype.getDebitCredit = function (journals, type) { - for (var i = 0, l = journals.length; i < l; i++) { - if (journals[i].Debit === type) { - return journals[i].CostCentre.CostCentreID; - } - } - }; - IssueController.prototype.resetVoucher = function () { - var date = this.voucher.Date; - var source = this.getDebitCredit(this.voucher.Journals, -1); - var destination = this.getDebitCredit(this.voucher.Journals, 1); - this.$location.path('/Issue/' + date).search({ Source: source, Destination: destination }); - }; - IssueController.prototype.preventAlteration = function (voucher) { - if (angular.isUndefined(voucher.VoucherID)) { - return !this.Credentials.Perms['Issue']; - } - else if (voucher.Posted && !this.Credentials.Perms['Edit Posted Vouchers']) { - return true; - } - else if (voucher.User.UserID != this.Credentials.Auth.UserID && !this.Credentials.Perms["Edit Other User's Vouchers"]) { - return true; - } - else { - return false; - } - }; - IssueController.prototype.get = function (voucherid) { - var _this = this; - this.voucher = this.Voucher.get({ id: voucherid }, function (u, putResponseHeaders) { - _this.$location.path('/Issue/' + u.VoucherID); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - IssueController.prototype.save = function () { - var _this = this; - this.voucher.$save({ type: 'Issue' }, function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.redirectOnSave(u); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - IssueController.prototype.delete = function () { - var _this = this; - return this.voucher.$delete(function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - var date = u.Date; - var source = _this.getDebitCredit(u.Journals, -1); - var destination = _this.getDebitCredit(u.Journals, 1); - _this.$location.path('/Issue/' + date).search({ Source: source, Destination: destination }).replace(); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - IssueController.prototype.redirectOnSave = function (voucher) { - var _this = this; - if (!angular.isUndefined(this.$routeParams.Source) && !angular.isUndefined(this.$routeParams.Destination) && !angular.isUndefined(this.$routeParams.id)) { - this.Voucher.get({ - type: 'Issue', - Date: this.$routeParams.id, - Source: this.$routeParams.Source, - Destination: this.$routeParams.Destination - }, function (u, putResponseHeaders) { - _this.voucher = u; - }); - this.smallGrid = this.IssueGrid.query({ - date: this.$routeParams.id, - Source: this.$routeParams.Source, - Destination: this.$routeParams.Destination - }); - } - else { - var date = voucher.Date; - var source = this.getDebitCredit(voucher.Journals, -1); - var destination = this.getDebitCredit(voucher.Journals, 1); - this.$location.path('/Issue/' + date).search({ Source: source, Destination: destination }); - } - }; - IssueController.prototype.modal = function (inventory) { - var _this = this; - this.selectedInventory = inventory; - var edit = {}; - angular.copy(this.selectedInventory, edit); - var modalInstance = this.$modal.open({ - backdrop: true, - size: 'lg', - templateUrl: '/app/issue/issue-modal.html', - controllerAs: 'vmModal', - controller: issue_modal_controller_1.IssueModalController, - resolve: { - edit: function () { - return edit; - } - } - }); - modalInstance.result.then(function (updated) { - if (updated.Product.ProductID !== _this.selectedInventory.Batch.Product.ProductID) { - var oldInventory = _this.getOld(updated.Batch.Product.ProductID, _this.voucher.Inventories); - if (!angular.isUndefined(oldInventory)) { - delete _this.selectedInventory; - return false; - } - } - angular.copy(updated, _this.selectedInventory); - delete _this.selectedInventory; - }, function () { - delete _this.selectedInventory; - }); - }; - IssueController.prototype.confirm = function () { - var _this = this; - var modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', /** @class */ (function () { - function class_1($modalInstance) { - this.$modalInstance = $modalInstance; - this.title = "Delete Voucher"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - class_1.prototype.ok = function () { - this.$modalInstance.close(); - }; - class_1.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - return class_1; - }())] - }); - modalInstance.result.then(function () { - return _this.delete(); - }); - return modalInstance; - }; - IssueController.prototype.batches = function ($viewValue) { - var params = { term: $viewValue, count: 20, date: this.voucher.Date }; - return this.Batch.autocomplete(params).$promise; - }; - IssueController.$inject = ['$scope', '$routeParams', '$location', 'asDateFilter', 'IssueGrid', 'Voucher', '$uibModal', 'Batch', 'uibDateParser', 'Messages', 'Credentials']; - return IssueController; -}()); -exports.IssueController = IssueController; -//# sourceMappingURL=issue.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/issue/issue.controller.js.map b/brewman/static/src/app/issue/issue.controller.js.map deleted file mode 100644 index 811d9983..00000000 --- a/brewman/static/src/app/issue/issue.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"issue.controller.js","sourceRoot":"","sources":["issue.controller.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AACnC,0BAA4B;AAC5B,mEAA8D;AAE9D;IAWI,yBAAmB,MAAM,EAAS,YAAY,EAAS,SAAS,EAAS,MAAM,EAAS,SAAS,EAAS,OAAO,EAAS,MAAM,EAAS,KAAK,EAAS,UAAU,EAAS,QAAQ,EAAS,WAAW;QAAtM,iBAmEC;QAnEkB,WAAM,GAAN,MAAM,CAAA;QAAS,iBAAY,GAAZ,YAAY,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,YAAO,GAAP,O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CAAC,QAAQ,GAAG,IAAI,CAAC;oBACzB,CAAC;oBAED,oBAAE,GAAF;wBACI,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;oBAChC,CAAC;oBAED,wBAAM,GAAN;wBACI,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;oBAC1C,CAAC;oBACL,cAAC;gBAAD,CAAC,AAlBiC,IAkBhC;SACL,CAAC,CAAC;QACH,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC;YACtB,OAAO,KAAI,CAAC,MAAM,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;QACH,OAAO,aAAa,CAAC;IACzB,CAAC;IAED,iCAAO,GAAP,UAAQ,UAAU;QACd,IAAM,MAAM,GAAG,EAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAC,CAAC;QACtE,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC;IACpD,CAAC;IArRM,uBAAO,GAAG,CAAC,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;IAsRvK,sBAAC;CAAA,AAvRD,IAuRC;AAvRY,0CAAe"} \ No newline at end of file diff --git a/brewman/static/src/app/issue/issue.controller.ts b/brewman/static/src/app/issue/issue.controller.ts deleted file mode 100644 index c04f0a47..00000000 --- a/brewman/static/src/app/issue/issue.controller.ts +++ /dev/null @@ -1,284 +0,0 @@ -import * as angular from 'angular'; -import * as _ from 'lodash'; -import {IssueModalController} from './issue-modal.controller'; - -export class IssueController { - static $inject = ['$scope', '$routeParams', '$location', 'asDateFilter', 'IssueGrid', 'Voucher', '$uibModal', 'Batch', 'uibDateParser', 'Messages', 'Credentials']; - _voucher_Date: any; - foBatch: any; - selectedInventory: any; - quantity: any; - batch: any; - voucher: any; - costCentres: any; - smallGrid: any; - - constructor(public $scope, public $routeParams, public $location, public asDate, public IssueGrid, public Voucher, public $modal, public Batch, public dateParser, public Messages, public Credentials) { - this.voucher = $scope.$parent.res.voucher; - this.costCentres = $scope.$parent.res.costCentres; - this.smallGrid = $scope.$parent.res.smallGrid; - this._voucher_Date = dateParser.parse(this.voucher.Date, "dd-MMM-yyyy"); - if (angular.isUndefined(this.$routeParams.Source) && angular.isUndefined(this.$routeParams.Destination) && angular.isUndefined(this.$routeParams.id)) { - const date = this.voucher.Date; - const source = this.getDebitCredit(this.voucher.Journals, -1); - const destination = this.getDebitCredit(this.voucher.Journals, 1); - this.$location.path('/Issue/' + date).search({Source: source, Destination: destination}); - } - $scope.$watch('vm.voucher.Date', (newDate, oldDate) => { - const nDate = asDate(newDate), - oDate = asDate(oldDate); - - if (nDate !== oDate && !angular.isUndefined(nDate)) { - if (!angular.isUndefined(this.$routeParams.Source) && !angular.isUndefined(this.$routeParams.Destination) && !angular.isUndefined(this.$routeParams.id)) { - this.$location.path('/Issue/' + nDate).search({ - Source: this.$routeParams.Source, - Destination: this.$routeParams.Destination - }); - } else { - this.smallGrid = this.IssueGrid.query({ - date: nDate, - Source: this.$routeParams.Source, - Destination: this.$routeParams.Destination - }); - } - } - }, true); - - $scope.$watch('vm.voucher.Journals', (newJournals, oldJournals) => { - if (angular.isUndefined(newJournals) || angular.equals(newJournals, oldJournals)) { - return; - } - if (!angular.isUndefined(oldJournals)) { - if (this.getDebitCredit(oldJournals, -1) === this.getDebitCredit(newJournals, -1) && this.getDebitCredit(oldJournals, 1) === this.getDebitCredit(newJournals, 1)) { - return; - } - } - - if (!angular.isUndefined(this.$routeParams.Source) && !angular.isUndefined(this.$routeParams.Destination) && !angular.isUndefined(this.$routeParams.id)) { - this.$location.path('/Issue/' + this.voucher.Date).search({ - Source: this.getDebitCredit(newJournals, -1), - Destination: this.getDebitCredit(newJournals, 1) - }); - } else { - this.smallGrid = this.IssueGrid.query({ - date: this.voucher.Date, - Source: this.getDebitCredit(newJournals, -1), - Destination: this.getDebitCredit(newJournals, 1) - }); - } - }, true); - - $scope.$watch('vm.voucher.Inventories', (newInventories, oldInventories) => { - if (angular.isUndefined(newInventories) || angular.isUndefined(oldInventories)) { - return; - } - var amount = 0; - for (var i = 0, l = newInventories.length; i < l; i++) { - amount += newInventories[i].Amount; - } - for (i = 0, l = this.voucher.Journals.length; i < l; i++) { - this.voucher.Journals[i].Amount = amount; - } - }, true); - } - - voucher_Date(value) { - if (arguments.length) { - this.voucher.Date = this.asDate(value); - this._voucher_Date = value; - } - return this._voucher_Date; - } - - getOld(productID, inventories) { - return _.find(inventories, function (inventory) { - return inventory.Product.ProductID === productID; - }); - } - - add() { - const oldInventory = this.getOld(this.batch.Product.ProductID, this.voucher.Inventories), - quantity = Number(this.quantity), - consumption = (this.getDebitCredit(this.voucher.Journals, -1) === '7b845f95-dfef-fa4a-897c-f0baf15284a3'); - - if (!this.batch || !this.batch.Product.ProductID || !quantity) { - return; - } - - if (!angular.isUndefined(oldInventory) && - oldInventory.Batch.BatchID === this.batch.BatchID && - (!consumption || oldInventory.Quantity + quantity <= this.batch.QuantityRemaining)) { - oldInventory.Quantity += quantity; - delete this.batch; - delete this.quantity; - this.foBatch = true; - } - - if (angular.isUndefined(oldInventory) && (!consumption || quantity <= this.batch.QuantityRemaining)) { - this.voucher.Inventories.push( - { - Product: this.batch.Product, - Quantity: quantity, - Rate: this.batch.Rate, - Tax: this.batch.Tax, - Discount: this.batch.Discount, - Amount: quantity * this.batch.Rate * (1 + this.batch.Tax) * (1 - this.batch.Discount), - Batch: this.batch - }); - delete this.batch; - delete this.quantity; - this.foBatch = true; - } - } - - removeInventory(inventory) { - const index = this.voucher.Inventories.indexOf(inventory); - this.voucher.Inventories.splice(index, 1); - } - - getDebitCredit(journals, type) { - for (var i = 0, l = journals.length; i < l; i++) { - if (journals[i].Debit === type) { - return journals[i].CostCentre.CostCentreID; - } - } - } - - resetVoucher() { - const date = this.voucher.Date; - const source = this.getDebitCredit(this.voucher.Journals, -1); - const destination = this.getDebitCredit(this.voucher.Journals, 1); - this.$location.path('/Issue/' + date).search({Source: source, Destination: destination}); - } - - preventAlteration(voucher) { - if (angular.isUndefined(voucher.VoucherID)) { - return !this.Credentials.Perms['Issue']; - } else if (voucher.Posted && !this.Credentials.Perms['Edit Posted Vouchers']) { - return true; - } else if (voucher.User.UserID != this.Credentials.Auth.UserID && !this.Credentials.Perms["Edit Other User's Vouchers"]) { - return true; - } else { - return false; - } - } - - get(voucherid) { - this.voucher = this.Voucher.get({id: voucherid}, (u, putResponseHeaders) => { - this.$location.path('/Issue/' + u.VoucherID); - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - save() { - this.voucher.$save({type: 'Issue'}, (u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - this.redirectOnSave(u); - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - delete() { - return this.voucher.$delete((u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - const date = u.Date; - const source = this.getDebitCredit(u.Journals, -1); - const destination = this.getDebitCredit(u.Journals, 1); - this.$location.path('/Issue/' + date).search({Source: source, Destination: destination}).replace(); - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - redirectOnSave(voucher) { - if (!angular.isUndefined(this.$routeParams.Source) && !angular.isUndefined(this.$routeParams.Destination) && !angular.isUndefined(this.$routeParams.id)) { - this.Voucher.get({ - type: 'Issue', - Date: this.$routeParams.id, - Source: this.$routeParams.Source, - Destination: this.$routeParams.Destination - }, (u, putResponseHeaders) => { - this.voucher = u; - }); - this.smallGrid = this.IssueGrid.query({ - date: this.$routeParams.id, - Source: this.$routeParams.Source, - Destination: this.$routeParams.Destination - }); - } else { - const date = voucher.Date; - const source = this.getDebitCredit(voucher.Journals, -1); - const destination = this.getDebitCredit(voucher.Journals, 1); - this.$location.path('/Issue/' + date).search({Source: source, Destination: destination}); - } - } - - modal(inventory) { - this.selectedInventory = inventory; - let edit = {}; - angular.copy(this.selectedInventory, edit); - const modalInstance = this.$modal.open({ - backdrop: true, - size: 'lg', - templateUrl: '/app/issue/issue-modal.html', - controllerAs: 'vmModal', - controller: IssueModalController, - resolve: { - edit: function () { - return edit; - } - } - }); - modalInstance.result.then((updated) => { - if (updated.Product.ProductID !== this.selectedInventory.Batch.Product.ProductID) { - let oldInventory = this.getOld(updated.Batch.Product.ProductID, this.voucher.Inventories); - if (!angular.isUndefined(oldInventory)) { - delete this.selectedInventory; - return false; - } - } - angular.copy(updated, this.selectedInventory); - delete this.selectedInventory; - }, () => { - delete this.selectedInventory; - }); - } - - confirm() { - const modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', class { - title: any; - body: any; - isDelete: boolean; - - constructor(public $modalInstance) { - this.title = "Delete Voucher"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - - ok() { - this.$modalInstance.close(); - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - }] - }); - modalInstance.result.then(() => { - return this.delete(); - }); - return modalInstance; - } - - batches($viewValue) { - const params = {term: $viewValue, count: 20, date: this.voucher.Date}; - return this.Batch.autocomplete(params).$promise; - } -} diff --git a/brewman/static/src/app/issue/issue.html b/brewman/static/src/app/issue/issue.html deleted file mode 100644 index 13f420fe..00000000 --- a/brewman/static/src/app/issue/issue.html +++ /dev/null @@ -1,123 +0,0 @@ -
-

Issue Edit / New

- - - - - - - - - - - - -
AmountLoad
{{item.Amount | currency}} - Load -
-
- - -
-
- - - - -
-
-
- -
-
-
- - ₹ - -
-
-
-
- - -
- -
-
-
- - - - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - -
ProductBatchQuantityRateAmountDelete
{{inventory.Product.Name}}{{inventory.Batch.Name}}{{inventory.Quantity | number:2}}{{inventory.Rate | currency}}{{inventory.Amount | currency}} -
- Delete - - -
-
-
- - -
- -
-
-
-
- - - -
-
-
- Created on {{vm.voucher.CreationDate | localTime}} and Last Edited on {{vm.voucher.LastEditDate | localTime}} - by {{vm.voucher.User.Name}}. - -
-
\ No newline at end of file diff --git a/brewman/static/src/app/journal/journal-modal.controller.js b/brewman/static/src/app/journal/journal-modal.controller.js deleted file mode 100644 index 4bf107fb..00000000 --- a/brewman/static/src/app/journal/journal-modal.controller.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var JournalModalController = /** @class */ (function () { - function JournalModalController($scope, $modalInstance, MathSolver, Account) { - this.$scope = $scope; - this.$modalInstance = $modalInstance; - this.MathSolver = MathSolver; - this.Account = Account; - this.edit = $scope.$resolve.edit; - } - JournalModalController.prototype.toggleDebit = function () { - this.edit.Debit = (this.edit.Debit === 1) ? -1 : 1; - }; - JournalModalController.prototype.ok = function () { - this.edit.Amount = this.MathSolver(this.edit.Amount); - if (this.edit.Amount < 0) { - this.edit.Debit *= -1; - this.edit.Amount *= -1; - } - else if (Number.isNaN(this.edit.Amount)) { - this.edit.Amount = 0; - } - this.$modalInstance.close(this.edit); - }; - JournalModalController.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - JournalModalController.prototype.accounts = function ($viewValue) { - return this.Account.autocomplete({ term: $viewValue, count: 20 }).$promise; - }; - JournalModalController.$inject = ['$scope', '$uibModalInstance', 'MathSolver', 'Account']; - return JournalModalController; -}()); -exports.JournalModalController = JournalModalController; -//# sourceMappingURL=journal-modal.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/journal/journal-modal.controller.js.map b/brewman/static/src/app/journal/journal-modal.controller.js.map deleted file mode 100644 index eb1f8a8c..00000000 --- a/brewman/static/src/app/journal/journal-modal.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"journal-modal.controller.js","sourceRoot":"","sources":["journal-modal.controller.ts"],"names":[],"mappings":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C;IAC7E,CAAC;IA7BM,8BAAO,GAAG,CAAC,QAAQ,EAAE,mBAAmB,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;IA8B9E,6BAAC;CAAA,AA/BD,IA+BC;AA/BY,wDAAsB"} \ No newline at end of file diff --git a/brewman/static/src/app/journal/journal-modal.controller.ts b/brewman/static/src/app/journal/journal-modal.controller.ts deleted file mode 100644 index 95d1a0a5..00000000 --- a/brewman/static/src/app/journal/journal-modal.controller.ts +++ /dev/null @@ -1,32 +0,0 @@ -export class JournalModalController { - static $inject = ['$scope', '$uibModalInstance', 'MathSolver', 'Account']; - edit: any; - - constructor(public $scope, public $modalInstance, public MathSolver, public Account) { - this.edit = $scope.$resolve.edit; - } - - toggleDebit() { - this.edit.Debit = (this.edit.Debit === 1) ? -1 : 1; - } - - ok() { - this.edit.Amount = this.MathSolver(this.edit.Amount); - if (this.edit.Amount < 0) { - this.edit.Debit *= -1; - this.edit.Amount *= -1; - } - else if (Number.isNaN(this.edit.Amount)) { - this.edit.Amount = 0; - } - this.$modalInstance.close(this.edit); - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - - accounts($viewValue) { - return this.Account.autocomplete({term: $viewValue, count: 20}).$promise; - } -} diff --git a/brewman/static/src/app/journal/journal-modal.html b/brewman/static/src/app/journal/journal-modal.html deleted file mode 100644 index baf4b4bb..00000000 --- a/brewman/static/src/app/journal/journal-modal.html +++ /dev/null @@ -1,33 +0,0 @@ - \ No newline at end of file diff --git a/brewman/static/src/app/journal/journal-voucher.resolver.js b/brewman/static/src/app/journal/journal-voucher.resolver.js deleted file mode 100644 index 48ab5f00..00000000 --- a/brewman/static/src/app/journal/journal-voucher.resolver.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function JournalVoucherResolver($route, Voucher) { - var id = $route.current.params.id; - if (angular.isUndefined(id)) { - return Voucher.get({ type: 'Journal' }).$promise; - } - else { - return Voucher.get({ id: id }).$promise; - } -} -exports.JournalVoucherResolver = JournalVoucherResolver; -//# sourceMappingURL=journal-voucher.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/journal/journal-voucher.resolver.js.map b/brewman/static/src/app/journal/journal-voucher.resolver.js.map deleted file mode 100644 index ec651dfb..00000000 --- a/brewman/static/src/app/journal/journal-voucher.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"journal-voucher.resolver.js","sourceRoot":"","sources":["journal-voucher.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,gCAAuC,MAAM,EAAE,OAAO;IAClD,IAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IACpC,IAAI,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;QACzB,OAAO,OAAO,CAAC,GAAG,CAAC,EAAC,IAAI,EAAE,SAAS,EAAC,CAAC,CAAC,QAAQ,CAAC;KAClD;SAAM;QACH,OAAO,OAAO,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;KACzC;AACL,CAAC;AAPD,wDAOC"} \ No newline at end of file diff --git a/brewman/static/src/app/journal/journal-voucher.resolver.ts b/brewman/static/src/app/journal/journal-voucher.resolver.ts deleted file mode 100644 index 010e23ce..00000000 --- a/brewman/static/src/app/journal/journal-voucher.resolver.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as angular from 'angular'; - -export function JournalVoucherResolver($route, Voucher) { - const id = $route.current.params.id; - if (angular.isUndefined(id)) { - return Voucher.get({type: 'Journal'}).$promise; - } else { - return Voucher.get({id: id}).$promise; - } -} diff --git a/brewman/static/src/app/journal/journal.component.js b/brewman/static/src/app/journal/journal.component.js deleted file mode 100644 index 9cb23592..00000000 --- a/brewman/static/src/app/journal/journal.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var journal_controller_1 = require("./journal.controller"); -exports.JournalComponent = { - templateUrl: '/app/journal/journal.html', - controller: journal_controller_1.JournalController, - controllerAs: 'vm', -}; -//# sourceMappingURL=journal.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/journal/journal.component.js.map b/brewman/static/src/app/journal/journal.component.js.map deleted file mode 100644 index 0bc65067..00000000 --- a/brewman/static/src/app/journal/journal.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"journal.component.js","sourceRoot":"","sources":["journal.component.ts"],"names":[],"mappings":";;AAAA,2DAAuD;AAE1C,QAAA,gBAAgB,GAAG;IAC5B,WAAW,EAAE,2BAA2B;IACxC,UAAU,EAAE,sCAAiB;IAC7B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/journal/journal.component.ts b/brewman/static/src/app/journal/journal.component.ts deleted file mode 100644 index 0be8bcfa..00000000 --- a/brewman/static/src/app/journal/journal.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {JournalController} from "./journal.controller"; - -export const JournalComponent = { - templateUrl: '/app/journal/journal.html', - controller: JournalController, - controllerAs: 'vm', -}; \ No newline at end of file diff --git a/brewman/static/src/app/journal/journal.controller.js b/brewman/static/src/app/journal/journal.controller.js deleted file mode 100644 index 017a0c0d..00000000 --- a/brewman/static/src/app/journal/journal.controller.js +++ /dev/null @@ -1,222 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var _ = require("lodash"); -var journal_modal_controller_1 = require("./journal-modal.controller"); -var JournalController = /** @class */ (function () { - function JournalController($scope, $location, asDate, $modal, UploadedImageResizer, MathSolver, Account, dateParser, Messages, Credentials) { - var _this = this; - this.$scope = $scope; - this.$location = $location; - this.asDate = asDate; - this.$modal = $modal; - this.UploadedImageResizer = UploadedImageResizer; - this.MathSolver = MathSolver; - this.Account = Account; - this.dateParser = dateParser; - this.Messages = Messages; - this.Credentials = Credentials; - this.voucher = $scope.$parent.res.voucher; - this._voucher_Date = dateParser.parse(this.voucher.Date, "dd-MMM-yyyy"); - this.foAccount = true; - this.debit = "1"; - $scope.$on("fileSelected", function (event, args) { - UploadedImageResizer(args, _this.voucher.Files); - }); - $scope.$watch('vm.voucher.Journals', function (journals) { - if (!angular.isArray(journals)) { - return; - } - var amount = journals.reduce(function (previousValue, currentValue) { - return previousValue + (currentValue.Amount * currentValue.Debit); - }, 0); - _this.amount = Math.abs(amount); - }, true); - $scope.$watch('vm.account', function (account) { - if (!account) { - delete _this.accBal; - } - else { - Account.balance({ id: account.LedgerID, d: _this.voucher.Date }, function (bal) { - _this.accBal = bal; - }); - } - }, true); - } - JournalController.prototype.voucher_Date = function (value) { - if (arguments.length) { - this.voucher.Date = this.asDate(value); - this._voucher_Date = value; - } - return this._voucher_Date; - }; - JournalController.prototype.getOld = function (ledgerID, journals) { - return _.find(journals, function (journal) { - return journal.Ledger.LedgerID === ledgerID; - }); - }; - JournalController.prototype.deleteFile = function (item) { - var index = this.voucher.Files.indexOf(item); - this.voucher.Files.splice(index, 1); - }; - JournalController.prototype.zoomImage = function (item) { - this.$modal.open({ - templateUrl: '/template/modal/image.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', /** @class */ (function () { - function class_1($modalInstance) { - this.$modalInstance = $modalInstance; - this.imageUrl = item.Resized; - this.size = null; - } - class_1.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - return class_1; - }())] - }); - }; - JournalController.prototype.add = function () { - var amount, oldJournal, debit = parseInt(this.debit); - if (!this.account || !this.account.LedgerID) { - return; - } - amount = this.MathSolver(this.amount); - if (Number.isNaN(amount) || amount === 0) { - return; - } - if (amount < 0) { - amount *= -1; - debit *= -1; - } - oldJournal = this.getOld(this.account.LedgerID, this.voucher.Journals); - if (!angular.isUndefined(oldJournal)) { - amount = (oldJournal.Debit * oldJournal.Amount) + (debit * amount); - if (amount < 0) { - oldJournal.Debit = -1; - oldJournal.Amount = amount * -1; - } - else { - oldJournal.Debit = 1; - oldJournal.Amount = amount; - } - } - else { - this.voucher.Journals.push({ Debit: debit, Amount: amount, Ledger: this.account }); - } - delete this.account; - delete this.amount; - this.foAccount = true; - }; - JournalController.prototype.removeJournal = function (journal) { - var index = this.voucher.Journals.indexOf(journal); - this.voucher.Journals.splice(index, 1); - }; - JournalController.prototype.preventAlteration = function (voucher) { - if (angular.isUndefined(this.Credentials.Perms)) { - return false; - } - else if (angular.isUndefined(voucher.VoucherID)) { - return !this.Credentials.Perms['Journal']; - } - else if (voucher.Posted && !this.Credentials.Perms['Edit Posted Vouchers']) { - return true; - } - else if (voucher.User.UserID !== this.Credentials.Auth.UserID && !this.Credentials.Perms["Edit Other User's Vouchers"]) { - return true; - } - else { - return false; - } - }; - JournalController.prototype.save = function () { - var _this = this; - return this.voucher.$save({ type: 'Journal' }, function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/Journal/' + u.VoucherID); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - JournalController.prototype.delete = function () { - var _this = this; - this.voucher.$delete(function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/Journal').replace(); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - JournalController.prototype.post = function () { - var _this = this; - return this.voucher.$post(function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - JournalController.prototype.modal = function (journal) { - var _this = this; - this.selectedJournal = journal; - var edit = {}; - angular.copy(this.selectedJournal, edit); - var modalInstance = this.$modal.open({ - backdrop: true, - size: 'lg', - templateUrl: '/app/journal/journal-modal.html', - controllerAs: 'vmModal', - controller: journal_modal_controller_1.JournalModalController, - resolve: { - edit: function () { - return edit; - } - } - }); - modalInstance.result.then(function (updated) { - if (updated.Ledger.LedgerID !== _this.selectedJournal.Ledger.LedgerID) { - var oldJournal = _this.getOld(updated.Ledger.LedgerID, _this.voucher.Journals); - if (!angular.isUndefined(oldJournal)) { - delete _this.selectedJournal; - return false; - } - } - angular.copy(updated, _this.selectedJournal); - delete _this.selectedJournal; - }, function () { - delete _this.selectedJournal; - }); - }; - JournalController.prototype.confirm = function () { - var _this = this; - var modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', /** @class */ (function () { - function class_2($modalInstance) { - this.$modalInstance = $modalInstance; - this.title = "Delete Voucher"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - class_2.prototype.ok = function () { - this.$modalInstance.close(); - }; - class_2.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - return class_2; - }())] - }); - modalInstance.result.then(function () { - _this.delete(); - }); - }; - JournalController.prototype.accounts = function ($viewValue) { - return this.Account.autocomplete({ term: $viewValue, count: 20 }).$promise; - }; - JournalController.$inject = ['$scope', '$location', 'asDateFilter', '$uibModal', 'UploadedImageResizer', 'MathSolver', 'Account', 'uibDateParser', 'Messages', 'Credentials']; - return JournalController; -}()); -exports.JournalController = JournalController; -//# sourceMappingURL=journal.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/journal/journal.controller.js.map b/brewman/static/src/app/journal/journal.controller.js.map deleted file mode 100644 index e8c44927..00000000 --- a/brewman/static/src/app/journal/journal.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"journal.controller.js","sourceRoot":"","sources":["journal.controller.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AACnC,0BAA4B;AAC5B,uEAAkE;AAElE;IAWI,2BAAmB,MAAM,EAAS,SAAS,EAAS,MAAM,EAAS,MAAM,EAAS,oBAAoB,EAAS,UAAU,EAAS,OAAO,EAAS,UAAU,EAAS,QAAQ,EAAS,WAAW;QAAjM,iBA4BC;QA5BkB,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,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ACJ,CAAC;IACN,CAAC;IAED,mCAAO,GAAP;QAAA,iBA4BC;QA3BG,IAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YACnC,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,8BAA8B;YAC3C,YAAY,EAAE,SAAS;YACvB,UAAU,EAAE,CAAC,mBAAmB;oBAK5B,iBAAmB,cAAc;wBAAd,mBAAc,GAAd,cAAc,CAAA;wBAC7B,IAAI,CAAC,KAAK,GAAG,gBAAgB,CAAC;wBAC9B,IAAI,CAAC,IAAI,GAAG,sCAAsC,CAAC;wBACnD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;oBACzB,CAAC;oBAED,oBAAE,GAAF;wBACI,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;oBAChC,CAAC;oBAED,wBAAM,GAAN;wBACI,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;oBAC1C,CAAC;oBACL,cAAC;gBAAD,CAAC,AAlBiC,IAkBhC;SACL,CAAC,CAAC;QACH,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC;YACtB,KAAI,CAAC,MAAM,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACP,CAAC;IAED,oCAAQ,GAAR,UAAS,UAAU;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;IAC7E,CAAC;IA9NM,yBAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,sBAAsB,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;IA+NvK,wBAAC;CAAA,AAhOD,IAgOC;AAhOY,8CAAiB"} \ No newline at end of file diff --git a/brewman/static/src/app/journal/journal.controller.ts b/brewman/static/src/app/journal/journal.controller.ts deleted file mode 100644 index 65869193..00000000 --- a/brewman/static/src/app/journal/journal.controller.ts +++ /dev/null @@ -1,229 +0,0 @@ -import * as angular from 'angular'; -import * as _ from 'lodash'; -import {JournalModalController} from './journal-modal.controller'; - -export class JournalController { - static $inject = ['$scope', '$location', 'asDateFilter', '$uibModal', 'UploadedImageResizer', 'MathSolver', 'Account', 'uibDateParser', 'Messages', 'Credentials']; - _voucher_Date: any; - foAccount: any; - debit: any; - selectedJournal: any; - amount: any; - account: any; - voucher: any; - accBal: any; - - constructor(public $scope, public $location, public asDate, public $modal, public UploadedImageResizer, public MathSolver, public Account, public dateParser, public Messages, public Credentials) { - this.voucher = $scope.$parent.res.voucher; - this._voucher_Date = dateParser.parse(this.voucher.Date, "dd-MMM-yyyy"); - this.foAccount = true; - this.debit = "1"; - $scope.$on("fileSelected", (event, args) => { - UploadedImageResizer(args, this.voucher.Files); - }); - $scope.$watch('vm.voucher.Journals', (journals) => { - if (!angular.isArray(journals)) { - return; - } - const amount = journals.reduce(function (previousValue, currentValue) { - return previousValue + (currentValue.Amount * currentValue.Debit); - }, 0); - this.amount = Math.abs(amount); - }, true); - - $scope.$watch('vm.account', (account) => { - if (!account) { - delete this.accBal; - } - else { - Account.balance({id: account.LedgerID, d: this.voucher.Date}, (bal) => { - this.accBal = bal; - }); - } - }, true); - } - - voucher_Date(value) { - if (arguments.length) { - this.voucher.Date = this.asDate(value); - this._voucher_Date = value; - } - return this._voucher_Date; - } - - getOld(ledgerID, journals) { - return _.find(journals, function (journal) { - return journal.Ledger.LedgerID === ledgerID; - }); - } - - deleteFile(item) { - const index = this.voucher.Files.indexOf(item); - this.voucher.Files.splice(index, 1); - } - - zoomImage(item) { - this.$modal.open({ - templateUrl: '/template/modal/image.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', class { - imageUrl: any; - size: any; - - constructor(public $modalInstance) { - this.imageUrl = item.Resized; - this.size = null; - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - }] - }); - } - - add() { - let amount, - oldJournal, - debit = parseInt(this.debit); - - if (!this.account || !this.account.LedgerID) { - return; - } - amount = this.MathSolver(this.amount); - if (Number.isNaN(amount) || amount === 0) { - return; - } - if (amount < 0) { - amount *= -1; - debit *= -1; - } - oldJournal = this.getOld(this.account.LedgerID, this.voucher.Journals); - if (!angular.isUndefined(oldJournal)) { - amount = (oldJournal.Debit * oldJournal.Amount) + (debit * amount); - if (amount < 0) { - oldJournal.Debit = -1; - oldJournal.Amount = amount * -1; - } else { - oldJournal.Debit = 1; - oldJournal.Amount = amount; - } - } else { - this.voucher.Journals.push({Debit: debit, Amount: amount, Ledger: this.account}); - } - delete this.account; - delete this.amount; - this.foAccount = true; - } - - removeJournal(journal) { - const index = this.voucher.Journals.indexOf(journal); - this.voucher.Journals.splice(index, 1); - } - - preventAlteration(voucher) { - if (angular.isUndefined(this.Credentials.Perms)) { - return false; - } else if (angular.isUndefined(voucher.VoucherID)) { - return !this.Credentials.Perms['Journal']; - } else if (voucher.Posted && !this.Credentials.Perms['Edit Posted Vouchers']) { - return true; - } else if (voucher.User.UserID !== this.Credentials.Auth.UserID && !this.Credentials.Perms["Edit Other User's Vouchers"]) { - return true; - } else { - return false; - } - } - - save() { - return this.voucher.$save({type: 'Journal'}, (u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/Journal/' + u.VoucherID); - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - delete() { - this.voucher.$delete((u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/Journal').replace(); - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - post() { - return this.voucher.$post((u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - modal(journal) { - this.selectedJournal = journal; - let edit = {}; - angular.copy(this.selectedJournal, edit); - const modalInstance = this.$modal.open({ - backdrop: true, - size: 'lg', - templateUrl: '/app/journal/journal-modal.html', - controllerAs: 'vmModal', - controller: JournalModalController, - resolve: { - edit: function () { - return edit; - } - } - }); - modalInstance.result.then((updated) => { - if (updated.Ledger.LedgerID !== this.selectedJournal.Ledger.LedgerID) { - const oldJournal = this.getOld(updated.Ledger.LedgerID, this.voucher.Journals); - if (!angular.isUndefined(oldJournal)) { - delete this.selectedJournal; - return false; - } - } - angular.copy(updated, this.selectedJournal); - delete this.selectedJournal; - }, () => { - delete this.selectedJournal; - } - ); - } - - confirm() { - const modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', class { - title: any; - body: any; - isDelete: boolean; - - constructor(public $modalInstance) { - this.title = "Delete Voucher"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - - ok() { - this.$modalInstance.close(); - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - }] - }); - modalInstance.result.then(() => { - this.delete(); - }); - } - - accounts($viewValue) { - return this.Account.autocomplete({term: $viewValue, count: 20}).$promise; - } -} diff --git a/brewman/static/src/app/journal/journal.html b/brewman/static/src/app/journal/journal.html deleted file mode 100644 index b28aad1d..00000000 --- a/brewman/static/src/app/journal/journal.html +++ /dev/null @@ -1,117 +0,0 @@ -
-

Journal Edit / New

- -
- - -
-
- - - - -
-
-
-
- - -
- -
-
- - -

Balance as on Date: {{vm.accBal.Date | accounting}} / {{vm.accBal.Total - | accounting}}

-
-
-
- ₹ - - - - -
-
-
- - - - - - - - - - - - - - - - - - - - -
DebitNameAmountDelete
{{journal.Debit | debit}}{{journal.Ledger.Name}}{{journal.Amount | currency}} -
- Delete - - -
-
-
- - -
- -
-
-
-
-
- - -
- - -
-
-
-
- - - -
-
-
- Created on {{vm.voucher.CreationDate | localTime}} and Last Edited on {{vm.voucher.LastEditDate | localTime}} - by {{vm.voucher.User.Name}}. Posted by {{vm.voucher.Poster}} - -
-
diff --git a/brewman/static/src/app/ledger/ledger.component.js b/brewman/static/src/app/ledger/ledger.component.js deleted file mode 100644 index 0b9bda41..00000000 --- a/brewman/static/src/app/ledger/ledger.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var ledger_controller_1 = require("./ledger.controller"); -exports.LedgerComponent = { - templateUrl: '/app/ledger/ledger.html', - controller: ledger_controller_1.LedgerController, - controllerAs: 'vm' -}; -//# sourceMappingURL=ledger.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/ledger/ledger.component.js.map b/brewman/static/src/app/ledger/ledger.component.js.map deleted file mode 100644 index 6c61916b..00000000 --- a/brewman/static/src/app/ledger/ledger.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ledger.component.js","sourceRoot":"","sources":["ledger.component.ts"],"names":[],"mappings":";;AACA,yDAAwD;AAG3C,QAAA,eAAe,GAAG;IAC3B,WAAW,EAAE,yBAAyB;IACtC,UAAU,EAAE,oCAAgB;IAC5B,YAAY,EAAE,IAAI;CACrB,CAAA"} \ No newline at end of file diff --git a/brewman/static/src/app/ledger/ledger.component.ts b/brewman/static/src/app/ledger/ledger.component.ts deleted file mode 100644 index 551703db..00000000 --- a/brewman/static/src/app/ledger/ledger.component.ts +++ /dev/null @@ -1,9 +0,0 @@ -import * as angular from 'angular'; -import { LedgerController } from './ledger.controller'; -import { LedgerResolver } from './ledger.resolver'; - -export const LedgerComponent = { - templateUrl: '/app/ledger/ledger.html', - controller: LedgerController, - controllerAs: 'vm' -} \ No newline at end of file diff --git a/brewman/static/src/app/ledger/ledger.controller.js b/brewman/static/src/app/ledger/ledger.controller.js deleted file mode 100644 index 58c04ce4..00000000 --- a/brewman/static/src/app/ledger/ledger.controller.js +++ /dev/null @@ -1,158 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var _ = require("lodash"); -var $ = require("jquery"); -var LedgerController = /** @class */ (function () { - function LedgerController($scope, $routeParams, $location, asDate, Ledger, Account, dateParser) { - var _this = this; - this.$scope = $scope; - this.$routeParams = $routeParams; - this.$location = $location; - this.asDate = asDate; - this.Ledger = Ledger; - this.Account = Account; - this.dateParser = dateParser; - this.ledger = $scope.$parent.res.ledger; - this._info_StartDate = dateParser.parse(this.ledger.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.ledger.FinishDate, "dd-MMM-yyyy"); - this.info = this.ledger; - this.selected = -1; - this.hidden = []; - if ($routeParams.id) { - this.foGrid = true; - } - else { - this.foLedger = true; - } - $scope.$watch('vm.hidden', function () { - var filtered = _this.doFilter(_this.hidden, _this.info.Body); - _this.ledger = filtered.Body; - _this.footer = filtered.Footer; - }, true); - $scope.$watch('vm.info', function () { - var filtered = _this.doFilter(_this.hidden, _this.info.Body); - _this.ledger = filtered.Body; - _this.footer = filtered.Footer; - }, true); - this.shortcuts = { - 'up': function (e) { - if (_this.selected > 0) { - $scope.$apply(function () { - _this.selected = Math.min(Math.max(0, _this.selected - 1), _this.ledger.length - 1); - }); - $("#" + _this.selected).scrollintoview(); - e.preventDefault(); - } - }, - 'down': function (e) { - if (_this.selected < _this.ledger.length - 1) { - $scope.$apply(function () { - _this.selected = Math.min(Math.max(0, _this.selected + 1), _this.ledger.length - 1); - }); - $("#" + _this.selected).scrollintoview(); - e.preventDefault(); - } - }, - 'alt+r': function (e) { - if (_this.selected > -1) { - $scope.$apply(function () { - var max = _this.ledger.length; - _this.hidden.push(_this.ledger[_this.selected].ID); - if (_this.selected === max - 1) { - _this.selected = max - 2; - } - }); - } - e.preventDefault(); - }, - 'enter': function (e) { - var path = _this.info.Body[_this.selected].Url.replace(/^(?:\/\/|[^\/]+)*/, ""); - $scope.$apply(function () { - _this.$location.path(path).search('StartDate', null).search('FinishDate', null); - }); - e.preventDefault(); - }, - 'alt+u': function (e) { - if (_this.hidden.length !== 0) { - $scope.$apply(function () { - _this.hidden.pop(); - }); - } - e.preventDefault(); - } - }; - } - LedgerController.prototype.info_StartDate = function (value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - }; - LedgerController.prototype.info_FinishDate = function (value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - }; - LedgerController.prototype.show = function () { - var _this = this; - var id = this.info.Ledger.LedgerID, startDate = this.info.StartDate, finishDate = this.info.FinishDate; - if (id === this.$routeParams.id && startDate === this.$routeParams.StartDate && finishDate === this.$routeParams.FinishDate) { - this.Ledger.get({ id: id, StartDate: startDate, FinishDate: finishDate }, function (data) { - _this.info = data; - }); - } - else { - this.$location.path('/Ledger/' + id).search('StartDate', startDate).search('FinishDate', finishDate); - } - }; - LedgerController.prototype.downloadTable = function () { - var table = $('#gvGrid'), html = table.clone().wrap('
').parent().html(); - html = html.replace(/á/g, 'á'); - window.open('data:application/vnd.ms-excel;charset=UTF-8,' + encodeURIComponent(html)); - }; - LedgerController.prototype.setSelected = function (index) { - this.selected = index; - }; - LedgerController.prototype.doFilter = function (hidden, input) { - var data = angular.copy(input), debit = 0, credit = 0, running = 0; - if (hidden.length !== 0) { - data = _.filter(data, function (item) { - return !_.some(hidden, function (hi) { - return item.ID === hi; - }); - }); - } - _.forEach(data, function (item) { - if (item.Type !== 'Opening Balance') { - debit += item.Debit; - credit += item.Credit; - if (item.Posted) { - running += item.Debit - item.Credit; - } - } - else { - running += item.Debit - item.Credit; - } - item.Running = running; - }); - return { - Body: data, - Footer: { - Debit: debit, - Credit: credit, - Running: running - } - }; - }; - LedgerController.prototype.accounts = function ($viewValue) { - return this.Account.autocomplete({ term: $viewValue, count: 20 }).$promise; - }; - LedgerController.$inject = ['$scope', '$routeParams', '$location', 'asDateFilter', 'Ledger', 'Account', 'uibDateParser']; - return LedgerController; -}()); -exports.LedgerController = LedgerController; -//# sourceMappingURL=ledger.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/ledger/ledger.controller.js.map b/brewman/static/src/app/ledger/ledger.controller.js.map deleted file mode 100644 index c0befda2..00000000 --- a/brewman/static/src/app/ledger/ledger.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ledger.controller.js","sourceRoot":"","sources":["ledger.controller.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AACnC,0BAA4B;AAC5B,0BAA4B;AAE5B;IAaI,0BAAmB,MAAM,EAAS,YAAY,EAAS,SAAS,EAAS,MAAM,EAAS,MAAM,EAAS,OAAO,EAAS,UAAU;QAAjI,iBAuEC;QAvEkB,WAAM,GAAN,MAAM,CAAA;QAAS,iBAAY,GAAZ,YAAY,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,YAAO,GAAP,OAAO,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QAC7H,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;QACxC,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QAC9E,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;QAChF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,YAAY,CAAC,EAAE,EAAE;YACjB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;SACtB;aAAM;YACH,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;SACxB;QACD,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;YACvB,IAAM,QAAQ,GAAG,KAAI,CAAC,QAAQ,CAAC,KAAI,CAAC,MAAM,EAAE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iB,EAAE;gBACjC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC;gBACpB,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC;gBACtB,IAAI,IAAI,CAAC,MAAM,EAAE;oBACb,OAAO,IAAI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;iBACvC;aACJ;iBAAM;gBACH,OAAO,IAAI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;aACvC;YACD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAC3B,CAAC,CAAC,CAAC;QACH,OAAO;YACH,IAAI,EAAE,IAAI;YACV,MAAM,EAAE;gBACJ,KAAK,EAAE,KAAK;gBACZ,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,OAAO;aACnB;SACJ,CAAC;IACN,CAAC;IAED,mCAAQ,GAAR,UAAS,UAAU;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;IAC7E,CAAC;IAjKM,wBAAO,GAAG,CAAC,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;IAkKnH,uBAAC;CAAA,AAnKD,IAmKC;AAnKY,4CAAgB"} \ No newline at end of file diff --git a/brewman/static/src/app/ledger/ledger.controller.ts b/brewman/static/src/app/ledger/ledger.controller.ts deleted file mode 100644 index 875ae915..00000000 --- a/brewman/static/src/app/ledger/ledger.controller.ts +++ /dev/null @@ -1,168 +0,0 @@ -import * as angular from 'angular'; -import * as _ from 'lodash'; -import * as $ from 'jquery'; - -export class LedgerController { - static $inject = ['$scope', '$routeParams', '$location', 'asDateFilter', 'Ledger', 'Account', 'uibDateParser']; - _info_StartDate: any; - _info_FinishDate: any; - info: any; - selected: any; - hidden: any; - foGrid: boolean; - foLedger: boolean; - shortcuts: any; - footer: any; - ledger: any; - - constructor(public $scope, public $routeParams, public $location, public asDate, public Ledger, public Account, public dateParser) { - this.ledger = $scope.$parent.res.ledger; - this._info_StartDate = dateParser.parse(this.ledger.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.ledger.FinishDate, "dd-MMM-yyyy"); - this.info = this.ledger; - this.selected = -1; - this.hidden = []; - if ($routeParams.id) { - this.foGrid = true; - } else { - this.foLedger = true; - } - $scope.$watch('vm.hidden', () => { - const filtered = this.doFilter(this.hidden, this.info.Body); - this.ledger = filtered.Body; - this.footer = filtered.Footer; - }, true); - - $scope.$watch('vm.info', () => { - const filtered = this.doFilter(this.hidden, this.info.Body); - this.ledger = filtered.Body; - this.footer = filtered.Footer; - }, true); - - this.shortcuts = { - 'up': (e) => { - if (this.selected > 0) { - $scope.$apply(() => { - this.selected = Math.min(Math.max(0, this.selected - 1), this.ledger.length - 1); - }); - $("#" + this.selected).scrollintoview(); - e.preventDefault(); - } - }, - 'down': (e) => { - if (this.selected < this.ledger.length - 1) { - $scope.$apply(() => { - this.selected = Math.min(Math.max(0, this.selected + 1), this.ledger.length - 1); - }); - $("#" + this.selected).scrollintoview(); - e.preventDefault(); - } - }, - 'alt+r': (e) => { - if (this.selected > -1) { - $scope.$apply(() => { - const max = this.ledger.length; - this.hidden.push(this.ledger[this.selected].ID); - if (this.selected === max - 1) { - this.selected = max - 2; - } - }); - } - e.preventDefault(); - }, - 'enter': (e) => { - const path = this.info.Body[this.selected].Url.replace(/^(?:\/\/|[^\/]+)*/, ""); - $scope.$apply(() => { - this.$location.path(path).search('StartDate', null).search('FinishDate', null); - }); - e.preventDefault(); - }, - 'alt+u': (e) => { - if (this.hidden.length !== 0) { - $scope.$apply(() => { - this.hidden.pop(); - }); - } - e.preventDefault(); - } - }; - } - - info_StartDate(value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - } - - info_FinishDate(value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - } - - show() { - let id = this.info.Ledger.LedgerID, - startDate = this.info.StartDate, - finishDate = this.info.FinishDate; - if (id === this.$routeParams.id && startDate === this.$routeParams.StartDate && finishDate === this.$routeParams.FinishDate) { - this.Ledger.get({id: id, StartDate: startDate, FinishDate: finishDate}, (data) => { - this.info = data; - }); - } else { - this.$location.path('/Ledger/' + id).search('StartDate', startDate).search('FinishDate', finishDate); - } - } - - downloadTable() { - let table = $('#gvGrid'), - html = table.clone().wrap('
').parent().html(); - html = html.replace(/á/g, 'á'); - window.open('data:application/vnd.ms-excel;charset=UTF-8,' + encodeURIComponent(html)); - } - - setSelected(index) { - this.selected = index; - } - - doFilter(hidden, input) { - let data = angular.copy(input), - debit = 0, credit = 0, running = 0; - - if (hidden.length !== 0) { - data = _.filter(data, function (item) { - return !_.some(hidden, function (hi) { - return item.ID === hi; - }); - }); - } - - _.forEach(data, function (item) { - if (item.Type !== 'Opening Balance') { - debit += item.Debit; - credit += item.Credit; - if (item.Posted) { - running += item.Debit - item.Credit; - } - } else { - running += item.Debit - item.Credit; - } - item.Running = running; - }); - return { - Body: data, - Footer: { - Debit: debit, - Credit: credit, - Running: running - } - }; - } - - accounts($viewValue) { - return this.Account.autocomplete({term: $viewValue, count: 20}).$promise; - } -} diff --git a/brewman/static/src/app/ledger/ledger.html b/brewman/static/src/app/ledger/ledger.html deleted file mode 100644 index e474a245..00000000 --- a/brewman/static/src/app/ledger/ledger.html +++ /dev/null @@ -1,87 +0,0 @@ -
-

Ledger

- -
- - -
-
- - - - -
-
-
-
- - - - -
-
-
-
- - -
-
- - - - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DateParticularsTypeNarrationDebitCreditRunning
{{item.Date}}{{item.Name}}{{item.Name}}{{item.Type}}{{item.Narration}}{{item.Debit | currency | clr}}{{item.Credit | currency | clr}}{{item.Running | accounting}}
Closing BalanceClosing Balance{{vm.footer.Debit | currency}}{{vm.footer.Credit | currency}}{{vm.footer.Running | accounting}}
-
-
- -
-
-
diff --git a/brewman/static/src/app/ledger/ledger.resolver.js b/brewman/static/src/app/ledger/ledger.resolver.js deleted file mode 100644 index 4dee3f14..00000000 --- a/brewman/static/src/app/ledger/ledger.resolver.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function LedgerResolver($route, Ledger) { - var id = $route.current.params.id, startDate = $route.current.params.StartDate, finishDate = $route.current.params.FinishDate; - if (angular.isUndefined(id)) { - return Ledger.get({}).$promise; - } - else { - return Ledger.get({ id: id, StartDate: startDate, FinishDate: finishDate }).$promise; - } -} -exports.LedgerResolver = LedgerResolver; -//# sourceMappingURL=ledger.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/ledger/ledger.resolver.js.map b/brewman/static/src/app/ledger/ledger.resolver.js.map deleted file mode 100644 index e4d191ac..00000000 --- a/brewman/static/src/app/ledger/ledger.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ledger.resolver.js","sourceRoot":"","sources":["ledger.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,wBAA+B,MAAM,EAAE,MAAM;IACzC,IAAI,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAC7B,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAC3C,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;IAElD,IAAI,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;QACzB,OAAO,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;KAClC;SAAM;QACH,OAAO,MAAM,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAC,CAAC,CAAC,QAAQ,CAAC;KACtF;AACL,CAAC;AAVD,wCAUC"} \ No newline at end of file diff --git a/brewman/static/src/app/ledger/ledger.resolver.ts b/brewman/static/src/app/ledger/ledger.resolver.ts deleted file mode 100644 index 1f5ae4d7..00000000 --- a/brewman/static/src/app/ledger/ledger.resolver.ts +++ /dev/null @@ -1,13 +0,0 @@ -import * as angular from 'angular'; - -export function LedgerResolver($route, Ledger) { - var id = $route.current.params.id, - startDate = $route.current.params.StartDate, - finishDate = $route.current.params.FinishDate; - - if (angular.isUndefined(id)) { - return Ledger.get({}).$promise; - } else { - return Ledger.get({id: id, StartDate: startDate, FinishDate: finishDate}).$promise; - } -} diff --git a/brewman/static/src/app/ledger/ledger.service.js b/brewman/static/src/app/ledger/ledger.service.js deleted file mode 100644 index 0d3e53dc..00000000 --- a/brewman/static/src/app/ledger/ledger.service.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function Ledger($resource) { - return $resource('/api/Ledger/:id'); -} -exports.Ledger = Ledger; -//# sourceMappingURL=ledger.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/ledger/ledger.service.js.map b/brewman/static/src/app/ledger/ledger.service.js.map deleted file mode 100644 index 849fea8c..00000000 --- a/brewman/static/src/app/ledger/ledger.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ledger.service.js","sourceRoot":"","sources":["ledger.service.ts"],"names":[],"mappings":";;AAAA,gBAAuB,SAAS;IAC5B,OAAO,SAAS,CAAC,iBAAiB,CAAC,CAAC;AACxC,CAAC;AAFD,wBAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/ledger/ledger.service.ts b/brewman/static/src/app/ledger/ledger.service.ts deleted file mode 100644 index 6b36714b..00000000 --- a/brewman/static/src/app/ledger/ledger.service.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function Ledger($resource) { - return $resource('/api/Ledger/:id'); -} diff --git a/brewman/static/src/app/login/login.component.js b/brewman/static/src/app/login/login.component.js deleted file mode 100644 index d1e19162..00000000 --- a/brewman/static/src/app/login/login.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var login_controller_1 = require("./login.controller"); -exports.LoginComponent = { - templateUrl: '/app/login/login.html', - controller: login_controller_1.LoginController, - controllerAs: 'vm' -}; -//# sourceMappingURL=login.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/login/login.component.js.map b/brewman/static/src/app/login/login.component.js.map deleted file mode 100644 index 98c24ac2..00000000 --- a/brewman/static/src/app/login/login.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"login.component.js","sourceRoot":"","sources":["login.component.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AAEtC,QAAA,cAAc,GAAG;IAC1B,WAAW,EAAE,uBAAuB;IACpC,UAAU,EAAE,kCAAe;IAC3B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/login/login.component.ts b/brewman/static/src/app/login/login.component.ts deleted file mode 100644 index 7d4faa48..00000000 --- a/brewman/static/src/app/login/login.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {LoginController} from "./login.controller"; - -export const LoginComponent = { - templateUrl: '/app/login/login.html', - controller: LoginController, - controllerAs: 'vm' -}; \ No newline at end of file diff --git a/brewman/static/src/app/login/login.controller.js b/brewman/static/src/app/login/login.controller.js deleted file mode 100644 index f04e9e61..00000000 --- a/brewman/static/src/app/login/login.controller.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var LoginController = /** @class */ (function () { - function LoginController($scope, $http, $location, $routeParams, $cookies, Messages) { - this.$scope = $scope; - this.$http = $http; - this.$location = $location; - this.$routeParams = $routeParams; - this.$cookies = $cookies; - this.Messages = Messages; - this.showOTP = false; - this.foUsername = true; - } - LoginController.prototype.submit = function () { - var _this = this; - var data; - if (this.showOTP) { - data = { username: this.username, password: this.password, otp: this.otp, ClientName: this.name }; - } - else { - data = { username: this.username, password: this.password }; - } - this.$http.post('/api/login', data).then(function () { - var came_from = _this.$routeParams.came_from; - if (angular.isUndefined(came_from) || came_from === "" || came_from === "/login" || came_from === "/logout") { - came_from = "/"; - } - _this.$location.url(came_from); - }).catch(function (data, status, headers, config) { - if (status === 403 && ['Unknown Client', 'OTP not supplied', 'OTP is wrong'].indexOf(data) !== -1) { - _this.showOTP = true; - _this.clientID = _this.$cookies.get('ClientID'); - _this.$scope.$apply(); - } - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - LoginController.$inject = ['$scope', '$http', '$location', '$routeParams', '$cookies', 'Messages']; - return LoginController; -}()); -exports.LoginController = LoginController; -//# sourceMappingURL=login.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/login/login.controller.js.map b/brewman/static/src/app/login/login.controller.js.map deleted file mode 100644 index 6863524b..00000000 --- a/brewman/static/src/app/login/login.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"login.controller.js","sourceRoot":"","sources":["login.controller.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC;IAUI,yBAAmB,MAAM,EAAS,KAAK,EAAS,SAAS,EAAS,YAAY,EAAS,QAAQ,EAAS,QAAQ;QAA7F,WAAM,GAAN,MAAM,CAAA;QAAS,UAAK,GAAL,KAAK,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,iBAAY,GAAZ,YAAY,CAAA;QAAS,aAAQ,GAAR,QAAQ,CAAA;QAAS,aAAQ,GAAR,QAAQ,CAAA;QAC5G,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IAC3B,CAAC;IAEM,gCAAM,GAAb;QAAA,iBAsBC;QArBG,IAAI,IAAI,CAAC;QACT,IAAI,IAAI,CAAC,OAAO,EAAE;YACd,IAAI,GAAG,EAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAA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AAW,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAqC9F,sBAAC;CAAA,AAtCD,IAsCC;AAtCY,0CAAe"} \ No newline at end of file diff --git a/brewman/static/src/app/login/login.controller.ts b/brewman/static/src/app/login/login.controller.ts deleted file mode 100644 index e2e834ec..00000000 --- a/brewman/static/src/app/login/login.controller.ts +++ /dev/null @@ -1,41 +0,0 @@ -import * as angular from 'angular'; - -export class LoginController { - static $inject = ['$scope', '$http', '$location', '$routeParams', '$cookies', 'Messages']; - showOTP: any; - foUsername: any; - username: any; - password: any; - otp: any; - name: any; - clientID: any; - - constructor(public $scope, public $http, public $location, public $routeParams, public $cookies, public Messages) { - this.showOTP = false; - this.foUsername = true; - } - - public submit() { - var data; - if (this.showOTP) { - data = {username: this.username, password: this.password, otp: this.otp, ClientName: this.name}; - } else { - data = {username: this.username, password: this.password}; - } - - this.$http.post('/api/login', data).then(() => { - var came_from = this.$routeParams.came_from; - if (angular.isUndefined(came_from) || came_from === "" || came_from === "/login" || came_from === "/logout") { - came_from = "/"; - } - this.$location.url(came_from); - }).catch((data, status, headers, config) => { - if (status === 403 && ['Unknown Client', 'OTP not supplied', 'OTP is wrong'].indexOf(data) !== -1) { - this.showOTP = true; - this.clientID = this.$cookies.get('ClientID'); - this.$scope.$apply(); - } - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } -} diff --git a/brewman/static/src/app/login/login.html b/brewman/static/src/app/login/login.html deleted file mode 100644 index 8b7e4a0a..00000000 --- a/brewman/static/src/app/login/login.html +++ /dev/null @@ -1,48 +0,0 @@ -
-

Please sign in

- -
- - -
- -
-
-
- - -
- -
-
-

ClientID {{vm.clientID}}

- -
- - -
- -
-
-
- - -
- -
-
-
- - -
- Forgot Username / Password -
-
-
-
- -
-
-
diff --git a/brewman/static/src/app/login/logout.component.js b/brewman/static/src/app/login/logout.component.js deleted file mode 100644 index 71de1bf5..00000000 --- a/brewman/static/src/app/login/logout.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var logout_controller_1 = require("./logout.controller"); -exports.LogoutComponent = { - templateUrl: '/app/home.html', - controller: logout_controller_1.LogoutController, - controllerAs: 'vm' -}; -//# sourceMappingURL=logout.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/login/logout.component.js.map b/brewman/static/src/app/login/logout.component.js.map deleted file mode 100644 index 37af5f1b..00000000 --- a/brewman/static/src/app/login/logout.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"logout.component.js","sourceRoot":"","sources":["logout.component.ts"],"names":[],"mappings":";;AAAA,yDAAqD;AAExC,QAAA,eAAe,GAAG;IAC3B,WAAW,EAAE,gBAAgB;IAC7B,UAAU,EAAE,oCAAgB;IAC5B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/login/logout.component.ts b/brewman/static/src/app/login/logout.component.ts deleted file mode 100644 index 861379ee..00000000 --- a/brewman/static/src/app/login/logout.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {LogoutController} from "./logout.controller"; - -export const LogoutComponent = { - templateUrl: '/app/home.html', - controller: LogoutController, - controllerAs: 'vm' -}; diff --git a/brewman/static/src/app/login/logout.controller.js b/brewman/static/src/app/login/logout.controller.js deleted file mode 100644 index acbd7352..00000000 --- a/brewman/static/src/app/login/logout.controller.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var LogoutController = /** @class */ (function () { - function LogoutController($scope, $http, $location, Messages) { - var _this = this; - this.$scope = $scope; - this.$http = $http; - this.$location = $location; - this.Messages = Messages; - this.$http.post('/logout').then(function () { - _this.Messages.push({ Type: 'Success', Message: 'Logged out' }); - _this.$location.path('/'); - }).catch(function (errorMessage) { - _this.Messages.push({ Type: 'Danger', Message: errorMessage.data }); - }); - } - LogoutController.$inject = ['$scope', '$http', '$location', 'Messages']; - return LogoutController; -}()); -exports.LogoutController = LogoutController; -//# sourceMappingURL=logout.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/login/logout.controller.js.map b/brewman/static/src/app/login/logout.controller.js.map deleted file mode 100644 index 8ca96078..00000000 --- a/brewman/static/src/app/login/logout.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"logout.controller.js","sourceRoot":"","sources":["logout.controller.ts"],"names":[],"mappings":";;AAAA;IAGI,0BAAmB,MAAM,EAAS,KAAK,EAAS,SAAS,EAAS,QAAQ;QAA1E,iBAOC;QAPkB,WAAM,GAAN,MAAM,CAAA;QAAS,UAAK,GAAL,KAAK,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,aAAQ,GAAR,QAAQ,CAAA;QACtE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC;YAC5B,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAC,CAAC,CAAC;YAC7D,KAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC,KAAK,CAAC,UAAC,YAAY;YAClB,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAC,IAAI,EAAC,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;IACP,CAAC;IATM,wBAAO,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;IAUlE,uBAAC;CAAA,AAXD,IAWC;AAXY,4CAAgB"} \ No newline at end of file diff --git a/brewman/static/src/app/login/logout.controller.ts b/brewman/static/src/app/login/logout.controller.ts deleted file mode 100644 index 0f5c0016..00000000 --- a/brewman/static/src/app/login/logout.controller.ts +++ /dev/null @@ -1,12 +0,0 @@ -export class LogoutController { - static $inject = ['$scope', '$http', '$location', 'Messages']; - - constructor(public $scope, public $http, public $location, public Messages) { - this.$http.post('/logout').then(() => { - this.Messages.push({Type: 'Success', Message: 'Logged out'}); - this.$location.path('/'); - }).catch((errorMessage) => { - this.Messages.push({Type: 'Danger', Message: errorMessage.data}); - }); - } -} diff --git a/brewman/static/src/app/net-transactions/net-transactions.component.js b/brewman/static/src/app/net-transactions/net-transactions.component.js deleted file mode 100644 index 2c60a1fe..00000000 --- a/brewman/static/src/app/net-transactions/net-transactions.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var net_transactions_controller_1 = require("./net-transactions.controller"); -exports.NetTransactionsComponent = { - templateUrl: '/app/net-transactions/net-transactions.html', - controller: net_transactions_controller_1.NetTransactionsController, - controllerAs: 'vm', -}; -//# sourceMappingURL=net-transactions.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/net-transactions/net-transactions.component.js.map b/brewman/static/src/app/net-transactions/net-transactions.component.js.map deleted file mode 100644 index ba334127..00000000 --- a/brewman/static/src/app/net-transactions/net-transactions.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"net-transactions.component.js","sourceRoot":"","sources":["net-transactions.component.ts"],"names":[],"mappings":";;AAAA,6EAAwE;AAE3D,QAAA,wBAAwB,GAAG;IACpC,WAAW,EAAE,6CAA6C;IAC1D,UAAU,EAAE,uDAAyB;IACrC,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/net-transactions/net-transactions.component.ts b/brewman/static/src/app/net-transactions/net-transactions.component.ts deleted file mode 100644 index efe53e52..00000000 --- a/brewman/static/src/app/net-transactions/net-transactions.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {NetTransactionsController} from "./net-transactions.controller"; - -export const NetTransactionsComponent = { - templateUrl: '/app/net-transactions/net-transactions.html', - controller: NetTransactionsController, - controllerAs: 'vm', -}; diff --git a/brewman/static/src/app/net-transactions/net-transactions.controller.js b/brewman/static/src/app/net-transactions/net-transactions.controller.js deleted file mode 100644 index 73728d64..00000000 --- a/brewman/static/src/app/net-transactions/net-transactions.controller.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var NetTransactionsController = /** @class */ (function () { - function NetTransactionsController($scope, $location, asDate, dateParser) { - this.$scope = $scope; - this.$location = $location; - this.asDate = asDate; - this.dateParser = dateParser; - this.netTransactions = $scope.$parent.res.netTransactions; - this._info_StartDate = dateParser.parse(this.netTransactions.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.netTransactions.FinishDate, "dd-MMM-yyyy"); - this.info = this.netTransactions; - this.foDate = true; - } - NetTransactionsController.prototype.info_StartDate = function (value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - }; - NetTransactionsController.prototype.info_FinishDate = function (value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - }; - NetTransactionsController.prototype.show = function () { - this.$location.path('/NetTransactions').search({ - StartDate: this.info.StartDate, - FinishDate: this.info.FinishDate - }); - }; - NetTransactionsController.$inject = ['$scope', '$location', 'asDateFilter', 'uibDateParser']; - return NetTransactionsController; -}()); -exports.NetTransactionsController = NetTransactionsController; -//# sourceMappingURL=net-transactions.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/net-transactions/net-transactions.controller.js.map b/brewman/static/src/app/net-transactions/net-transactions.controller.js.map deleted file mode 100644 index 6894b23a..00000000 --- a/brewman/static/src/app/net-transactions/net-transactions.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"net-transactions.controller.js","sourceRoot":"","sources":["net-transactions.controller.ts"],"names":[],"mappings":";;AAAA;IAQI,mCAAmB,MAAM,EAAS,SAAS,EAAS,MAAM,EAAS,UAAU;QAA1D,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,WAAM,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AE,eAAe,CAAC,CAAC;IAqC9E,gCAAC;CAAA,AAtCD,IAsCC;AAtCY,8DAAyB"} \ No newline at end of file diff --git a/brewman/static/src/app/net-transactions/net-transactions.controller.ts b/brewman/static/src/app/net-transactions/net-transactions.controller.ts deleted file mode 100644 index 43d53fe0..00000000 --- a/brewman/static/src/app/net-transactions/net-transactions.controller.ts +++ /dev/null @@ -1,39 +0,0 @@ -export class NetTransactionsController { - static $inject = ['$scope', '$location', 'asDateFilter', 'uibDateParser']; - _info_StartDate: any; - _info_FinishDate: any; - info: any; - foDate: any; - netTransactions: any; - - constructor(public $scope, public $location, public asDate, public dateParser) { - this.netTransactions = $scope.$parent.res.netTransactions; - this._info_StartDate = dateParser.parse(this.netTransactions.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.netTransactions.FinishDate, "dd-MMM-yyyy"); - this.info = this.netTransactions; - this.foDate = true; - } - - info_StartDate(value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - } - - info_FinishDate(value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - } - - show() { - this.$location.path('/NetTransactions').search({ - StartDate: this.info.StartDate, - FinishDate: this.info.FinishDate - }); - } -} diff --git a/brewman/static/src/app/net-transactions/net-transactions.html b/brewman/static/src/app/net-transactions/net-transactions.html deleted file mode 100644 index b5cd8961..00000000 --- a/brewman/static/src/app/net-transactions/net-transactions.html +++ /dev/null @@ -1,49 +0,0 @@ -
-

Net Transactions

- -
- - -
-
- - - - -
-
-
-
- - - - -
-
-
- -
-
- - - - - - - - - - - - - - - - - -
TypeNameDebitCredit
{{item.Type}}{{item.Name}}{{item.Debit | accounting}}{{item.Credit | accounting}}
-
diff --git a/brewman/static/src/app/net-transactions/net-transactions.resolver.js b/brewman/static/src/app/net-transactions/net-transactions.resolver.js deleted file mode 100644 index 3b56f766..00000000 --- a/brewman/static/src/app/net-transactions/net-transactions.resolver.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function NetTransactionsResolver($route, NetTransactions) { - var startDate = $route.current.params.StartDate, finishDate = $route.current.params.FinishDate; - if (angular.isUndefined(startDate) || angular.isUndefined(finishDate)) { - return NetTransactions.get({}).$promise; - } - else { - return NetTransactions.get({ StartDate: startDate, FinishDate: finishDate }).$promise; - } -} -exports.NetTransactionsResolver = NetTransactionsResolver; -//# sourceMappingURL=net-transactions.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/net-transactions/net-transactions.resolver.js.map b/brewman/static/src/app/net-transactions/net-transactions.resolver.js.map deleted file mode 100644 index 3be31771..00000000 --- a/brewman/static/src/app/net-transactions/net-transactions.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"net-transactions.resolver.js","sourceRoot":"","sources":["net-transactions.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,iCAAwC,MAAM,EAAE,eAAe;IAC3D,IAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAC7C,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;IAElD,IAAI,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE;QACnE,OAAO,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;KAC3C;SAAM;QACH,OAAO,eAAe,CAAC,GAAG,CAAC,EAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAC,CAAC,CAAC,QAAQ,CAAC;KACvF;AACL,CAAC;AATD,0DASC"} \ No newline at end of file diff --git a/brewman/static/src/app/net-transactions/net-transactions.resolver.ts b/brewman/static/src/app/net-transactions/net-transactions.resolver.ts deleted file mode 100644 index b1ca4bce..00000000 --- a/brewman/static/src/app/net-transactions/net-transactions.resolver.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as angular from 'angular'; - -export function NetTransactionsResolver($route, NetTransactions) { - const startDate = $route.current.params.StartDate, - finishDate = $route.current.params.FinishDate; - - if (angular.isUndefined(startDate) || angular.isUndefined(finishDate)) { - return NetTransactions.get({}).$promise; - } else { - return NetTransactions.get({StartDate: startDate, FinishDate: finishDate}).$promise; - } -} diff --git a/brewman/static/src/app/net-transactions/net-transactions.service.js b/brewman/static/src/app/net-transactions/net-transactions.service.js deleted file mode 100644 index 07b9902e..00000000 --- a/brewman/static/src/app/net-transactions/net-transactions.service.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function NetTransactions($resource) { - return $resource('/api/NetTransactions'); -} -exports.NetTransactions = NetTransactions; -//# sourceMappingURL=net-transactions.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/net-transactions/net-transactions.service.js.map b/brewman/static/src/app/net-transactions/net-transactions.service.js.map deleted file mode 100644 index 0df0273e..00000000 --- a/brewman/static/src/app/net-transactions/net-transactions.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"net-transactions.service.js","sourceRoot":"","sources":["net-transactions.service.ts"],"names":[],"mappings":";;AAAA,yBAAgC,SAAS;IACrC,OAAO,SAAS,CAAC,sBAAsB,CAAC,CAAC;AAC7C,CAAC;AAFD,0CAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/net-transactions/net-transactions.service.ts b/brewman/static/src/app/net-transactions/net-transactions.service.ts deleted file mode 100644 index 6b4695a4..00000000 --- a/brewman/static/src/app/net-transactions/net-transactions.service.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function NetTransactions($resource) { - return $resource('/api/NetTransactions'); -} diff --git a/brewman/static/src/app/overlord.app.js b/brewman/static/src/app/overlord.app.js deleted file mode 100644 index acd4b2a2..00000000 --- a/brewman/static/src/app/overlord.app.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -require("ngCookies"); -require("ngLocale"); -require("ngRoute"); -require("ngResource"); -require("angular-ui-bootstrap"); -require("bootstrap"); -var overlord_routes_1 = require("./overlord.routes"); -var overlord_config_1 = require("./overlord.config"); -var base_controller_1 = require("./base.controller"); -var overlord_services_1 = require("./overlord.services"); -var overlord_filters_1 = require("./overlord.filters"); -var overlord_components_1 = require("./overlord.components"); -var overlord_directive_1 = require("./overlord.directive"); -var app; -(function (app) { - angular.module('overlord', [ - 'ngCookies', - 'ngRoute', - 'ngResource', - 'ui.bootstrap' - ]); - angular - .module('overlord') - .controller('BaseController', base_controller_1.BaseController); - overlord_routes_1.registerRoutes(); - overlord_config_1.configureApp(); - overlord_services_1.addServices(); - overlord_filters_1.addFilters(); - overlord_components_1.addComponents(); - overlord_directive_1.addDirectives(); - app.angularModule = app; -})(app = exports.app || (exports.app = {})); -//# sourceMappingURL=overlord.app.js.map \ No newline at end of file diff --git a/brewman/static/src/app/overlord.app.js.map b/brewman/static/src/app/overlord.app.js.map deleted file mode 100644 index fd02d314..00000000 --- a/brewman/static/src/app/overlord.app.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"overlord.app.js","sourceRoot":"","sources":["overlord.app.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AACnC,qBAAmB;AACnB,oBAAkB;AAClB,mBAAiB;AACjB,sBAAoB;AACpB,gCAA8B;AAC9B,qBAAmB;AAEnB,qDAAiD;AACjD,qDAA+C;AAC/C,qDAAiD;AACjD,yDAAgD;AAChD,uDAA8C;AAC9C,6DAAoD;AACpD,2DAAmD;AAEnD,IAAc,GAAG,CAkBhB;AAlBD,WAAc,GAAG;IACb,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE;QACvB,WAAW;QACX,SAAS;QACT,YAAY;QACZ,cAAc;KACjB,CAAC,CAAC;IACH,OAAO;SACF,MAAM,CAAC,UAAU,CAAC;SAClB,UAAU,CAAC,gBAAgB,EAAE,gCAAc,CAAC,CAAC;IAElD,gCAAc,EAAE,CAAC;IACjB,8BAAY,EAAE,CAAC;IACf,+BAAW,EAAE,CAAC;IACd,6BAAU,EAAE,CAAC;IACb,mCAAa,EAAE,CAAC;IAChB,kCAAa,EAAE,CAAC;IACL,iBAAa,GAAG,GAAG,CAAC;AACnC,CAAC,EAlBa,GAAG,GAAH,WAAG,KAAH,WAAG,QAkBhB"} \ No newline at end of file diff --git a/brewman/static/src/app/overlord.app.ts b/brewman/static/src/app/overlord.app.ts deleted file mode 100644 index 6ef94bc7..00000000 --- a/brewman/static/src/app/overlord.app.ts +++ /dev/null @@ -1,35 +0,0 @@ -import * as angular from 'angular'; -import 'ngCookies'; -import 'ngLocale'; -import 'ngRoute'; -import 'ngResource'; -import 'angular-ui-bootstrap'; -import 'bootstrap'; - -import {registerRoutes} from './overlord.routes'; -import {configureApp} from './overlord.config'; -import {BaseController} from './base.controller'; -import {addServices} from './overlord.services'; -import {addFilters} from './overlord.filters'; -import {addComponents} from './overlord.components'; -import {addDirectives} from "./overlord.directive"; - -export module app { - angular.module('overlord', [ - 'ngCookies', - 'ngRoute', - 'ngResource', - 'ui.bootstrap' - ]); - angular - .module('overlord') - .controller('BaseController', BaseController); - - registerRoutes(); - configureApp(); - addServices(); - addFilters(); - addComponents(); - addDirectives(); - export var angularModule = app; -} diff --git a/brewman/static/src/app/overlord.components.js b/brewman/static/src/app/overlord.components.js deleted file mode 100644 index 7a46cfff..00000000 --- a/brewman/static/src/app/overlord.components.js +++ /dev/null @@ -1,100 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var account_component_1 = require("./account/account.component"); -var account_list_component_1 = require("./account/account-list.component"); -var attendance_component_1 = require("./attendance/attendance.component"); -var balance_sheet_component_1 = require("./balance-sheet/balance-sheet.component"); -var cash_flow_component_1 = require("./cash-flow/cash-flow.component"); -var client_component_1 = require("./client/client.component"); -var client_list_component_1 = require("./client/client-list.component"); -var cost_centre_component_1 = require("./cost-centre/cost-centre.component"); -var cost_centre_list_component_1 = require("./cost-centre/cost-centre-list.component"); -var closing_stock_component_1 = require("./closing-stock/closing-stock.component"); -var daybook_component_1 = require("./daybook/daybook.component"); -var employee_component_1 = require("./employee/employee.component"); -var employee_list_component_1 = require("./employee/employee-list.component"); -var employee_attendance_component_1 = require("./employee/employee-attendance.component"); -var ledger_component_1 = require("./ledger/ledger.component"); -var employee_functions_component_1 = require("./employee/employee-functions.component"); -var group_component_1 = require("./group/group.component"); -var group_list_component_1 = require("./group/group-list.component"); -var issue_component_1 = require("./issue/issue.component"); -var journal_component_1 = require("./journal/journal.component"); -var net_transactions_component_1 = require("./net-transactions/net-transactions.component"); -var payment_component_1 = require("./payment/payment.component"); -var product_component_1 = require("./product/product.component"); -var product_list_component_1 = require("./product/product-list.component"); -var product_group_component_1 = require("./product-group/product-group.component"); -var product_group_list_component_1 = require("./product-group/product-group-list.component"); -var product_ledger_component_1 = require("./product-ledger/product-ledger.component"); -var profit_loss_component_1 = require("./profit-loss/profit-loss.component"); -var purchase_component_1 = require("./purchase/purchase.component"); -var purchase_entries_component_1 = require("./purchase-entries/purchase-entries.component"); -var purchase_return_component_1 = require("./purchase-return/purchase-return.component"); -var purchases_component_1 = require("./purchases/purchases.component"); -var raw_material_cost_component_1 = require("./raw-material-cost/raw-material-cost.component"); -var receipt_component_1 = require("./receipt/receipt.component"); -var reconcile_component_1 = require("./reconcile/reconcile.component"); -var salary_deduction_component_1 = require("./salary-deduction/salary-deduction.component"); -var settings_component_1 = require("./settings/settings.component"); -var stock_movement_component_1 = require("./stock-movement/stock-movement.component"); -var trial_balance_component_1 = require("./trial-balance/trial-balance.component"); -var unposted_component_1 = require("./unposted/unposted.component"); -var user_component_1 = require("./user/user.component"); -var user_list_component_1 = require("./user/user-list.component"); -var incentive_component_1 = require("./incentive/incentive.component"); -var home_component_1 = require("./home/home.component"); -var login_component_1 = require("./login/login.component"); -var logout_component_1 = require("./login/logout.component"); -function addComponents() { - angular.module('overlord') - .component('account', account_component_1.AccountComponent) - .component('accounts', account_list_component_1.AccountListComponent) - .component('attendance', attendance_component_1.AttendanceComponent) - .component('balanceSheet', balance_sheet_component_1.BalanceSheetComponent) - .component('cashFlow', cash_flow_component_1.CashFlowComponent) - .component('client', client_component_1.ClientComponent) - .component('clients', client_list_component_1.ClientListComponent) - .component('costCentre', cost_centre_component_1.CostCentreComponent) - .component('costCentres', cost_centre_list_component_1.CostCentreListComponent) - .component('closingStock', closing_stock_component_1.ClosingStockComponent) - .component('daybook', daybook_component_1.DaybookComponent) - .component('employee', employee_component_1.EmployeeComponent) - .component('employees', employee_list_component_1.EmployeeListComponent) - .component('employeeAttendance', employee_attendance_component_1.EmployeeAttendanceComponent) - .component('employeeFunctions', employee_functions_component_1.EmployeeFunctionsComponent) - .component('group', group_component_1.GroupComponent) - .component('groups', group_list_component_1.GroupListComponent) - .component('home', home_component_1.HomeComponent) - .component('issue', issue_component_1.IssueComponent) - .component('ledger', ledger_component_1.LedgerComponent) - .component('incentive', incentive_component_1.IncentiveComponent) - .component('journal', journal_component_1.JournalComponent) - .component('login', login_component_1.LoginComponent) - .component('logout', logout_component_1.LogoutComponent) - .component('netTransactions', net_transactions_component_1.NetTransactionsComponent) - .component('payment', payment_component_1.PaymentComponent) - .component('product', product_component_1.ProductComponent) - .component('products', product_list_component_1.ProductListComponent) - .component('productGroup', product_group_component_1.ProductGroupComponent) - .component('productGroups', product_group_list_component_1.ProductGroupListComponent) - .component('productLedger', product_ledger_component_1.ProductLedgerComponent) - .component('profitLoss', profit_loss_component_1.ProfitLossComponent) - .component('purchase', purchase_component_1.PurchaseComponent) - .component('purchaseEntries', purchase_entries_component_1.PurchaseEntriesComponent) - .component('purchaseReturn', purchase_return_component_1.PurchaseReturnComponent) - .component('purchases', purchases_component_1.PurchasesComponent) - .component('rawMaterialCost', raw_material_cost_component_1.RawMaterialCostComponent) - .component('receipt', receipt_component_1.ReceiptComponent) - .component('reconcile', reconcile_component_1.ReconcileComponent) - .component('salaryDeduction', salary_deduction_component_1.SalaryDeductionComponent) - .component('settings', settings_component_1.SettingsComponent) - .component('stockMovement', stock_movement_component_1.StockMovementComponent) - .component('trialBalance', trial_balance_component_1.TrialBalanceComponent) - .component('unposted', unposted_component_1.UnpostedComponent) - .component('user', user_component_1.UserComponent) - .component('users', user_list_component_1.UserListComponent); -} -exports.addComponents = addComponents; -//# sourceMappingURL=overlord.components.js.map \ No newline at end of file diff --git a/brewman/static/src/app/overlord.components.js.map b/brewman/static/src/app/overlord.components.js.map deleted file mode 100644 index cf16e813..00000000 --- a/brewman/static/src/app/overlord.components.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"overlord.components.js","sourceRoot":"","sources":["overlord.components.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,iEAA6D;AAC7D,2EAAsE;AACtE,0EAAsE;AACtE,mFAA8E;AAC9E,uEAAkE;AAClE,8DAA0D;AAC1D,wEAAmE;AACnE,6EAAwE;AACxE,uFAAiF;AACjF,mFAA8E;AAC9E,iEAA6D;AAC7D,oEAAgE;AAChE,8EAAyE;AACzE,0FAAqF;AACrF,8DAA0D;AAC1D,wFAAmF;AACnF,2DAAuD;AACvD,qEAAgE;AAChE,2DAAuD;AACvD,iEAA6D;AAC7D,4FAAuF;AACvF,iEAA6D;AAC7D,iEAA6D;AAC7D,2EAAsE;AACtE,mFAA8E;AAC9E,6FAAuF;AACvF,sFAAiF;AACjF,6EAAwE;AACxE,oEAAgE;AAChE,4FAAuF;AACvF,yFAAoF;AACpF,uEAAmE;AACnE,+FAAyF;AACzF,iEAA6D;AAC7D,uEAAmE;AACnE,4FAAuF;AACvF,oEAAgE;AAChE,sFAAiF;AACjF,mFAA8E;AAC9E,oEAAgE;AAChE,wDAAoD;AACpD,kEAA6D;AAC7D,uEAAmE;AACnE,wDAAoD;AACpD,2DAAuD;AAEvD,6DAAyD;AAEzD;IACI,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;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UAAU,EAAE,6CAAoB,CAAC;SAC3C,SAAS,CAAC,cAAc,EAAE,+CAAqB,CAAC;SAChD,SAAS,CAAC,eAAe,EAAE,wDAAyB,CAAC;SACrD,SAAS,CAAC,eAAe,EAAE,iDAAsB,CAAC;SAClD,SAAS,CAAC,YAAY,EAAE,2CAAmB,CAAC;SAC5C,SAAS,CAAC,UAAU,EAAE,sCAAiB,CAAC;SACxC,SAAS,CAAC,iBAAiB,EAAE,qDAAwB,CAAC;SACtD,SAAS,CAAC,gBAAgB,EAAE,mDAAuB,CAAC;SACpD,SAAS,CAAC,WAAW,EAAE,wCAAkB,CAAC;SAC1C,SAAS,CAAC,iBAAiB,EAAE,sDAAwB,CAAC;SACtD,SAAS,CAAC,SAAS,EAAE,oCAAgB,CAAC;SACtC,SAAS,CAAC,WAAW,EAAE,wCAAkB,CAAC;SAC1C,SAAS,CAAC,iBAAiB,EAAE,qDAAwB,CAAC;SACtD,SAAS,CAAC,UAAU,EAAE,sCAAiB,CAAC;SACxC,SAAS,CAAC,eAAe,EAAE,iDAAsB,CAAC;SAClD,SAAS,CAAC,cAAc,EAAE,+CAAqB,CAAC;SAChD,SAAS,CAAC,UAAU,EAAE,sCAAiB,CAAC;SACxC,SAAS,CAAC,MAAM,EAAE,8BAAa,CAAC;SAChC,SAAS,CAAC,OAAO,EAAE,uCAAiB,CAAC,CAAC;AAC/C,CAAC;AAhDD,sCAgDC"} \ No newline at end of file diff --git a/brewman/static/src/app/overlord.components.ts b/brewman/static/src/app/overlord.components.ts deleted file mode 100644 index cfa7df7a..00000000 --- a/brewman/static/src/app/overlord.components.ts +++ /dev/null @@ -1,99 +0,0 @@ -import * as angular from 'angular'; - -import {AccountComponent} from './account/account.component'; -import {AccountListComponent} from './account/account-list.component'; -import {AttendanceComponent} from './attendance/attendance.component'; -import {BalanceSheetComponent} from "./balance-sheet/balance-sheet.component"; -import {CashFlowComponent} from './cash-flow/cash-flow.component'; -import {ClientComponent} from "./client/client.component"; -import {ClientListComponent} from "./client/client-list.component"; -import {CostCentreComponent} from './cost-centre/cost-centre.component'; -import {CostCentreListComponent} from './cost-centre/cost-centre-list.component'; -import {ClosingStockComponent} from "./closing-stock/closing-stock.component"; -import {DaybookComponent} from './daybook/daybook.component'; -import {EmployeeComponent} from "./employee/employee.component"; -import {EmployeeListComponent} from "./employee/employee-list.component"; -import {EmployeeAttendanceComponent} from "./employee/employee-attendance.component"; -import {LedgerComponent} from './ledger/ledger.component'; -import {EmployeeFunctionsComponent} from "./employee/employee-functions.component"; -import {GroupComponent} from "./group/group.component"; -import {GroupListComponent} from "./group/group-list.component"; -import {IssueComponent} from "./issue/issue.component"; -import {JournalComponent} from "./journal/journal.component"; -import {NetTransactionsComponent} from "./net-transactions/net-transactions.component"; -import {PaymentComponent} from "./payment/payment.component"; -import {ProductComponent} from "./product/product.component"; -import {ProductListComponent} from "./product/product-list.component"; -import {ProductGroupComponent} from "./product-group/product-group.component"; -import {ProductGroupListComponent} from "./product-group/product-group-list.component"; -import {ProductLedgerComponent} from "./product-ledger/product-ledger.component"; -import {ProfitLossComponent} from "./profit-loss/profit-loss.component"; -import {PurchaseComponent} from "./purchase/purchase.component"; -import {PurchaseEntriesComponent} from "./purchase-entries/purchase-entries.component"; -import {PurchaseReturnComponent} from "./purchase-return/purchase-return.component"; -import {PurchasesComponent} from "./purchases/purchases.component"; -import {RawMaterialCostComponent} from "./raw-material-cost/raw-material-cost.component"; -import {ReceiptComponent} from "./receipt/receipt.component"; -import {ReconcileComponent} from "./reconcile/reconcile.component"; -import {SalaryDeductionComponent} from "./salary-deduction/salary-deduction.component"; -import {SettingsComponent} from "./settings/settings.component"; -import {StockMovementComponent} from "./stock-movement/stock-movement.component"; -import {TrialBalanceComponent} from "./trial-balance/trial-balance.component"; -import {UnpostedComponent} from "./unposted/unposted.component"; -import {UserComponent} from "./user/user.component"; -import {UserListComponent} from "./user/user-list.component"; -import {IncentiveComponent} from "./incentive/incentive.component"; -import {HomeComponent} from "./home/home.component"; -import {LoginComponent} from "./login/login.component"; -import {LogoutController} from "./login/logout.controller"; -import {LogoutComponent} from "./login/logout.component"; - -export function addComponents() { - angular.module('overlord') - .component('account', AccountComponent) - .component('accounts', AccountListComponent) - .component('attendance', AttendanceComponent) - .component('balanceSheet', BalanceSheetComponent) - .component('cashFlow', CashFlowComponent) - .component('client', ClientComponent) - .component('clients', ClientListComponent) - .component('costCentre', CostCentreComponent) - .component('costCentres', CostCentreListComponent) - .component('closingStock', ClosingStockComponent) - .component('daybook', DaybookComponent) - .component('employee', EmployeeComponent) - .component('employees', EmployeeListComponent) - .component('employeeAttendance', EmployeeAttendanceComponent) - .component('employeeFunctions', EmployeeFunctionsComponent) - .component('group', GroupComponent) - .component('groups', GroupListComponent) - .component('home', HomeComponent) - .component('issue', IssueComponent) - .component('ledger', LedgerComponent) - .component('incentive', IncentiveComponent) - .component('journal', JournalComponent) - .component('login', LoginComponent) - .component('logout', LogoutComponent) - .component('netTransactions', NetTransactionsComponent) - .component('payment', PaymentComponent) - .component('product', ProductComponent) - .component('products', ProductListComponent) - .component('productGroup', ProductGroupComponent) - .component('productGroups', ProductGroupListComponent) - .component('productLedger', ProductLedgerComponent) - .component('profitLoss', ProfitLossComponent) - .component('purchase', PurchaseComponent) - .component('purchaseEntries', PurchaseEntriesComponent) - .component('purchaseReturn', PurchaseReturnComponent) - .component('purchases', PurchasesComponent) - .component('rawMaterialCost', RawMaterialCostComponent) - .component('receipt', ReceiptComponent) - .component('reconcile', ReconcileComponent) - .component('salaryDeduction', SalaryDeductionComponent) - .component('settings', SettingsComponent) - .component('stockMovement', StockMovementComponent) - .component('trialBalance', TrialBalanceComponent) - .component('unposted', UnpostedComponent) - .component('user', UserComponent) - .component('users', UserListComponent); -} diff --git a/brewman/static/src/app/overlord.config.js b/brewman/static/src/app/overlord.config.js deleted file mode 100644 index 2e289181..00000000 --- a/brewman/static/src/app/overlord.config.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function configureApp() { - angular.module('overlord') - .config(['$httpProvider', function ($httpProvider) { - $httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; - }]) - .config(['$httpProvider', function ($httpProvider) { - $httpProvider.interceptors.push('responseInterceptor'); - }]) - .config(['$qProvider', function ($qProvider) { - $qProvider.errorOnUnhandledRejections(true); - }]) - .factory('responseInterceptor', ['$q', '$rootScope', function ($q, $rootScope) { - return { - response: function (response) { - return response; - }, - responseError: function (response) { - var headers = response.headers(), isResourceResponse = headers['content-type'] === "application/json; charset=utf-8", status = response.status; - if (status === 401 && !isResourceResponse) { - $rootScope.$broadcast('loginRequired'); - } - // otherwise - return $q.reject(response); - } - }; - }]); -} -exports.configureApp = configureApp; -//# sourceMappingURL=overlord.config.js.map \ No newline at end of file diff --git a/brewman/static/src/app/overlord.config.js.map b/brewman/static/src/app/overlord.config.js.map deleted file mode 100644 index b3a8b1c7..00000000 --- a/brewman/static/src/app/overlord.config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"overlord.config.js","sourceRoot":"","sources":["overlord.config.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAGnC;IACI,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;SACrB,MAAM,CAAC,CAAC,eAAe,EAAE,UAAU,aAAa;YAC7C,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC,GAAG,gBAAgB,CAAC;QACjF,CAAC,CAAC,CAAC;SACF,MAAM,CAAC,CAAC,eAAe,EAAE,UAAU,aAAa;YAC7C,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;SACF,MAAM,CAAC,CAAC,YAAY,EAAE,UAAU,UAAU;YACvC,UAAU,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;SACF,OAAO,CAAC,qBAAqB,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,UAAU;YACzE,OAAO;gBACH,QAAQ,EAAE,UAAU,QAAQ;oBACxB,OAAO,QAAQ,CAAC;gBACpB,CAAC;gBACD,aAAa,EAAE,UAAU,QAAQ;oBAC7B,IAAI,OAAO,GAAG,QAAQ,CAAC,OAAO,EAAE,EAC5B,kBAAkB,GAAG,OAAO,CAAC,cAAc,CAAC,KAAK,iCAAiC,EAClF,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;oBAC7B,IAAI,MAAM,KAAK,GAAG,IAAI,CAAC,kBAAkB,EAAE;wBACvC,UAAU,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;qBAC1C;oBACD,YAAY;oBACZ,OAAO,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;gBAC/B,CAAC;aACJ,CAAC;QACN,CAAC,CAAC,CAAC,CAAC;AACZ,CAAC;AA5BD,oCA4BC"} \ No newline at end of file diff --git a/brewman/static/src/app/overlord.config.ts b/brewman/static/src/app/overlord.config.ts deleted file mode 100644 index 0f162559..00000000 --- a/brewman/static/src/app/overlord.config.ts +++ /dev/null @@ -1,32 +0,0 @@ -import * as angular from 'angular'; -import * as moment from 'moment'; - -export function configureApp() { - angular.module('overlord') - .config(['$httpProvider', function ($httpProvider) { - $httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; - }]) - .config(['$httpProvider', function ($httpProvider) { - $httpProvider.interceptors.push('responseInterceptor'); - }]) - .config(['$qProvider', function ($qProvider) { - $qProvider.errorOnUnhandledRejections(true); - }]) - .factory('responseInterceptor', ['$q', '$rootScope', function ($q, $rootScope) { - return { - response: function (response) { - return response; - }, - responseError: function (response) { - var headers = response.headers(), - isResourceResponse = headers['content-type'] === "application/json; charset=utf-8", - status = response.status; - if (status === 401 && !isResourceResponse) { - $rootScope.$broadcast('loginRequired'); - } - // otherwise - return $q.reject(response); - } - }; - }]); -} \ No newline at end of file diff --git a/brewman/static/src/app/overlord.directive.js b/brewman/static/src/app/overlord.directive.js deleted file mode 100644 index 49aa4e6b..00000000 --- a/brewman/static/src/app/overlord.directive.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var attendance_sub_directive_1 = require("./attendance/attendance-sub.directive"); -var employee_attendance_sub_directive_1 = require("./employee/employee-attendance-sub.directive"); -var focus_on_directive_1 = require("./common/focus-on.directive"); -var file_upload_directive_1 = require("./common/file-upload.directive"); -var tan_click_directive_1 = require("./common/tan-click.directive"); -var on_return_directive_1 = require("./common/on-return.directive"); -var keypress_directive_1 = require("./common/keypress.directive"); -var ng_growl_directive_1 = require("./common/ng-growl.directive"); -var fadey_directive_1 = require("./common/fadey.directive"); -function addDirectives() { - angular.module('overlord') - .directive('attendanceSub', attendance_sub_directive_1.AttendanceSubDirective) - .directive('employeeAttendanceSub', employee_attendance_sub_directive_1.EmployeeAttendanceSubDirective) - .directive('focusOn', ['$timeout', '$parse', focus_on_directive_1.FocusOn]) - .directive('fileUpload', file_upload_directive_1.FileUpload) - .directive('tanClick', ['$parse', '$timeout', tan_click_directive_1.TanClick]) - .directive('onReturn', ['$parse', on_return_directive_1.OnReturn]) - .directive('keypress', keypress_directive_1.Keypress) - .directive('ngGrowl', ['growl', '$parse', ng_growl_directive_1.NgGrowl]) - .directive('fadey', fadey_directive_1.Fadey); -} -exports.addDirectives = addDirectives; -//# sourceMappingURL=overlord.directive.js.map \ No newline at end of file diff --git a/brewman/static/src/app/overlord.directive.js.map b/brewman/static/src/app/overlord.directive.js.map deleted file mode 100644 index 866d57fd..00000000 --- a/brewman/static/src/app/overlord.directive.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"overlord.directive.js","sourceRoot":"","sources":["overlord.directive.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AACnC,kFAA6E;AAC7E,kGAA4F;AAC5F,kEAAoD;AACpD,wEAA0D;AAC1D,oEAAsD;AACtD,oEAAsD;AACtD,kEAAqD;AACrD,kEAAoD;AACpD,4DAA+C;AAE/C;IACI,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;SACrB,SAAS,CAAC,eAAe,EAAE,iDAAsB,CAAC;SAClD,SAAS,CAAC,uBAAuB,EAAE,kEAA8B,CAAC;SAClE,SAAS,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,4BAAO,CAAC,CAAC;SACrD,SAAS,CAAC,YAAY,EAAE,kCAAU,CAAC;SACnC,SAAS,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,8BAAQ,CAAC,CAAC;SACvD,SAAS,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,8BAAQ,CAAC,CAAC;SAC3C,SAAS,CAAC,UAAU,EAAE,6BAAQ,CAAC;SAC/B,SAAS,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,4BAAO,CAAC,CAAC;SAClD,SAAS,CAAC,OAAO,EAAE,uBAAK,CAAC,CAAC;AACnC,CAAC;AAXD,sCAWC"} \ No newline at end of file diff --git a/brewman/static/src/app/overlord.directive.ts b/brewman/static/src/app/overlord.directive.ts deleted file mode 100644 index abb08021..00000000 --- a/brewman/static/src/app/overlord.directive.ts +++ /dev/null @@ -1,23 +0,0 @@ -import * as angular from 'angular'; -import {AttendanceSubDirective} from './attendance/attendance-sub.directive'; -import {EmployeeAttendanceSubDirective} from "./employee/employee-attendance-sub.directive"; -import {FocusOn} from "./common/focus-on.directive"; -import {FileUpload} from "./common/file-upload.directive"; -import {TanClick} from "./common/tan-click.directive"; -import {OnReturn} from "./common/on-return.directive"; -import {Keypress} from "./common/keypress.directive"; -import {NgGrowl} from "./common/ng-growl.directive"; -import {Fadey} from "./common/fadey.directive"; - -export function addDirectives() { - angular.module('overlord') - .directive('attendanceSub', AttendanceSubDirective) - .directive('employeeAttendanceSub', EmployeeAttendanceSubDirective) - .directive('focusOn', ['$timeout', '$parse', FocusOn]) - .directive('fileUpload', FileUpload) - .directive('tanClick', ['$parse', '$timeout', TanClick]) - .directive('onReturn', ['$parse', OnReturn]) - .directive('keypress', Keypress) - .directive('ngGrowl', ['growl', '$parse', NgGrowl]) - .directive('fadey', Fadey); -} \ No newline at end of file diff --git a/brewman/static/src/app/overlord.filters.js b/brewman/static/src/app/overlord.filters.js deleted file mode 100644 index 4e53e123..00000000 --- a/brewman/static/src/app/overlord.filters.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var accounting_filter_1 = require("./common/accounting.filter"); -var as_date_filter_1 = require("./common/as-date.filter"); -var clr_filter_1 = require("./common/clr.filter"); -var debit_filter_1 = require("./common/debit.filter"); -var local_time_filter_1 = require("./common/local-time.filter"); -var md_filter_1 = require("./common/md.filter"); -var percent_filter_1 = require("./common/percent.filter"); -var posted_filter_1 = require("./common/posted.filter"); -var saveButtonText_filter_1 = require("./common/saveButtonText.filter"); -var journal_debit_filter_1 = require("./common/journal-debit.filter"); -function addFilters() { - angular.module('overlord') - .filter('accounting', ['currencyFilter', accounting_filter_1.Accounting]) - .filter('asDate', ['dateFilter', as_date_filter_1.AsDate]) - .filter('clr', clr_filter_1.Clr) - .filter('debit', debit_filter_1.Debit) - .filter('localTime', local_time_filter_1.LocalTime) - .filter('md', md_filter_1.Md) - .filter('percent', ['numberFilter', percent_filter_1.Percent]) - .filter('posted', posted_filter_1.Posted) - .filter('saveButton', saveButtonText_filter_1.SaveButtonText) - .filter('journalDebit', journal_debit_filter_1.JournalDebit); -} -exports.addFilters = addFilters; -//# sourceMappingURL=overlord.filters.js.map \ No newline at end of file diff --git a/brewman/static/src/app/overlord.filters.js.map b/brewman/static/src/app/overlord.filters.js.map deleted file mode 100644 index 27dfe00e..00000000 --- a/brewman/static/src/app/overlord.filters.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"overlord.filters.js","sourceRoot":"","sources":["overlord.filters.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,gEAAsD;AACtD,0DAA+C;AAC/C,kDAAwC;AACxC,sDAA4C;AAC5C,gEAAqD;AACrD,gDAAsC;AACtC,0DAAgD;AAChD,wDAA8C;AAC9C,wEAA8D;AAC9D,sEAA2D;AAE3D;IACI,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;SACrB,MAAM,CAAC,YAAY,EAAE,CAAC,gBAAgB,EAAE,8BAAU,CAAC,CAAC;SACpD,MAAM,CAAC,QAAQ,EAAE,CAAC,YAAY,EAAE,uBAAM,CAAC,CAAC;SACxC,MAAM,CAAC,KAAK,EAAE,gBAAG,CAAC;SAClB,MAAM,CAAC,OAAO,EAAE,oBAAK,CAAC;SACtB,MAAM,CAAC,WAAW,EAAE,6BAAS,CAAC;SAC9B,MAAM,CAAC,IAAI,EAAE,cAAE,CAAC;SAChB,MAAM,CAAC,SAAS,EAAE,CAAC,cAAc,EAAE,wBAAO,CAAC,CAAC;SAC5C,MAAM,CAAC,QAAQ,EAAE,sBAAM,CAAC;SACxB,MAAM,CAAC,YAAY,EAAE,sCAAc,CAAC;SACpC,MAAM,CAAC,cAAc,EAAE,mCAAY,CAAC,CAAC;AAC9C,CAAC;AAZD,gCAYC"} \ No newline at end of file diff --git a/brewman/static/src/app/overlord.filters.ts b/brewman/static/src/app/overlord.filters.ts deleted file mode 100644 index 99ad9da0..00000000 --- a/brewman/static/src/app/overlord.filters.ts +++ /dev/null @@ -1,26 +0,0 @@ -import * as angular from 'angular'; - -import {Accounting} from './common/accounting.filter'; -import {AsDate} from './common/as-date.filter'; -import {Clr} from './common/clr.filter'; -import {Debit} from "./common/debit.filter"; -import {LocalTime} from "./common/local-time.filter"; -import {Md} from "./common/md.filter"; -import {Percent} from "./common/percent.filter"; -import {Posted} from "./common/posted.filter"; -import {SaveButtonText} from "./common/saveButtonText.filter"; -import {JournalDebit} from "./common/journal-debit.filter"; - -export function addFilters() { - angular.module('overlord') - .filter('accounting', ['currencyFilter', Accounting]) - .filter('asDate', ['dateFilter', AsDate]) - .filter('clr', Clr) - .filter('debit', Debit) - .filter('localTime', LocalTime) - .filter('md', Md) - .filter('percent', ['numberFilter', Percent]) - .filter('posted', Posted) - .filter('saveButton', SaveButtonText) - .filter('journalDebit', JournalDebit); -} \ No newline at end of file diff --git a/brewman/static/src/app/overlord.routes.js b/brewman/static/src/app/overlord.routes.js deleted file mode 100644 index 16f1ce2c..00000000 --- a/brewman/static/src/app/overlord.routes.js +++ /dev/null @@ -1,476 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var account_resolver_1 = require("./account/account.resolver"); -var account_list_resolver_1 = require("./account/account-list.resolver"); -var account_types_resolver_1 = require("./account/account-types.resolver"); -var payment_accounts_resolver_1 = require("./account/payment-accounts.resolver"); -var receipt_accounts_resolver_1 = require("./account/receipt-accounts.resolver"); -var attendance_info_resolver_1 = require("./attendance/attendance-info.resolver"); -var attendance_types_resolver_1 = require("./attendance/attendance-types.resolver"); -var balance_sheet_resolver_1 = require("./balance-sheet/balance-sheet.resolver"); -var client_resolver_1 = require("./client/client.resolver"); -var client_list_resolver_1 = require("./client/client-list.resolver"); -var closing_stock_resolver_1 = require("./closing-stock/closing-stock.resolver"); -var cost_centre_resolver_1 = require("./cost-centre/cost-centre.resolver"); -var cost_centre_list_resolver_1 = require("./cost-centre/cost-centre-list.resolver"); -var daybook_resolver_1 = require("./daybook/daybook.resolver"); -var employee_attendance_info_resolver_1 = require("./employee/employee-attendance-info.resolver"); -var employee_resolver_1 = require("./employee/employee.resolver"); -var employee_list_resolver_1 = require("./employee/employee-list.resolver"); -var cash_flow_resolver_1 = require("./cash-flow/cash-flow.resolver"); -var group_resolver_1 = require("./group/group.resolver"); -var group_list_resolver_1 = require("./group/group-list.resolver"); -var issue_voucher_resolver_1 = require("./issue/issue-voucher.resolver"); -var issue_grid_resolver_1 = require("./issue/issue-grid.resolver"); -var journal_voucher_resolver_1 = require("./journal/journal-voucher.resolver"); -var ledger_resolver_1 = require("./ledger/ledger.resolver"); -var net_transactions_resolver_1 = require("./net-transactions/net-transactions.resolver"); -var payment_voucher_resolver_1 = require("./payment/payment-voucher.resolver"); -var product_ledger_resolver_1 = require("./product-ledger/product-ledger.resolver"); -var profit_loss_resolver_1 = require("./profit-loss/profit-loss.resolver"); -var product_resolver_1 = require("./product/product.resolver"); -var product_list_resolver_1 = require("./product/product-list.resolver"); -var product_group_resolver_1 = require("./product-group/product-group.resolver"); -var product_group_list_resolver_1 = require("./product-group/product-group-list.resolver"); -var purchase_voucher_resolver_1 = require("./purchase/purchase-voucher.resolver"); -var purchase_entries_resolver_1 = require("./purchase-entries/purchase-entries.resolver"); -var purchase_return_voucher_resolver_1 = require("./purchase-return/purchase-return-voucher.resolver"); -var purchases_resolver_1 = require("./purchases/purchases.resolver"); -var raw_material_cost_resolver_1 = require("./raw-material-cost/raw-material-cost.resolver"); -var receipt_voucher_resolver_1 = require("./receipt/receipt-voucher.resolver"); -var reconcile_resolver_1 = require("./reconcile/reconcile.resolver"); -var salary_deduction_voucher_resolver_1 = require("./salary-deduction/salary-deduction-voucher.resolver"); -var stock_movement_resolver_1 = require("./stock-movement/stock-movement.resolver"); -var trial_balance_resolver_1 = require("./trial-balance/trial-balance.resolver"); -var unposted_resolver_1 = require("./unposted/unposted.resolver"); -var user_resolver_1 = require("./user/user.resolver"); -var user_list_resolver_1 = require("./user/user-list.resolver"); -var lock_info_resolver_1 = require("./settings/lock-info.resolver"); -var maintenance_resolver_1 = require("./settings/maintenance.resolver"); -var incentive_voucher_resolver_1 = require("./incentive/incentive-voucher.resolver"); -function registerRoutes() { - angular.module('overlord') - .config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) { - $routeProvider - .when('/', { - template: '', - }) - .when('/login', { - template: '', - }) - .when('/logout', { - template: '', - }) - .when('/Journal', { - template: '', - resolveAs: 'res', - resolve: { voucher: journal_voucher_resolver_1.JournalVoucherResolver } - }) - .when('/Journal/:id', { - template: '', - resolveAs: 'res', - resolve: { voucher: journal_voucher_resolver_1.JournalVoucherResolver } - }) - .when('/Payment', { - template: '', - resolveAs: 'res', - resolve: { - voucher: payment_voucher_resolver_1.PaymentVoucherResolver, - ledgers: payment_accounts_resolver_1.PaymentAccountsResolver - }, - reloadOnSearch: false - }) - .when('/Payment/:id', { - template: '', - resolveAs: 'res', - resolve: { - voucher: payment_voucher_resolver_1.PaymentVoucherResolver, - ledgers: payment_accounts_resolver_1.PaymentAccountsResolver - }, - reloadOnSearch: false - }) - .when('/Receipt', { - template: '', - resolveAs: 'res', - resolve: { - voucher: receipt_voucher_resolver_1.ReceiptVoucherResolver, - ledgers: receipt_accounts_resolver_1.ReceiptAccountsResolver - }, - reloadOnSearch: false - }) - .when('/Receipt/:id', { - template: '', - resolveAs: 'res', - resolve: { - voucher: receipt_voucher_resolver_1.ReceiptVoucherResolver, - ledgers: receipt_accounts_resolver_1.ReceiptAccountsResolver - }, - reloadOnSearch: false - }) - .when('/Purchase', { - template: '', - resolveAs: 'res', - resolve: { voucher: purchase_voucher_resolver_1.PurchaseVoucherResolver } - }) - .when('/Purchase/:id', { - template: '', - resolveAs: 'res', - resolve: { voucher: purchase_voucher_resolver_1.PurchaseVoucherResolver } - }) - .when('/Return', { - template: '', - resolveAs: 'res', - resolve: { voucher: purchase_return_voucher_resolver_1.PurchaseReturnVoucherResolver } - }) - .when('/Return/:id', { - template: '', - resolveAs: 'res', - resolve: { voucher: purchase_return_voucher_resolver_1.PurchaseReturnVoucherResolver } - }) - .when('/Issue', { - template: '', - resolveAs: 'res', - resolve: { - voucher: issue_voucher_resolver_1.IssueVoucherResolver, - smallGrid: issue_grid_resolver_1.IssueGridResolver, - costCentres: cost_centre_list_resolver_1.CostCentreListResolver - } - }) - .when('/Issue/:id', { - template: '', - resolveAs: 'res', - resolve: { - voucher: issue_voucher_resolver_1.IssueVoucherResolver, - smallGrid: issue_grid_resolver_1.IssueGridResolver, - costCentres: cost_centre_list_resolver_1.CostCentreListResolver - } - }) - .when('/SalaryDeduction', { - template: '', - resolveAs: 'res', - resolve: { voucher: salary_deduction_voucher_resolver_1.SalaryDeductionVoucherResolver } - }) - .when('/SalaryDeduction/:id', { - template: '', - resolveAs: 'res', - resolve: { voucher: salary_deduction_voucher_resolver_1.SalaryDeductionVoucherResolver } - }) - .when('/Incentive', { - template: '', - resolveAs: 'res', - resolve: { voucher: incentive_voucher_resolver_1.IncentiveVoucherResolver } - }) - .when('/Incentive/:id', { - template: '', - resolveAs: 'res', - resolve: { voucher: incentive_voucher_resolver_1.IncentiveVoucherResolver } - }) - .when('/Ledger', { - template: '', - resolveAs: 'res', - resolve: { ledger: ledger_resolver_1.LedgerResolver } - }) - .when('/Ledger/:id', { - template: '', - resolveAs: 'res', - resolve: { ledger: ledger_resolver_1.LedgerResolver } - }) - .when('/Reconcile', { - template: '', - resolveAs: 'res', - resolve: { reconcile: reconcile_resolver_1.ReconcileResolver } - }) - .when('/Reconcile/:id', { - template: '', - resolveAs: 'res', - resolve: { reconcile: reconcile_resolver_1.ReconcileResolver } - }) - .when('/ProductLedger', { - template: '', - resolveAs: 'res', - resolve: { productLedger: product_ledger_resolver_1.ProductLedgerResolver } - }) - .when('/ProductLedger/:id', { - template: '', - resolveAs: 'res', - resolve: { productLedger: product_ledger_resolver_1.ProductLedgerResolver } - }) - .when('/CashFlow', { - template: '', - resolveAs: 'res', - resolve: { cashFlow: cash_flow_resolver_1.CashFlowResolver } - }) - .when('/CashFlow/:id', { - template: '', - resolveAs: 'res', - resolve: { cashFlow: cash_flow_resolver_1.CashFlowResolver } - }) - .when('/RawMaterialCost', { - template: '', - resolveAs: 'res', - resolve: { rawMaterialCost: raw_material_cost_resolver_1.RawMaterialCostResolver } - }) - .when('/RawMaterialCost/:id', { - template: '', - resolveAs: 'res', - resolve: { rawMaterialCost: raw_material_cost_resolver_1.RawMaterialCostResolver } - }) - .when('/Attendance', { - template: '', - resolveAs: 'res', - resolve: { - info: attendance_info_resolver_1.AttendanceInfoResolver, - attendanceTypes: attendance_types_resolver_1.AttendanceTypesResolver - } - }) - .when('/Attendance/:date', { - template: '', - resolveAs: 'res', - resolve: { - info: attendance_info_resolver_1.AttendanceInfoResolver, - attendanceTypes: attendance_types_resolver_1.AttendanceTypesResolver - } - }) - .when('/EmployeeAttendance', { - template: '', - resolveAs: 'res', - resolve: { - info: employee_attendance_info_resolver_1.EmployeeAttendanceInfoResolver, - attendanceTypes: attendance_types_resolver_1.AttendanceTypesResolver - } - }) - .when('/EmployeeAttendance/:id', { - template: '', - resolveAs: 'res', - resolve: { - info: employee_attendance_info_resolver_1.EmployeeAttendanceInfoResolver, - attendanceTypes: attendance_types_resolver_1.AttendanceTypesResolver - } - }) - .when('/Daybook', { - template: '', - resolveAs: 'res', - resolve: { info: daybook_resolver_1.DaybookResolver } - }) - .when('/Unposted', { - template: '', - resolveAs: 'res', - resolve: { info: unposted_resolver_1.UnpostedResolver } - }) - .when('/ProfitLoss', { - template: '', - resolveAs: 'res', - resolve: { profit_loss: profit_loss_resolver_1.ProfitLossResolver } - }) - .when('/StockMovement', { - template: '', - resolveAs: 'res', - resolve: { stockMovement: stock_movement_resolver_1.StockMovementResolver } - }) - .when('/NetTransactions', { - template: '', - resolveAs: 'res', - resolve: { netTransactions: net_transactions_resolver_1.NetTransactionsResolver } - }) - .when('/PurchaseEntries', { - template: '', - resolveAs: 'res', - resolve: { purchaseEntries: purchase_entries_resolver_1.PurchaseEntriesResolver } - }) - .when('/Purchases', { - template: '', - resolveAs: 'res', - resolve: { purchases: purchases_resolver_1.PurchasesResolver } - }) - .when('/EmployeeFunctions', { - template: '' - }) - .when('/BalanceSheet', { - template: '', - resolveAs: 'res', - resolve: { info: balance_sheet_resolver_1.BalanceSheetResolver } - }) - .when('/BalanceSheet/:date', { - template: '', - resolveAs: 'res', - resolve: { info: balance_sheet_resolver_1.BalanceSheetResolver } - }) - .when('/TrialBalance', { - template: '', - resolveAs: 'res', - resolve: { trialBalance: trial_balance_resolver_1.TrialBalanceResolver } - }) - .when('/TrialBalance/:date', { - template: '', - resolveAs: 'res', - resolve: { trialBalance: trial_balance_resolver_1.TrialBalanceResolver } - }) - .when('/ClosingStock', { - template: '', - resolveAs: 'res', - resolve: { info: closing_stock_resolver_1.ClosingStockResolver } - }) - .when('/ClosingStock/:date', { - template: '', - resolveAs: 'res', - resolve: { info: closing_stock_resolver_1.ClosingStockResolver } - }) - .when('/Ledger', { - template: '', - resolveAs: 'res', - resolve: { ledger: ledger_resolver_1.LedgerResolver } - }) - .when('/Accounts', { - template: '', - resolveAs: 'res', - resolve: { - accounts: account_list_resolver_1.AccountListResolver - }, - reloadOnSearch: false - }) - .when('/Account', { - template: '', - resolveAs: 'res', - resolve: { - account: account_resolver_1.AccountResolver, - accountTypes: account_types_resolver_1.AccountTypesResolver, - costCentres: cost_centre_list_resolver_1.CostCentreListResolver - } - }) - .when('/Account/:id', { - template: '', - resolveAs: 'res', - resolve: { - account: account_resolver_1.AccountResolver, - accountTypes: account_types_resolver_1.AccountTypesResolver, - costCentres: cost_centre_list_resolver_1.CostCentreListResolver - } - }) - .when('/Employees', { - template: '', - resolveAs: 'res', - resolve: { employees: employee_list_resolver_1.EmployeeListResolver }, - reloadOnSearch: false - }) - .when('/Employee', { - template: '', - resolveAs: 'res', - resolve: { - employee: employee_resolver_1.EmployeeResolver, - costCentres: cost_centre_list_resolver_1.CostCentreListResolver - } - }) - .when('/Employee/:id', { - template: '', - resolveAs: 'res', - resolve: { - employee: employee_resolver_1.EmployeeResolver, - costCentres: cost_centre_list_resolver_1.CostCentreListResolver - } - }) - .when('/CostCentres', { - template: '', - resolveAs: 'res', - resolve: { costCentres: cost_centre_list_resolver_1.CostCentreListResolver } - }) - .when('/CostCentre', { - template: '', - resolveAs: 'res', - resolve: { costCentre: cost_centre_resolver_1.CostCentreResolver } - }) - .when('/CostCentre/:id', { - template: '', - resolveAs: 'res', - resolve: { costCentre: cost_centre_resolver_1.CostCentreResolver } - }) - .when('/Products', { - template: '', - resolveAs: 'res', - resolve: { products: product_list_resolver_1.ProductListResolver }, - reloadOnSearch: false - }) - .when('/Product', { - template: '', - resolveAs: 'res', - resolve: { - product: product_resolver_1.ProductResolver, - productGroups: product_group_list_resolver_1.ProductGroupListResolver - } - }) - .when('/Product/:id', { - template: '', - resolveAs: 'res', - resolve: { - product: product_resolver_1.ProductResolver, - productGroups: product_group_list_resolver_1.ProductGroupListResolver - } - }) - .when('/ProductGroups', { - template: '', - resolveAs: 'res', - resolve: { productGroups: product_group_list_resolver_1.ProductGroupListResolver } - }) - .when('/ProductGroup', { - template: '', - resolveAs: 'res', - resolve: { productGroup: product_group_resolver_1.ProductGroupResolver } - }) - .when('/ProductGroup/:id', { - template: '', - resolveAs: 'res', - resolve: { productGroup: product_group_resolver_1.ProductGroupResolver } - }) - .when('/Users', { - template: '', - resolveAs: 'res', - resolve: { users: user_list_resolver_1.UserListResolver } - }) - .when('/User', { - template: '', - resolveAs: 'res', - resolve: { user: user_resolver_1.UserResolver } - }) - .when('/User/:id', { - template: '', - resolveAs: 'res', - resolve: { user: user_resolver_1.UserResolver } - }) - .when('/Groups', { - template: '', - resolveAs: 'res', - resolve: { groups: group_list_resolver_1.GroupListResolver } - }) - .when('/Group', { - template: '', - resolveAs: 'res', - resolve: { group: group_resolver_1.GroupResolver } - }) - .when('/Group/:id', { - template: '', - resolveAs: 'res', - resolve: { group: group_resolver_1.GroupResolver } - }) - .when('/Clients', { - template: '', - resolveAs: 'res', - resolve: { clients: client_list_resolver_1.ClientListResolver } - }) - .when('/Client/:id', { - template: '', - resolveAs: 'res', - resolve: { client: client_resolver_1.ClientResolver } - }) - .when('/Settings', { - template: '', - resolveAs: 'res', - resolve: { - lockInfo: lock_info_resolver_1.LockInfoResolver, - maintenance: maintenance_resolver_1.MaintenanceResolver - } - }).otherwise({ templateUrl: '/app/404.html' }); - $locationProvider.html5Mode(true).hashPrefix('!'); - }]); -} -exports.registerRoutes = registerRoutes; -//# sourceMappingURL=overlord.routes.js.map \ No newline at end of file diff --git a/brewman/static/src/app/overlord.routes.js.map b/brewman/static/src/app/overlord.routes.js.map deleted file mode 100644 index e693919f..00000000 --- a/brewman/static/src/app/overlord.routes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"overlord.routes.js","sourceRoot":"","sources":["overlord.routes.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,+DAA2D;AAC3D,yEAAoE;AACpE,2EAAsE;AACtE,iFAA4E;AAC5E,iFAA4E;AAC5E,kFAA6E;AAC7E,oFAA+E;AAC/E,iFAA4E;AAC5E,4DAAwD;AACxD,sEAAiE;AACjE,iFAA4E;AAC5E,2EAAsE;AACtE,qFAA+E;AAC/E,+DAA2D;AAC3D,kGAA4F;AAC5F,kEAA8D;AAC9D,4EAAuE;AACvE,qEAAgE;AAChE,yDAAqD;AACrD,mEAA8D;AAC9D,yEAAoE;AACpE,mEAA8D;AAC9D,+EAA0E;AAC1E,4DAAwD;AACxD,0FAAqF;AACrF,+EAA0E;AAC1E,oFAA+E;AAC/E,2EAAsE;AACtE,+DAA2D;AAC3D,yEAAoE;AACpE,iFAA4E;AAC5E,2FAAqF;AACrF,kFAA6E;AAC7E,0FAAqF;AACrF,uGAAiG;AACjG,qEAAiE;AACjE,6FAAuF;AACvF,+EAA0E;AAC1E,qEAAiE;AACjE,0GAAoG;AACpG,oFAA+E;AAC/E,iFAA4E;AAC5E,kEAA8D;AAC9D,sDAAkD;AAClD,gEAA2D;AAC3D,oEAA+D;AAC/D,wEAAoE;AACpE,qFAAgF;AAEhF;IACI,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;SACrB,MAAM,CAAC,CAAC,gBAAgB,EAAE,mBAAmB,EAAE,UAAU,cAAc,EAAE,iBAAiB;YACvF,cAAc;iBACT,IAAI,CAAC,GAAG,EAAE;gBACP,QAAQ,EAAE,eAAe;aAC5B,CAAC;iBACD,IAAI,CAAC,QAAQ,EAAE;gBACZ,QAAQ,EAAE,iBAAiB;aAC9B,CAAC;iBACD,IAAI,CA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C,WAAW,EAAE,eAAe,EAAC,CAAC,CAAC;YACjD,iBAAiB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC,CAAA;AACX,CAAC;AAtaD,wCAsaC"} \ No newline at end of file diff --git a/brewman/static/src/app/overlord.routes.ts b/brewman/static/src/app/overlord.routes.ts deleted file mode 100644 index 572cbef9..00000000 --- a/brewman/static/src/app/overlord.routes.ts +++ /dev/null @@ -1,474 +0,0 @@ -import * as angular from 'angular'; - -import {AccountResolver} from './account/account.resolver'; -import {AccountListResolver} from './account/account-list.resolver'; -import {AccountTypesResolver} from './account/account-types.resolver'; -import {PaymentAccountsResolver} from './account/payment-accounts.resolver'; -import {ReceiptAccountsResolver} from './account/receipt-accounts.resolver'; -import {AttendanceInfoResolver} from './attendance/attendance-info.resolver'; -import {AttendanceTypesResolver} from './attendance/attendance-types.resolver'; -import {BalanceSheetResolver} from './balance-sheet/balance-sheet.resolver'; -import {ClientResolver} from './client/client.resolver'; -import {ClientListResolver} from './client/client-list.resolver'; -import {ClosingStockResolver} from './closing-stock/closing-stock.resolver'; -import {CostCentreResolver} from './cost-centre/cost-centre.resolver'; -import {CostCentreListResolver} from './cost-centre/cost-centre-list.resolver'; -import {DaybookResolver} from './daybook/daybook.resolver'; -import {EmployeeAttendanceInfoResolver} from './employee/employee-attendance-info.resolver'; -import {EmployeeResolver} from './employee/employee.resolver'; -import {EmployeeListResolver} from './employee/employee-list.resolver'; -import {CashFlowResolver} from './cash-flow/cash-flow.resolver'; -import {GroupResolver} from './group/group.resolver'; -import {GroupListResolver} from './group/group-list.resolver'; -import {IssueVoucherResolver} from './issue/issue-voucher.resolver'; -import {IssueGridResolver} from './issue/issue-grid.resolver'; -import {JournalVoucherResolver} from './journal/journal-voucher.resolver'; -import {LedgerResolver} from './ledger/ledger.resolver'; -import {NetTransactionsResolver} from './net-transactions/net-transactions.resolver'; -import {PaymentVoucherResolver} from './payment/payment-voucher.resolver'; -import {ProductLedgerResolver} from './product-ledger/product-ledger.resolver'; -import {ProfitLossResolver} from './profit-loss/profit-loss.resolver'; -import {ProductResolver} from './product/product.resolver'; -import {ProductListResolver} from './product/product-list.resolver'; -import {ProductGroupResolver} from './product-group/product-group.resolver'; -import {ProductGroupListResolver} from './product-group/product-group-list.resolver'; -import {PurchaseVoucherResolver} from './purchase/purchase-voucher.resolver'; -import {PurchaseEntriesResolver} from './purchase-entries/purchase-entries.resolver'; -import {PurchaseReturnVoucherResolver} from './purchase-return/purchase-return-voucher.resolver'; -import {PurchasesResolver} from './purchases/purchases.resolver'; -import {RawMaterialCostResolver} from './raw-material-cost/raw-material-cost.resolver'; -import {ReceiptVoucherResolver} from './receipt/receipt-voucher.resolver'; -import {ReconcileResolver} from './reconcile/reconcile.resolver'; -import {SalaryDeductionVoucherResolver} from './salary-deduction/salary-deduction-voucher.resolver'; -import {StockMovementResolver} from './stock-movement/stock-movement.resolver'; -import {TrialBalanceResolver} from './trial-balance/trial-balance.resolver'; -import {UnpostedResolver} from './unposted/unposted.resolver'; -import {UserResolver} from './user/user.resolver'; -import {UserListResolver} from './user/user-list.resolver'; -import {LockInfoResolver} from './settings/lock-info.resolver'; -import {MaintenanceResolver} from './settings/maintenance.resolver'; -import {IncentiveVoucherResolver} from "./incentive/incentive-voucher.resolver"; - -export function registerRoutes() { - angular.module('overlord') - .config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) { - $routeProvider - .when('/', { - template: '', - }) - .when('/login', { - template: '', - }) - .when('/logout', { - template: '', - }) - .when('/Journal', { - template: '', - resolveAs: 'res', - resolve: {voucher: JournalVoucherResolver} - }) - .when('/Journal/:id', { - template: '', - resolveAs: 'res', - resolve: {voucher: JournalVoucherResolver} - }) - .when('/Payment', { - template: '', - resolveAs: 'res', - resolve: { - voucher: PaymentVoucherResolver, - ledgers: PaymentAccountsResolver - }, - reloadOnSearch: false - }) - .when('/Payment/:id', { - template: '', - resolveAs: 'res', - resolve: { - voucher: PaymentVoucherResolver, - ledgers: PaymentAccountsResolver - }, - reloadOnSearch: false - }) - .when('/Receipt', { - template: '', - resolveAs: 'res', - resolve: { - voucher: ReceiptVoucherResolver, - ledgers: ReceiptAccountsResolver - }, - reloadOnSearch: false - }) - .when('/Receipt/:id', { - template: '', - resolveAs: 'res', - resolve: { - voucher: ReceiptVoucherResolver, - ledgers: ReceiptAccountsResolver - }, - reloadOnSearch: false - }) - .when('/Purchase', { - template: '', - resolveAs: 'res', - resolve: {voucher: PurchaseVoucherResolver} - }) - .when('/Purchase/:id', { - template: '', - resolveAs: 'res', - resolve: {voucher: PurchaseVoucherResolver} - }) - .when('/Return', { - template: '', - resolveAs: 'res', - resolve: {voucher: PurchaseReturnVoucherResolver} - }) - .when('/Return/:id', { - template: '', - resolveAs: 'res', - resolve: {voucher: PurchaseReturnVoucherResolver} - }) - .when('/Issue', { - template: '', - resolveAs: 'res', - resolve: { - voucher: IssueVoucherResolver, - smallGrid: IssueGridResolver, - costCentres: CostCentreListResolver - } - }) - .when('/Issue/:id', { - template: '', - resolveAs: 'res', - resolve: { - voucher: IssueVoucherResolver, - smallGrid: IssueGridResolver, - costCentres: CostCentreListResolver - } - }) - .when('/SalaryDeduction', { - template: '', - resolveAs: 'res', - resolve: {voucher: SalaryDeductionVoucherResolver} - }) - .when('/SalaryDeduction/:id', { - template: '', - resolveAs: 'res', - resolve: {voucher: SalaryDeductionVoucherResolver} - }) - .when('/Incentive', { - template: '', - resolveAs: 'res', - resolve: {voucher: IncentiveVoucherResolver} - }) - .when('/Incentive/:id', { - template: '', - resolveAs: 'res', - resolve: {voucher: IncentiveVoucherResolver} - }) - .when('/Ledger', { - template: '', - resolveAs: 'res', - resolve: {ledger: LedgerResolver} - }) - .when('/Ledger/:id', { - template: '', - resolveAs: 'res', - resolve: {ledger: LedgerResolver} - }) - .when('/Reconcile', { - template: '', - resolveAs: 'res', - resolve: {reconcile: ReconcileResolver} - }) - .when('/Reconcile/:id', { - template: '', - resolveAs: 'res', - resolve: {reconcile: ReconcileResolver} - }) - .when('/ProductLedger', { - template: '', - resolveAs: 'res', - resolve: {productLedger: ProductLedgerResolver} - }) - .when('/ProductLedger/:id', { - template: '', - resolveAs: 'res', - resolve: {productLedger: ProductLedgerResolver} - }) - .when('/CashFlow', { - template: '', - resolveAs: 'res', - resolve: {cashFlow: CashFlowResolver} - }) - .when('/CashFlow/:id', { - template: '', - resolveAs: 'res', - resolve: {cashFlow: CashFlowResolver} - }) - .when('/RawMaterialCost', { - template: '', - resolveAs: 'res', - resolve: {rawMaterialCost: RawMaterialCostResolver} - }) - .when('/RawMaterialCost/:id', { - template: '', - resolveAs: 'res', - resolve: {rawMaterialCost: RawMaterialCostResolver} - }) - .when('/Attendance', { - template: '', - resolveAs: 'res', - resolve: { - info: AttendanceInfoResolver, - attendanceTypes: AttendanceTypesResolver - } - }) - .when('/Attendance/:date', { - template: '', - resolveAs: 'res', - resolve: { - info: AttendanceInfoResolver, - attendanceTypes: AttendanceTypesResolver - } - }) - .when('/EmployeeAttendance', { - template: '', - resolveAs: 'res', - resolve: { - info: EmployeeAttendanceInfoResolver, - attendanceTypes: AttendanceTypesResolver - } - }) - .when('/EmployeeAttendance/:id', { - template: '', - resolveAs: 'res', - resolve: { - info: EmployeeAttendanceInfoResolver, - attendanceTypes: AttendanceTypesResolver - } - }) - .when('/Daybook', { - template: '', - resolveAs: 'res', - resolve: {info: DaybookResolver} - }) - .when('/Unposted', { - template: '', - resolveAs: 'res', - resolve: {info: UnpostedResolver} - }) - .when('/ProfitLoss', { - template: '', - resolveAs: 'res', - resolve: {profit_loss: ProfitLossResolver} - }) - .when('/StockMovement', { - template: '', - resolveAs: 'res', - resolve: {stockMovement: StockMovementResolver} - }) - .when('/NetTransactions', { - template: '', - resolveAs: 'res', - resolve: {netTransactions: NetTransactionsResolver} - }) - .when('/PurchaseEntries', { - template: '', - resolveAs: 'res', - resolve: {purchaseEntries: PurchaseEntriesResolver} - }) - .when('/Purchases', { - template: '', - resolveAs: 'res', - resolve: {purchases: PurchasesResolver} - }) - .when('/EmployeeFunctions', { - template: '' - }) - .when('/BalanceSheet', { - template: '', - resolveAs: 'res', - resolve: {info: BalanceSheetResolver} - }) - .when('/BalanceSheet/:date', { - template: '', - resolveAs: 'res', - resolve: {info: BalanceSheetResolver} - }) - .when('/TrialBalance', { - template: '', - resolveAs: 'res', - resolve: {trialBalance: TrialBalanceResolver} - }) - .when('/TrialBalance/:date', { - template: '', - resolveAs: 'res', - resolve: {trialBalance: TrialBalanceResolver} - }) - .when('/ClosingStock', { - template: '', - resolveAs: 'res', - resolve: {info: ClosingStockResolver} - }) - .when('/ClosingStock/:date', { - template: '', - resolveAs: 'res', - resolve: {info: ClosingStockResolver} - }) - .when('/Ledger', { - template: '', - resolveAs: 'res', - resolve: {ledger: LedgerResolver} - }) - .when('/Accounts', { - template: '', - resolveAs: 'res', - resolve: { - accounts: AccountListResolver - }, - reloadOnSearch: false - }) - .when('/Account', { - template: '', - resolveAs: 'res', - resolve: { - account: AccountResolver, - accountTypes: AccountTypesResolver, - costCentres: CostCentreListResolver - } - }) - .when('/Account/:id', { - template: '', - resolveAs: 'res', - resolve: { - account: AccountResolver, - accountTypes: AccountTypesResolver, - costCentres: CostCentreListResolver - } - }) - .when('/Employees', { - template: '', - resolveAs: 'res', - resolve: {employees: EmployeeListResolver}, - reloadOnSearch: false - }) - .when('/Employee', { - template: '', - resolveAs: 'res', - resolve: { - employee: EmployeeResolver, - costCentres: CostCentreListResolver - } - }) - .when('/Employee/:id', { - template: '', - resolveAs: 'res', - resolve: { - employee: EmployeeResolver, - costCentres: CostCentreListResolver - } - }) - .when('/CostCentres', { - template: '', - resolveAs: 'res', - resolve: {costCentres: CostCentreListResolver} - }) - .when('/CostCentre', { - template: '', - resolveAs: 'res', - resolve: {costCentre: CostCentreResolver} - }) - .when('/CostCentre/:id', { - template: '', - resolveAs: 'res', - resolve: {costCentre: CostCentreResolver} - }) - .when('/Products', { - template: '', - resolveAs: 'res', - resolve: {products: ProductListResolver}, - reloadOnSearch: false - }) - .when('/Product', { - template: '', - resolveAs: 'res', - resolve: { - product: ProductResolver, - productGroups: ProductGroupListResolver - } - }) - .when('/Product/:id', { - template: '', - resolveAs: 'res', - resolve: { - product: ProductResolver, - productGroups: ProductGroupListResolver - } - }) - .when('/ProductGroups', { - template: '', - resolveAs: 'res', - resolve: {productGroups: ProductGroupListResolver} - }) - .when('/ProductGroup', { - template: '', - resolveAs: 'res', - resolve: {productGroup: ProductGroupResolver} - }) - .when('/ProductGroup/:id', { - template: '', - resolveAs: 'res', - resolve: {productGroup: ProductGroupResolver} - }) - .when('/Users', { - template: '', - resolveAs: 'res', - resolve: {users: UserListResolver} - }) - .when('/User', { - template: '', - resolveAs: 'res', - resolve: {user: UserResolver} - }) - .when('/User/:id', { - template: '', - resolveAs: 'res', - resolve: {user: UserResolver} - }) - .when('/Groups', { - template: '', - resolveAs: 'res', - resolve: {groups: GroupListResolver} - }) - .when('/Group', { - template: '', - resolveAs: 'res', - resolve: {group: GroupResolver} - }) - .when('/Group/:id', { - template: '', - resolveAs: 'res', - resolve: {group: GroupResolver} - }) - .when('/Clients', { - template: '', - resolveAs: 'res', - resolve: {clients: ClientListResolver} - }) - .when('/Client/:id', { - template: '', - resolveAs: 'res', - resolve: {client: ClientResolver} - }) - .when('/Settings', { - template: '', - resolveAs: 'res', - resolve: { - lockInfo: LockInfoResolver, - maintenance: MaintenanceResolver - } - }).otherwise({templateUrl: '/app/404.html'}); - $locationProvider.html5Mode(true).hashPrefix('!'); - }]) -} \ No newline at end of file diff --git a/brewman/static/src/app/overlord.services.js b/brewman/static/src/app/overlord.services.js deleted file mode 100644 index e7478826..00000000 --- a/brewman/static/src/app/overlord.services.js +++ /dev/null @@ -1,86 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var account_service_1 = require("./account/account.service"); -var account_type_service_1 = require("./account/account-type.service"); -var attendance_service_1 = require("./attendance/attendance.service"); -var attendance_types_service_1 = require("./attendance/attendance-types.service"); -var balance_sheet_service_1 = require("./balance-sheet/balance-sheet.service"); -var cash_flow_service_1 = require("./cash-flow/cash-flow.service"); -var client_service_1 = require("./client/client.service"); -var auth_service_1 = require("./common/auth.service"); -var tokenizer_service_1 = require("./common/tokenizer.service"); -var voucher_service_1 = require("./common/voucher.service"); -var cost_centre_service_1 = require("./cost-centre/cost-centre.service"); -var closing_stock_service_1 = require("./closing-stock/closing-stock.service"); -var daybook_service_1 = require("./daybook/daybook.service"); -var employee_service_1 = require("./employee/employee.service"); -var employee_attendance_service_1 = require("./employee/employee-attendance.service"); -var group_service_1 = require("./group/group.service"); -var ledger_service_1 = require("./ledger/ledger.service"); -var issue_grid_service_1 = require("./issue/issue-grid.service"); -var batch_service_1 = require("./issue/batch.service"); -var recipe_service_1 = require("./recipe/recipe.service"); -var raw_material_cost_service_1 = require("./raw-material-cost/raw-material-cost.service"); -var reconcile_service_1 = require("./reconcile/reconcile.service"); -var product_ledger_service_1 = require("./product-ledger/product-ledger.service"); -var user_service_1 = require("./user/user.service"); -var reader_promise_service_1 = require("./common/reader-promise.service"); -var upload_image_resizer_service_1 = require("./common/upload-image-resizer.service"); -var net_transactions_service_1 = require("./net-transactions/net-transactions.service"); -var math_solver_service_1 = require("./common/math-solver.service"); -var product_service_1 = require("./product/product.service"); -var product_group_service_1 = require("./product-group/product-group.service"); -var profit_loss_service_1 = require("./profit-loss/profit-loss.service"); -var purchase_entries_service_1 = require("./purchase-entries/purchase-entries.service"); -var purchases_service_1 = require("./purchases/purchases.service"); -var stock_movement_service_1 = require("./stock-movement/stock-movement.service"); -var trial_balance_service_1 = require("./trial-balance/trial-balance.service"); -var unposted_service_1 = require("./unposted/unposted.service"); -var growl_service_1 = require("./common/growl.service"); -var message_service_1 = require("./common/message.service"); -var credentials_service_1 = require("./common/credentials.service"); -function addServices() { - angular.module('overlord') - .factory('Account', ['$resource', account_service_1.Account]) - .factory('AccountType', ['$resource', account_type_service_1.AccountType]) - .factory('Attendance', ['$resource', attendance_service_1.Attendance]) - .factory('AttendanceTypes', ['$resource', attendance_types_service_1.AttendanceTypes]) - .factory('BalanceSheet', ['$resource', balance_sheet_service_1.BalanceSheet]) - .factory('CashFlow', ['$resource', cash_flow_service_1.CashFlow]) - .factory('Client', ['$resource', client_service_1.Client]) - .factory('Auth', ['$resource', auth_service_1.Auth]) - .factory('Tokenizer', ['$filter', tokenizer_service_1.Tokenizer]) - .factory('CostCentre', ['$resource', cost_centre_service_1.CostCentre]) - .factory('ClosingStock', ['$resource', closing_stock_service_1.ClosingStock]) - .factory('Daybook', ['$resource', daybook_service_1.Daybook]) - .factory('Employee', ['$resource', employee_service_1.Employee]) - .factory('EmployeeAttendance', ['$resource', employee_attendance_service_1.EmployeeAttendance]) - .factory('Group', ['$resource', group_service_1.Group]) - .factory('IssueGrid', ['$resource', issue_grid_service_1.IssueGrid]) - .factory('Batch', ['$resource', batch_service_1.Batch]) - .factory('Voucher', ['$resource', voucher_service_1.Voucher]) - .factory('Ledger', ['$resource', ledger_service_1.Ledger]) - .factory('Recipe', ['$resource', recipe_service_1.Recipe]) - .factory('RawMaterialCost', ['$resource', raw_material_cost_service_1.RawMaterialCost]) - .factory('Reconcile', ['$resource', reconcile_service_1.Reconcile]) - .factory('ProductLedger', ['$resource', product_ledger_service_1.ProductLedger]) - .factory('User', ['$resource', user_service_1.User]) - .factory("ReaderPromise", ["$q", reader_promise_service_1.ReaderPromise]) - .factory("UploadedImageResizer", ["$q", "ReaderPromise", upload_image_resizer_service_1.UploadedImageResizer]) - .factory('NetTransactions', ['$resource', net_transactions_service_1.NetTransactions]) - .factory("MathSolver", math_solver_service_1.MathSolver) - .factory('Product', ['$resource', product_service_1.Product]) - .factory('ProductGroup', ['$resource', product_group_service_1.ProductGroup]) - .factory('ProfitLoss', ['$resource', profit_loss_service_1.ProfitLoss]) - .factory('PurchaseEntries', ['$resource', purchase_entries_service_1.PurchaseEntries]) - .factory('Purchases', ['$resource', purchases_service_1.Purchases]) - .factory('StockMovement', ['$resource', stock_movement_service_1.StockMovement]) - .factory('TrialBalance', ['$resource', trial_balance_service_1.TrialBalance]) - .factory('Unposted', ['$resource', unposted_service_1.Unposted]) - .factory('Messages', message_service_1.Messages) - .factory('Credentials', credentials_service_1.Credentials) - .factory('growl', ['$http', '$compile', '$timeout', growl_service_1.Growl]); -} -exports.addServices = addServices; -//# sourceMappingURL=overlord.services.js.map \ No newline at end of file diff --git a/brewman/static/src/app/overlord.services.js.map b/brewman/static/src/app/overlord.services.js.map deleted file mode 100644 index 4080fa8f..00000000 --- a/brewman/static/src/app/overlord.services.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"overlord.services.js","sourceRoot":"","sources":["overlord.services.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,6DAAkD;AAClD,uEAA2D;AAC3D,sEAA2D;AAC3D,kFAAsE;AACtE,+EAAmE;AACnE,mEAAuD;AACvD,0DAA+C;AAC/C,sDAA2C;AAC3C,gEAAqD;AACrD,4DAAiD;AACjD,yEAA6D;AAC7D,+EAAmE;AACnE,6DAAkD;AAClD,gEAAqD;AACrD,sFAA0E;AAC1E,uDAA4C;AAC5C,0DAA+C;AAC/C,iEAAqD;AACrD,uDAA4C;AAC5C,0DAA+C;AAC/C,2FAA8E;AAC9E,mEAAwD;AACxD,kFAAsE;AACtE,oDAAyC;AACzC,0EAA8D;AAC9D,sFAA2E;AAC3E,wFAA4E;AAC5E,oEAAwD;AACxD,6DAAkD;AAClD,+EAAmE;AACnE,yEAA6D;AAC7D,wFAA4E;AAC5E,mEAAwD;AACxD,kFAAsE;AACtE,+EAAmE;AACnE,gEAAqD;AACrD,wDAA6C;AAC7C,4DAAkD;AAClD,oEAAyD;AAEzD;IACI,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;SACrB,OAAO,CAAC,SAAS,EAAE,CAAC,WAAW,EAAE,yBAAO,CAAC,CAAC;SAC1C,OAAO,CAAC,aAAa,EAAE,CAAC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AO,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,qBAAK,CAAC,CAAC,CAAC;AACpE,CAAC;AAzCD,kCAyCC"} \ No newline at end of file diff --git a/brewman/static/src/app/overlord.services.ts b/brewman/static/src/app/overlord.services.ts deleted file mode 100644 index 03b6fc82..00000000 --- a/brewman/static/src/app/overlord.services.ts +++ /dev/null @@ -1,84 +0,0 @@ -import * as angular from 'angular'; - -import {Account} from './account/account.service'; -import {AccountType} from './account/account-type.service'; -import {Attendance} from './attendance/attendance.service'; -import {AttendanceTypes} from './attendance/attendance-types.service'; -import {BalanceSheet} from './balance-sheet/balance-sheet.service'; -import {CashFlow} from "./cash-flow/cash-flow.service"; -import {Client} from "./client/client.service"; -import {Auth} from './common/auth.service'; -import {Tokenizer} from './common/tokenizer.service'; -import {Voucher} from "./common/voucher.service"; -import {CostCentre} from './cost-centre/cost-centre.service'; -import {ClosingStock} from "./closing-stock/closing-stock.service"; -import {Daybook} from './daybook/daybook.service'; -import {Employee} from "./employee/employee.service"; -import {EmployeeAttendance} from "./employee/employee-attendance.service"; -import {Group} from "./group/group.service"; -import {Ledger} from './ledger/ledger.service'; -import {IssueGrid} from "./issue/issue-grid.service"; -import {Batch} from "./issue/batch.service"; -import {Recipe} from "./recipe/recipe.service"; -import {RawMaterialCost} from "./raw-material-cost/raw-material-cost.service"; -import {Reconcile} from "./reconcile/reconcile.service"; -import {ProductLedger} from "./product-ledger/product-ledger.service"; -import {User} from "./user/user.service"; -import {ReaderPromise} from "./common/reader-promise.service"; -import {UploadedImageResizer} from "./common/upload-image-resizer.service"; -import {NetTransactions} from "./net-transactions/net-transactions.service"; -import {MathSolver} from "./common/math-solver.service"; -import {Product} from "./product/product.service"; -import {ProductGroup} from "./product-group/product-group.service"; -import {ProfitLoss} from "./profit-loss/profit-loss.service"; -import {PurchaseEntries} from "./purchase-entries/purchase-entries.service"; -import {Purchases} from "./purchases/purchases.service"; -import {StockMovement} from "./stock-movement/stock-movement.service"; -import {TrialBalance} from "./trial-balance/trial-balance.service"; -import {Unposted} from "./unposted/unposted.service"; -import {Growl} from "./common/growl.service"; -import {Messages} from "./common/message.service"; -import {Credentials} from "./common/credentials.service"; - -export function addServices() { - angular.module('overlord') - .factory('Account', ['$resource', Account]) - .factory('AccountType', ['$resource', AccountType]) - .factory('Attendance', ['$resource', Attendance]) - .factory('AttendanceTypes', ['$resource', AttendanceTypes]) - .factory('BalanceSheet', ['$resource', BalanceSheet]) - .factory('CashFlow', ['$resource', CashFlow]) - .factory('Client', ['$resource', Client]) - .factory('Auth', ['$resource', Auth]) - .factory('Tokenizer', ['$filter', Tokenizer]) - .factory('CostCentre', ['$resource', CostCentre]) - .factory('ClosingStock', ['$resource', ClosingStock]) - .factory('Daybook', ['$resource', Daybook]) - .factory('Employee', ['$resource', Employee]) - .factory('EmployeeAttendance', ['$resource', EmployeeAttendance]) - .factory('Group', ['$resource', Group]) - .factory('IssueGrid', ['$resource', IssueGrid]) - .factory('Batch', ['$resource', Batch]) - .factory('Voucher', ['$resource', Voucher]) - .factory('Ledger', ['$resource', Ledger]) - .factory('Recipe', ['$resource', Recipe]) - .factory('RawMaterialCost', ['$resource', RawMaterialCost]) - .factory('Reconcile', ['$resource', Reconcile]) - .factory('ProductLedger', ['$resource', ProductLedger]) - .factory('User', ['$resource', User]) - .factory("ReaderPromise", ["$q", ReaderPromise]) - .factory("UploadedImageResizer", ["$q", "ReaderPromise", UploadedImageResizer]) - .factory('NetTransactions', ['$resource', NetTransactions]) - .factory("MathSolver", MathSolver) - .factory('Product', ['$resource', Product]) - .factory('ProductGroup', ['$resource', ProductGroup]) - .factory('ProfitLoss', ['$resource', ProfitLoss]) - .factory('PurchaseEntries', ['$resource', PurchaseEntries]) - .factory('Purchases', ['$resource', Purchases]) - .factory('StockMovement', ['$resource', StockMovement]) - .factory('TrialBalance', ['$resource', TrialBalance]) - .factory('Unposted', ['$resource', Unposted]) - .factory('Messages', Messages) - .factory('Credentials', Credentials) - .factory('growl', ['$http', '$compile', '$timeout', Growl]); -} diff --git a/brewman/static/src/app/payment/payment-modal.controller.js b/brewman/static/src/app/payment/payment-modal.controller.js deleted file mode 100644 index fd0e540b..00000000 --- a/brewman/static/src/app/payment/payment-modal.controller.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var PaymentModalController = /** @class */ (function () { - function PaymentModalController($scope, $modalInstance, MathSolver, Account) { - this.$scope = $scope; - this.$modalInstance = $modalInstance; - this.MathSolver = MathSolver; - this.Account = Account; - this.edit = $scope.$resolve.edit; - } - PaymentModalController.prototype.ok = function () { - this.edit.Amount = this.MathSolver(this.edit.Amount); - this.$modalInstance.close(this.edit); - }; - PaymentModalController.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - PaymentModalController.prototype.accounts = function ($viewValue) { - return this.Account.autocomplete({ term: $viewValue, count: 20 }).$promise; - }; - PaymentModalController.$inject = ['$scope', '$uibModalInstance', 'MathSolver', 'Account']; - return PaymentModalController; -}()); -exports.PaymentModalController = PaymentModalController; -//# sourceMappingURL=payment-modal.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/payment/payment-modal.controller.js.map b/brewman/static/src/app/payment/payment-modal.controller.js.map deleted file mode 100644 index 668bfe7c..00000000 --- a/brewman/static/src/app/payment/payment-modal.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"payment-modal.controller.js","sourceRoot":"","sources":["payment-modal.controller.ts"],"names":[],"mappings":";;AAAA;IAII,gCAAmB,MAAM,EAAS,cAAc,EAAS,UAAU,EAAS,OAAO;QAAhE,WAAM,GAAN,MAAM,CAAA;QAAS,mBAAc,GAAd,cAAc,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QAAS,YAAO,GAAP,OAAO,CAAA;QAC/E,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;IACrC,CAAC;IAED,mCAAE,GAAF;QACI,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,uCAAM,GAAN;QACI,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED,yCAAQ,GAAR,UAAS,UAAU;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;IAC7E,CAAC;IAlBM,8BAAO,GAAG,CAAC,QAAQ,EAAE,mBAAmB,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;IAmB9E,6BAAC;CAAA,AApBD,IAoBC;AApBY,wDAAsB"} \ No newline at end of file diff --git a/brewman/static/src/app/payment/payment-modal.controller.ts b/brewman/static/src/app/payment/payment-modal.controller.ts deleted file mode 100644 index 8b874438..00000000 --- a/brewman/static/src/app/payment/payment-modal.controller.ts +++ /dev/null @@ -1,21 +0,0 @@ -export class PaymentModalController { - static $inject = ['$scope', '$uibModalInstance', 'MathSolver', 'Account']; - edit:any; - - constructor(public $scope, public $modalInstance, public MathSolver, public Account) { - this.edit = $scope.$resolve.edit; - } - - ok() { - this.edit.Amount = this.MathSolver(this.edit.Amount); - this.$modalInstance.close(this.edit); - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - - accounts($viewValue) { - return this.Account.autocomplete({term: $viewValue, count: 20}).$promise; - } -} diff --git a/brewman/static/src/app/payment/payment-modal.html b/brewman/static/src/app/payment/payment-modal.html deleted file mode 100644 index 1e5e2442..00000000 --- a/brewman/static/src/app/payment/payment-modal.html +++ /dev/null @@ -1,27 +0,0 @@ - diff --git a/brewman/static/src/app/payment/payment-voucher.resolver.js b/brewman/static/src/app/payment/payment-voucher.resolver.js deleted file mode 100644 index dc5b7923..00000000 --- a/brewman/static/src/app/payment/payment-voucher.resolver.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function PaymentVoucherResolver($route, Voucher) { - var id = $route.current.params.id, account = $route.current.params.a; - if (angular.isUndefined(id)) { - var options = { type: 'Payment' }; - if (!angular.isUndefined(account)) { - options['a'] = account; - } - return Voucher.get(options).$promise; - } - else { - return Voucher.get({ id: id }).$promise; - } -} -exports.PaymentVoucherResolver = PaymentVoucherResolver; -//# sourceMappingURL=payment-voucher.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/payment/payment-voucher.resolver.js.map b/brewman/static/src/app/payment/payment-voucher.resolver.js.map deleted file mode 100644 index 2bd324bc..00000000 --- a/brewman/static/src/app/payment/payment-voucher.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"payment-voucher.resolver.js","sourceRoot":"","sources":["payment-voucher.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,gCAAuC,MAAM,EAAE,OAAO;IAClD,IAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAC/B,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAEtC,IAAI,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;QACzB,IAAI,OAAO,GAAG,EAAC,IAAI,EAAE,SAAS,EAAC,CAAC;QAChC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE;YAC/B,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;SAC1B;QACD,OAAO,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;KACxC;SAAM;QACH,OAAO,OAAO,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;KACzC;AACL,CAAC;AAbD,wDAaC"} \ No newline at end of file diff --git a/brewman/static/src/app/payment/payment-voucher.resolver.ts b/brewman/static/src/app/payment/payment-voucher.resolver.ts deleted file mode 100644 index 8e19e010..00000000 --- a/brewman/static/src/app/payment/payment-voucher.resolver.ts +++ /dev/null @@ -1,16 +0,0 @@ -import * as angular from 'angular'; - -export function PaymentVoucherResolver($route, Voucher) { - const id = $route.current.params.id, - account = $route.current.params.a; - - if (angular.isUndefined(id)) { - let options = {type: 'Payment'}; - if (!angular.isUndefined(account)) { - options['a'] = account; - } - return Voucher.get(options).$promise; - } else { - return Voucher.get({id: id}).$promise; - } -} diff --git a/brewman/static/src/app/payment/payment.component.js b/brewman/static/src/app/payment/payment.component.js deleted file mode 100644 index bff9b008..00000000 --- a/brewman/static/src/app/payment/payment.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var payment_controller_1 = require("./payment.controller"); -exports.PaymentComponent = { - templateUrl: '/app/payment/payment.html', - controller: payment_controller_1.PaymentController, - controllerAs: 'vm', -}; -//# sourceMappingURL=payment.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/payment/payment.component.js.map b/brewman/static/src/app/payment/payment.component.js.map deleted file mode 100644 index 3ad271ec..00000000 --- a/brewman/static/src/app/payment/payment.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"payment.component.js","sourceRoot":"","sources":["payment.component.ts"],"names":[],"mappings":";;AAAA,2DAAuD;AAE1C,QAAA,gBAAgB,GAAG;IAC5B,WAAW,EAAE,2BAA2B;IACxC,UAAU,EAAE,sCAAiB;IAC7B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/payment/payment.component.ts b/brewman/static/src/app/payment/payment.component.ts deleted file mode 100644 index 412f7b9c..00000000 --- a/brewman/static/src/app/payment/payment.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {PaymentController} from "./payment.controller"; - -export const PaymentComponent = { - templateUrl: '/app/payment/payment.html', - controller: PaymentController, - controllerAs: 'vm', -}; \ No newline at end of file diff --git a/brewman/static/src/app/payment/payment.controller.js b/brewman/static/src/app/payment/payment.controller.js deleted file mode 100644 index 753d4c07..00000000 --- a/brewman/static/src/app/payment/payment.controller.js +++ /dev/null @@ -1,217 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var _ = require("lodash"); -var payment_modal_controller_1 = require("./payment-modal.controller"); -var PaymentController = /** @class */ (function () { - function PaymentController($scope, $location, asDate, $modal, UploadedImageResizer, MathSolver, Account, dateParser, Messages, Credentials) { - var _this = this; - this.$scope = $scope; - this.$location = $location; - this.asDate = asDate; - this.$modal = $modal; - this.UploadedImageResizer = UploadedImageResizer; - this.MathSolver = MathSolver; - this.Account = Account; - this.dateParser = dateParser; - this.Messages = Messages; - this.Credentials = Credentials; - this.voucher = $scope.$parent.res.voucher; - this.ledgers = $scope.$parent.res.ledgers; - this._voucher_Date = dateParser.parse(this.voucher.Date, "dd-MMM-yyyy"); - this.foAccount = true; - $scope.$on("fileSelected", function (event, args) { - UploadedImageResizer(args, _this.voucher.Files); - }); - $scope.$watch('vm.voucher.Journals', function (journals, oldValue) { - var amount = _.chain(journals) - .filter({ 'Debit': 1 }) - .reduce(function (sum, item) { - return item.Amount + sum; - }, 0).value(); - var j = _.find(journals, { 'Debit': -1 }); - j.Amount = amount; - if (_.find(oldValue, { 'Debit': -1 }).Ledger.LedgerID !== j.Ledger.LedgerID) { - $location.search({ a: j.Ledger.LedgerID }).replace(); - } - }, true); - $scope.$watch('vm.account', function (account) { - if (!account) { - delete _this.accBal; - } - else { - Account.balance({ id: account.LedgerID, d: _this.voucher.Date }, function (bal) { - _this.accBal = bal; - }); - } - }, true); - } - PaymentController.prototype.voucher_Date = function (value) { - if (arguments.length) { - this.voucher.Date = this.asDate(value); - this._voucher_Date = value; - } - return this._voucher_Date; - }; - PaymentController.prototype.getOld = function (ledgerID, journals) { - return _.find(journals, function (journal) { - return journal.Ledger.LedgerID === ledgerID; - }); - }; - PaymentController.prototype.deleteFile = function (item) { - var index = this.voucher.Files.indexOf(item); - this.voucher.Files.splice(index, 1); - }; - PaymentController.prototype.zoomImage = function (item) { - this.$modal.open({ - templateUrl: '/template/modal/image.html', - controller: ['$uibModalInstance', /** @class */ (function () { - function class_1($modalInstance) { - this.$modalInstance = $modalInstance; - this.imageUrl = item.Resized; - this.size = null; - } - class_1.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - return class_1; - }())] - }); - }; - PaymentController.prototype.add = function () { - var amount, oldJournal; - if (!this.account || !this.account.LedgerID) { - return; - } - amount = this.MathSolver(this.amount); - if (Number.isNaN(amount) || amount <= 0) { - return; - } - oldJournal = this.getOld(this.account.LedgerID, this.voucher.Journals); - if (angular.isUndefined(oldJournal)) { - this.voucher.Journals.push({ Debit: 1, Amount: amount, Ledger: this.account }); - } - else { - if (oldJournal.Debit === 1) { - oldJournal.Amount += amount; - } - else { - return; - } - } - delete this.account; - delete this.amount; - this.foAccount = true; - }; - PaymentController.prototype.removeJournal = function (journal) { - var index = this.voucher.Journals.indexOf(journal); - this.voucher.Journals.splice(index, 1); - }; - PaymentController.prototype.preventAlteration = function (voucher) { - if (angular.isUndefined(this.Credentials.Perms)) { - return false; - } - else if (angular.isUndefined(voucher.VoucherID)) { - return !this.Credentials.Perms['Payment']; - } - else if (voucher.Posted && !this.Credentials.Perms['Edit Posted Vouchers']) { - return true; - } - else if (voucher.User.UserID != this.Credentials.Auth.UserID && !this.Credentials.Perms["Edit Other User's Vouchers"]) { - return true; - } - else { - return false; - } - }; - PaymentController.prototype.save = function () { - var _this = this; - return this.voucher.$save({ type: 'Payment' }, function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/Payment/' + u.VoucherID); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - PaymentController.prototype.delete = function () { - var _this = this; - this.voucher.$delete(function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/Payment').replace(); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - PaymentController.prototype.post = function () { - var _this = this; - return this.voucher.$post(function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - PaymentController.prototype.modal = function (journal) { - var _this = this; - this.selectedJournal = journal; - var edit = {}; - angular.copy(this.selectedJournal, edit); - var modalInstance = this.$modal.open({ - backdrop: true, - size: 'lg', - templateUrl: '/app/payment/payment-modal.html', - controllerAs: 'vmModal', - controller: payment_modal_controller_1.PaymentModalController, - resolve: { - edit: function () { - return edit; - } - } - }); - modalInstance.result.then(function (updated) { - if (updated.Ledger.LedgerID !== _this.selectedJournal.Ledger.LedgerID) { - var oldJournal = _this.getOld(updated.Ledger.LedgerID, _this.voucher.Journals); - if (!angular.isUndefined(oldJournal)) { - delete _this.selectedJournal; - return false; - } - } - angular.copy(updated, _this.selectedJournal); - delete _this.selectedJournal; - }, function () { - delete _this.selectedJournal; - }); - }; - PaymentController.prototype.confirm = function () { - var _this = this; - var modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', /** @class */ (function () { - function class_2($modalInstance) { - this.$modalInstance = $modalInstance; - this.title = "Delete Voucher"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - class_2.prototype.ok = function () { - this.$modalInstance.close(); - }; - class_2.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - return class_2; - }())] - }); - modalInstance.result.then(function () { - _this.delete(); - }); - }; - PaymentController.prototype.accounts = function ($viewValue) { - return this.Account.autocomplete({ term: $viewValue, count: 20 }).$promise; - }; - PaymentController.$inject = ['$scope', '$location', 'asDateFilter', '$uibModal', 'UploadedImageResizer', 'MathSolver', 'Account', 'uibDateParser', 'Messages', 'Credentials']; - return PaymentController; -}()); -exports.PaymentController = PaymentController; -//# sourceMappingURL=payment.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/payment/payment.controller.js.map b/brewman/static/src/app/payment/payment.controller.js.map deleted file mode 100644 index 0070a00b..00000000 --- a/brewman/static/src/app/payment/payment.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"payment.controller.js","sourceRoot":"","sources":["payment.controller.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AACnC,0BAA4B;AAC5B,uEAAkE;AAElE;IAWI,2BAAmB,MAAM,EAAS,SAAS,EAAS,MAAM,EAAS,MAAM,EAAS,oBAAoB,EAAS,UAAU,EAAS,OAAO,EAAS,UAAU,EAAS,QAAQ,EAAS,WAAW;QAAjM,iBAiCC;QAjCkB,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,yBAAoB,GAApB,oBAAoB,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QAAS,YAAO,GAAP,OAAO,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QAAS,aAAQ,GAAR,QAAQ,CAAA;QAAS,gBAAW,GAAX,WAAW,CAAA;QAC7L,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;QAC1C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;QAC1C,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QACxE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,UAAC,KAAK,EAAE,IAAI;YACnC,oBAAoB,CAAC,IAAI,EAA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M,CAAC,IAAI,CAAC;YACtB,KAAI,CAAC,MAAM,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACP,CAAC;IAED,oCAAQ,GAAR,UAAS,UAAU;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;IAC7E,CAAC;IAxNM,yBAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,sBAAsB,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;IAyNvK,wBAAC;CAAA,AA1ND,IA0NC;AA1NY,8CAAiB"} \ No newline at end of file diff --git a/brewman/static/src/app/payment/payment.controller.ts b/brewman/static/src/app/payment/payment.controller.ts deleted file mode 100644 index 2517ea17..00000000 --- a/brewman/static/src/app/payment/payment.controller.ts +++ /dev/null @@ -1,223 +0,0 @@ -import * as angular from 'angular'; -import * as _ from 'lodash'; -import {PaymentModalController} from './payment-modal.controller'; - -export class PaymentController { - static $inject = ['$scope', '$location', 'asDateFilter', '$uibModal', 'UploadedImageResizer', 'MathSolver', 'Account', 'uibDateParser', 'Messages', 'Credentials']; - _voucher_Date: any; - foAccount: any; - selectedJournal: any; - amount: any; - accBal: any; - account: any; - voucher: any; - ledgers: any; - - constructor(public $scope, public $location, public asDate, public $modal, public UploadedImageResizer, public MathSolver, public Account, public dateParser, public Messages, public Credentials) { - this.voucher = $scope.$parent.res.voucher; - this.ledgers = $scope.$parent.res.ledgers; - this._voucher_Date = dateParser.parse(this.voucher.Date, "dd-MMM-yyyy"); - this.foAccount = true; - $scope.$on("fileSelected", (event, args) => { - UploadedImageResizer(args, this.voucher.Files); - }); - $scope.$watch('vm.voucher.Journals', (journals, oldValue) => { - const amount = _.chain(journals) - .filter({'Debit': 1}) - .reduce(function (sum, item) { - return item.Amount + sum; - }, 0).value(); - - const j = _.find(journals, {'Debit': -1}); - j.Amount = amount; - if (_.find(oldValue, {'Debit': -1}).Ledger.LedgerID !== j.Ledger.LedgerID) { - $location.search({a: j.Ledger.LedgerID}).replace(); - } - }, true); - - $scope.$watch('vm.account', (account) => { - if (!account) { - delete this.accBal; - } - else { - Account.balance({id: account.LedgerID, d: this.voucher.Date}, (bal) => { - this.accBal = bal; - }); - } - }, true); - - } - - voucher_Date(value) { - if (arguments.length) { - this.voucher.Date = this.asDate(value); - this._voucher_Date = value; - } - return this._voucher_Date; - } - - getOld(ledgerID, journals) { - return _.find(journals, function (journal) { - return journal.Ledger.LedgerID === ledgerID; - }); - } - - deleteFile(item) { - const index = this.voucher.Files.indexOf(item); - this.voucher.Files.splice(index, 1); - } - - zoomImage(item) { - this.$modal.open({ - templateUrl: '/template/modal/image.html', - controller: ['$uibModalInstance', class { - imageUrl: any; - size: any; - - constructor(public $modalInstance) { - this.imageUrl = item.Resized; - this.size = null; - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - }] - }); - } - - add() { - let amount, - oldJournal; - if (!this.account || !this.account.LedgerID) { - return; - } - amount = this.MathSolver(this.amount); - if (Number.isNaN(amount) || amount <= 0) { - return; - } - oldJournal = this.getOld(this.account.LedgerID, this.voucher.Journals); - if (angular.isUndefined(oldJournal)) { - this.voucher.Journals.push({Debit: 1, Amount: amount, Ledger: this.account}); - } else { - if (oldJournal.Debit === 1) { - oldJournal.Amount += amount; - } else { - return; - } - } - delete this.account; - delete this.amount; - this.foAccount = true; - } - - removeJournal(journal) { - const index = this.voucher.Journals.indexOf(journal); - this.voucher.Journals.splice(index, 1); - } - - preventAlteration(voucher) { - if (angular.isUndefined(this.Credentials.Perms)) { - return false; - } else if (angular.isUndefined(voucher.VoucherID)) { - return !this.Credentials.Perms['Payment']; - } else if (voucher.Posted && !this.Credentials.Perms['Edit Posted Vouchers']) { - return true; - } else if (voucher.User.UserID != this.Credentials.Auth.UserID && !this.Credentials.Perms["Edit Other User's Vouchers"]) { - return true; - } else { - return false; - } - } - - save() { - return this.voucher.$save({type: 'Payment'}, (u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/Payment/' + u.VoucherID); - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - delete() { - this.voucher.$delete((u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/Payment').replace(); - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - post() { - return this.voucher.$post((u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - modal(journal) { - this.selectedJournal = journal; - let edit = {}; - angular.copy(this.selectedJournal, edit); - const modalInstance = this.$modal.open({ - backdrop: true, - size: 'lg', - templateUrl: '/app/payment/payment-modal.html', - controllerAs: 'vmModal', - controller: PaymentModalController, - resolve: { - edit: function () { - return edit; - } - } - }); - modalInstance.result.then((updated) => { - if (updated.Ledger.LedgerID !== this.selectedJournal.Ledger.LedgerID) { - const oldJournal = this.getOld(updated.Ledger.LedgerID, this.voucher.Journals); - if (!angular.isUndefined(oldJournal)) { - delete this.selectedJournal; - return false; - } - } - angular.copy(updated, this.selectedJournal); - delete this.selectedJournal; - }, () => { - delete this.selectedJournal; - }); - } - - confirm() { - const modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', class { - title: any; - body: any; - isDelete: boolean; - - constructor(public $modalInstance) { - this.title = "Delete Voucher"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - - ok() { - this.$modalInstance.close(); - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - }] - }); - modalInstance.result.then(() => { - this.delete(); - }); - } - - accounts($viewValue) { - return this.Account.autocomplete({term: $viewValue, count: 20}).$promise; - } -} diff --git a/brewman/static/src/app/payment/payment.html b/brewman/static/src/app/payment/payment.html deleted file mode 100644 index b85291d8..00000000 --- a/brewman/static/src/app/payment/payment.html +++ /dev/null @@ -1,117 +0,0 @@ -
-

Payment Edit / New

- -
- - -
-
- - - - -
-
- -
-
- ₹ -
-
-
- -
- - -
- - -

Balance as on Date: {{vm.accBal.Date | accounting}} / {{vm.accBal.Total - | accounting}}

-
-
-
- ₹ - - - - -
-
-
- - - - - - - - - - - - - - - - - -
NameAmountDelete
{{journal.Ledger.Name}}{{journal.Amount | currency}} -
- Delete - - -
-
-
- - -
- -
-
-
-
-
- - -
- - -
-
-
-
- - - -
-
-
- Created on {{vm.voucher.CreationDate | localTime}} and Last Edited on {{vm.voucher.LastEditDate | localTime}} - by {{vm.voucher.User.Name}}. Posted by {{vm.voucher.Poster}} - -
-
diff --git a/brewman/static/src/app/product-group/product-group-detail.html b/brewman/static/src/app/product-group/product-group-detail.html deleted file mode 100644 index ffef3407..00000000 --- a/brewman/static/src/app/product-group/product-group-detail.html +++ /dev/null @@ -1,16 +0,0 @@ -
-

Product Group Detail

- -
- - -
- -
-
-
-
- -
-
-
diff --git a/brewman/static/src/app/product-group/product-group-list.component.js b/brewman/static/src/app/product-group/product-group-list.component.js deleted file mode 100644 index d4199cb7..00000000 --- a/brewman/static/src/app/product-group/product-group-list.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var product_group_list_controller_1 = require("./product-group-list.controller"); -exports.ProductGroupListComponent = { - templateUrl: '/app/product-group/product-group-list.html', - controller: product_group_list_controller_1.ProductGroupListController, - controllerAs: 'vm', -}; -//# sourceMappingURL=product-group-list.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/product-group/product-group-list.component.js.map b/brewman/static/src/app/product-group/product-group-list.component.js.map deleted file mode 100644 index 35b00bc5..00000000 --- a/brewman/static/src/app/product-group/product-group-list.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"product-group-list.component.js","sourceRoot":"","sources":["product-group-list.component.ts"],"names":[],"mappings":";;AAAA,iFAA2E;AAE9D,QAAA,yBAAyB,GAAG;IACrC,WAAW,EAAE,4CAA4C;IACzD,UAAU,EAAE,0DAA0B;IACtC,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/product-group/product-group-list.component.ts b/brewman/static/src/app/product-group/product-group-list.component.ts deleted file mode 100644 index c2d166e5..00000000 --- a/brewman/static/src/app/product-group/product-group-list.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {ProductGroupListController} from "./product-group-list.controller"; - -export const ProductGroupListComponent = { - templateUrl: '/app/product-group/product-group-list.html', - controller: ProductGroupListController, - controllerAs: 'vm', -}; diff --git a/brewman/static/src/app/product-group/product-group-list.controller.js b/brewman/static/src/app/product-group/product-group-list.controller.js deleted file mode 100644 index 6339257b..00000000 --- a/brewman/static/src/app/product-group/product-group-list.controller.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var ProductGroupListController = /** @class */ (function () { - function ProductGroupListController($scope) { - this.$scope = $scope; - this.productGroups = $scope.$parent.res.productGroups; - this.info = this.productGroups; - } - ProductGroupListController.$inject = ['$scope']; - return ProductGroupListController; -}()); -exports.ProductGroupListController = ProductGroupListController; -//# sourceMappingURL=product-group-list.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/product-group/product-group-list.controller.js.map b/brewman/static/src/app/product-group/product-group-list.controller.js.map deleted file mode 100644 index 324ede3c..00000000 --- a/brewman/static/src/app/product-group/product-group-list.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"product-group-list.controller.js","sourceRoot":"","sources":["product-group-list.controller.ts"],"names":[],"mappings":";;AAAA;IAKI,oCAAmB,MAAM;QAAN,WAAM,GAAN,MAAM,CAAA;QACrB,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;QACtD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC;IACnC,CAAC;IAPM,kCAAO,GAAG,CAAC,QAAQ,CAAC,CAAC;IAQhC,iCAAC;CAAA,AATD,IASC;AATY,gEAA0B"} \ No newline at end of file diff --git a/brewman/static/src/app/product-group/product-group-list.controller.ts b/brewman/static/src/app/product-group/product-group-list.controller.ts deleted file mode 100644 index 7ce852a5..00000000 --- a/brewman/static/src/app/product-group/product-group-list.controller.ts +++ /dev/null @@ -1,10 +0,0 @@ -export class ProductGroupListController { - static $inject = ['$scope']; - info: any; - productGroups: any; - - constructor(public $scope) { - this.productGroups = $scope.$parent.res.productGroups; - this.info = this.productGroups; - } -} diff --git a/brewman/static/src/app/product-group/product-group-list.html b/brewman/static/src/app/product-group/product-group-list.html deleted file mode 100644 index a7c4b6d7..00000000 --- a/brewman/static/src/app/product-group/product-group-list.html +++ /dev/null @@ -1,13 +0,0 @@ -

Product Groups Add

- - - - - - - - - - - -
Name
{{item.Name}}
diff --git a/brewman/static/src/app/product-group/product-group-list.resolver.js b/brewman/static/src/app/product-group/product-group-list.resolver.js deleted file mode 100644 index 16c7cd92..00000000 --- a/brewman/static/src/app/product-group/product-group-list.resolver.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function ProductGroupListResolver(ProductGroup) { - return ProductGroup.query({}).$promise; -} -exports.ProductGroupListResolver = ProductGroupListResolver; -//# sourceMappingURL=product-group-list.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/product-group/product-group-list.resolver.js.map b/brewman/static/src/app/product-group/product-group-list.resolver.js.map deleted file mode 100644 index 0d1a6ad8..00000000 --- a/brewman/static/src/app/product-group/product-group-list.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"product-group-list.resolver.js","sourceRoot":"","sources":["product-group-list.resolver.ts"],"names":[],"mappings":";;AAAA,kCAAyC,YAAY;IACjD,OAAO,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;AAC3C,CAAC;AAFD,4DAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/product-group/product-group-list.resolver.ts b/brewman/static/src/app/product-group/product-group-list.resolver.ts deleted file mode 100644 index e7c9da23..00000000 --- a/brewman/static/src/app/product-group/product-group-list.resolver.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function ProductGroupListResolver(ProductGroup) { - return ProductGroup.query({}).$promise; -} diff --git a/brewman/static/src/app/product-group/product-group.component.js b/brewman/static/src/app/product-group/product-group.component.js deleted file mode 100644 index 34b1fb4f..00000000 --- a/brewman/static/src/app/product-group/product-group.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var product_group_controller_1 = require("./product-group.controller"); -exports.ProductGroupComponent = { - templateUrl: '/app/product-group/product-group-detail.html', - controller: product_group_controller_1.ProductGroupController, - controllerAs: 'vm', -}; -//# sourceMappingURL=product-group.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/product-group/product-group.component.js.map b/brewman/static/src/app/product-group/product-group.component.js.map deleted file mode 100644 index 1e3b8990..00000000 --- a/brewman/static/src/app/product-group/product-group.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"product-group.component.js","sourceRoot":"","sources":["product-group.component.ts"],"names":[],"mappings":";;AAAA,uEAAkE;AAErD,QAAA,qBAAqB,GAAG;IACjC,WAAW,EAAE,8CAA8C;IAC3D,UAAU,EAAE,iDAAsB;IAClC,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/product-group/product-group.component.ts b/brewman/static/src/app/product-group/product-group.component.ts deleted file mode 100644 index 9ea3eba2..00000000 --- a/brewman/static/src/app/product-group/product-group.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {ProductGroupController} from "./product-group.controller"; - -export const ProductGroupComponent = { - templateUrl: '/app/product-group/product-group-detail.html', - controller: ProductGroupController, - controllerAs: 'vm', -}; diff --git a/brewman/static/src/app/product-group/product-group.controller.js b/brewman/static/src/app/product-group/product-group.controller.js deleted file mode 100644 index b0af851a..00000000 --- a/brewman/static/src/app/product-group/product-group.controller.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var ProductGroupController = /** @class */ (function () { - function ProductGroupController($scope, $location, Messages) { - this.$scope = $scope; - this.$location = $location; - this.Messages = Messages; - this.productGroup = $scope.$parent.res.productGroup; - this.foName = true; - } - ProductGroupController.prototype.save = function () { - var _this = this; - this.productGroup.$save(function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/ProductGroups'); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - ProductGroupController.prototype.delete = function () { - var _this = this; - this.productGroup.$delete(function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/ProductGroups'); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - ProductGroupController.$inject = ['$scope', '$location', 'Messages']; - return ProductGroupController; -}()); -exports.ProductGroupController = ProductGroupController; -//# sourceMappingURL=product-group.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/product-group/product-group.controller.js.map b/brewman/static/src/app/product-group/product-group.controller.js.map deleted file mode 100644 index bb4aa091..00000000 --- a/brewman/static/src/app/product-group/product-group.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"product-group.controller.js","sourceRoot":"","sources":["product-group.controller.ts"],"names":[],"mappings":";;AAAA;IAKI,gCAAmB,MAAM,EAAS,SAAS,EAAS,QAAQ;QAAzC,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,aAAQ,GAAR,QAAQ,CAAA;QACxD,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;QACpD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;IAED,qCAAI,GAAJ;QAAA,iBAOC;QANG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,UAAC,CAAC,EAAE,kBAAkB;YAC1C,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAC,CAAC,CAAC;YACnD,KAAI,CAAC,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;QACzC,CAAC,EAAE,UAAC,IAAI,EAAE,MAAM;YACZ,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,EAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACP,CAAC;IAED,uCAAM,GAAN;QAAA,iBAOC;QANG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,UAAC,CAAC,EAAE,kBAAkB;YAC5C,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAC,CAAC,CAAC;YACnD,KAAI,CAAC,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;QACzC,CAAC,EAAE,UAAC,IAAI,EAAE,MAAM;YACZ,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,EAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACP,CAAC;IAzBM,8BAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;IA0BzD,6BAAC;CAAA,AA3BD,IA2BC;AA3BY,wDAAsB"} \ No newline at end of file diff --git a/brewman/static/src/app/product-group/product-group.controller.ts b/brewman/static/src/app/product-group/product-group.controller.ts deleted file mode 100644 index 17d7cf6a..00000000 --- a/brewman/static/src/app/product-group/product-group.controller.ts +++ /dev/null @@ -1,28 +0,0 @@ -export class ProductGroupController { - static $inject = ['$scope', '$location', 'Messages']; - foName: boolean; - productGroup: any; - - constructor(public $scope, public $location, public Messages) { - this.productGroup = $scope.$parent.res.productGroup; - this.foName = true; - } - - save() { - this.productGroup.$save((u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/ProductGroups') - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - delete() { - this.productGroup.$delete((u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/ProductGroups') - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } -} diff --git a/brewman/static/src/app/product-group/product-group.resolver.js b/brewman/static/src/app/product-group/product-group.resolver.js deleted file mode 100644 index 346316c1..00000000 --- a/brewman/static/src/app/product-group/product-group.resolver.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function ProductGroupResolver($route, ProductGroup) { - var id = $route.current.params.id; - return ProductGroup.get({ id: id }).$promise; -} -exports.ProductGroupResolver = ProductGroupResolver; -//# sourceMappingURL=product-group.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/product-group/product-group.resolver.js.map b/brewman/static/src/app/product-group/product-group.resolver.js.map deleted file mode 100644 index 1feed1ed..00000000 --- a/brewman/static/src/app/product-group/product-group.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"product-group.resolver.js","sourceRoot":"","sources":["product-group.resolver.ts"],"names":[],"mappings":";;AAAA,8BAAqC,MAAM,EAAE,YAAY;IACrD,IAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IACpC,OAAO,YAAY,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;AAC/C,CAAC;AAHD,oDAGC"} \ No newline at end of file diff --git a/brewman/static/src/app/product-group/product-group.resolver.ts b/brewman/static/src/app/product-group/product-group.resolver.ts deleted file mode 100644 index 2956bcf4..00000000 --- a/brewman/static/src/app/product-group/product-group.resolver.ts +++ /dev/null @@ -1,4 +0,0 @@ -export function ProductGroupResolver($route, ProductGroup) { - const id = $route.current.params.id; - return ProductGroup.get({id: id}).$promise; -} diff --git a/brewman/static/src/app/product-group/product-group.service.js b/brewman/static/src/app/product-group/product-group.service.js deleted file mode 100644 index a4c52692..00000000 --- a/brewman/static/src/app/product-group/product-group.service.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function ProductGroup($resource) { - return $resource('/api/ProductGroup/:id', { id: '@ProductGroupID' }, { - query: { method: 'GET', params: { list: true }, isArray: true } - }); -} -exports.ProductGroup = ProductGroup; -//# sourceMappingURL=product-group.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/product-group/product-group.service.js.map b/brewman/static/src/app/product-group/product-group.service.js.map deleted file mode 100644 index c3124039..00000000 --- a/brewman/static/src/app/product-group/product-group.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"product-group.service.js","sourceRoot":"","sources":["product-group.service.ts"],"names":[],"mappings":";;AAAA,sBAA6B,SAAS;IAClC,OAAO,SAAS,CAAC,uBAAuB,EACpC,EAAC,EAAE,EAAE,iBAAiB,EAAC,EAAE;QACrB,KAAK,EAAE,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,EAAE,OAAO,EAAE,IAAI,EAAC;KAC9D,CAAC,CAAC;AACX,CAAC;AALD,oCAKC"} \ No newline at end of file diff --git a/brewman/static/src/app/product-group/product-group.service.ts b/brewman/static/src/app/product-group/product-group.service.ts deleted file mode 100644 index 56ccec44..00000000 --- a/brewman/static/src/app/product-group/product-group.service.ts +++ /dev/null @@ -1,6 +0,0 @@ -export function ProductGroup($resource) { - return $resource('/api/ProductGroup/:id', - {id: '@ProductGroupID'}, { - query: {method: 'GET', params: {list: true}, isArray: true} - }); -} diff --git a/brewman/static/src/app/product-ledger/product-ledger.component.js b/brewman/static/src/app/product-ledger/product-ledger.component.js deleted file mode 100644 index 98424130..00000000 --- a/brewman/static/src/app/product-ledger/product-ledger.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var product_ledger_controller_1 = require("./product-ledger.controller"); -exports.ProductLedgerComponent = { - templateUrl: '/app/product-ledger/product-ledger.html', - controller: product_ledger_controller_1.ProductLedgerController, - controllerAs: 'vm', -}; -//# sourceMappingURL=product-ledger.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/product-ledger/product-ledger.component.js.map b/brewman/static/src/app/product-ledger/product-ledger.component.js.map deleted file mode 100644 index d3cbdf6e..00000000 --- a/brewman/static/src/app/product-ledger/product-ledger.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"product-ledger.component.js","sourceRoot":"","sources":["product-ledger.component.ts"],"names":[],"mappings":";;AAAA,yEAAoE;AAEvD,QAAA,sBAAsB,GAAG;IAClC,WAAW,EAAE,yCAAyC;IACtD,UAAU,EAAE,mDAAuB;IACnC,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/product-ledger/product-ledger.component.ts b/brewman/static/src/app/product-ledger/product-ledger.component.ts deleted file mode 100644 index d9b8aef6..00000000 --- a/brewman/static/src/app/product-ledger/product-ledger.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {ProductLedgerController} from "./product-ledger.controller"; - -export const ProductLedgerComponent = { - templateUrl: '/app/product-ledger/product-ledger.html', - controller: ProductLedgerController, - controllerAs: 'vm', -}; \ No newline at end of file diff --git a/brewman/static/src/app/product-ledger/product-ledger.controller.js b/brewman/static/src/app/product-ledger/product-ledger.controller.js deleted file mode 100644 index 7eedce81..00000000 --- a/brewman/static/src/app/product-ledger/product-ledger.controller.js +++ /dev/null @@ -1,61 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var $ = require("jquery"); -var ProductLedgerController = /** @class */ (function () { - function ProductLedgerController($scope, $routeParams, $location, asDate, ProductLedger, Product, dateParser) { - this.$scope = $scope; - this.$routeParams = $routeParams; - this.$location = $location; - this.asDate = asDate; - this.ProductLedger = ProductLedger; - this.Product = Product; - this.dateParser = dateParser; - this.productLedger = $scope.$parent.res.productLedger; - this._info_StartDate = dateParser.parse(this.productLedger.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.productLedger.FinishDate, "dd-MMM-yyyy"); - this.info = this.productLedger; - this.foProduct = true; - } - ProductLedgerController.prototype.info_StartDate = function (value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - }; - ProductLedgerController.prototype.info_FinishDate = function (value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - }; - ProductLedgerController.prototype.show = function () { - var _this = this; - var id = this.info.Product.ProductID; - if (id === this.$routeParams.id && this.info.StartDate === this.$routeParams.StartDate && this.info.FinishDate === this.$routeParams.FinishDate) { - this.ProductLedger.get({ - id: id, - StartDate: this.info.StartDate, - FinishDate: this.info.FinishDate - }, function (data) { - _this.info = data; - }); - } - else { - this.$location.path('/ProductLedger/' + this.info.Product.ProductID).search('StartDate', this.info.StartDate).search('FinishDate', this.info.FinishDate); - } - }; - ProductLedgerController.prototype.downloadTable = function () { - var table = $('#gvGrid'), html = table.clone().wrap('
').parent().html(); - html = html.replace(/á/g, 'á'); - window.open('data:application/vnd.ms-excel;charset=UTF-8,' + encodeURIComponent(html)); - }; - ProductLedgerController.prototype.products = function ($viewValue) { - return this.Product.autocomplete({ term: $viewValue, count: 20 }).$promise; - }; - ProductLedgerController.$inject = ['$scope', '$routeParams', '$location', 'asDateFilter', 'ProductLedger', 'Product', 'uibDateParser']; - return ProductLedgerController; -}()); -exports.ProductLedgerController = ProductLedgerController; -//# sourceMappingURL=product-ledger.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/product-ledger/product-ledger.controller.js.map b/brewman/static/src/app/product-ledger/product-ledger.controller.js.map deleted file mode 100644 index 61a912d6..00000000 --- a/brewman/static/src/app/product-ledger/product-ledger.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"product-ledger.controller.js","sourceRoot":"","sources":["product-ledger.controller.ts"],"names":[],"mappings":";;AAAA,0BAA4B;AAE5B;IASI,iCAAmB,MAAM,EAAS,YAAY,EAAS,SAAS,EAAS,MAAM,EAAS,aAAa,EAAS,OAAO,EAAS,UAAU;QAArH,WAAM,GAAN,MAAM,CAAA;QAAS,iBAAY,GAAZ,YAAY,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,kBAAa,GAAb,aAAa,CAAA;QAAS,YAAO,GAAP,OAAO,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QACpI,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;QACtD,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QACrF,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;QACvF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,gDAAc,GAAd,UAAe,KAAK;QAChB,IAAI,SAAS,CAAC,MAAM,EAAE;YAClB,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACzC,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;SAChC;QACD,OAAO,IAAI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AC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;QAC7D,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QACtC,MAAM,CAAC,IAAI,CAAC,8CAA8C,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3F,CAAC;IAED,0CAAQ,GAAR,UAAS,UAAU;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;IAC7E,CAAC;IAxDM,+BAAO,GAAG,CAAC,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;IAyD1H,8BAAC;CAAA,AA1DD,IA0DC;AA1DY,0DAAuB"} \ No newline at end of file diff --git a/brewman/static/src/app/product-ledger/product-ledger.controller.ts b/brewman/static/src/app/product-ledger/product-ledger.controller.ts deleted file mode 100644 index 08938862..00000000 --- a/brewman/static/src/app/product-ledger/product-ledger.controller.ts +++ /dev/null @@ -1,61 +0,0 @@ -import * as $ from 'jquery'; - -export class ProductLedgerController { - static $inject = ['$scope', '$routeParams', '$location', 'asDateFilter', 'ProductLedger', 'Product', 'uibDateParser']; - _info_StartDate: any; - _info_FinishDate: any; - info: any; - foProduct; - boolean; - productLedger: any; - - constructor(public $scope, public $routeParams, public $location, public asDate, public ProductLedger, public Product, public dateParser) { - this.productLedger = $scope.$parent.res.productLedger; - this._info_StartDate = dateParser.parse(this.productLedger.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.productLedger.FinishDate, "dd-MMM-yyyy"); - this.info = this.productLedger; - this.foProduct = true; - } - - info_StartDate(value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - } - - info_FinishDate(value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - } - - show() { - const id = this.info.Product.ProductID; - if (id === this.$routeParams.id && this.info.StartDate === this.$routeParams.StartDate && this.info.FinishDate === this.$routeParams.FinishDate) { - this.ProductLedger.get({ - id: id, - StartDate: this.info.StartDate, - FinishDate: this.info.FinishDate - }, (data) => { - this.info = data; - }); - } else { - this.$location.path('/ProductLedger/' + this.info.Product.ProductID).search('StartDate', this.info.StartDate).search('FinishDate', this.info.FinishDate); - } - } - - downloadTable() { - let table = $('#gvGrid'), - html = table.clone().wrap('
').parent().html(); - html = html.replace(/á/g, 'á'); - window.open('data:application/vnd.ms-excel;charset=UTF-8,' + encodeURIComponent(html)); - } - - products($viewValue) { - return this.Product.autocomplete({term: $viewValue, count: 20}).$promise; - } -} diff --git a/brewman/static/src/app/product-ledger/product-ledger.html b/brewman/static/src/app/product-ledger/product-ledger.html deleted file mode 100644 index d70b4cc5..00000000 --- a/brewman/static/src/app/product-ledger/product-ledger.html +++ /dev/null @@ -1,93 +0,0 @@ -
-

Product Ledger

- -
- - -
-
- - - - -
-
-
-
- - - - -
-
-
-
- - -
-
- - - - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DateParticularsTypeNarrationDebit QDebit ACredit QCredit ARunning QRunning A
{{item.Date}}{{item.Name}}{{item.Type}}{{item.Narration}}{{item.DebitQ | number:2 | clr}}{{item.DebitA | currency | clr}}{{item.CreditQ | number:2 | clr}}{{item.CreditA | currency | clr}}{{item.RunningQ | number:2}}{{item.RunningA | currency}}
{{vm.info.Footer.Date}}{{vm.info.Footer.Name}}{{vm.info.Footer.Type}}{{vm.info.Footer.Narration}}{{vm.info.Footer.DebitQ | number:2}}{{vm.info.Footer.DebitA | currency}}{{vm.info.Footer.CreditQ | number:2}}{{vm.info.Footer.CreditA | currency}}{{vm.info.Footer.RunningQ | number:2}}{{vm.info.Footer.RunningA | currency}}
-
-
- -
-
-
diff --git a/brewman/static/src/app/product-ledger/product-ledger.resolver.js b/brewman/static/src/app/product-ledger/product-ledger.resolver.js deleted file mode 100644 index 7591a141..00000000 --- a/brewman/static/src/app/product-ledger/product-ledger.resolver.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function ProductLedgerResolver($route, ProductLedger) { - var id = $route.current.params.id, startDate = $route.current.params.StartDate, finishDate = $route.current.params.FinishDate; - if (angular.isUndefined(id)) { - return ProductLedger.get({}).$promise; - } - else { - return ProductLedger.get({ id: id, StartDate: startDate, FinishDate: finishDate }).$promise; - } -} -exports.ProductLedgerResolver = ProductLedgerResolver; -//# sourceMappingURL=product-ledger.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/product-ledger/product-ledger.resolver.js.map b/brewman/static/src/app/product-ledger/product-ledger.resolver.js.map deleted file mode 100644 index 1f3111cb..00000000 --- a/brewman/static/src/app/product-ledger/product-ledger.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"product-ledger.resolver.js","sourceRoot":"","sources":["product-ledger.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,+BAAsC,MAAM,EAAE,aAAa;IACvD,IAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAC/B,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAC3C,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;IAElD,IAAI,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;QACzB,OAAO,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;KACzC;SAAM;QACH,OAAO,aAAa,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAC,CAAC,CAAC,QAAQ,CAAC;KAC7F;AACL,CAAC;AAVD,sDAUC"} \ No newline at end of file diff --git a/brewman/static/src/app/product-ledger/product-ledger.resolver.ts b/brewman/static/src/app/product-ledger/product-ledger.resolver.ts deleted file mode 100644 index 3756a235..00000000 --- a/brewman/static/src/app/product-ledger/product-ledger.resolver.ts +++ /dev/null @@ -1,13 +0,0 @@ -import * as angular from 'angular'; - -export function ProductLedgerResolver($route, ProductLedger) { - const id = $route.current.params.id, - startDate = $route.current.params.StartDate, - finishDate = $route.current.params.FinishDate; - - if (angular.isUndefined(id)) { - return ProductLedger.get({}).$promise; - } else { - return ProductLedger.get({id: id, StartDate: startDate, FinishDate: finishDate}).$promise; - } -} diff --git a/brewman/static/src/app/product-ledger/product-ledger.service.js b/brewman/static/src/app/product-ledger/product-ledger.service.js deleted file mode 100644 index 4edb1777..00000000 --- a/brewman/static/src/app/product-ledger/product-ledger.service.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function ProductLedger($resource) { - return $resource('/api/ProductLedger/:id'); -} -exports.ProductLedger = ProductLedger; -//# sourceMappingURL=product-ledger.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/product-ledger/product-ledger.service.js.map b/brewman/static/src/app/product-ledger/product-ledger.service.js.map deleted file mode 100644 index 950795c8..00000000 --- a/brewman/static/src/app/product-ledger/product-ledger.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"product-ledger.service.js","sourceRoot":"","sources":["product-ledger.service.ts"],"names":[],"mappings":";;AAAA,uBAA8B,SAAS;IACnC,OAAO,SAAS,CAAC,wBAAwB,CAAC,CAAC;AAC/C,CAAC;AAFD,sCAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/product-ledger/product-ledger.service.ts b/brewman/static/src/app/product-ledger/product-ledger.service.ts deleted file mode 100644 index 36260593..00000000 --- a/brewman/static/src/app/product-ledger/product-ledger.service.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function ProductLedger($resource) { - return $resource('/api/ProductLedger/:id'); -} diff --git a/brewman/static/src/app/product/product-detail.html b/brewman/static/src/app/product/product-detail.html deleted file mode 100644 index 62af4678..00000000 --- a/brewman/static/src/app/product/product-detail.html +++ /dev/null @@ -1,63 +0,0 @@ -
-

Product Detail

- -
- - - - - - -
-
- - - - - - - - - -
-
- - - - - - - -
- -
- - - Is Purchased? - - - - - Is Sold? - - - - - Is Active? - - -
-
- - - - {{pg.Name}} - - -
-
- Save - Delete -
-
diff --git a/brewman/static/src/app/product/product-list.component.js b/brewman/static/src/app/product/product-list.component.js deleted file mode 100644 index c2b9fe0d..00000000 --- a/brewman/static/src/app/product/product-list.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var product_list_controller_1 = require("./product-list.controller"); -exports.ProductListComponent = { - templateUrl: '/app/product/product-list.html', - controller: product_list_controller_1.ProductListController, - controllerAs: 'vm', -}; -//# sourceMappingURL=product-list.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/product/product-list.component.js.map b/brewman/static/src/app/product/product-list.component.js.map deleted file mode 100644 index 00dbfb7a..00000000 --- a/brewman/static/src/app/product/product-list.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"product-list.component.js","sourceRoot":"","sources":["product-list.component.ts"],"names":[],"mappings":";;AAAA,qEAAgE;AAEnD,QAAA,oBAAoB,GAAG;IAChC,WAAW,EAAE,gCAAgC;IAC7C,UAAU,EAAE,+CAAqB;IACjC,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/product/product-list.component.ts b/brewman/static/src/app/product/product-list.component.ts deleted file mode 100644 index 80a3bcfb..00000000 --- a/brewman/static/src/app/product/product-list.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {ProductListController} from "./product-list.controller"; - -export const ProductListComponent = { - templateUrl: '/app/product/product-list.html', - controller: ProductListController, - controllerAs: 'vm', -}; diff --git a/brewman/static/src/app/product/product-list.controller.js b/brewman/static/src/app/product/product-list.controller.js deleted file mode 100644 index 843f14c9..00000000 --- a/brewman/static/src/app/product/product-list.controller.js +++ /dev/null @@ -1,123 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var _ = require("lodash"); -var $ = require("jquery"); -var ProductListController = /** @class */ (function () { - function ProductListController($scope, $location, $routeParams, Tokenizer) { - var _this = this; - this.$scope = $scope; - this.$location = $location; - this.$routeParams = $routeParams; - this.Tokenizer = Tokenizer; - this.products = $scope.$parent.res.products; - this.search = $routeParams.q || ''; - this.showExtended = false; - this.product_groups = _.reduce(this.products, function (acculumator, item) { - if (!acculumator.includes(item.ProductGroup)) { - acculumator.push(item.ProductGroup); - } - return acculumator; - }, []).sort(); - $scope.$watch('vm.search', function (value) { - _this.filterProducts(value); - }, true); - $scope.$on('$destroy', function () { - Tokenizer.doFilter.cache = {}; - }); - this.searchInfo = { - comparator: { - 'n': { 'Col': 'Name', 'Comparator': 'text' }, - 'u': { 'Col': 'Units', 'Comparator': 'text' }, - 'a': { 'Col': 'IsActive', 'Comparator': 'boolean' }, - 's': { 'Col': 'IsSold', 'Comparator': 'boolean' }, - 'p': { 'Col': 'IsPurchased', 'Comparator': 'boolean' }, - 't': { 'Col': 'ProductGroup', 'Comparator': 'text' }, - 'y': { 'Col': 'ProductYield', 'Comparator': 'numeric' } - }, - def: 'n', - sorter: { - 'c': 'Code', - 'n': 'Name', - 'u': 'Units', - 'p': 'Price', - 't': 'ProductGroup', - 'a': 'IsActive', - 'y': 'ProductYield', - 'f': 'Fraction', - 'fu': 'FractionUnits' - }, - flags: { - 'e': 'boolean' - } - }; - this.filterProducts = _.debounce(function (q) { - if (q !== $scope._search) { - $scope._search = q; - if (angular.isUndefined(q) || q === '') { - _this.$location.path('/Products').search('q', null).replace(); - } - else { - _this.$location.path('/Products').search({ 'q': q }).replace(); - } - $scope.$apply(function () { - var matches = Tokenizer.parseFilterString(q, _this.searchInfo); - _this.showExtended = 'e' in matches.f; - _this.products = Tokenizer.doFilter(q, _this.info, matches); - }); - } - }, 350); - this.selected = -1; - this.shortcuts = { - 'up': function (e) { - if (_this.selected > 0) { - $scope.$apply(function () { - _this.selected = Math.min(Math.max(0, _this.selected - 1), _this.products.length - 1); - }); - $("#" + _this.selected).scrollintoview(); - e.preventDefault(); - } - }, - 'down': function (e) { - if (_this.selected < _this.products.length - 1) { - $scope.$apply(function () { - _this.selected = Math.min(Math.max(0, _this.selected + 1), _this.products.length - 1); - }); - $("#" + _this.selected).scrollintoview(); - e.preventDefault(); - } - } - }; - } - ProductListController.prototype.isPurchased = function (isPurchased) { - if (arguments.length === 0) { - return this.$scope._isPurchased; - } - this.$scope._isPurchased = isPurchased; - var re = /(('[p]'|"[p]"|[p]+)\s*:\s*('[^']+'|"[^"]+"|[^\s]+))/gi, matches = this.search.match(re), st = isPurchased === 'null' ? '' : 'p:' + isPurchased, search = (matches === null) ? this.search.trim() + ' ' + st : this.search.replace(re, st); - this.search = search.trim(); - }; - ProductListController.prototype.isSold = function (isSold) { - if (arguments.length === 0) { - return this.$scope._isSold; - } - this.$scope._isSold = isSold; - var re = /(('[s]'|"[s]"|[s]+)\s*:\s*('[^']+'|"[^"]+"|[^\s]+))/gi, matches = this.search.match(re), st = isSold === 'null' ? '' : 's:' + isSold, search = (matches === null) ? this.search.trim() + ' ' + st : this.search.replace(re, st); - this.search = search.trim(); - }; - ProductListController.prototype.productGroup = function (productGroup) { - if (arguments.length === 0) { - return this.$scope._productGroup; - } - this.$scope._productGroup = productGroup; - var re = /(('[t]'|"[t]"|[t]+)\s*:\s*('[^']+'|"[^"]+"|[^\s]+))/gi, matches = this.search.match(re), st = 't:"' + productGroup + '"', search = (matches === null) ? this.search.trim() + ' ' + st : this.search.replace(re, st); - this.search = search.trim(); - }; - ProductListController.prototype.setSelected = function (index) { - this.selected = Math.min(Math.max(0, index), this.products.length - 1); - }; - ProductListController.$inject = ['$scope', '$location', '$routeParams', 'Tokenizer']; - return ProductListController; -}()); -exports.ProductListController = ProductListController; -//# sourceMappingURL=product-list.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/product/product-list.controller.js.map b/brewman/static/src/app/product/product-list.controller.js.map deleted file mode 100644 index 0769a8c7..00000000 --- a/brewman/static/src/app/product/product-list.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"product-list.controller.js","sourceRoot":"","sources":["product-list.controller.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AACnC,0BAA4B;AAC5B,0BAA4B;AAE5B;IAYI,+BAAmB,MAAM,EAAS,SAAS,EAAS,YAAY,EAAS,SAAS;QAAlF,iBAiFC;QAjFkB,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,iBAAY,GAAZ,YAAY,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAC9E,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;QAC5C,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC,CAAC,IAAI,EAAE,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,WAAW,EAAE,IAAI;YACrE,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE;gBAC1C,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;aACvC;YACD,OAAO,WAAW,CAAC;QACvB,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACd,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,UAAC,KAAK;YAC7B,KAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC,EAAE,IAAI,CAAC,CAAC;QAET,MAAM,CAAC,GAAG,CAAC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I,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC3E,CAAC;IArIM,6BAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;IAsI1E,4BAAC;CAAA,AAvID,IAuIC;AAvIY,sDAAqB"} \ No newline at end of file diff --git a/brewman/static/src/app/product/product-list.controller.ts b/brewman/static/src/app/product/product-list.controller.ts deleted file mode 100644 index 63343930..00000000 --- a/brewman/static/src/app/product/product-list.controller.ts +++ /dev/null @@ -1,140 +0,0 @@ -import * as angular from 'angular'; -import * as _ from 'lodash'; -import * as $ from 'jquery'; - -export class ProductListController { - static $inject = ['$scope', '$location', '$routeParams', 'Tokenizer']; - search: any; - showExtended: boolean; - info: any; - product_groups: any; - searchInfo: any; - filterProducts: any; - selected: any; - shortcuts: any; - products: any; - - constructor(public $scope, public $location, public $routeParams, public Tokenizer) { - this.products = $scope.$parent.res.products; - this.search = $routeParams.q || ''; - this.showExtended = false; - this.product_groups = _.reduce(this.products, function (acculumator, item) { - if (!acculumator.includes(item.ProductGroup)) { - acculumator.push(item.ProductGroup); - } - return acculumator; - }, []).sort(); - $scope.$watch('vm.search', (value) => { - this.filterProducts(value); - }, true); - - $scope.$on('$destroy', function () { - Tokenizer.doFilter.cache = {}; - }); - - this.searchInfo = { - comparator: { - 'n': {'Col': 'Name', 'Comparator': 'text'}, - 'u': {'Col': 'Units', 'Comparator': 'text'}, - 'a': {'Col': 'IsActive', 'Comparator': 'boolean'}, - 's': {'Col': 'IsSold', 'Comparator': 'boolean'}, - 'p': {'Col': 'IsPurchased', 'Comparator': 'boolean'}, - 't': {'Col': 'ProductGroup', 'Comparator': 'text'}, - 'y': {'Col': 'ProductYield', 'Comparator': 'numeric'} - }, - def: 'n', - sorter: { - 'c': 'Code', - 'n': 'Name', - 'u': 'Units', - 'p': 'Price', - 't': 'ProductGroup', - 'a': 'IsActive', - 'y': 'ProductYield', - 'f': 'Fraction', - 'fu': 'FractionUnits' - }, - flags: { - 'e': 'boolean' - } - }; - this.filterProducts = _.debounce((q) => { - if (q !== $scope._search) { - $scope._search = q; - if (angular.isUndefined(q) || q === '') { - this.$location.path('/Products').search('q', null).replace(); - } else { - this.$location.path('/Products').search({'q': q}).replace(); - } - $scope.$apply(() => { - const matches = Tokenizer.parseFilterString(q, this.searchInfo); - this.showExtended = 'e' in matches.f; - this.products = Tokenizer.doFilter(q, this.info, matches); - }); - } - }, 350); - - this.selected = -1; - this.shortcuts = { - 'up': (e) => { - if (this.selected > 0) { - $scope.$apply(() => { - this.selected = Math.min(Math.max(0, this.selected - 1), this.products.length - 1); - }); - $("#" + this.selected).scrollintoview(); - e.preventDefault(); - } - }, - 'down': (e) => { - if (this.selected < this.products.length - 1) { - $scope.$apply(() => { - this.selected = Math.min(Math.max(0, this.selected + 1), this.products.length - 1); - }); - $("#" + this.selected).scrollintoview(); - e.preventDefault(); - } - } - }; - } - - isPurchased(isPurchased) { - if (arguments.length === 0) { - return this.$scope._isPurchased; - } - this.$scope._isPurchased = isPurchased; - const re = /(('[p]'|"[p]"|[p]+)\s*:\s*('[^']+'|"[^"]+"|[^\s]+))/gi, - matches = this.search.match(re), - st = isPurchased === 'null' ? '' : 'p:' + isPurchased, - search = (matches === null) ? this.search.trim() + ' ' + st : this.search.replace(re, st); - this.search = search.trim(); - } - - isSold(isSold) { - if (arguments.length === 0) { - return this.$scope._isSold; - } - this.$scope._isSold = isSold; - const re = /(('[s]'|"[s]"|[s]+)\s*:\s*('[^']+'|"[^"]+"|[^\s]+))/gi, - matches = this.search.match(re), - st = isSold === 'null' ? '' : 's:' + isSold, - search = (matches === null) ? this.search.trim() + ' ' + st : this.search.replace(re, st); - this.search = search.trim(); - } - - productGroup(productGroup) { - if (arguments.length === 0) { - - return this.$scope._productGroup; - } - this.$scope._productGroup = productGroup; - const re = /(('[t]'|"[t]"|[t]+)\s*:\s*('[^']+'|"[^"]+"|[^\s]+))/gi, - matches = this.search.match(re), - st = 't:"' + productGroup + '"', - search = (matches === null) ? this.search.trim() + ' ' + st : this.search.replace(re, st); - this.search = search.trim(); - } - - setSelected(index) { - this.selected = Math.min(Math.max(0, index), this.products.length - 1); - } -} diff --git a/brewman/static/src/app/product/product-list.html b/brewman/static/src/app/product/product-list.html deleted file mode 100644 index be4d906c..00000000 --- a/brewman/static/src/app/product/product-list.html +++ /dev/null @@ -1,80 +0,0 @@ -

Products

-
- - - - - Add - -
-
- - - - All - Yes - No - - - - - - All - Yes - No - - - - - - {{pg}} - - -
- - - - - - - - - - - - - - - - - - - - - -
CodeNamePriceYieldTypeDetails
{{item.Code}}{{item.Name}} ({{vm.showExtended ? item.Fraction + ' ' + item.FractionUnits + ' = 1 ' : - ''}}{{item.Units}}){{item.CostPrice | currency}}{{item.ProductYield * 100 | number:2}}%{{item.ProductGroup}} -
-
- - {{ item.IsPurchased ? "shopping_cart" : "remove_shopping_cart" }} - - {{ item.IsPurchased ? "Purchased" : "Made" }} -
-
- - {{ item.IsSold ? "restaurant_menu" : "import_contacts" }} - - {{ item.IsSold ? "Sold" : "Used" }} -
-
- - {{ item.IsActive ? "visibility" : "visibility_off" }} - - {{ item.IsActive ? "Active" : "Deactivated" }} -
-
-
diff --git a/brewman/static/src/app/product/product-list.resolver.js b/brewman/static/src/app/product/product-list.resolver.js deleted file mode 100644 index 15268620..00000000 --- a/brewman/static/src/app/product/product-list.resolver.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function ProductListResolver(Product) { - return Product.query({}).$promise; -} -exports.ProductListResolver = ProductListResolver; -//# sourceMappingURL=product-list.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/product/product-list.resolver.js.map b/brewman/static/src/app/product/product-list.resolver.js.map deleted file mode 100644 index 118c3285..00000000 --- a/brewman/static/src/app/product/product-list.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"product-list.resolver.js","sourceRoot":"","sources":["product-list.resolver.ts"],"names":[],"mappings":";;AAAA,6BAAoC,OAAO;IACvC,OAAO,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;AACtC,CAAC;AAFD,kDAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/product/product-list.resolver.ts b/brewman/static/src/app/product/product-list.resolver.ts deleted file mode 100644 index 531780a4..00000000 --- a/brewman/static/src/app/product/product-list.resolver.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function ProductListResolver(Product) { - return Product.query({}).$promise; -} diff --git a/brewman/static/src/app/product/product.component.js b/brewman/static/src/app/product/product.component.js deleted file mode 100644 index 1d2580cd..00000000 --- a/brewman/static/src/app/product/product.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var product_controller_1 = require("./product.controller"); -exports.ProductComponent = { - templateUrl: '/app/product/product-detail.html', - controller: product_controller_1.ProductController, - controllerAs: 'vm', -}; -//# sourceMappingURL=product.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/product/product.component.js.map b/brewman/static/src/app/product/product.component.js.map deleted file mode 100644 index 6abbc2b9..00000000 --- a/brewman/static/src/app/product/product.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"product.component.js","sourceRoot":"","sources":["product.component.ts"],"names":[],"mappings":";;AAAA,2DAAuD;AAE1C,QAAA,gBAAgB,GAAG;IAC5B,WAAW,EAAE,kCAAkC;IAC/C,UAAU,EAAE,sCAAiB;IAC7B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/product/product.component.ts b/brewman/static/src/app/product/product.component.ts deleted file mode 100644 index 17eeb836..00000000 --- a/brewman/static/src/app/product/product.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {ProductController} from "./product.controller"; - -export const ProductComponent = { - templateUrl: '/app/product/product-detail.html', - controller: ProductController, - controllerAs: 'vm', -}; diff --git a/brewman/static/src/app/product/product.controller.js b/brewman/static/src/app/product/product.controller.js deleted file mode 100644 index 60048a76..00000000 --- a/brewman/static/src/app/product/product.controller.js +++ /dev/null @@ -1,60 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var ProductController = /** @class */ (function () { - function ProductController($scope, $location, $window, $mdDialog, productGroups, Messages) { - this.$scope = $scope; - this.$location = $location; - this.$window = $window; - this.$mdDialog = $mdDialog; - this.productGroups = productGroups; - this.Messages = Messages; - this.product = $scope.$parent.res.product; - this.foName = true; - } - ProductController.prototype.save = function () { - var _this = this; - this.product.$save(function (u) { - _this.Messages.push({ Type: 'Success', Message: u.Code }); - _this.$window.history.back(); - }, function (data) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - ProductController.prototype.delete = function () { - var _this = this; - this.product.$delete(function () { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$window.history.back(); - }, function (data) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - ProductController.prototype.confirm = function (ev) { - var _this = this; - this.$mdDialog.show({ - templateUrl: '/template/modal/confirm-material.html', - parent: angular.element(document.body), - targetEvent: ev, - clickOutsideToClose: false, - fullscreen: true, - controller: ['$scope', '$mdDialog', function ($scope, $mdDialog) { - this.title = "Delete Product"; - this.body = "Are you sure that you want to delete this product? This cannot be undone."; - this.isDelete = true; - var ok = function () { - $mdDialog.hide(); - }; - var cancel = function () { - $mdDialog.cancel(); - }; - }] - }).then(function () { - _this.delete(); - }); - }; - ProductController.$inject = ['$scope', '$location', '$window', '$mdDialog', 'productGroups', 'Messages']; - return ProductController; -}()); -exports.ProductController = ProductController; -//# sourceMappingURL=product.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/product/product.controller.js.map b/brewman/static/src/app/product/product.controller.js.map deleted file mode 100644 index 89ff3421..00000000 --- a/brewman/static/src/app/product/product.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"product.controller.js","sourceRoot":"","sources":["product.controller.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC;IAKI,2BAAmB,MAAM,EAAS,SAAS,EAAS,OAAO,EAAS,SAAS,EAAS,aAAa,EAAS,QAAQ;QAAjG,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,YAAO,GAAP,OAAO,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,kBAAa,GAAb,aAAa,CAAA;QAAS,aAAQ,GAAR,QAAQ,CAAA;QAChH,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;QAC1C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;IAED,gCAAI,GAAJ;QAAA,iBAOC;QANG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,UAAC,CAAC;YACjB,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC,IAAI,EAAC,CAAC,CAAC;YACvD,KAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QAChC,CAAC,EAAE,UAAC,IAAI;YACJ,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,EAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACP,CAAC;IAED,kCAAM,GAAN;QAAA,iBAOC;QANG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;YACjB,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAC,CAAC,CAAC;YACnD,KAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QAChC,CAAC,EAAE,UAAC,IAAI;YACJ,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,EAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACP,CAAC;IAED,mCAAO,GAAP,UAAQ,EAAE;QAAV,iBAqBC;QApBG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YAChB,WAAW,EAAE,uCAAuC;YACpD,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;YACtC,WAAW,EAAE,EAAE;YACf,mBAAmB,EAAE,KAAK;YAC1B,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,UAAU,MAAM,EAAE,SAAS;oBAC3D,IAAI,CAAC,KAAK,GAAG,gBAAgB,CAAC;oBAC9B,IAAI,CAAC,IAAI,GAAG,2EAA2E,CAAC;oBACxF,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;oBACrB,IAAI,EAAE,GAAG;wBACL,SAAS,CAAC,IAAI,EAAE,CAAC;oBACrB,CAAC,CAAC;oBACF,IAAI,MAAM,GAAG;wBACT,SAAS,CAAC,MAAM,EAAE,CAAC;oBACvB,CAAC,CAAA;gBACL,CAAC,CAAC;SACL,CAAC,CAAC,IAAI,CAAC;YACJ,KAAI,CAAC,MAAM,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACP,CAAC;IAhDM,yBAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;IAiDlG,wBAAC;CAAA,AAlDD,IAkDC;AAlDY,8CAAiB"} \ No newline at end of file diff --git a/brewman/static/src/app/product/product.controller.ts b/brewman/static/src/app/product/product.controller.ts deleted file mode 100644 index 5139ba47..00000000 --- a/brewman/static/src/app/product/product.controller.ts +++ /dev/null @@ -1,53 +0,0 @@ -import * as angular from 'angular'; - -export class ProductController { - static $inject = ['$scope', '$location', '$window', '$mdDialog', 'productGroups', 'Messages']; - foName: boolean; - product: any; - - constructor(public $scope, public $location, public $window, public $mdDialog, public productGroups, public Messages) { - this.product = $scope.$parent.res.product; - this.foName = true; - } - - save() { - this.product.$save((u) => { - this.Messages.push({Type: 'Success', Message: u.Code}); - this.$window.history.back(); - }, (data) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - delete() { - this.product.$delete(() => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$window.history.back(); - }, (data) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - confirm(ev) { - this.$mdDialog.show({ - templateUrl: '/template/modal/confirm-material.html', - parent: angular.element(document.body), - targetEvent: ev, - clickOutsideToClose: false, - fullscreen: true, - controller: ['$scope', '$mdDialog', function ($scope, $mdDialog) { - this.title = "Delete Product"; - this.body = "Are you sure that you want to delete this product? This cannot be undone."; - this.isDelete = true; - let ok = () => { - $mdDialog.hide(); - }; - let cancel = () => { - $mdDialog.cancel(); - } - }] - }).then(() => { - this.delete(); - }); - } -} diff --git a/brewman/static/src/app/product/product.resolver.js b/brewman/static/src/app/product/product.resolver.js deleted file mode 100644 index 6c8959c4..00000000 --- a/brewman/static/src/app/product/product.resolver.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function ProductResolver($route, Product) { - var id = $route.current.params.id; - return Product.get({ id: id }).$promise; -} -exports.ProductResolver = ProductResolver; -//# sourceMappingURL=product.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/product/product.resolver.js.map b/brewman/static/src/app/product/product.resolver.js.map deleted file mode 100644 index 227f5254..00000000 --- a/brewman/static/src/app/product/product.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"product.resolver.js","sourceRoot":"","sources":["product.resolver.ts"],"names":[],"mappings":";;AAAA,yBAAgC,MAAM,EAAE,OAAO;IAC3C,IAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IACpC,OAAO,OAAO,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;AAC1C,CAAC;AAHD,0CAGC"} \ No newline at end of file diff --git a/brewman/static/src/app/product/product.resolver.ts b/brewman/static/src/app/product/product.resolver.ts deleted file mode 100644 index 02ab68cd..00000000 --- a/brewman/static/src/app/product/product.resolver.ts +++ /dev/null @@ -1,4 +0,0 @@ -export function ProductResolver($route, Product) { - const id = $route.current.params.id; - return Product.get({id: id}).$promise; -} diff --git a/brewman/static/src/app/product/product.service.js b/brewman/static/src/app/product/product.service.js deleted file mode 100644 index 86febed0..00000000 --- a/brewman/static/src/app/product/product.service.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function Product($resource) { - return $resource('/api/Product/:id', { id: '@ProductID' }, { - query: { method: 'GET', params: { list: true }, isArray: true }, - autocomplete: { method: 'GET', params: { term: '' }, isArray: true } - }); -} -exports.Product = Product; -//# sourceMappingURL=product.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/product/product.service.js.map b/brewman/static/src/app/product/product.service.js.map deleted file mode 100644 index 4dbd3bb3..00000000 --- a/brewman/static/src/app/product/product.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"product.service.js","sourceRoot":"","sources":["product.service.ts"],"names":[],"mappings":";;AAAA,iBAAwB,SAAS;IAC7B,OAAO,SAAS,CAAC,kBAAkB,EAC/B,EAAC,EAAE,EAAE,YAAY,EAAC,EAAE;QAChB,KAAK,EAAE,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,EAAE,OAAO,EAAE,IAAI,EAAC;QAC3D,YAAY,EAAE,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAC,IAAI,EAAE,EAAE,EAAC,EAAE,OAAO,EAAE,IAAI,EAAC;KACnE,CAAC,CAAC;AACX,CAAC;AAND,0BAMC"} \ No newline at end of file diff --git a/brewman/static/src/app/product/product.service.ts b/brewman/static/src/app/product/product.service.ts deleted file mode 100644 index 1621758f..00000000 --- a/brewman/static/src/app/product/product.service.ts +++ /dev/null @@ -1,7 +0,0 @@ -export function Product($resource) { - return $resource('/api/Product/:id', - {id: '@ProductID'}, { - query: {method: 'GET', params: {list: true}, isArray: true}, - autocomplete: {method: 'GET', params: {term: ''}, isArray: true} - }); -} diff --git a/brewman/static/src/app/profit-loss/profit-loss.component.js b/brewman/static/src/app/profit-loss/profit-loss.component.js deleted file mode 100644 index 0e9a19cc..00000000 --- a/brewman/static/src/app/profit-loss/profit-loss.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var profit_loss_controller_1 = require("./profit-loss.controller"); -exports.ProfitLossComponent = { - templateUrl: '/app/profit-loss/profit-loss.html', - controller: profit_loss_controller_1.ProfitLossController, - controllerAs: 'vm', -}; -//# sourceMappingURL=profit-loss.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/profit-loss/profit-loss.component.js.map b/brewman/static/src/app/profit-loss/profit-loss.component.js.map deleted file mode 100644 index 7f95c9c8..00000000 --- a/brewman/static/src/app/profit-loss/profit-loss.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"profit-loss.component.js","sourceRoot":"","sources":["profit-loss.component.ts"],"names":[],"mappings":";;AAAA,mEAA8D;AAEjD,QAAA,mBAAmB,GAAG;IAC/B,WAAW,EAAE,mCAAmC;IAChD,UAAU,EAAE,6CAAoB;IAChC,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/profit-loss/profit-loss.component.ts b/brewman/static/src/app/profit-loss/profit-loss.component.ts deleted file mode 100644 index 658083e7..00000000 --- a/brewman/static/src/app/profit-loss/profit-loss.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {ProfitLossController} from "./profit-loss.controller"; - -export const ProfitLossComponent = { - templateUrl: '/app/profit-loss/profit-loss.html', - controller: ProfitLossController, - controllerAs: 'vm', -}; diff --git a/brewman/static/src/app/profit-loss/profit-loss.controller.js b/brewman/static/src/app/profit-loss/profit-loss.controller.js deleted file mode 100644 index a12cd030..00000000 --- a/brewman/static/src/app/profit-loss/profit-loss.controller.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var ProfitLossController = /** @class */ (function () { - function ProfitLossController($scope, $location, asDate, dateParser) { - this.$scope = $scope; - this.$location = $location; - this.asDate = asDate; - this.dateParser = dateParser; - this.profit_loss = $scope.$parent.res.profit_loss; - this._info_StartDate = dateParser.parse(this.profit_loss.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.profit_loss.FinishDate, "dd-MMM-yyyy"); - this.info = this.profit_loss; - this.foDate = true; - } - ProfitLossController.prototype.info_StartDate = function (value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - }; - ProfitLossController.prototype.info_FinishDate = function (value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - }; - ProfitLossController.prototype.show = function () { - this.$location.path('/ProfitLoss').search({ StartDate: this.info.StartDate, FinishDate: this.info.FinishDate }); - }; - ProfitLossController.$inject = ['$scope', '$location', 'asDateFilter', 'uibDateParser']; - return ProfitLossController; -}()); -exports.ProfitLossController = ProfitLossController; -//# sourceMappingURL=profit-loss.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/profit-loss/profit-loss.controller.js.map b/brewman/static/src/app/profit-loss/profit-loss.controller.js.map deleted file mode 100644 index 7114bae3..00000000 --- a/brewman/static/src/app/profit-loss/profit-loss.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"profit-loss.controller.js","s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AS,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAC,CAAC,CAAC;IAClH,CAAC;IAjCM,4BAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC;IAkC9E,2BAAC;CAAA,AAnCD,IAmCC;AAnCY,oDAAoB"} \ No newline at end of file diff --git a/brewman/static/src/app/profit-loss/profit-loss.controller.ts b/brewman/static/src/app/profit-loss/profit-loss.controller.ts deleted file mode 100644 index facfbdc3..00000000 --- a/brewman/static/src/app/profit-loss/profit-loss.controller.ts +++ /dev/null @@ -1,36 +0,0 @@ -export class ProfitLossController { - static $inject = ['$scope', '$location', 'asDateFilter', 'uibDateParser']; - info: any; - _info_StartDate: any; - _info_FinishDate: any; - foDate: boolean; - profit_loss: any; - - constructor(public $scope, public $location, public asDate, public dateParser) { - this.profit_loss = $scope.$parent.res.profit_loss; - this._info_StartDate = dateParser.parse(this.profit_loss.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.profit_loss.FinishDate, "dd-MMM-yyyy"); - this.info = this.profit_loss; - this.foDate = true; - } - - info_StartDate(value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - } - - info_FinishDate(value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - } - - show() { - this.$location.path('/ProfitLoss').search({StartDate: this.info.StartDate, FinishDate: this.info.FinishDate}); - } -} diff --git a/brewman/static/src/app/profit-loss/profit-loss.html b/brewman/static/src/app/profit-loss/profit-loss.html deleted file mode 100644 index 04cefc07..00000000 --- a/brewman/static/src/app/profit-loss/profit-loss.html +++ /dev/null @@ -1,58 +0,0 @@ -
-

Profit & Loss

- -
- - -
-
- - - - -
-
-
-
- - - - -
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
GroupNameAmountTotal
{{item.Group}}{{item.Name}}{{item.SubAmount | currency | clr}}{{item.Amount | currency | clr}}
{{item.Group}}{{item.Name}}{{item.SubAmount | currency | clr}}{{item.Amount | currency | clr}}
-
diff --git a/brewman/static/src/app/profit-loss/profit-loss.resolver.js b/brewman/static/src/app/profit-loss/profit-loss.resolver.js deleted file mode 100644 index 1c0c3186..00000000 --- a/brewman/static/src/app/profit-loss/profit-loss.resolver.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function ProfitLossResolver($route, ProfitLoss) { - var startDate = $route.current.params.StartDate, finishDate = $route.current.params.FinishDate; - if (angular.isUndefined(startDate) || angular.isUndefined(finishDate)) { - return ProfitLoss.get({}).$promise; - } - else { - return ProfitLoss.get({ StartDate: startDate, FinishDate: finishDate }).$promise; - } -} -exports.ProfitLossResolver = ProfitLossResolver; -//# sourceMappingURL=profit-loss.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/profit-loss/profit-loss.resolver.js.map b/brewman/static/src/app/profit-loss/profit-loss.resolver.js.map deleted file mode 100644 index a5e50de4..00000000 --- a/brewman/static/src/app/profit-loss/profit-loss.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"profit-loss.resolver.js","sourceRoot":"","sources":["profit-loss.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,4BAAmC,MAAM,EAAE,UAAU;IACjD,IAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAC7C,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;IAElD,IAAI,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE;QACnE,OAAO,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;KACtC;SAAM;QACH,OAAO,UAAU,CAAC,GAAG,CAAC,EAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAC,CAAC,CAAC,QAAQ,CAAC;KAClF;AACL,CAAC;AATD,gDASC"} \ No newline at end of file diff --git a/brewman/static/src/app/profit-loss/profit-loss.resolver.ts b/brewman/static/src/app/profit-loss/profit-loss.resolver.ts deleted file mode 100644 index a5611ab7..00000000 --- a/brewman/static/src/app/profit-loss/profit-loss.resolver.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as angular from 'angular'; - -export function ProfitLossResolver($route, ProfitLoss) { - const startDate = $route.current.params.StartDate, - finishDate = $route.current.params.FinishDate; - - if (angular.isUndefined(startDate) || angular.isUndefined(finishDate)) { - return ProfitLoss.get({}).$promise; - } else { - return ProfitLoss.get({StartDate: startDate, FinishDate: finishDate}).$promise; - } -} diff --git a/brewman/static/src/app/profit-loss/profit-loss.service.js b/brewman/static/src/app/profit-loss/profit-loss.service.js deleted file mode 100644 index c2f081da..00000000 --- a/brewman/static/src/app/profit-loss/profit-loss.service.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function ProfitLoss($resource) { - return $resource('/api/ProfitLoss'); -} -exports.ProfitLoss = ProfitLoss; -//# sourceMappingURL=profit-loss.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/profit-loss/profit-loss.service.js.map b/brewman/static/src/app/profit-loss/profit-loss.service.js.map deleted file mode 100644 index 13c492ba..00000000 --- a/brewman/static/src/app/profit-loss/profit-loss.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"profit-loss.service.js","sourceRoot":"","sources":["profit-loss.service.ts"],"names":[],"mappings":";;AAAA,oBAA2B,SAAS;IAChC,OAAO,SAAS,CAAC,iBAAiB,CAAC,CAAC;AACxC,CAAC;AAFD,gCAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/profit-loss/profit-loss.service.ts b/brewman/static/src/app/profit-loss/profit-loss.service.ts deleted file mode 100644 index 0801c9bb..00000000 --- a/brewman/static/src/app/profit-loss/profit-loss.service.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function ProfitLoss($resource) { - return $resource('/api/ProfitLoss'); -} diff --git a/brewman/static/src/app/purchase-entries/purchase-entries.component.js b/brewman/static/src/app/purchase-entries/purchase-entries.component.js deleted file mode 100644 index 1a661590..00000000 --- a/brewman/static/src/app/purchase-entries/purchase-entries.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var purchase_entries_controller_1 = require("./purchase-entries.controller"); -exports.PurchaseEntriesComponent = { - templateUrl: '/app/purchase-entries/purchase-entries.html', - controller: purchase_entries_controller_1.PurchaseEntriesController, - controllerAs: 'vm', -}; -//# sourceMappingURL=purchase-entries.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/purchase-entries/purchase-entries.component.js.map b/brewman/static/src/app/purchase-entries/purchase-entries.component.js.map deleted file mode 100644 index 3c80aa21..00000000 --- a/brewman/static/src/app/purchase-entries/purchase-entries.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"purchase-entries.component.js","sourceRoot":"","sources":["purchase-entries.component.ts"],"names":[],"mappings":";;AAAA,6EAAwE;AAE3D,QAAA,wBAAwB,GAAG;IACpC,WAAW,EAAE,6CAA6C;IAC1D,UAAU,EAAE,uDAAyB;IACrC,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/purchase-entries/purchase-entries.component.ts b/brewman/static/src/app/purchase-entries/purchase-entries.component.ts deleted file mode 100644 index e7064875..00000000 --- a/brewman/static/src/app/purchase-entries/purchase-entries.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {PurchaseEntriesController} from "./purchase-entries.controller"; - -export const PurchaseEntriesComponent = { - templateUrl: '/app/purchase-entries/purchase-entries.html', - controller: PurchaseEntriesController, - controllerAs: 'vm', -}; diff --git a/brewman/static/src/app/purchase-entries/purchase-entries.controller.js b/brewman/static/src/app/purchase-entries/purchase-entries.controller.js deleted file mode 100644 index f74c2dd0..00000000 --- a/brewman/static/src/app/purchase-entries/purchase-entries.controller.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var PurchaseEntriesController = /** @class */ (function () { - function PurchaseEntriesController($scope, $location, asDate, dateParser) { - this.$scope = $scope; - this.$location = $location; - this.asDate = asDate; - this.dateParser = dateParser; - this.purchaseEntries = $scope.$parent.res.purchaseEntries; - this._info_StartDate = dateParser.parse(this.purchaseEntries.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.purchaseEntries.FinishDate, "dd-MMM-yyyy"); - this.info = this.purchaseEntries; - this.foDate = true; - } - PurchaseEntriesController.prototype.info_StartDate = function (value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - }; - PurchaseEntriesController.prototype.info_FinishDate = function (value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - }; - PurchaseEntriesController.prototype.show = function () { - this.$location.path('/PurchaseEntries').search({ - StartDate: this.info.StartDate, - FinishDate: this.info.FinishDate - }); - }; - PurchaseEntriesController.$inject = ['$scope', '$location', 'asDateFilter', 'uibDateParser']; - return PurchaseEntriesController; -}()); -exports.PurchaseEntriesController = PurchaseEntriesController; -//# sourceMappingURL=purchase-entries.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/purchase-entries/purchase-entries.controller.js.map b/brewman/static/src/app/purchase-entries/purchase-entries.controller.js.map deleted file mode 100644 index 0afe5848..00000000 --- a/brewman/static/src/app/purchase-entries/purchase-entries.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"purchase-entries.controller.js","sourceRoot":"","sources":["purchase-entries.controller.ts"],"names":[],"mappings":";;AAAA;IAQI,mCAAmB,MAAM,EAAS,SAAS,EAAS,MAAM,EAAS,UAAU;QAA1D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P,CAAC;IApCM,iCAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC;IAqC9E,gCAAC;CAAA,AAtCD,IAsCC;AAtCY,8DAAyB"} \ No newline at end of file diff --git a/brewman/static/src/app/purchase-entries/purchase-entries.controller.ts b/brewman/static/src/app/purchase-entries/purchase-entries.controller.ts deleted file mode 100644 index d56a8302..00000000 --- a/brewman/static/src/app/purchase-entries/purchase-entries.controller.ts +++ /dev/null @@ -1,39 +0,0 @@ -export class PurchaseEntriesController { - static $inject = ['$scope', '$location', 'asDateFilter', 'uibDateParser']; - info: any; - _info_StartDate: any; - _info_FinishDate: any; - foDate: boolean; - purchaseEntries: any; - - constructor(public $scope, public $location, public asDate, public dateParser) { - this.purchaseEntries = $scope.$parent.res.purchaseEntries; - this._info_StartDate = dateParser.parse(this.purchaseEntries.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.purchaseEntries.FinishDate, "dd-MMM-yyyy"); - this.info = this.purchaseEntries; - this.foDate = true; - } - - info_StartDate(value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - } - - info_FinishDate(value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - } - - show() { - this.$location.path('/PurchaseEntries').search({ - StartDate: this.info.StartDate, - FinishDate: this.info.FinishDate - }); - } -} diff --git a/brewman/static/src/app/purchase-entries/purchase-entries.html b/brewman/static/src/app/purchase-entries/purchase-entries.html deleted file mode 100644 index 685a7e9c..00000000 --- a/brewman/static/src/app/purchase-entries/purchase-entries.html +++ /dev/null @@ -1,55 +0,0 @@ -
-

Purchase Entries

- -
- - -
-
- - - - -
-
-
-
- - - - -
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - -
DateSupplierProductQuantityRateTaxAmount
{{items.Date}}{{items.Supplier}}{{item.Product}}{{item.Quantity | number:2}}{{item.Rate | currency}}{{item.Tax | percent}}{{item.Amount | currency}}
-
diff --git a/brewman/static/src/app/purchase-entries/purchase-entries.resolver.js b/brewman/static/src/app/purchase-entries/purchase-entries.resolver.js deleted file mode 100644 index 6d30c3c5..00000000 --- a/brewman/static/src/app/purchase-entries/purchase-entries.resolver.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function PurchaseEntriesResolver($route, PurchaseEntries) { - var startDate = $route.current.params.StartDate, finishDate = $route.current.params.FinishDate; - if (angular.isUndefined(startDate) || angular.isUndefined(finishDate)) { - return PurchaseEntries.get({}).$promise; - } - else { - return PurchaseEntries.get({ StartDate: startDate, FinishDate: finishDate }).$promise; - } -} -exports.PurchaseEntriesResolver = PurchaseEntriesResolver; -//# sourceMappingURL=purchase-entries.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/purchase-entries/purchase-entries.resolver.js.map b/brewman/static/src/app/purchase-entries/purchase-entries.resolver.js.map deleted file mode 100644 index 3a471baf..00000000 --- a/brewman/static/src/app/purchase-entries/purchase-entries.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"purchase-entries.resolver.js","sourceRoot":"","sources":["purchase-entries.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,iCAAwC,MAAM,EAAE,eAAe;IAC3D,IAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAC7C,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;IAElD,IAAI,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE;QACnE,OAAO,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;KAC3C;SAAM;QACH,OAAO,eAAe,CAAC,GAAG,CAAC,EAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAC,CAAC,CAAC,QAAQ,CAAC;KACvF;AACL,CAAC;AATD,0DASC"} \ No newline at end of file diff --git a/brewman/static/src/app/purchase-entries/purchase-entries.resolver.ts b/brewman/static/src/app/purchase-entries/purchase-entries.resolver.ts deleted file mode 100644 index baaf484d..00000000 --- a/brewman/static/src/app/purchase-entries/purchase-entries.resolver.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as angular from 'angular'; - -export function PurchaseEntriesResolver($route, PurchaseEntries) { - const startDate = $route.current.params.StartDate, - finishDate = $route.current.params.FinishDate; - - if (angular.isUndefined(startDate) || angular.isUndefined(finishDate)) { - return PurchaseEntries.get({}).$promise; - } else { - return PurchaseEntries.get({StartDate: startDate, FinishDate: finishDate}).$promise; - } -} diff --git a/brewman/static/src/app/purchase-entries/purchase-entries.service.js b/brewman/static/src/app/purchase-entries/purchase-entries.service.js deleted file mode 100644 index 07c2e685..00000000 --- a/brewman/static/src/app/purchase-entries/purchase-entries.service.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function PurchaseEntries($resource) { - return $resource('/api/PurchaseEntries'); -} -exports.PurchaseEntries = PurchaseEntries; -//# sourceMappingURL=purchase-entries.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/purchase-entries/purchase-entries.service.js.map b/brewman/static/src/app/purchase-entries/purchase-entries.service.js.map deleted file mode 100644 index 3cc1e889..00000000 --- a/brewman/static/src/app/purchase-entries/purchase-entries.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"purchase-entries.service.js","sourceRoot":"","sources":["purchase-entries.service.ts"],"names":[],"mappings":";;AAAA,yBAAgC,SAAS;IACrC,OAAO,SAAS,CAAC,sBAAsB,CAAC,CAAC;AAC7C,CAAC;AAFD,0CAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/purchase-entries/purchase-entries.service.ts b/brewman/static/src/app/purchase-entries/purchase-entries.service.ts deleted file mode 100644 index a337e4cc..00000000 --- a/brewman/static/src/app/purchase-entries/purchase-entries.service.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function PurchaseEntries($resource) { - return $resource('/api/PurchaseEntries'); -} diff --git a/brewman/static/src/app/purchase-return/purchase-return-modal.controller.js b/brewman/static/src/app/purchase-return/purchase-return-modal.controller.js deleted file mode 100644 index faef20de..00000000 --- a/brewman/static/src/app/purchase-return/purchase-return-modal.controller.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var PurchaseReturnModalController = /** @class */ (function () { - function PurchaseReturnModalController($scope, $modalInstance, Batch) { - this.$scope = $scope; - this.$modalInstance = $modalInstance; - this.Batch = Batch; - this.edit = $scope.$resolve.edit; - } - PurchaseReturnModalController.prototype.ok = function () { - this.edit.Product = this.edit.Batch.Product; - this.edit.Quantity = Number(this.edit.Quantity); - this.edit.Tax = this.edit.Batch.Tax; - this.edit.Discount = this.edit.Batch.Discount; - this.edit.Rate = this.edit.Batch.Rate; - this.edit.Amount = this.edit.Quantity * this.edit.Rate * (1 + this.edit.Tax) * (1 - this.edit.Discount); - this.$modalInstance.close(this.edit); - }; - PurchaseReturnModalController.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - PurchaseReturnModalController.prototype.batches = function ($viewValue) { - return this.Batch.autocomplete({ term: $viewValue, count: 20 }).$promise; - }; - PurchaseReturnModalController.$inject = ['$scope', '$uibModalInstance', 'Batch']; - return PurchaseReturnModalController; -}()); -exports.PurchaseReturnModalController = PurchaseReturnModalController; -//# sourceMappingURL=purchase-return-modal.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/purchase-return/purchase-return-modal.controller.js.map b/brewman/static/src/app/purchase-return/purchase-return-modal.controller.js.map deleted file mode 100644 index baf3428b..00000000 --- a/brewman/static/src/app/purchase-return/purchase-return-modal.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"purchase-return-modal.controller.js","sourceRoot":"","sources":["purchase-return-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,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;IAC3E,CAAC;IAvBM,qCAAO,GAAG,CAAC,QAAQ,EAAE,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAwB9D,oCAAC;CAAA,AAzBD,IAyBC;AAzBY,sEAA6B"} \ No newline at end of file diff --git a/brewman/static/src/app/purchase-return/purchase-return-modal.controller.ts b/brewman/static/src/app/purchase-return/purchase-return-modal.controller.ts deleted file mode 100644 index b5c60981..00000000 --- a/brewman/static/src/app/purchase-return/purchase-return-modal.controller.ts +++ /dev/null @@ -1,26 +0,0 @@ -export class PurchaseReturnModalController { - static $inject = ['$scope', '$uibModalInstance', 'Batch']; - edit:any; - - constructor(public $scope, public $modalInstance, public Batch) { - this.edit = $scope.$resolve.edit; - } - - ok() { - this.edit.Product = this.edit.Batch.Product; - this.edit.Quantity = Number(this.edit.Quantity); - this.edit.Tax = this.edit.Batch.Tax; - this.edit.Discount = this.edit.Batch.Discount; - this.edit.Rate = this.edit.Batch.Rate; - this.edit.Amount = this.edit.Quantity * this.edit.Rate * (1 + this.edit.Tax) * (1 - this.edit.Discount); - this.$modalInstance.close(this.edit); - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - - batches($viewValue) { - return this.Batch.autocomplete({term: $viewValue, count: 20}).$promise; - } -} diff --git a/brewman/static/src/app/purchase-return/purchase-return-modal.html b/brewman/static/src/app/purchase-return/purchase-return-modal.html deleted file mode 100644 index 9238d90f..00000000 --- a/brewman/static/src/app/purchase-return/purchase-return-modal.html +++ /dev/null @@ -1,24 +0,0 @@ - diff --git a/brewman/static/src/app/purchase-return/purchase-return-voucher.resolver.js b/brewman/static/src/app/purchase-return/purchase-return-voucher.resolver.js deleted file mode 100644 index 4d49d9fa..00000000 --- a/brewman/static/src/app/purchase-return/purchase-return-voucher.resolver.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function PurchaseReturnVoucherResolver($route, Voucher) { - var id = $route.current.params.id; - if (angular.isUndefined(id)) { - return Voucher.get({ type: 'Purchase Return' }).$promise; - } - else { - return Voucher.get({ id: id }).$promise; - } -} -exports.PurchaseReturnVoucherResolver = PurchaseReturnVoucherResolver; -//# sourceMappingURL=purchase-return-voucher.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/purchase-return/purchase-return-voucher.resolver.js.map b/brewman/static/src/app/purchase-return/purchase-return-voucher.resolver.js.map deleted file mode 100644 index 5ad85563..00000000 --- a/brewman/static/src/app/purchase-return/purchase-return-voucher.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"purchase-return-voucher.resolver.js","sourceRoot":"","sources":["purchase-return-voucher.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,uCAA8C,MAAM,EAAE,OAAO;IACzD,IAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IACpC,IAAI,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;QACzB,OAAO,OAAO,CAAC,GAAG,CAAC,EAAC,IAAI,EAAE,iBAAiB,EAAC,CAAC,CAAC,QAAQ,CAAC;KAC1D;SAAM;QACH,OAAO,OAAO,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;KACzC;AACL,CAAC;AAPD,sEAOC"} \ No newline at end of file diff --git a/brewman/static/src/app/purchase-return/purchase-return-voucher.resolver.ts b/brewman/static/src/app/purchase-return/purchase-return-voucher.resolver.ts deleted file mode 100644 index 1cdf5376..00000000 --- a/brewman/static/src/app/purchase-return/purchase-return-voucher.resolver.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as angular from 'angular'; - -export function PurchaseReturnVoucherResolver($route, Voucher) { - const id = $route.current.params.id; - if (angular.isUndefined(id)) { - return Voucher.get({type: 'Purchase Return'}).$promise; - } else { - return Voucher.get({id: id}).$promise; - } -} diff --git a/brewman/static/src/app/purchase-return/purchase-return.component.js b/brewman/static/src/app/purchase-return/purchase-return.component.js deleted file mode 100644 index 346bcccd..00000000 --- a/brewman/static/src/app/purchase-return/purchase-return.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var purchase_return_controller_1 = require("./purchase-return.controller"); -exports.PurchaseReturnComponent = { - templateUrl: '/app/purchase-return/purchase-return.html', - controller: purchase_return_controller_1.PurchaseReturnController, - controllerAs: 'vm', -}; -//# sourceMappingURL=purchase-return.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/purchase-return/purchase-return.component.js.map b/brewman/static/src/app/purchase-return/purchase-return.component.js.map deleted file mode 100644 index 69983e65..00000000 --- a/brewman/static/src/app/purchase-return/purchase-return.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"purchase-return.component.js","sourceRoot":"","sources":["purchase-return.component.ts"],"names":[],"mappings":";;AAAA,2EAAsE;AAEzD,QAAA,uBAAuB,GAAG;IACnC,WAAW,EAAE,2CAA2C;IACxD,UAAU,EAAE,qDAAwB;IACpC,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/purchase-return/purchase-return.component.ts b/brewman/static/src/app/purchase-return/purchase-return.component.ts deleted file mode 100644 index 5ea91b0f..00000000 --- a/brewman/static/src/app/purchase-return/purchase-return.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {PurchaseReturnController} from "./purchase-return.controller"; - -export const PurchaseReturnComponent = { - templateUrl: '/app/purchase-return/purchase-return.html', - controller: PurchaseReturnController, - controllerAs: 'vm', -}; \ No newline at end of file diff --git a/brewman/static/src/app/purchase-return/purchase-return.controller.js b/brewman/static/src/app/purchase-return/purchase-return.controller.js deleted file mode 100644 index 120c71f5..00000000 --- a/brewman/static/src/app/purchase-return/purchase-return.controller.js +++ /dev/null @@ -1,209 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var _ = require("lodash"); -var purchase_return_modal_controller_1 = require("./purchase-return-modal.controller"); -var PurchaseReturnController = /** @class */ (function () { - function PurchaseReturnController($scope, $location, asDate, $modal, UploadedImageResizer, Account, Batch, dateParser, Messages, Credentials) { - var _this = this; - this.$scope = $scope; - this.$location = $location; - this.asDate = asDate; - this.$modal = $modal; - this.UploadedImageResizer = UploadedImageResizer; - this.Account = Account; - this.Batch = Batch; - this.dateParser = dateParser; - this.Messages = Messages; - this.Credentials = Credentials; - this.voucher = $scope.$parent.res.voucher; - this._voucher_Date = dateParser.parse(this.voucher.Date, "dd-MMM-yyyy"); - this.rate = 0; - $scope.$on("fileSelected", function (event, args) { - UploadedImageResizer(args, _this.voucher.Files); - }); - $scope.$watch('vm.voucher.Inventories', function (inventories) { - var amount = 0, i, l; - if (!angular.isUndefined(inventories)) { - for (i = 0, l = inventories.length; i < l; i++) { - amount += Number(inventories[i].Amount); - } - } - if (!angular.isUndefined(_this.voucher.Journals)) { - for (i = 0, l = _this.voucher.Journals.length; i < l; i++) { - if (_this.voucher.Journals[i].Debit === 1) { - _this.voucher.Journals[i].Amount = amount; - break; - } - } - } - }, true); - } - PurchaseReturnController.prototype.voucher_Date = function (value) { - if (arguments.length) { - this.voucher.Date = this.asDate(value); - this._voucher_Date = value; - } - return this._voucher_Date; - }; - PurchaseReturnController.prototype.getOld = function (productID, inventories) { - return _.find(inventories, function (inventory) { - return inventory.Product.ProductID === productID; - }); - }; - PurchaseReturnController.prototype.deleteFile = function (item) { - var index = this.voucher.Files.indexOf(item); - this.voucher.Files.splice(index, 1); - }; - PurchaseReturnController.prototype.zoomImage = function (item) { - this.$modal.open({ - templateUrl: '/template/modal/image.html', - controller: ['$uibModalInstance', /** @class */ (function () { - function class_1($modalInstance) { - this.$modalInstance = $modalInstance; - this.imageUrl = item.Resized; - this.size = null; - } - class_1.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - return class_1; - }())] - }); - }; - PurchaseReturnController.prototype.add = function () { - var oldInventory = this.getOld(this.batch.Product.ProductID, this.voucher.Inventories), quantity = Number(this.quantity); - if (!this.batch || !this.batch.Product.ProductID || !quantity) { - return; - } - if (angular.isUndefined(oldInventory) && quantity <= this.batch.QuantityRemaining) { - this.voucher.Inventories.push({ - Product: this.batch.Product, - Quantity: quantity, - Rate: this.batch.Rate, - Tax: this.batch.Tax, - Discount: this.batch.Discount, - Amount: quantity * this.batch.Rate * (1 + this.batch.Tax) * (1 - this.batch.Discount), - Batch: this.batch - }); - delete this.batch; - delete this.quantity; - this.foBatch = true; - } - }; - PurchaseReturnController.prototype.removeInventory = function (inventory) { - var index = this.voucher.Inventories.indexOf(inventory); - this.voucher.Inventories.splice(index, 1); - }; - PurchaseReturnController.prototype.preventAlteration = function (voucher) { - if (angular.isUndefined(this.Credentials.Perms)) { - return false; - } - else if (angular.isUndefined(voucher.VoucherID)) { - return !this.Credentials.Perms['Purchase Return']; - } - else if (voucher.Posted && !this.Credentials.Perms['Edit Posted Vouchers']) { - return true; - } - else if (voucher.User.UserID !== this.Credentials.Auth.UserID && !this.Credentials.Perms["Edit Other User's Vouchers"]) { - return true; - } - else { - return false; - } - }; - PurchaseReturnController.prototype.save = function () { - var _this = this; - return this.voucher.$save({ type: 'Purchase Return' }, function (u) { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/Return/' + u.VoucherID); - }, function (data) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - PurchaseReturnController.prototype.delete = function () { - var _this = this; - this.voucher.$delete(function () { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/Return').replace(); - }, function (data) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - PurchaseReturnController.prototype.post = function () { - var _this = this; - return this.voucher.$post(function () { - _this.Messages.push({ Type: 'Success', Message: '' }); - }, function (data) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - PurchaseReturnController.prototype.modal = function (inventory) { - var _this = this; - this.selectedInventory = inventory; - var edit = {}; - angular.copy(this.selectedInventory, edit); - var modalInstance = this.$modal.open({ - backdrop: true, - size: 'lg', - templateUrl: '/app/purchase-return/purchase-return-modal.html', - controllerAs: 'vmModal', - controller: purchase_return_modal_controller_1.PurchaseReturnModalController, - resolve: { - edit: function () { - return edit; - } - } - }); - modalInstance.result.then(function (updated) { - if (updated.Product.ProductID !== _this.selectedInventory.Batch.Product.ProductID) { - var oldInventory = _this.getOld(updated.Batch.Product.ProductID, _this.voucher.Inventories); - if (!angular.isUndefined(oldInventory)) { - delete _this.selectedInventory; - return false; - } - } - angular.copy(updated, _this.selectedInventory); - delete _this.selectedInventory; - }, function () { - delete _this.selectedInventory; - }); - }; - PurchaseReturnController.prototype.confirm = function () { - var _this = this; - var modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', /** @class */ (function () { - function class_2($modalInstance) { - this.$modalInstance = $modalInstance; - this.title = "Delete Voucher"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - class_2.prototype.ok = function () { - this.$modalInstance.close(); - }; - class_2.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - return class_2; - }())] - }); - modalInstance.result.then(function () { - _this.delete(); - }); - }; - PurchaseReturnController.prototype.accounts = function ($viewValue) { - return this.Account.autocomplete({ term: $viewValue, count: 20, a: true }).$promise; - }; - PurchaseReturnController.prototype.batches = function ($viewValue) { - var params = { term: $viewValue, count: 20, date: this.voucher.Date }; - return this.Batch.autocomplete(params).$promise; - }; - PurchaseReturnController.$inject = ['$scope', '$location', 'asDateFilter', '$uibModal', 'UploadedImageResizer', 'Account', 'Batch', 'uibDateParser', 'Messages', 'Credentials']; - return PurchaseReturnController; -}()); -exports.PurchaseReturnController = PurchaseReturnController; -//# sourceMappingURL=purchase-return.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/purchase-return/purchase-return.controller.js.map b/brewman/static/src/app/purchase-return/purchase-return.controller.js.map deleted file mode 100644 index ab2c152b..00000000 --- a/brewman/static/src/app/purchase-return/purchase-return.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"purchase-return.controller.js","sourceRoot":"","sources":["purchase-return.controller.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AACnC,0BAA4B;AAC5B,uFAAiF;AAEjF;IAUI,kCAAmB,MAAM,EAAS,SAAS,EAAS,MAAM,EAAS,MAAM,EAAS,oBAAoB,EAAS,OAAO,EAAS,KAAK,EAAS,UAAU,EAAS,QAAQ,EAAS,WAAW;QAA5L,iBA2BC;QA3BkB,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,yBAAoB,GAApB,oBAAoB,CAAA;QAAS,YAAO,GAAP,OAAO,CAAA;QAAS,UAAK,GAAL,KAAK,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QAAS,aAAQ,GAAR,QAAQ,CAAA;QAAS,gBAAW,GAAX,WAAW,CAAA;QACxL,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;QAC1C,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QACxE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QAEd,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,UAAC,KAAK,EAAE,IAAI;YACnC,oBAAoB,CAAC,IAAI,EAAE,KAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,wBAAwB,EAAE,UAAC,WAAW;YAChD,IAAI,MAAM,GAAG,CAAC,EACV,CAAC,EACD,CAAC,CAAC;YACN,IAAI,CA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,CAAC,OAAO,CAAC,IAAI,EAAC,CAAC;QACtE,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC;IACpD,CAAC;IAtNM,gCAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,sBAAsB,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;IAuNlK,+BAAC;CAAA,AAxND,IAwNC;AAxNY,4DAAwB"} \ No newline at end of file diff --git a/brewman/static/src/app/purchase-return/purchase-return.controller.ts b/brewman/static/src/app/purchase-return/purchase-return.controller.ts deleted file mode 100644 index 86abc39d..00000000 --- a/brewman/static/src/app/purchase-return/purchase-return.controller.ts +++ /dev/null @@ -1,221 +0,0 @@ -import * as angular from 'angular'; -import * as _ from 'lodash'; -import {PurchaseReturnModalController} from './purchase-return-modal.controller'; - -export class PurchaseReturnController { - static $inject = ['$scope', '$location', 'asDateFilter', '$uibModal', 'UploadedImageResizer', 'Account', 'Batch', 'uibDateParser', 'Messages', 'Credentials']; - selectedInventory: any; - foBatch: boolean; - quantity: any; - batch: any; - _voucher_Date: any; - rate: any; - voucher: any; - - constructor(public $scope, public $location, public asDate, public $modal, public UploadedImageResizer, public Account, public Batch, public dateParser, public Messages, public Credentials) { - this.voucher = $scope.$parent.res.voucher; - this._voucher_Date = dateParser.parse(this.voucher.Date, "dd-MMM-yyyy"); - this.rate = 0; - - $scope.$on("fileSelected", (event, args) => { - UploadedImageResizer(args, this.voucher.Files); - }); - - $scope.$watch('vm.voucher.Inventories', (inventories) => { - let amount = 0, - i, - l; - if (!angular.isUndefined(inventories)) { - for (i = 0, l = inventories.length; i < l; i++) { - amount += Number(inventories[i].Amount); - } - } - if (!angular.isUndefined(this.voucher.Journals)) { - for (i = 0, l = this.voucher.Journals.length; i < l; i++) { - if (this.voucher.Journals[i].Debit === 1) { - this.voucher.Journals[i].Amount = amount; - break; - } - } - } - }, true); - } - - voucher_Date(value) { - if (arguments.length) { - this.voucher.Date = this.asDate(value); - this._voucher_Date = value; - } - return this._voucher_Date; - } - - getOld(productID, inventories) { - return _.find(inventories, function (inventory) { - return inventory.Product.ProductID === productID; - }); - } - - deleteFile(item) { - const index = this.voucher.Files.indexOf(item); - this.voucher.Files.splice(index, 1); - } - - zoomImage(item) { - this.$modal.open({ - templateUrl: '/template/modal/image.html', - controller: ['$uibModalInstance', class { - imageUrl: any; - size: any; - - constructor(public $modalInstance) { - this.imageUrl = item.Resized; - this.size = null; - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - }] - }); - } - - add() { - let oldInventory = this.getOld(this.batch.Product.ProductID, this.voucher.Inventories), - quantity = Number(this.quantity); - - if (!this.batch || !this.batch.Product.ProductID || !quantity) { - return; - } - - if (angular.isUndefined(oldInventory) && quantity <= this.batch.QuantityRemaining) { - this.voucher.Inventories.push( - { - Product: this.batch.Product, - Quantity: quantity, - Rate: this.batch.Rate, - Tax: this.batch.Tax, - Discount: this.batch.Discount, - Amount: quantity * this.batch.Rate * (1 + this.batch.Tax) * (1 - this.batch.Discount), - Batch: this.batch - }); - delete this.batch; - delete this.quantity; - this.foBatch = true; - } - } - - removeInventory(inventory) { - const index = this.voucher.Inventories.indexOf(inventory); - this.voucher.Inventories.splice(index, 1); - } - - preventAlteration(voucher) { - if (angular.isUndefined(this.Credentials.Perms)) { - return false; - } else if (angular.isUndefined(voucher.VoucherID)) { - return !this.Credentials.Perms['Purchase Return']; - } else if (voucher.Posted && !this.Credentials.Perms['Edit Posted Vouchers']) { - return true; - } else if (voucher.User.UserID !== this.Credentials.Auth.UserID && !this.Credentials.Perms["Edit Other User's Vouchers"]) { - return true; - } else { - return false; - } - } - - save() { - return this.voucher.$save({type: 'Purchase Return'}, (u) => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/Return/' + u.VoucherID); - }, (data) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - delete() { - this.voucher.$delete(() => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/Return').replace(); - }, (data) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - post() { - return this.voucher.$post(() => { - this.Messages.push({Type: 'Success', Message: ''}); - }, (data) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - modal(inventory) { - this.selectedInventory = inventory; - let edit = {}; - angular.copy(this.selectedInventory, edit); - const modalInstance = this.$modal.open({ - backdrop: true, - size: 'lg', - templateUrl: '/app/purchase-return/purchase-return-modal.html', - controllerAs: 'vmModal', - controller: PurchaseReturnModalController, - resolve: { - edit: function () { - return edit; - } - } - }); - modalInstance.result.then((updated) => { - if (updated.Product.ProductID !== this.selectedInventory.Batch.Product.ProductID) { - const oldInventory = this.getOld(updated.Batch.Product.ProductID, this.voucher.Inventories); - if (!angular.isUndefined(oldInventory)) { - delete this.selectedInventory; - return false; - } - } - angular.copy(updated, this.selectedInventory); - delete this.selectedInventory; - }, () => { - delete this.selectedInventory; - }); - } - - confirm() { - const modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', class { - title: any; - body: any; - isDelete: boolean; - - constructor(public $modalInstance) { - this.title = "Delete Voucher"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - - ok() { - this.$modalInstance.close(); - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - }] - }); - modalInstance.result.then(() => { - this.delete(); - }); - } - - accounts($viewValue) { - return this.Account.autocomplete({term: $viewValue, count: 20, a: true}).$promise; - } - - batches($viewValue) { - const params = {term: $viewValue, count: 20, date: this.voucher.Date}; - return this.Batch.autocomplete(params).$promise; - } -} diff --git a/brewman/static/src/app/purchase-return/purchase-return.html b/brewman/static/src/app/purchase-return/purchase-return.html deleted file mode 100644 index 264a4c11..00000000 --- a/brewman/static/src/app/purchase-return/purchase-return.html +++ /dev/null @@ -1,117 +0,0 @@ -
-

Purchase Return Edit / New

- -
- - -
-
- - - - -
-
-
-
- ₹ -
-
-
-
- - -
- -
-
-
- - - - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
ProductQuantityRateTaxDiscountAmountDelete
{{inventory.Product.Name}}{{inventory.Quantity | number:2}}{{inventory.Rate | currency}}{{inventory.Tax | percent}}{{inventory.Discount | percent}}{{inventory.Amount | currency}} -
- Delete - - -
-
-
- - -
- -
-
-
-
-
- - -
- - -
-
-
- - - -
-
- Created on {{vm.voucher.CreationDate | localTime}} and Last Edited on {{vm.voucher.LastEditDate | localTime}} by - {{vm.voucher.User.Name}}. Posted by {{vm.voucher.Poster}} -
-
\ No newline at end of file diff --git a/brewman/static/src/app/purchase/purchase-modal.controller.js b/brewman/static/src/app/purchase/purchase-modal.controller.js deleted file mode 100644 index 450a3876..00000000 --- a/brewman/static/src/app/purchase/purchase-modal.controller.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var PurchaseModalController = /** @class */ (function () { - function PurchaseModalController($scope, $modalInstance, Product) { - this.$scope = $scope; - this.$modalInstance = $modalInstance; - this.Product = Product; - this.edit = $scope.$resolve.edit; - } - PurchaseModalController.prototype.ok = function () { - this.edit.Quantity = Number(this.edit.Quantity); - this.edit.Tax = (this.edit.Tax) ? Number(this.edit.Tax) : 0; - this.edit.Discount = (this.edit.Discount) ? Number(this.edit.Discount) : 0; - this.edit.Rate = Number(this.edit.Rate); - this.edit.Amount = this.edit.Quantity * this.edit.Rate * (1 + this.edit.Tax) * (1 - this.edit.Discount); - this.$modalInstance.close(this.edit); - }; - PurchaseModalController.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - PurchaseModalController.prototype.products = function ($viewValue) { - return this.Product.autocomplete({ term: $viewValue, count: 20 }).$promise; - }; - PurchaseModalController.$inject = ['$scope', '$uibModalInstance', 'Product']; - return PurchaseModalController; -}()); -exports.PurchaseModalController = PurchaseModalController; -//# sourceMappingURL=purchase-modal.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/purchase/purchase-modal.controller.js.map b/brewman/static/src/app/purchase/purchase-modal.controller.js.map deleted file mode 100644 index f453412a..00000000 --- a/brewman/static/src/app/purchase/purchase-modal.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"purchase-modal.controller.js","sourceRoot":"","sources":["purchase-modal.controller.ts"],"names":[],"mappings":";;AAAA;IAII,iCAAmB,MAAM,EAAS,cAAc,EAAS,OAAO;QAA7C,WAAM,GAAN,MAAM,CAAA;QAAS,mBAAc,GAAd,cAAc,CAAA;QAAS,YAAO,GAAP,OAAO,CAAA;QAC5D,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;IACrC,CAAC;IAED,oCAAE,GAAF;QACI,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChD,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3E,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACxG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,wCAAM,GAAN;QACI,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED,0CAAQ,GAAR,UAAS,UAAU;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;IAC7E,CAAC;IAtBM,+BAAO,GAAG,CAAC,QAAQ,EAAE,mBAAmB,EAAE,SAAS,CAAC,CAAC;IAuBhE,8BAAC;CAAA,AAxBD,IAwBC;AAxBY,0DAAuB"} \ No newline at end of file diff --git a/brewman/static/src/app/purchase/purchase-modal.controller.ts b/brewman/static/src/app/purchase/purchase-modal.controller.ts deleted file mode 100644 index 8ddaa9ef..00000000 --- a/brewman/static/src/app/purchase/purchase-modal.controller.ts +++ /dev/null @@ -1,25 +0,0 @@ -export class PurchaseModalController { - static $inject = ['$scope', '$uibModalInstance', 'Product']; - edit: any; - - constructor(public $scope, public $modalInstance, public Product) { - this.edit = $scope.$resolve.edit; - } - - ok() { - this.edit.Quantity = Number(this.edit.Quantity); - this.edit.Tax = (this.edit.Tax) ? Number(this.edit.Tax) : 0; - this.edit.Discount = (this.edit.Discount) ? Number(this.edit.Discount) : 0; - this.edit.Rate = Number(this.edit.Rate); - this.edit.Amount = this.edit.Quantity * this.edit.Rate * (1 + this.edit.Tax) * (1 - this.edit.Discount); - this.$modalInstance.close(this.edit); - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - - products($viewValue) { - return this.Product.autocomplete({term: $viewValue, count: 20}).$promise; - } -} diff --git a/brewman/static/src/app/purchase/purchase-modal.html b/brewman/static/src/app/purchase/purchase-modal.html deleted file mode 100644 index 34689dc7..00000000 --- a/brewman/static/src/app/purchase/purchase-modal.html +++ /dev/null @@ -1,33 +0,0 @@ - \ No newline at end of file diff --git a/brewman/static/src/app/purchase/purchase-voucher.resolver.js b/brewman/static/src/app/purchase/purchase-voucher.resolver.js deleted file mode 100644 index 2e4ba1b3..00000000 --- a/brewman/static/src/app/purchase/purchase-voucher.resolver.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function PurchaseVoucherResolver($route, Voucher) { - var id = $route.current.params.id; - if (angular.isUndefined(id)) { - return Voucher.get({ type: 'Purchase' }).$promise; - } - else { - return Voucher.get({ id: id }).$promise; - } -} -exports.PurchaseVoucherResolver = PurchaseVoucherResolver; -//# sourceMappingURL=purchase-voucher.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/purchase/purchase-voucher.resolver.js.map b/brewman/static/src/app/purchase/purchase-voucher.resolver.js.map deleted file mode 100644 index 5bb64707..00000000 --- a/brewman/static/src/app/purchase/purchase-voucher.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"purchase-voucher.resolver.js","sourceRoot":"","sources":["purchase-voucher.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,iCAAwC,MAAM,EAAE,OAAO;IACnD,IAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IAEpC,IAAI,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;QACzB,OAAO,OAAO,CAAC,GAAG,CAAC,EAAC,IAAI,EAAE,UAAU,EAAC,CAAC,CAAC,QAAQ,CAAC;KACnD;SAAM;QACH,OAAO,OAAO,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;KACzC;AACL,CAAC;AARD,0DAQC"} \ No newline at end of file diff --git a/brewman/static/src/app/purchase/purchase-voucher.resolver.ts b/brewman/static/src/app/purchase/purchase-voucher.resolver.ts deleted file mode 100644 index b91bd4ac..00000000 --- a/brewman/static/src/app/purchase/purchase-voucher.resolver.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as angular from 'angular'; - -export function PurchaseVoucherResolver($route, Voucher) { - const id = $route.current.params.id; - - if (angular.isUndefined(id)) { - return Voucher.get({type: 'Purchase'}).$promise; - } else { - return Voucher.get({id: id}).$promise; - } -} diff --git a/brewman/static/src/app/purchase/purchase.component.js b/brewman/static/src/app/purchase/purchase.component.js deleted file mode 100644 index 76c1eb94..00000000 --- a/brewman/static/src/app/purchase/purchase.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var purchase_controller_1 = require("./purchase.controller"); -exports.PurchaseComponent = { - templateUrl: '/app/purchase/purchase.html', - controller: purchase_controller_1.PurchaseController, - controllerAs: 'vm', -}; -//# sourceMappingURL=purchase.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/purchase/purchase.component.js.map b/brewman/static/src/app/purchase/purchase.component.js.map deleted file mode 100644 index 6d1dc99c..00000000 --- a/brewman/static/src/app/purchase/purchase.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"purchase.component.js","sourceRoot":"","sources":["purchase.component.ts"],"names":[],"mappings":";;AAAA,6DAAyD;AAE5C,QAAA,iBAAiB,GAAG;IAC7B,WAAW,EAAE,6BAA6B;IAC1C,UAAU,EAAE,wCAAkB;IAC9B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/purchase/purchase.component.ts b/brewman/static/src/app/purchase/purchase.component.ts deleted file mode 100644 index b6ce41d1..00000000 --- a/brewman/static/src/app/purchase/purchase.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {PurchaseController} from "./purchase.controller"; - -export const PurchaseComponent = { - templateUrl: '/app/purchase/purchase.html', - controller: PurchaseController, - controllerAs: 'vm', -}; \ No newline at end of file diff --git a/brewman/static/src/app/purchase/purchase.controller.js b/brewman/static/src/app/purchase/purchase.controller.js deleted file mode 100644 index 67d5d986..00000000 --- a/brewman/static/src/app/purchase/purchase.controller.js +++ /dev/null @@ -1,208 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var _ = require("lodash"); -var purchase_modal_controller_1 = require("./purchase-modal.controller"); -var PurchaseController = /** @class */ (function () { - function PurchaseController($scope, $location, asDate, $modal, UploadedImageResizer, Account, Product, dateParser, Messages, Credentials) { - var _this = this; - this.$scope = $scope; - this.$location = $location; - this.asDate = asDate; - this.$modal = $modal; - this.UploadedImageResizer = UploadedImageResizer; - this.Account = Account; - this.Product = Product; - this.dateParser = dateParser; - this.Messages = Messages; - this.Credentials = Credentials; - this.voucher = $scope.$parent.res.voucher; - this._voucher_Date = dateParser.parse(this.voucher.Date, "dd-MMM-yyyy"); - $scope.$on("fileSelected", function (event, args) { - UploadedImageResizer(args, _this.voucher.Files); - }); - $scope.$watch('vm.voucher.Inventories', function (inventories, oldValue) { - var amount = 0, i, l; - if (!angular.isUndefined(inventories)) { - for (i = 0, l = inventories.length; i < l; i++) { - amount += Number(inventories[i].Amount); - } - } - if (!angular.isUndefined(_this.voucher.Journals)) { - for (i = 0, l = _this.voucher.Journals.length; i < l; i++) { - if (_this.voucher.Journals[i].Debit === -1) { - _this.voucher.Journals[i].Amount = amount; - break; - } - } - } - }, true); - } - PurchaseController.prototype.voucher_Date = function (value) { - if (arguments.length) { - this.voucher.Date = this.asDate(value); - this._voucher_Date = value; - } - return this._voucher_Date; - }; - PurchaseController.prototype.getOld = function (productID, inventories) { - return _.find(inventories, function (inventory) { - return inventory.Product.ProductID === productID; - }); - }; - PurchaseController.prototype.deleteFile = function (item) { - var index = this.voucher.Files.indexOf(item); - this.voucher.Files.splice(index, 1); - }; - PurchaseController.prototype.zoomImage = function (item) { - this.$modal.open({ - templateUrl: '/template/modal/image.html', - controller: ['$uibModalInstance', /** @class */ (function () { - function class_1($modalInstance) { - this.$modalInstance = $modalInstance; - this.imageUrl = item.Resized; - this.size = null; - } - class_1.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - return class_1; - }())] - }); - }; - PurchaseController.prototype.add = function () { - var oldInventory = this.getOld(this.product.ProductID, this.voucher.Inventories), quantity = Number(this.quantity), tax = (this.tax) ? Number(this.tax) : 0, discount = (this.discount) ? Number(this.discount) : 0, price = Number(this.product.Price); - if (!this.product || !this.product.ProductID || !quantity || !price) { - return; - } - if (angular.isUndefined(oldInventory)) { - this.voucher.Inventories.push({ - Product: this.product, - Quantity: quantity, - Rate: price, - Tax: tax, - Discount: discount, - Amount: quantity * price * (1 + tax) * (1 - discount) - }); - delete this.product; - delete this.quantity; - delete this.tax; - delete this.discount; - this.foProduct = true; - } - }; - PurchaseController.prototype.removeInventory = function (inventory) { - var index = this.voucher.Inventories.indexOf(inventory); - this.voucher.Inventories.splice(index, 1); - }; - PurchaseController.prototype.preventAlteration = function (voucher) { - if (angular.isUndefined(this.Credentials.Perms)) { - return false; - } - else if (angular.isUndefined(voucher.VoucherID)) { - return !this.Credentials.Perms['Purchase']; - } - else if (voucher.Posted && !this.Credentials.Perms['Edit Posted Vouchers']) { - return true; - } - else if (voucher.User.UserID != this.Credentials.Auth.UserID && !this.Credentials.Perms["Edit Other User's Vouchers"]) { - return true; - } - else { - return false; - } - }; - PurchaseController.prototype.save = function () { - var _this = this; - return this.voucher.$save({ type: 'Purchase' }, function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/Purchase/' + u.VoucherID); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - PurchaseController.prototype.delete = function () { - var _this = this; - this.voucher.$delete(function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/Purchase').replace(); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - PurchaseController.prototype.post = function () { - var _this = this; - return this.voucher.$post(function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - PurchaseController.prototype.modal = function (inventory) { - var _this = this; - this.selectedInventory = inventory; - var edit = {}; - angular.copy(this.selectedInventory, edit); - var modalInstance = this.$modal.open({ - backdrop: true, - size: 'lg', - templateUrl: '/app/purchase/purchase-modal.html', - controllerAs: 'vmModal', - controller: purchase_modal_controller_1.PurchaseModalController, - resolve: { - edit: function () { - return edit; - } - } - }); - modalInstance.result.then(function (updated) { - if (updated.Product.ProductID !== _this.selectedInventory.Product.ProductID) { - var oldInventory = _this.getOld(updated.Product.ProductID, _this.voucher.Inventories); - if (!angular.isUndefined(oldInventory)) { - delete _this.selectedInventory; - return false; - } - } - angular.copy(updated, _this.selectedInventory); - delete _this.selectedInventory; - }, function () { - delete _this.selectedInventory; - }); - }; - PurchaseController.prototype.confirm = function () { - var _this = this; - var modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', /** @class */ (function () { - function class_2($modalInstance) { - this.$modalInstance = $modalInstance; - this.title = "Delete Voucher"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - class_2.prototype.ok = function () { - this.$modalInstance.close(); - }; - class_2.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - return class_2; - }())] - }); - modalInstance.result.then(function () { - _this.delete(); - }); - }; - PurchaseController.prototype.accounts = function ($viewValue) { - return this.Account.autocomplete({ term: $viewValue, count: 20, a: true }).$promise; - }; - PurchaseController.prototype.products = function ($viewValue) { - return this.Product.autocomplete({ term: $viewValue, count: 20, a: true }).$promise; - }; - PurchaseController.$inject = ['$scope', '$location', 'asDateFilter', '$uibModal', 'UploadedImageResizer', 'Account', 'Product', 'uibDateParser', 'Messages', 'Credentials']; - return PurchaseController; -}()); -exports.PurchaseController = PurchaseController; -//# sourceMappingURL=purchase.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/purchase/purchase.controller.js.map b/brewman/static/src/app/purchase/purchase.controller.js.map deleted file mode 100644 index 42a7a1f1..00000000 --- a/brewman/static/src/app/purchase/purchase.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"purchase.controller.js","sourceRoot":"","sources":["purchase.controller.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AACnC,0BAA4B;AAC5B,yEAAoE;AAEpE;IAWI,4BAAmB,MAAM,EAAS,SAAS,EAAS,MAAM,EAAS,MAAM,EAAS,oBAAoB,EAAS,OAAO,EAAS,OAAO,EAAS,UAAU,EAAS,QAAQ,EAAS,WAAW;QAA9L,iBAyBC;QAzBkB,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,yBAAoB,GAApB,oBAAoB,CAAA;QAAS,YAAO,GAAP,OAAO,CAAA;QAAS,YAAO,GAAP,OAAO,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QAAS,aAAQ,GAAR,QAAQ,CAAA;QAAS,gBAAW,GAAX,WAAW,CAAA;QAC1L,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;QAC1C,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QAExE,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,UAAC,KAAK,EAAE,IAAI;YACnC,oBAAoB,CAAC,IAAI,EAAE,KAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,wBAAwB,EAAE,UAAC,WAAW,EAAE,QAAQ;YAC1D,IAAI,MAAM,GAAG,CAAC,EACV,CAAC,EAAE,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AC,EAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAC,CAAC,CAAC,QAAQ,CAAC;IACtF,CAAC;IAED,qCAAQ,GAAR,UAAS,UAAU;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAC,CAAC,CAAC,QAAQ,CAAC;IACtF,CAAC;IAxNM,0BAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,sBAAsB,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;IAyNpK,yBAAC;CAAA,AA1ND,IA0NC;AA1NY,gDAAkB"} \ No newline at end of file diff --git a/brewman/static/src/app/purchase/purchase.controller.ts b/brewman/static/src/app/purchase/purchase.controller.ts deleted file mode 100644 index b2f2b644..00000000 --- a/brewman/static/src/app/purchase/purchase.controller.ts +++ /dev/null @@ -1,223 +0,0 @@ -import * as angular from 'angular'; -import * as _ from 'lodash'; -import {PurchaseModalController} from './purchase-modal.controller'; - -export class PurchaseController { - static $inject = ['$scope', '$location', 'asDateFilter', '$uibModal', 'UploadedImageResizer', 'Account', 'Product', 'uibDateParser', 'Messages', 'Credentials']; - _voucher_Date: any; - selectedInventory: any; - foProduct: boolean; - product: any; - quantity: any; - tax: any; - discount: any; - voucher: any; - - constructor(public $scope, public $location, public asDate, public $modal, public UploadedImageResizer, public Account, public Product, public dateParser, public Messages, public Credentials) { - this.voucher = $scope.$parent.res.voucher; - this._voucher_Date = dateParser.parse(this.voucher.Date, "dd-MMM-yyyy"); - - $scope.$on("fileSelected", (event, args) => { - UploadedImageResizer(args, this.voucher.Files); - }); - - $scope.$watch('vm.voucher.Inventories', (inventories, oldValue) => { - let amount = 0, - i, l; - if (!angular.isUndefined(inventories)) { - for (i = 0, l = inventories.length; i < l; i++) { - amount += Number(inventories[i].Amount); - } - } - if (!angular.isUndefined(this.voucher.Journals)) { - for (i = 0, l = this.voucher.Journals.length; i < l; i++) { - if (this.voucher.Journals[i].Debit === -1) { - this.voucher.Journals[i].Amount = amount; - break; - } - } - } - }, true); - } - - voucher_Date(value) { - if (arguments.length) { - this.voucher.Date = this.asDate(value); - this._voucher_Date = value; - } - return this._voucher_Date; - } - - getOld(productID, inventories) { - return _.find(inventories, function (inventory) { - return inventory.Product.ProductID === productID; - }); - } - - deleteFile(item) { - const index = this.voucher.Files.indexOf(item); - this.voucher.Files.splice(index, 1); - } - - zoomImage(item) { - this.$modal.open({ - templateUrl: '/template/modal/image.html', - controller: ['$uibModalInstance', class { - imageUrl: any; - size: any; - - constructor(public $modalInstance) { - this.imageUrl = item.Resized; - this.size = null; - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - }] - }); - } - - add() { - const oldInventory = this.getOld(this.product.ProductID, this.voucher.Inventories), - quantity = Number(this.quantity), - tax = (this.tax) ? Number(this.tax) : 0, - discount = (this.discount) ? Number(this.discount) : 0, - price = Number(this.product.Price); - - if (!this.product || !this.product.ProductID || !quantity || !price) { - return; - } - - if (angular.isUndefined(oldInventory)) { - this.voucher.Inventories.push( - { - Product: this.product, - Quantity: quantity, - Rate: price, - Tax: tax, - Discount: discount, - Amount: quantity * price * (1 + tax) * (1 - discount) - }); - delete this.product; - delete this.quantity; - delete this.tax; - delete this.discount; - this.foProduct = true; - } - } - - removeInventory(inventory) { - const index = this.voucher.Inventories.indexOf(inventory); - this.voucher.Inventories.splice(index, 1); - } - - preventAlteration(voucher) { - if (angular.isUndefined(this.Credentials.Perms)) { - return false; - } else if (angular.isUndefined(voucher.VoucherID)) { - return !this.Credentials.Perms['Purchase']; - } else if (voucher.Posted && !this.Credentials.Perms['Edit Posted Vouchers']) { - return true; - } else if (voucher.User.UserID != this.Credentials.Auth.UserID && !this.Credentials.Perms["Edit Other User's Vouchers"]) { - return true; - } else { - return false; - } - } - - save() { - return this.voucher.$save({type: 'Purchase'}, (u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/Purchase/' + u.VoucherID); - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - delete() { - this.voucher.$delete((u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/Purchase').replace(); - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - post() { - return this.voucher.$post((u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - modal(inventory) { - this.selectedInventory = inventory; - let edit = {}; - angular.copy(this.selectedInventory, edit); - const modalInstance = this.$modal.open({ - backdrop: true, - size: 'lg', - templateUrl: '/app/purchase/purchase-modal.html', - controllerAs: 'vmModal', - controller: PurchaseModalController, - resolve: { - edit: function () { - return edit; - } - } - }); - modalInstance.result.then((updated) => { - if (updated.Product.ProductID !== this.selectedInventory.Product.ProductID) { - const oldInventory = this.getOld(updated.Product.ProductID, this.voucher.Inventories); - if (!angular.isUndefined(oldInventory)) { - delete this.selectedInventory; - return false; - } - } - angular.copy(updated, this.selectedInventory); - delete this.selectedInventory; - }, () => { - delete this.selectedInventory; - }); - } - - confirm() { - const modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', class { - title: any; - body: any; - isDelete: boolean; - - constructor(public $modalInstance) { - this.title = "Delete Voucher"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - - ok() { - this.$modalInstance.close(); - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - }] - }); - modalInstance.result.then(() => { - this.delete(); - }); - } - - accounts($viewValue) { - return this.Account.autocomplete({term: $viewValue, count: 20, a: true}).$promise; - } - - products($viewValue) { - return this.Product.autocomplete({term: $viewValue, count: 20, a: true}).$promise; - } -} diff --git a/brewman/static/src/app/purchase/purchase.html b/brewman/static/src/app/purchase/purchase.html deleted file mode 100644 index 61c3790d..00000000 --- a/brewman/static/src/app/purchase/purchase.html +++ /dev/null @@ -1,123 +0,0 @@ -
-

Purchase Edit / New

- -
- - -
-
- - - - -
-
- -
-
- ₹ - -
-
-
-
- - -
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
ProductQuantityRateTaxDiscountAmountDelete
{{inventory.Product.Name}}{{inventory.Quantity | number:2}}{{inventory.Rate | currency}}{{inventory.Tax | percent}}{{inventory.Discount | percent}}{{inventory.Amount | currency}} -
- Delete - - -
-
-
- - -
- -
-
-
-
-
- - -
- - -
-
-
- - - -
-
- Created on {{vm.voucher.CreationDate | localTime}} and Last Edited on {{vm.voucher.LastEditDate | localTime}} by - {{vm.voucher.User.Name}}. Posted by {{vm.voucher.Poster}} -
-
\ No newline at end of file diff --git a/brewman/static/src/app/purchases/purchases.component.js b/brewman/static/src/app/purchases/purchases.component.js deleted file mode 100644 index 6b887457..00000000 --- a/brewman/static/src/app/purchases/purchases.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var purchases_controller_1 = require("./purchases.controller"); -exports.PurchasesComponent = { - templateUrl: '/app/purchases/purchases.html', - controller: purchases_controller_1.PurchasesController, - controllerAs: 'vm', -}; -//# sourceMappingURL=purchases.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/purchases/purchases.component.js.map b/brewman/static/src/app/purchases/purchases.component.js.map deleted file mode 100644 index cb4e4a15..00000000 --- a/brewman/static/src/app/purchases/purchases.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"purchases.component.js","sourceRoot":"","sources":["purchases.component.ts"],"names":[],"mappings":";;AAAA,+DAA2D;AAE9C,QAAA,kBAAkB,GAAG;IAC9B,WAAW,EAAE,+BAA+B;IAC5C,UAAU,EAAE,0CAAmB;IAC/B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/purchases/purchases.component.ts b/brewman/static/src/app/purchases/purchases.component.ts deleted file mode 100644 index f8e55fbf..00000000 --- a/brewman/static/src/app/purchases/purchases.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {PurchasesController} from "./purchases.controller"; - -export const PurchasesComponent = { - templateUrl: '/app/purchases/purchases.html', - controller: PurchasesController, - controllerAs: 'vm', -}; diff --git a/brewman/static/src/app/purchases/purchases.controller.js b/brewman/static/src/app/purchases/purchases.controller.js deleted file mode 100644 index 0113405f..00000000 --- a/brewman/static/src/app/purchases/purchases.controller.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var PurchasesController = /** @class */ (function () { - function PurchasesController($scope, $routeParams, $location, asDate, dateParser) { - this.$scope = $scope; - this.$routeParams = $routeParams; - this.$location = $location; - this.asDate = asDate; - this.dateParser = dateParser; - this.purchases = $scope.$parent.res.purchases; - this._info_StartDate = dateParser.parse(this.purchases.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.purchases.FinishDate, "dd-MMM-yyyy"); - this.info = this.purchases; - } - PurchasesController.prototype.info_StartDate = function (value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - }; - PurchasesController.prototype.info_FinishDate = function (value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - }; - PurchasesController.prototype.show = function () { - this.$location.path('/Purchases').search({ s: this.info.StartDate, f: this.info.FinishDate }); - }; - PurchasesController.$inject = ['$scope', '$routeParams', '$location', 'asDateFilter', 'uibDateParser']; - return PurchasesController; -}()); -exports.PurchasesController = PurchasesController; -//# sourceMappingURL=purchases.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/purchases/purchases.controller.js.map b/brewman/static/src/app/purchases/purchases.controller.js.map deleted file mode 100644 index 4f671cde..00000000 --- a/brewman/static/src/app/purchases/purchases.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"purchases.controller.js","sourceRoot":"","sources":["purchases.controller.ts"],"names":[],"mappings":";;AAAA;IAOI,6BAAmB,MAAM,EAAS,YAAY,EAAS,SAAS,EAAS,MAAM,EAAS,UAAU;QAA/E,WAAM,GAAN,MAAM,CAAA;QAAS,iBAAY,GAAZ,YAAY,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QAC9F,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;QAC9C,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QACjF,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;QACnF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC;IAC/B,CAAC;IAED,4CAAc,GAAd,UAAe,KAAK;QAChB,IAAI,SAAS,CAAC,MAAM,EAAE;YAClB,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACzC,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;SAChC;QACD,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED,6CAAe,GAAf,UAAgB,KAAK;QACjB,IAAI,SAAS,CAAC,MAAM,EAAE;YAClB,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC1C,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC;SACjC;QACD,OAAO,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IAED,kCAAI,GAAJ;QACI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,EAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAC,CAAC,CAAC;IAChG,CAAC;IA/BM,2BAAO,GAAG,CAAC,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC;IAgC9F,0BAAC;CAAA,AAjCD,IAiCC;AAjCY,kDAAmB"} \ No newline at end of file diff --git a/brewman/static/src/app/purchases/purchases.controller.ts b/brewman/static/src/app/purchases/purchases.controller.ts deleted file mode 100644 index 89df71d3..00000000 --- a/brewman/static/src/app/purchases/purchases.controller.ts +++ /dev/null @@ -1,34 +0,0 @@ -export class PurchasesController { - static $inject = ['$scope', '$routeParams', '$location', 'asDateFilter', 'uibDateParser']; - _info_StartDate: any; - _info_FinishDate: any; - info: any; - purchases: any; - - constructor(public $scope, public $routeParams, public $location, public asDate, public dateParser) { - this.purchases = $scope.$parent.res.purchases; - this._info_StartDate = dateParser.parse(this.purchases.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.purchases.FinishDate, "dd-MMM-yyyy"); - this.info = this.purchases; - } - - info_StartDate(value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - } - - info_FinishDate(value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - } - - show() { - this.$location.path('/Purchases').search({s: this.info.StartDate, f: this.info.FinishDate}); - } -} diff --git a/brewman/static/src/app/purchases/purchases.html b/brewman/static/src/app/purchases/purchases.html deleted file mode 100644 index d7283b58..00000000 --- a/brewman/static/src/app/purchases/purchases.html +++ /dev/null @@ -1,58 +0,0 @@ -
-

Purchases

- -
- - -
-
- - - - -
-
-
-
- - - - -
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
ProductQuantityRateAmount
{{item.Name}}{{item.Quantity | number:2 | clr}}{{item.Rate | currency | clr}}{{item.Amount | currency | clr}}
{{item.Name}}{{item.Quantity | number:2 | clr}}{{item.Rate | currency | clr}}{{item.Amount | currency | clr}}
-
diff --git a/brewman/static/src/app/purchases/purchases.resolver.js b/brewman/static/src/app/purchases/purchases.resolver.js deleted file mode 100644 index ce7ee4f8..00000000 --- a/brewman/static/src/app/purchases/purchases.resolver.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function PurchasesResolver($route, Purchases) { - var startDate = $route.current.params.s, finishDate = $route.current.params.f; - if (angular.isUndefined(startDate) || angular.isUndefined(finishDate)) { - return Purchases.get({}).$promise; - } - else { - return Purchases.get({ s: startDate, f: finishDate }).$promise; - } -} -exports.PurchasesResolver = PurchasesResolver; -//# sourceMappingURL=purchases.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/purchases/purchases.resolver.js.map b/brewman/static/src/app/purchases/purchases.resolver.js.map deleted file mode 100644 index d1151a9b..00000000 --- a/brewman/static/src/app/purchases/purchases.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"purchases.resolver.js","sourceRoot":"","sources":["purchases.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,2BAAkC,MAAM,EAAE,SAAS;IAC/C,IAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EACrC,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAEzC,IAAI,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE;QACnE,OAAO,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;KACrC;SAAM;QACH,OAAO,SAAS,CAAC,GAAG,CAAC,EAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,UAAU,EAAC,CAAC,CAAC,QAAQ,CAAC;KAChE;AACL,CAAC;AATD,8CASC"} \ No newline at end of file diff --git a/brewman/static/src/app/purchases/purchases.resolver.ts b/brewman/static/src/app/purchases/purchases.resolver.ts deleted file mode 100644 index 91379a8c..00000000 --- a/brewman/static/src/app/purchases/purchases.resolver.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as angular from 'angular'; - -export function PurchasesResolver($route, Purchases) { - const startDate = $route.current.params.s, - finishDate = $route.current.params.f; - - if (angular.isUndefined(startDate) || angular.isUndefined(finishDate)) { - return Purchases.get({}).$promise; - } else { - return Purchases.get({s: startDate, f: finishDate}).$promise; - } -} diff --git a/brewman/static/src/app/purchases/purchases.service.js b/brewman/static/src/app/purchases/purchases.service.js deleted file mode 100644 index a0c6a421..00000000 --- a/brewman/static/src/app/purchases/purchases.service.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function Purchases($resource) { - return $resource('/api/Purchases'); -} -exports.Purchases = Purchases; -//# sourceMappingURL=purchases.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/purchases/purchases.service.js.map b/brewman/static/src/app/purchases/purchases.service.js.map deleted file mode 100644 index b9c3e7ba..00000000 --- a/brewman/static/src/app/purchases/purchases.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"purchases.service.js","sourceRoot":"","sources":["purchases.service.ts"],"names":[],"mappings":";;AAAA,mBAA0B,SAAS;IAC/B,OAAO,SAAS,CAAC,gBAAgB,CAAC,CAAC;AACvC,CAAC;AAFD,8BAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/purchases/purchases.service.ts b/brewman/static/src/app/purchases/purchases.service.ts deleted file mode 100644 index b85ad9a6..00000000 --- a/brewman/static/src/app/purchases/purchases.service.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function Purchases($resource) { - return $resource('/api/Purchases'); -} diff --git a/brewman/static/src/app/raw-material-cost/raw-material-cost-detail.html b/brewman/static/src/app/raw-material-cost/raw-material-cost-detail.html deleted file mode 100644 index 7e8f5258..00000000 --- a/brewman/static/src/app/raw-material-cost/raw-material-cost-detail.html +++ /dev/null @@ -1,51 +0,0 @@ -
-

Raw Material Cost Detail

- -
- - -
-
- - - - -
-
-
-
- - - - -
-
-
- -
-
- - - - - - - - - - - - - - - - - - - -
ProductGroupQuantityNetGross
{{item.Name}}{{item.Group}}{{item.Quantity | number:2}}{{item.Net | currency}}{{item.Gross | currency}}
-
diff --git a/brewman/static/src/app/raw-material-cost/raw-material-cost.component.js b/brewman/static/src/app/raw-material-cost/raw-material-cost.component.js deleted file mode 100644 index 753c765c..00000000 --- a/brewman/static/src/app/raw-material-cost/raw-material-cost.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var raw_material_cost_controller_1 = require("./raw-material-cost.controller"); -exports.RawMaterialCostComponent = { - templateUrl: '/app/raw-material-cost/raw-material-cost.html', - controller: raw_material_cost_controller_1.RawMaterialCostController, - controllerAs: 'vm', -}; -//# sourceMappingURL=raw-material-cost.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/raw-material-cost/raw-material-cost.component.js.map b/brewman/static/src/app/raw-material-cost/raw-material-cost.component.js.map deleted file mode 100644 index c0d15375..00000000 --- a/brewman/static/src/app/raw-material-cost/raw-material-cost.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"raw-material-cost.component.js","sourceRoot":"","sources":["raw-material-cost.component.ts"],"names":[],"mappings":";;AAAA,+EAAyE;AAE5D,QAAA,wBAAwB,GAAG;IACpC,WAAW,EAAE,+CAA+C;IAC5D,UAAU,EAAE,wDAAyB;IACrC,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/raw-material-cost/raw-material-cost.component.ts b/brewman/static/src/app/raw-material-cost/raw-material-cost.component.ts deleted file mode 100644 index 0ff5aee5..00000000 --- a/brewman/static/src/app/raw-material-cost/raw-material-cost.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {RawMaterialCostController} from "./raw-material-cost.controller"; - -export const RawMaterialCostComponent = { - templateUrl: '/app/raw-material-cost/raw-material-cost.html', - controller: RawMaterialCostController, - controllerAs: 'vm', -}; diff --git a/brewman/static/src/app/raw-material-cost/raw-material-cost.controller.js b/brewman/static/src/app/raw-material-cost/raw-material-cost.controller.js deleted file mode 100644 index 511dfd64..00000000 --- a/brewman/static/src/app/raw-material-cost/raw-material-cost.controller.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var RawMaterialCostController = /** @class */ (function () { - function RawMaterialCostController($scope, $location, asDate, dateParser) { - this.$scope = $scope; - this.$location = $location; - this.asDate = asDate; - this.dateParser = dateParser; - this.rawMaterialCost = $scope.$parent.res.rawMaterialCost; - this._info_StartDate = dateParser.parse(this.rawMaterialCost.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.rawMaterialCost.FinishDate, "dd-MMM-yyyy"); - this.info = this.rawMaterialCost; - this.foDate = true; - } - RawMaterialCostController.prototype.info_StartDate = function (value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - }; - RawMaterialCostController.prototype.info_FinishDate = function (value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - }; - RawMaterialCostController.prototype.show = function () { - this.$location.path('/RawMaterialCost').search({ - StartDate: this.info.StartDate, - FinishDate: this.info.FinishDate - }); - }; - RawMaterialCostController.$inject = ['$scope', '$location', 'asDateFilter', 'uibDateParser']; - return RawMaterialCostController; -}()); -exports.RawMaterialCostController = RawMaterialCostController; -//# sourceMappingURL=raw-material-cost.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/raw-material-cost/raw-material-cost.controller.js.map b/brewman/static/src/app/raw-material-cost/raw-material-cost.controller.js.map deleted file mode 100644 index 983387cb..00000000 --- a/brewman/static/src/app/raw-material-cost/raw-material-cost.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"raw-material-cost.controller.js","sourceRoot":"","sources":["raw-material-cost.controller.ts"],"names":[],"mappings":";;AAAA;IAQI,mCAAmB,MAAM,EAAS,SAAS,EAAS,MAAM,EAAS,UAAU;QAA1D,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QACzE,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;QAC1D,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QACvF,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;QACzF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,eAAe,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;IAED,kDAAc,GAAd,UAAe,KAAK;QAChB,IAAI,SAAS,CAAC,MAAM,EAAE;YAClB,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACzC,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;SAChC;QACD,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED,mDAAe,GAAf,UAAgB,KAAK;QACjB,IAAI,SAAS,CAAC,MAAM,EAAE;YAClB,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC1C,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC;SACjC;QACD,OAAO,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IAED,wCAAI,GAAJ;QACI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC;YAC3C,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS;YAC9B,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU;SACnC,CAAC,CAAC;IACP,CAAC;IApCM,iCAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC;IAqC9E,gCAAC;CAAA,AAtCD,IAsCC;AAtCY,8DAAyB"} \ No newline at end of file diff --git a/brewman/static/src/app/raw-material-cost/raw-material-cost.controller.ts b/brewman/static/src/app/raw-material-cost/raw-material-cost.controller.ts deleted file mode 100644 index bbb5bb62..00000000 --- a/brewman/static/src/app/raw-material-cost/raw-material-cost.controller.ts +++ /dev/null @@ -1,39 +0,0 @@ -export class RawMaterialCostController { - static $inject = ['$scope', '$location', 'asDateFilter', 'uibDateParser']; - _info_StartDate: any; - _info_FinishDate: any; - info: any; - foDate: any; - rawMaterialCost: any; - - constructor(public $scope, public $location, public asDate, public dateParser) { - this.rawMaterialCost = $scope.$parent.res.rawMaterialCost; - this._info_StartDate = dateParser.parse(this.rawMaterialCost.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.rawMaterialCost.FinishDate, "dd-MMM-yyyy"); - this.info = this.rawMaterialCost; - this.foDate = true; - } - - info_StartDate(value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - } - - info_FinishDate(value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - } - - show() { - this.$location.path('/RawMaterialCost').search({ - StartDate: this.info.StartDate, - FinishDate: this.info.FinishDate - }); - } -} diff --git a/brewman/static/src/app/raw-material-cost/raw-material-cost.html b/brewman/static/src/app/raw-material-cost/raw-material-cost.html deleted file mode 100644 index 2ea8da71..00000000 --- a/brewman/static/src/app/raw-material-cost/raw-material-cost.html +++ /dev/null @@ -1,57 +0,0 @@ -
-

Raw Material Cost

- -
- - -
-
- - - - -
-
-
-
- - - - -
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
Cost CentreIssueSaleRmc
{{item.Name}}{{item.Issue | currency}}{{item.Sale | currency}}{{item.Rmc | percent}}
{{item.Name}}{{item.Issue | currency}}{{item.Sale | currency}}{{item.Rmc | percent}}
-
diff --git a/brewman/static/src/app/raw-material-cost/raw-material-cost.resolver.js b/brewman/static/src/app/raw-material-cost/raw-material-cost.resolver.js deleted file mode 100644 index b6bb1d1e..00000000 --- a/brewman/static/src/app/raw-material-cost/raw-material-cost.resolver.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function RawMaterialCostResolver($route, RawMaterialCost) { - var id = $route.current.params.id, startDate = $route.current.params.StartDate, finishDate = $route.current.params.FinishDate; - if (angular.isUndefined(startDate) || angular.isUndefined(finishDate)) { - return RawMaterialCost.get({}).$promise; - } - else if (angular.isUndefined(id)) { - return RawMaterialCost.get({ StartDate: startDate, FinishDate: finishDate }).$promise; - } - else { - return RawMaterialCost.get({ id: id, StartDate: startDate, FinishDate: finishDate }).$promise; - } -} -exports.RawMaterialCostResolver = RawMaterialCostResolver; -//# sourceMappingURL=raw-material-cost.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/raw-material-cost/raw-material-cost.resolver.js.map b/brewman/static/src/app/raw-material-cost/raw-material-cost.resolver.js.map deleted file mode 100644 index 0f70f8c8..00000000 --- a/brewman/static/src/app/raw-material-cost/raw-material-cost.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"raw-material-cost.resolver.js","sourceRoot":"","sources":["raw-material-cost.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,iCAAwC,MAAM,EAAE,eAAe;IAC3D,IAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAC/B,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAC3C,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;IAElD,IAAI,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE;QACnE,OAAO,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;KAC3C;SAAM,IAAI,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;QAChC,OAAO,eAAe,CAAC,GAAG,CAAC,EAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAC,CAAC,CAAC,QAAQ,CAAC;KACvF;SAAM;QACH,OAAO,eAAe,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAC,CAAC,CAAC,QAAQ,CAAC;KAC/F;AACL,CAAC;AAZD,0DAYC"} \ No newline at end of file diff --git a/brewman/static/src/app/raw-material-cost/raw-material-cost.resolver.ts b/brewman/static/src/app/raw-material-cost/raw-material-cost.resolver.ts deleted file mode 100644 index 3f6e987b..00000000 --- a/brewman/static/src/app/raw-material-cost/raw-material-cost.resolver.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as angular from 'angular'; - -export function RawMaterialCostResolver($route, RawMaterialCost) { - const id = $route.current.params.id, - startDate = $route.current.params.StartDate, - finishDate = $route.current.params.FinishDate; - - if (angular.isUndefined(startDate) || angular.isUndefined(finishDate)) { - return RawMaterialCost.get({}).$promise; - } else if (angular.isUndefined(id)) { - return RawMaterialCost.get({StartDate: startDate, FinishDate: finishDate}).$promise; - } else { - return RawMaterialCost.get({id: id, StartDate: startDate, FinishDate: finishDate}).$promise; - } -} diff --git a/brewman/static/src/app/raw-material-cost/raw-material-cost.service.js b/brewman/static/src/app/raw-material-cost/raw-material-cost.service.js deleted file mode 100644 index f48da8ff..00000000 --- a/brewman/static/src/app/raw-material-cost/raw-material-cost.service.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function RawMaterialCost($resource) { - return $resource('/api/RawMaterialCost/:id'); -} -exports.RawMaterialCost = RawMaterialCost; -//# sourceMappingURL=raw-material-cost.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/raw-material-cost/raw-material-cost.service.js.map b/brewman/static/src/app/raw-material-cost/raw-material-cost.service.js.map deleted file mode 100644 index 24a392f2..00000000 --- a/brewman/static/src/app/raw-material-cost/raw-material-cost.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"raw-material-cost.service.js","sourceRoot":"","sources":["raw-material-cost.service.ts"],"names":[],"mappings":";;AAAA,yBAAgC,SAAS;IACrC,OAAO,SAAS,CAAC,0BAA0B,CAAC,CAAC;AACjD,CAAC;AAFD,0CAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/raw-material-cost/raw-material-cost.service.ts b/brewman/static/src/app/raw-material-cost/raw-material-cost.service.ts deleted file mode 100644 index 536bd6f3..00000000 --- a/brewman/static/src/app/raw-material-cost/raw-material-cost.service.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function RawMaterialCost($resource) { - return $resource('/api/RawMaterialCost/:id'); -} diff --git a/brewman/static/src/app/receipt/receipt-modal.controller.js b/brewman/static/src/app/receipt/receipt-modal.controller.js deleted file mode 100644 index 9ba60816..00000000 --- a/brewman/static/src/app/receipt/receipt-modal.controller.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var ReceiptModalController = /** @class */ (function () { - function ReceiptModalController($scope, $modalInstance, MathSolver, Account) { - this.$scope = $scope; - this.$modalInstance = $modalInstance; - this.MathSolver = MathSolver; - this.Account = Account; - this.edit = $scope.$resolve.edit; - } - ReceiptModalController.prototype.ok = function () { - this.edit.Amount = this.MathSolver(this.edit.Amount); - this.$modalInstance.close(this.edit); - }; - ReceiptModalController.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - ReceiptModalController.prototype.accounts = function ($viewValue) { - return this.Account.autocomplete({ term: $viewValue, count: 20 }).$promise; - }; - ReceiptModalController.$inject = ['$scope', '$uibModalInstance', 'MathSolver', 'Account']; - return ReceiptModalController; -}()); -exports.ReceiptModalController = ReceiptModalController; -//# sourceMappingURL=receipt-modal.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/receipt/receipt-modal.controller.js.map b/brewman/static/src/app/receipt/receipt-modal.controller.js.map deleted file mode 100644 index ebd54798..00000000 --- a/brewman/static/src/app/receipt/receipt-modal.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"receipt-modal.controller.js","sourceRoot":"","sources":["receipt-modal.controller.ts"],"names":[],"mappings":";;AAAA;IAII,gCAAmB,MAAM,EAAS,cAAc,EAAS,UAAU,EAAS,OAAO;QAAhE,WAAM,GAAN,MAAM,CAAA;QAAS,mBAAc,GAAd,cAAc,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QAAS,YAAO,GAAP,OAAO,CAAA;QAC/E,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;IACrC,CAAC;IAED,mCAAE,GAAF;QACI,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,uCAAM,GAAN;QACI,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED,yCAAQ,GAAR,UAAS,UAAU;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;IAC7E,CAAC;IAlBM,8BAAO,GAAG,CAAC,QAAQ,EAAE,mBAAmB,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;IAmB9E,6BAAC;CAAA,AApBD,IAoBC;AApBY,wDAAsB"} \ No newline at end of file diff --git a/brewman/static/src/app/receipt/receipt-modal.controller.ts b/brewman/static/src/app/receipt/receipt-modal.controller.ts deleted file mode 100644 index 9a7e1448..00000000 --- a/brewman/static/src/app/receipt/receipt-modal.controller.ts +++ /dev/null @@ -1,21 +0,0 @@ -export class ReceiptModalController { - static $inject = ['$scope', '$uibModalInstance', 'MathSolver', 'Account']; - edit:any; - - constructor(public $scope, public $modalInstance, public MathSolver, public Account) { - this.edit = $scope.$resolve.edit; - } - - ok() { - this.edit.Amount = this.MathSolver(this.edit.Amount); - this.$modalInstance.close(this.edit); - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - - accounts($viewValue) { - return this.Account.autocomplete({term: $viewValue, count: 20}).$promise; - } -} diff --git a/brewman/static/src/app/receipt/receipt-modal.html b/brewman/static/src/app/receipt/receipt-modal.html deleted file mode 100644 index d4c3a98c..00000000 --- a/brewman/static/src/app/receipt/receipt-modal.html +++ /dev/null @@ -1,27 +0,0 @@ - diff --git a/brewman/static/src/app/receipt/receipt-voucher.resolver.js b/brewman/static/src/app/receipt/receipt-voucher.resolver.js deleted file mode 100644 index 36f21391..00000000 --- a/brewman/static/src/app/receipt/receipt-voucher.resolver.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function ReceiptVoucherResolver($route, Voucher) { - var id = $route.current.params.id, account = $route.current.params.a; - if (angular.isUndefined(id)) { - var options = { type: 'Receipt' }; - if (!angular.isUndefined(account)) { - options['a'] = account; - } - return Voucher.get(options).$promise; - } - else { - return Voucher.get({ id: id }).$promise; - } -} -exports.ReceiptVoucherResolver = ReceiptVoucherResolver; -//# sourceMappingURL=receipt-voucher.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/receipt/receipt-voucher.resolver.js.map b/brewman/static/src/app/receipt/receipt-voucher.resolver.js.map deleted file mode 100644 index d5c533c2..00000000 --- a/brewman/static/src/app/receipt/receipt-voucher.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"receipt-voucher.resolver.js","sourceRoot":"","sources":["receipt-voucher.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,gCAAuC,MAAM,EAAE,OAAO;IAClD,IAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAC/B,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAEtC,IAAI,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;QACzB,IAAI,OAAO,GAAG,EAAC,IAAI,EAAE,SAAS,EAAC,CAAC;QAChC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE;YAC/B,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;SAC1B;QACD,OAAO,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;KACxC;SAAM;QACH,OAAO,OAAO,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;KACzC;AACL,CAAC;AAbD,wDAaC"} \ No newline at end of file diff --git a/brewman/static/src/app/receipt/receipt-voucher.resolver.ts b/brewman/static/src/app/receipt/receipt-voucher.resolver.ts deleted file mode 100644 index 94a2edb4..00000000 --- a/brewman/static/src/app/receipt/receipt-voucher.resolver.ts +++ /dev/null @@ -1,16 +0,0 @@ -import * as angular from 'angular'; - -export function ReceiptVoucherResolver($route, Voucher) { - const id = $route.current.params.id, - account = $route.current.params.a; - - if (angular.isUndefined(id)) { - let options = {type: 'Receipt'}; - if (!angular.isUndefined(account)) { - options['a'] = account; - } - return Voucher.get(options).$promise; - } else { - return Voucher.get({id: id}).$promise; - } -} diff --git a/brewman/static/src/app/receipt/receipt.component.js b/brewman/static/src/app/receipt/receipt.component.js deleted file mode 100644 index 804cbe77..00000000 --- a/brewman/static/src/app/receipt/receipt.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var receipt_controller_1 = require("./receipt.controller"); -exports.ReceiptComponent = { - templateUrl: '/app/receipt/receipt.html', - controller: receipt_controller_1.ReceiptController, - controllerAs: 'vm', -}; -//# sourceMappingURL=receipt.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/receipt/receipt.component.js.map b/brewman/static/src/app/receipt/receipt.component.js.map deleted file mode 100644 index 58dcc115..00000000 --- a/brewman/static/src/app/receipt/receipt.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"receipt.component.js","sourceRoot":"","sources":["receipt.component.ts"],"names":[],"mappings":";;AAAA,2DAAuD;AAE1C,QAAA,gBAAgB,GAAG;IAC5B,WAAW,EAAE,2BAA2B;IACxC,UAAU,EAAE,sCAAiB;IAC7B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/receipt/receipt.component.ts b/brewman/static/src/app/receipt/receipt.component.ts deleted file mode 100644 index dcb08ac4..00000000 --- a/brewman/static/src/app/receipt/receipt.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {ReceiptController} from "./receipt.controller"; - -export const ReceiptComponent = { - templateUrl: '/app/receipt/receipt.html', - controller: ReceiptController, - controllerAs: 'vm', -}; \ No newline at end of file diff --git a/brewman/static/src/app/receipt/receipt.controller.js b/brewman/static/src/app/receipt/receipt.controller.js deleted file mode 100644 index cbfa5b4c..00000000 --- a/brewman/static/src/app/receipt/receipt.controller.js +++ /dev/null @@ -1,219 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var _ = require("lodash"); -var receipt_modal_controller_1 = require("./receipt-modal.controller"); -var ReceiptController = /** @class */ (function () { - function ReceiptController($scope, $routeParams, $location, asDate, $modal, UploadedImageResizer, MathSolver, Voucher, Account, dateParser, Messages, Credentials) { - var _this = this; - this.$scope = $scope; - this.$routeParams = $routeParams; - this.$location = $location; - this.asDate = asDate; - this.$modal = $modal; - this.UploadedImageResizer = UploadedImageResizer; - this.MathSolver = MathSolver; - this.Voucher = Voucher; - this.Account = Account; - this.dateParser = dateParser; - this.Messages = Messages; - this.Credentials = Credentials; - this.voucher = $scope.$parent.res.voucher; - this.ledgers = $scope.$parent.res.ledgers; - this._voucher_Date = dateParser.parse(this.voucher.Date, "dd-MMM-yyyy"); - this.foAccount = true; - $scope.$on("fileSelected", function (event, args) { - UploadedImageResizer(args, _this.voucher.Files); - }); - $scope.$watch('vm.voucher.Journals', function (journals, oldValue) { - var amount = _.chain(journals) - .filter({ 'Debit': -1 }) - .reduce(function (sum, item) { - return item.Amount + sum; - }, 0).value(); - var j = _.find(journals, { 'Debit': 1 }); - j.Amount = amount; - if (_.find(oldValue, { 'Debit': 1 }).Ledger.LedgerID !== j.Ledger.LedgerID) { - $location.search({ a: j.Ledger.LedgerID }).replace(); - } - }, true); - $scope.$watch('vm.account', function (account) { - if (!account) { - delete _this.accBal; - } - else { - Account.balance({ id: account.LedgerID, d: _this.voucher.Date }, function (bal) { - _this.accBal = bal; - }); - } - }, true); - } - ReceiptController.prototype.voucher_Date = function (value) { - if (arguments.length) { - this.voucher.Date = this.asDate(value); - this._voucher_Date = value; - } - return this._voucher_Date; - }; - ReceiptController.prototype.getOld = function (ledgerID, journals) { - return _.find(journals, function (journal) { - return journal.Ledger.LedgerID === ledgerID; - }); - }; - ReceiptController.prototype.deleteFile = function (item) { - var index = this.voucher.Files.indexOf(item); - this.voucher.Files.splice(index, 1); - }; - ReceiptController.prototype.zoomImage = function (item) { - this.$modal.open({ - templateUrl: '/template/modal/image.html', - controller: ['$uibModalInstance', /** @class */ (function () { - function class_1($modalInstance) { - this.$modalInstance = $modalInstance; - this.imageUrl = item.Resized; - this.size = null; - } - class_1.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - return class_1; - }())] - }); - }; - ReceiptController.prototype.add = function () { - var amount, oldJournal; - if (!this.account || !this.account.LedgerID) { - return; - } - amount = this.MathSolver(this.amount); - if (Number.isNaN(amount) || amount <= 0) { - return; - } - oldJournal = this.getOld(this.account.LedgerID, this.voucher.Journals); - if (angular.isUndefined(oldJournal)) { - this.voucher.Journals.push({ Debit: -1, Amount: amount, Ledger: this.account }); - } - else { - if (oldJournal.Debit === -1) { - oldJournal.Amount += amount; - } - else { - return; - } - } - delete this.account; - delete this.amount; - this.foAccount = true; - }; - ReceiptController.prototype.removeJournal = function (journal) { - var index = this.voucher.Journals.indexOf(journal); - this.voucher.Journals.splice(index, 1); - }; - ReceiptController.prototype.preventAlteration = function (voucher) { - if (angular.isUndefined(this.Credentials.Perms)) { - return false; - } - else if (angular.isUndefined(voucher.VoucherID)) { - return !this.Credentials.Perms['Receipt']; - } - else if (voucher.Posted && !this.Credentials.Perms['Edit Posted Vouchers']) { - return true; - } - else if (voucher.User.UserID != this.Credentials.Auth.UserID && !this.Credentials.Perms["Edit Other User's Vouchers"]) { - return true; - } - else { - return false; - } - }; - ReceiptController.prototype.save = function () { - var _this = this; - return this.voucher.$save({ type: 'Receipt' }, function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/Receipt/' + u.VoucherID); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - ReceiptController.prototype.delete = function () { - var _this = this; - this.voucher.$delete(function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/Receipt').replace(); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - ReceiptController.prototype.post = function () { - var _this = this; - return this.voucher.$post(function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - ReceiptController.prototype.modal = function (journal) { - var _this = this; - this.selectedJournal = journal; - var edit = {}; - angular.copy(this.selectedJournal, edit); - var modalInstance = this.$modal.open({ - backdrop: true, - size: 'lg', - templateUrl: '/app/receipt/receipt-modal.html', - controllerAs: 'vmModal', - controller: receipt_modal_controller_1.ReceiptModalController, - resolve: { - edit: function () { - return edit; - } - } - }); - modalInstance.result.then(function (updated) { - if (updated.Ledger.LedgerID !== _this.selectedJournal.Ledger.LedgerID) { - var oldJournal = _this.getOld(updated.Ledger.LedgerID, _this.voucher.Journals); - if (!angular.isUndefined(oldJournal)) { - delete _this.selectedJournal; - return false; - } - } - angular.copy(updated, _this.selectedJournal); - delete _this.selectedJournal; - }, function () { - delete _this.selectedJournal; - }); - }; - ReceiptController.prototype.confirm = function () { - var _this = this; - var modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', /** @class */ (function () { - function class_2($modalInstance) { - this.$modalInstance = $modalInstance; - this.title = "Delete Voucher"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - class_2.prototype.ok = function () { - this.$modalInstance.close(); - }; - class_2.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - return class_2; - }())] - }); - modalInstance.result.then(function () { - _this.delete(); - }); - }; - ReceiptController.prototype.accounts = function ($viewValue) { - return this.Account.autocomplete({ term: $viewValue, count: 20, 'a': true }).$promise; - }; - ReceiptController.$inject = ['$scope', '$routeParams', '$location', 'asDateFilter', '$uibModal', 'UploadedImageResizer', 'MathSolver', 'Voucher', 'Account', 'uibDateParser', 'Messages', 'Credentials']; - return ReceiptController; -}()); -exports.ReceiptController = ReceiptController; -//# sourceMappingURL=receipt.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/receipt/receipt.controller.js.map b/brewman/static/src/app/receipt/receipt.controller.js.map deleted file mode 100644 index 0f972179..00000000 --- a/brewman/static/src/app/receipt/receipt.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"receipt.controller.js","sourceRoot":"","sources":["receipt.controller.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AACnC,0BAA4B;AAC5B,uEAAkE;AAElE;IAWI,2BAAmB,MAAM,EAAS,YAAY,EAAS,SAAS,EAAS,MAAM,EAAS,MAAM,EAAS,oBAAoB,EAAS,UAAU,EAAS,OAAO,EAAS,OAAO,EAAS,UAAU,EAAS,QAAQ,EAAS,WAAW;QAAtO,iBAiCC;QAjCkB,WAAM,GAAN,MAAM,CAAA;QAAS,iBAAY,GAAZ,YAAY,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,yBAAoB,GAApB,oBAAoB,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QAAS,YAAO,GAAP,OAAO,CAAA;QAAS,YAAO,GAAP,OAAO,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QAAS,aAAQ,GAAR,QAAQ,CAAA;QAAS,gBAAW,GAAX,WAAW,CAAA;QAClO,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;QAC1C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;QAC1C,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QACxE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QAEtB,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,UAAC,KAAK,EAAE,IAAI;YACnC,oBAAoB,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QACH,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC;YACtB,KAAI,CAAC,MAAM,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACP,CAAC;IAED,oCAAQ,GAAR,UAAS,UAAU;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAC,CAAC,CAAC,QAAQ,CAAC;IACxF,CAAC;IAxNM,yBAAO,GAAG,CAAC,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,sBAAsB,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;IAyNlM,wBAAC;CAAA,AA1ND,IA0NC;AA1NY,8CAAiB"} \ No newline at end of file diff --git a/brewman/static/src/app/receipt/receipt.controller.ts b/brewman/static/src/app/receipt/receipt.controller.ts deleted file mode 100644 index f036107f..00000000 --- a/brewman/static/src/app/receipt/receipt.controller.ts +++ /dev/null @@ -1,223 +0,0 @@ -import * as angular from 'angular'; -import * as _ from 'lodash'; -import {ReceiptModalController} from './receipt-modal.controller'; - -export class ReceiptController { - static $inject = ['$scope', '$routeParams', '$location', 'asDateFilter', '$uibModal', 'UploadedImageResizer', 'MathSolver', 'Voucher', 'Account', 'uibDateParser', 'Messages', 'Credentials']; - _voucher_Date: any; - foAccount: any; - selectedJournal: any; - accBal: any; - account: any; - amount: any; - voucher: any; - ledgers: any; - - constructor(public $scope, public $routeParams, public $location, public asDate, public $modal, public UploadedImageResizer, public MathSolver, public Voucher, public Account, public dateParser, public Messages, public Credentials) { - this.voucher = $scope.$parent.res.voucher; - this.ledgers = $scope.$parent.res.ledgers; - this._voucher_Date = dateParser.parse(this.voucher.Date, "dd-MMM-yyyy"); - this.foAccount = true; - - $scope.$on("fileSelected", (event, args) => { - UploadedImageResizer(args, this.voucher.Files); - }); - $scope.$watch('vm.voucher.Journals', function (journals, oldValue) { - const amount = _.chain(journals) - .filter({'Debit': -1}) - .reduce(function (sum, item) { - return item.Amount + sum; - }, 0).value(); - - let j = _.find(journals, {'Debit': 1}); - j.Amount = amount; - if (_.find(oldValue, {'Debit': 1}).Ledger.LedgerID !== j.Ledger.LedgerID) { - $location.search({a: j.Ledger.LedgerID}).replace(); - } - }, true); - - $scope.$watch('vm.account', (account) => { - if (!account) { - delete this.accBal; - } - else { - Account.balance({id: account.LedgerID, d: this.voucher.Date}, (bal) => { - this.accBal = bal; - }); - } - }, true); - } - - voucher_Date(value) { - if (arguments.length) { - this.voucher.Date = this.asDate(value); - this._voucher_Date = value; - } - return this._voucher_Date; - } - - getOld(ledgerID, journals) { - return _.find(journals, function (journal) { - return journal.Ledger.LedgerID === ledgerID; - }); - } - - deleteFile(item) { - const index = this.voucher.Files.indexOf(item); - this.voucher.Files.splice(index, 1); - } - - zoomImage(item) { - this.$modal.open({ - templateUrl: '/template/modal/image.html', - controller: ['$uibModalInstance', class { - imageUrl: any; - size: any; - - constructor(public $modalInstance) { - this.imageUrl = item.Resized; - this.size = null; - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - }] - }); - } - - add() { - let amount, - oldJournal; - if (!this.account || !this.account.LedgerID) { - return; - } - amount = this.MathSolver(this.amount); - if (Number.isNaN(amount) || amount <= 0) { - return; - } - oldJournal = this.getOld(this.account.LedgerID, this.voucher.Journals); - if (angular.isUndefined(oldJournal)) { - this.voucher.Journals.push({Debit: -1, Amount: amount, Ledger: this.account}); - } else { - if (oldJournal.Debit === -1) { - oldJournal.Amount += amount; - } else { - return; - } - } - delete this.account; - delete this.amount; - this.foAccount = true; - } - - removeJournal(journal) { - const index = this.voucher.Journals.indexOf(journal); - this.voucher.Journals.splice(index, 1); - } - - preventAlteration(voucher) { - if (angular.isUndefined(this.Credentials.Perms)) { - return false; - } else if (angular.isUndefined(voucher.VoucherID)) { - return !this.Credentials.Perms['Receipt']; - } else if (voucher.Posted && !this.Credentials.Perms['Edit Posted Vouchers']) { - return true; - } else if (voucher.User.UserID != this.Credentials.Auth.UserID && !this.Credentials.Perms["Edit Other User's Vouchers"]) { - return true; - } else { - return false; - } - } - - save() { - return this.voucher.$save({type: 'Receipt'}, (u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/Receipt/' + u.VoucherID); - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - delete() { - this.voucher.$delete((u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/Receipt').replace(); - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - post() { - return this.voucher.$post((u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - modal(journal) { - this.selectedJournal = journal; - let edit = {}; - angular.copy(this.selectedJournal, edit); - const modalInstance = this.$modal.open({ - backdrop: true, - size: 'lg', - templateUrl: '/app/receipt/receipt-modal.html', - controllerAs: 'vmModal', - controller: ReceiptModalController, - resolve: { - edit: function () { - return edit; - } - } - }); - modalInstance.result.then((updated) => { - if (updated.Ledger.LedgerID !== this.selectedJournal.Ledger.LedgerID) { - let oldJournal = this.getOld(updated.Ledger.LedgerID, this.voucher.Journals); - if (!angular.isUndefined(oldJournal)) { - delete this.selectedJournal; - return false; - } - } - angular.copy(updated, this.selectedJournal); - delete this.selectedJournal; - }, () => { - delete this.selectedJournal; - }); - } - - confirm() { - const modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', class { - title: any; - body: any; - isDelete: boolean; - - constructor(public $modalInstance) { - this.title = "Delete Voucher"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - - ok() { - this.$modalInstance.close(); - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - }] - }); - modalInstance.result.then(() => { - this.delete(); - }); - } - - accounts($viewValue) { - return this.Account.autocomplete({term: $viewValue, count: 20, 'a': true}).$promise; - } -} diff --git a/brewman/static/src/app/receipt/receipt.html b/brewman/static/src/app/receipt/receipt.html deleted file mode 100644 index a0aaefc3..00000000 --- a/brewman/static/src/app/receipt/receipt.html +++ /dev/null @@ -1,117 +0,0 @@ -
-

Receipt Edit / New

- -
- - -
-
- - - - -
-
- -
-
- ₹ -
-
-
- -
- - -
- - -

Balance as on Date: {{vm.accBal.Date | accounting}} / {{vm.accBal.Total - | accounting}}

-
-
-
- ₹ - - - - -
-
-
- - - - - - - - - - - - - - - - - -
NameAmountDelete
{{journal.Ledger.Name}}{{journal.Amount | currency}} -
- Delete - - -
-
-
- - -
- -
-
-
-
-
- - -
- - -
-
-
-
- - - -
-
-
- Created on {{vm.voucher.CreationDate | localTime}} and Last Edited on {{vm.voucher.LastEditDate | localTime}} - by {{vm.voucher.User.Name}}. Posted by {{vm.voucher.Poster}} - -
-
diff --git a/brewman/static/src/app/recipe/recipe-detail.html b/brewman/static/src/app/recipe/recipe-detail.html deleted file mode 100644 index 0529ffde..00000000 --- a/brewman/static/src/app/recipe/recipe-detail.html +++ /dev/null @@ -1,102 +0,0 @@ -
-

Recipe Detail

- -
- - - {{item.Name}} - - - No matches found. - - - - - - - - - Product's Sale Price {{vm.recipe.Product.SalePrice}}, Recipe's Sale Price {{vm.recipe.SalePrice}}, - - - - - - - - -
-
- - -
-
- - - {{item.Name}} - - - No matches found. - - - - - - - - - - - - - Yield {{vm.product.ProductYield * 100 | number:2}}% - - - - Add - -
- - - - - - - - - - - - - - - - - - - - - -
IngredientQuantityUnitsRateAmount
{{item.Product.Name}}{{item.Quantity | number:2}}{{item.Product.FractionUnits}}₹ {{item.Price}} / {{item.Product.Units}} of {{item.Product.Fraction}} - {{vm.product.FractionUnits}} - - Yield {{item.Product.ProductYield * 100 | number:2}}% - - {{item.Quantity * (item.Price / (item.Product.Fraction * - item.Product.ProductYield)) | currency}} - - -
-
- Save - Delete -
-
diff --git a/brewman/static/src/app/recipe/recipe-list.html b/brewman/static/src/app/recipe/recipe-list.html deleted file mode 100644 index 30cd8960..00000000 --- a/brewman/static/src/app/recipe/recipe-list.html +++ /dev/null @@ -1,52 +0,0 @@ -

Recipes

-
- - - - - Add - -
-
-
- - -
-
- - -
- - - - {{pg}} - - -
- - - - - - - - - - - - - - - - - - - - - - - -
NameTypeValid FromValid ToCost PriceSale PriceCosting
{{items.Name}}{{items.ProductGroup}}{{item.ValidFrom}}{{item.ValidTo}}{{item.CostPrice | currency}}{{item.SalePrice | currency}}{{item.Costing | percent}}
diff --git a/brewman/static/src/app/recipe/recipe.service.js b/brewman/static/src/app/recipe/recipe.service.js deleted file mode 100644 index 0bcc5ce9..00000000 --- a/brewman/static/src/app/recipe/recipe.service.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function Recipe($resource) { - return $resource('/api/Recipe/:id', { id: '@RecipeID' }, { - query: { method: 'GET', params: { list: true }, isArray: true } - }); -} -exports.Recipe = Recipe; -//# sourceMappingURL=recipe.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/recipe/recipe.service.js.map b/brewman/static/src/app/recipe/recipe.service.js.map deleted file mode 100644 index 2545a2d3..00000000 --- a/brewman/static/src/app/recipe/recipe.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"recipe.service.js","sourceRoot":"","sources":["recipe.service.ts"],"names":[],"mappings":";;AAAA,gBAAuB,SAAS;IAC5B,OAAO,SAAS,CAAC,iBAAiB,EAC9B,EAAC,EAAE,EAAE,WAAW,EAAC,EAAE;QACf,KAAK,EAAE,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,EAAE,OAAO,EAAE,IAAI,EAAC;KAC9D,CAAC,CAAC;AACX,CAAC;AALD,wBAKC"} \ No newline at end of file diff --git a/brewman/static/src/app/recipe/recipe.service.ts b/brewman/static/src/app/recipe/recipe.service.ts deleted file mode 100644 index 3ceb7cd0..00000000 --- a/brewman/static/src/app/recipe/recipe.service.ts +++ /dev/null @@ -1,6 +0,0 @@ -export function Recipe($resource) { - return $resource('/api/Recipe/:id', - {id: '@RecipeID'}, { - query: {method: 'GET', params: {list: true}, isArray: true} - }); -} diff --git a/brewman/static/src/app/reconcile/reconcile.component.js b/brewman/static/src/app/reconcile/reconcile.component.js deleted file mode 100644 index 31f7bd33..00000000 --- a/brewman/static/src/app/reconcile/reconcile.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var reconcile_controller_1 = require("./reconcile.controller"); -exports.ReconcileComponent = { - templateUrl: '/app/reconcile/reconcile.html', - controller: reconcile_controller_1.ReconcileController, - controllerAs: 'vm', -}; -//# sourceMappingURL=reconcile.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/reconcile/reconcile.component.js.map b/brewman/static/src/app/reconcile/reconcile.component.js.map deleted file mode 100644 index 09a03dae..00000000 --- a/brewman/static/src/app/reconcile/reconcile.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"reconcile.component.js","sourceRoot":"","sources":["reconcile.component.ts"],"names":[],"mappings":";;AAAA,+DAA2D;AAE9C,QAAA,kBAAkB,GAAG;IAC9B,WAAW,EAAE,+BAA+B;IAC5C,UAAU,EAAE,0CAAmB;IAC/B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/reconcile/reconcile.component.ts b/brewman/static/src/app/reconcile/reconcile.component.ts deleted file mode 100644 index 64ab838c..00000000 --- a/brewman/static/src/app/reconcile/reconcile.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {ReconcileController} from "./reconcile.controller"; - -export const ReconcileComponent = { - templateUrl: '/app/reconcile/reconcile.html', - controller: ReconcileController, - controllerAs: 'vm', -}; \ No newline at end of file diff --git a/brewman/static/src/app/reconcile/reconcile.controller.js b/brewman/static/src/app/reconcile/reconcile.controller.js deleted file mode 100644 index a7314b7c..00000000 --- a/brewman/static/src/app/reconcile/reconcile.controller.js +++ /dev/null @@ -1,148 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var _ = require("lodash"); -var $ = require("jquery"); -var moment = require("moment"); -var ReconcileController = /** @class */ (function () { - function ReconcileController($scope, $routeParams, $location, asDate, Reconcile, Account, dateParser, Messages) { - var _this = this; - this.$scope = $scope; - this.$routeParams = $routeParams; - this.$location = $location; - this.asDate = asDate; - this.Reconcile = Reconcile; - this.Account = Account; - this.dateParser = dateParser; - this.Messages = Messages; - this.reconcile = $scope.$parent.res.reconcile; - this._info_StartDate = dateParser.parse(this.reconcile.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.reconcile.FinishDate, "dd-MMM-yyyy"); - this.info = this.reconcile; - if ($routeParams.id) { - this.foGrid = true; - } - else { - this.foLedger = true; - } - this.selected = -1; - this.doFilter(); - this.shortcuts = { - 'up': function (e) { - if (_this.selected > 0) { - $scope.$apply(function () { - _this.selected = Math.min(Math.max(0, _this.selected - 1), _this.body.length - 1); - }); - $("#" + _this.selected).scrollintoview(); - e.preventDefault(); - } - }, - 'down': function (e) { - if (_this.selected < _this.info.Body.length - 1) { - $scope.$apply(function () { - _this.selected = Math.min(Math.max(0, _this.selected + 1), _this.body.length - 1); - }); - $("#" + _this.selected).scrollintoview(); - e.preventDefault(); - } - }, - 'enter': function (e) { - var path = _this.body[_this.selected].Url.replace(/^(?:\/\/|[^\/]+)*/, ""); - $scope.$apply(function () { - _this.$location.path(path).search('StartDate', null).search('FinishDate', null); - }); - e.preventDefault(); - } - }; - } - ReconcileController.prototype.info_StartDate = function (value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - }; - ReconcileController.prototype.info_FinishDate = function (value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - }; - ReconcileController.prototype.show = function () { - var _this = this; - var id = this.info.Account.LedgerID; - if (id === this.$routeParams.id && this.info.StartDate === this.$routeParams.StartDate && this.info.FinishDate === this.$routeParams.FinishDate) { - this.Reconcile.get({ - id: id, - StartDate: this.info.StartDate, - FinishDate: this.info.FinishDate - }, function (data) { - _this.info = data; - }); - } - else { - this.$location.path('/Reconcile/' + id).search('StartDate', this.info.StartDate).search('FinishDate', this.info.FinishDate); - } - }; - ReconcileController.prototype.save = function () { - var _this = this; - var i, len = this.body.length; - this.info.Body = this.body; - this.info.$save({ - StartDate: this.$routeParams.StartDate, - FinishDate: this.$routeParams.FinishDate - }, function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.info = u; - _this.doFilter(); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - ReconcileController.prototype.downloadTable = function () { - var table = $('#gvGrid'), html = table.clone().wrap('
').parent().html(); - html = html.replace(/á/g, 'á'); - window.open('data:application/vnd.ms-excel;charset=UTF-8,' + encodeURIComponent(html)); - }; - ReconcileController.prototype.setSelected = function (index) { - this.selected = index; - }; - ReconcileController.prototype.doFilter = function () { - var data = angular.copy(this.info.Body), debit = 0, credit = 0, running = 0; - data = data.sort(function (a, b) { - if (a.IsReconciled !== b.IsReconciled) { - return b.IsReconciled - a.IsReconciled; - } - var aDate = moment(a.ReconcileDate, 'DD-MMM-YYYY'); - var bDate = moment(b.ReconcileDate, 'DD-MMM-YYYY'); - return aDate - bDate; - }); - _.forEach(data, function (item) { - if (item.Type !== 'Opening Balance') { - debit += item.Debit; - credit += item.Credit; - if (item.IsReconciled) { - running += item.Debit - item.Credit; - } - } - else { - running += item.Debit - item.Credit; - } - item.Running = running; - }); - this.body = data; - this.footer = { - Debit: debit, - Credit: credit, - Running: running - }; - }; - ReconcileController.prototype.accounts = function ($viewValue) { - return this.Account.autocomplete({ term: $viewValue, count: 20, r: true }).$promise; - }; - ReconcileController.$inject = ['$scope', '$routeParams', '$location', 'asDateFilter', 'Reconcile', 'Account', 'uibDateParser', 'Messages']; - return ReconcileController; -}()); -exports.ReconcileController = ReconcileController; -//# sourceMappingURL=reconcile.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/reconcile/reconcile.controller.js.map b/brewman/static/src/app/reconcile/reconcile.controller.js.map deleted file mode 100644 index 9d211c2f..00000000 --- a/brewman/static/src/app/reconcile/reconcile.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"reconcile.controller.js","sourceRoot":"","sources":["reconcile.controller.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AACnC,0BAA4B;AAC5B,0BAA4B;AAC5B,+BAAiC;AAEjC;IAaI,6BAAmB,MAAM,EAAS,YAAY,EAAS,SAAS,EAAS,MAAM,EAAS,SAAS,EAAS,OAAO,EAAS,UAAU,EAAS,QAAQ;QAArJ,iBA0CC;QA1CkB,WAAM,GAAN,MAAM,CAAA;QAAS,iBAAY,GAAZ,YAAY,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,YAAO,GAAP,OAAO,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QAAS,aAAQ,GAAR,QAAQ,CAAA;QACjJ,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;QAC9C,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;QAChF,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;QACnF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC;QAC3B,IAAI,YAAY,CAAC,EAAE,EAAE;YACjB,IAAI,C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I,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;iBACvC;aACJ;iBAAM;gBACH,OAAO,IAAI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;aACvC;YACD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAC3B,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG;YACV,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,OAAO;SACnB,CAAA;IACL,CAAC;IAED,sCAAQ,GAAR,UAAS,UAAU;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAC,CAAC,CAAC,QAAQ,CAAC;IACtF,CAAC;IArJM,2BAAO,GAAG,CAAC,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;IAsJlI,0BAAC;CAAA,AAvJD,IAuJC;AAvJY,kDAAmB"} \ No newline at end of file diff --git a/brewman/static/src/app/reconcile/reconcile.controller.ts b/brewman/static/src/app/reconcile/reconcile.controller.ts deleted file mode 100644 index 393b5e9f..00000000 --- a/brewman/static/src/app/reconcile/reconcile.controller.ts +++ /dev/null @@ -1,157 +0,0 @@ -import * as angular from 'angular'; -import * as _ from 'lodash'; -import * as $ from 'jquery'; -import * as moment from 'moment'; - -export class ReconcileController { - static $inject = ['$scope', '$routeParams', '$location', 'asDateFilter', 'Reconcile', 'Account', 'uibDateParser', 'Messages']; - _info_StartDate: any; - _info_FinishDate: any; - info: any; - foGrid: any; - foLedger: any; - selected: any; - body: any; - footer: any; - shortcuts: any; - reconcile: any; - - constructor(public $scope, public $routeParams, public $location, public asDate, public Reconcile, public Account, public dateParser, public Messages) { - this.reconcile = $scope.$parent.res.reconcile; - this._info_StartDate = dateParser.parse(this.reconcile.StartDate, "dd-MMM-yyyy") - this._info_FinishDate = dateParser.parse(this.reconcile.FinishDate, "dd-MMM-yyyy"); - this.info = this.reconcile; - if ($routeParams.id) { - this.foGrid = true; - } else { - this.foLedger = true; - } - - this.selected = -1; - - this.doFilter(); - - this.shortcuts = { - 'up': (e) => { - if (this.selected > 0) { - $scope.$apply(() => { - this.selected = Math.min(Math.max(0, this.selected - 1), this.body.length - 1); - }); - $("#" + this.selected).scrollintoview(); - e.preventDefault(); - } - }, - 'down': (e) => { - if (this.selected < this.info.Body.length - 1) { - $scope.$apply(() => { - this.selected = Math.min(Math.max(0, this.selected + 1), this.body.length - 1); - }); - $("#" + this.selected).scrollintoview(); - e.preventDefault(); - } - }, - 'enter': (e) => { - const path = this.body[this.selected].Url.replace(/^(?:\/\/|[^\/]+)*/, ""); - $scope.$apply(() => { - this.$location.path(path).search('StartDate', null).search('FinishDate', null); - }); - e.preventDefault(); - } - }; - } - - info_StartDate(value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - } - - info_FinishDate(value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - } - - show() { - const id = this.info.Account.LedgerID; - if (id === this.$routeParams.id && this.info.StartDate === this.$routeParams.StartDate && this.info.FinishDate === this.$routeParams.FinishDate) { - this.Reconcile.get({ - id: id, - StartDate: this.info.StartDate, - FinishDate: this.info.FinishDate - }, (data) => { - this.info = data; - }); - } else { - this.$location.path('/Reconcile/' + id).search('StartDate', this.info.StartDate).search('FinishDate', this.info.FinishDate); - } - } - - save() { - let i, - len = this.body.length; - this.info.Body = this.body; - this.info.$save({ - StartDate: this.$routeParams.StartDate, - FinishDate: this.$routeParams.FinishDate - }, (u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - this.info = u; - this.doFilter(); - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - downloadTable() { - let table = $('#gvGrid'), - html = table.clone().wrap('
').parent().html(); - html = html.replace(/á/g, 'á'); - window.open('data:application/vnd.ms-excel;charset=UTF-8,' + encodeURIComponent(html)); - } - - setSelected(index) { - this.selected = index; - } - - doFilter() { - let data = angular.copy(this.info.Body), - debit = 0, credit = 0, running = 0; - - data = data.sort(function (a, b) { - if (a.IsReconciled !== b.IsReconciled) { - return b.IsReconciled - a.IsReconciled; - } - const aDate: any = moment(a.ReconcileDate, 'DD-MMM-YYYY'); - const bDate: any = moment(b.ReconcileDate, 'DD-MMM-YYYY'); - return aDate - bDate; - }); - - _.forEach(data, function (item) { - if (item.Type !== 'Opening Balance') { - debit += item.Debit; - credit += item.Credit; - if (item.IsReconciled) { - running += item.Debit - item.Credit; - } - } else { - running += item.Debit - item.Credit; - } - item.Running = running; - }); - this.body = data; - this.footer = { - Debit: debit, - Credit: credit, - Running: running - } - } - - accounts($viewValue) { - return this.Account.autocomplete({term: $viewValue, count: 20, r: true}).$promise; - } -} diff --git a/brewman/static/src/app/reconcile/reconcile.html b/brewman/static/src/app/reconcile/reconcile.html deleted file mode 100644 index a8003b6c..00000000 --- a/brewman/static/src/app/reconcile/reconcile.html +++ /dev/null @@ -1,102 +0,0 @@ -
-

Reconciliation

- -
- - -
-
- - - - -
-
-
-
- - - - -
-
-
-
- - -
-
- - - - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DateParticularsDebitCreditRunningReconcile Date
{{item.Date}}{{item.Name}}{{item.Debit | currency | clr}}{{item.Credit | currency | clr}}{{item.Running | accounting}} -
- - - - - - - -
-
-
-

{{item.Narration}}

- {{item.Type}} -
-
{{vm.footer.Debit | currency}}{{vm.footer.Credit | currency}}{{vm.footer.Running | accounting}}
-
-
- - -
-
-
diff --git a/brewman/static/src/app/reconcile/reconcile.resolver.js b/brewman/static/src/app/reconcile/reconcile.resolver.js deleted file mode 100644 index 71568234..00000000 --- a/brewman/static/src/app/reconcile/reconcile.resolver.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function ReconcileResolver($route, Reconcile) { - var id = $route.current.params.id, startDate = $route.current.params.StartDate, finishDate = $route.current.params.FinishDate; - if (angular.isUndefined(id)) { - return Reconcile.get({}).$promise; - } - else { - return Reconcile.get({ id: id, StartDate: startDate, FinishDate: finishDate }).$promise; - } -} -exports.ReconcileResolver = ReconcileResolver; -//# sourceMappingURL=reconcile.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/reconcile/reconcile.resolver.js.map b/brewman/static/src/app/reconcile/reconcile.resolver.js.map deleted file mode 100644 index c3c83dd8..00000000 --- a/brewman/static/src/app/reconcile/reconcile.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"reconcile.resolver.js","sourceRoot":"","sources":["reconcile.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,2BAAkC,MAAM,EAAE,SAAS;IAC/C,IAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAC/B,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAC3C,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;IAElD,IAAI,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;QACzB,OAAO,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;KACrC;SAAM;QACH,OAAO,SAAS,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAC,CAAC,CAAC,QAAQ,CAAC;KACzF;AACL,CAAC;AAVD,8CAUC"} \ No newline at end of file diff --git a/brewman/static/src/app/reconcile/reconcile.resolver.ts b/brewman/static/src/app/reconcile/reconcile.resolver.ts deleted file mode 100644 index f9c4d7a3..00000000 --- a/brewman/static/src/app/reconcile/reconcile.resolver.ts +++ /dev/null @@ -1,13 +0,0 @@ -import * as angular from 'angular'; - -export function ReconcileResolver($route, Reconcile) { - const id = $route.current.params.id, - startDate = $route.current.params.StartDate, - finishDate = $route.current.params.FinishDate; - - if (angular.isUndefined(id)) { - return Reconcile.get({}).$promise; - } else { - return Reconcile.get({id: id, StartDate: startDate, FinishDate: finishDate}).$promise; - } -} diff --git a/brewman/static/src/app/reconcile/reconcile.service.js b/brewman/static/src/app/reconcile/reconcile.service.js deleted file mode 100644 index 9d739a54..00000000 --- a/brewman/static/src/app/reconcile/reconcile.service.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function Reconcile($resource) { - return $resource('/api/Reconcile/:id', { id: '@Account.LedgerID' }); -} -exports.Reconcile = Reconcile; -//# sourceMappingURL=reconcile.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/reconcile/reconcile.service.js.map b/brewman/static/src/app/reconcile/reconcile.service.js.map deleted file mode 100644 index 7e16e041..00000000 --- a/brewman/static/src/app/reconcile/reconcile.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"reconcile.service.js","sourceRoot":"","sources":["reconcile.service.ts"],"names":[],"mappings":";;AAAA,mBAA0B,SAAS;IAC/B,OAAO,SAAS,CAAC,oBAAoB,EAAE,EAAC,EAAE,EAAE,mBAAmB,EAAC,CAAC,CAAC;AACtE,CAAC;AAFD,8BAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/reconcile/reconcile.service.ts b/brewman/static/src/app/reconcile/reconcile.service.ts deleted file mode 100644 index 51fbc92d..00000000 --- a/brewman/static/src/app/reconcile/reconcile.service.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function Reconcile($resource) { - return $resource('/api/Reconcile/:id', {id: '@Account.LedgerID'}); -} diff --git a/brewman/static/src/app/salary-deduction/salary-deduction-voucher.resolver.js b/brewman/static/src/app/salary-deduction/salary-deduction-voucher.resolver.js deleted file mode 100644 index 88f82159..00000000 --- a/brewman/static/src/app/salary-deduction/salary-deduction-voucher.resolver.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function SalaryDeductionVoucherResolver($route, Voucher) { - var id = $route.current.params.id; - if (angular.isUndefined(id)) { - return Voucher.get({ type: 'Salary Deduction' }).$promise; - } - else { - return Voucher.get({ id: id }).$promise; - } -} -exports.SalaryDeductionVoucherResolver = SalaryDeductionVoucherResolver; -//# sourceMappingURL=salary-deduction-voucher.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/salary-deduction/salary-deduction-voucher.resolver.js.map b/brewman/static/src/app/salary-deduction/salary-deduction-voucher.resolver.js.map deleted file mode 100644 index 0b5be90a..00000000 --- a/brewman/static/src/app/salary-deduction/salary-deduction-voucher.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"salary-deduction-voucher.resolver.js","sourceRoot":"","sources":["salary-deduction-voucher.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,wCAA+C,MAAM,EAAE,OAAO;IAC1D,IAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IAEpC,IAAI,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;QACzB,OAAO,OAAO,CAAC,GAAG,CAAC,EAAC,IAAI,EAAE,kBAAkB,EAAC,CAAC,CAAC,QAAQ,CAAC;KAC3D;SAAM;QACH,OAAO,OAAO,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;KACzC;AACL,CAAC;AARD,wEAQC"} \ No newline at end of file diff --git a/brewman/static/src/app/salary-deduction/salary-deduction-voucher.resolver.ts b/brewman/static/src/app/salary-deduction/salary-deduction-voucher.resolver.ts deleted file mode 100644 index 70ccfe01..00000000 --- a/brewman/static/src/app/salary-deduction/salary-deduction-voucher.resolver.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as angular from 'angular'; - -export function SalaryDeductionVoucherResolver($route, Voucher) { - const id = $route.current.params.id; - - if (angular.isUndefined(id)) { - return Voucher.get({type: 'Salary Deduction'}).$promise; - } else { - return Voucher.get({id: id}).$promise; - } -} \ No newline at end of file diff --git a/brewman/static/src/app/salary-deduction/salary-deduction.component.js b/brewman/static/src/app/salary-deduction/salary-deduction.component.js deleted file mode 100644 index 7fb32f78..00000000 --- a/brewman/static/src/app/salary-deduction/salary-deduction.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var salary_deduction_controller_1 = require("./salary-deduction.controller"); -exports.SalaryDeductionComponent = { - templateUrl: '/app/salary-deduction/salary-deduction.html', - controller: salary_deduction_controller_1.SalaryDeductionController, - controllerAs: 'vm', -}; -//# sourceMappingURL=salary-deduction.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/salary-deduction/salary-deduction.component.js.map b/brewman/static/src/app/salary-deduction/salary-deduction.component.js.map deleted file mode 100644 index 1c302a8c..00000000 --- a/brewman/static/src/app/salary-deduction/salary-deduction.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"salary-deduction.component.js","sourceRoot":"","sources":["salary-deduction.component.ts"],"names":[],"mappings":";;AAAA,6EAAwE;AAE3D,QAAA,wBAAwB,GAAG;IACpC,WAAW,EAAE,6CAA6C;IAC1D,UAAU,EAAE,uDAAyB;IACrC,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/salary-deduction/salary-deduction.component.ts b/brewman/static/src/app/salary-deduction/salary-deduction.component.ts deleted file mode 100644 index 608ccea5..00000000 --- a/brewman/static/src/app/salary-deduction/salary-deduction.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {SalaryDeductionController} from "./salary-deduction.controller"; - -export const SalaryDeductionComponent = { - templateUrl: '/app/salary-deduction/salary-deduction.html', - controller: SalaryDeductionController, - controllerAs: 'vm', -}; \ No newline at end of file diff --git a/brewman/static/src/app/salary-deduction/salary-deduction.controller.js b/brewman/static/src/app/salary-deduction/salary-deduction.controller.js deleted file mode 100644 index e935544d..00000000 --- a/brewman/static/src/app/salary-deduction/salary-deduction.controller.js +++ /dev/null @@ -1,164 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var SalaryDeductionController = /** @class */ (function () { - function SalaryDeductionController($scope, $location, asDate, $modal, Employee, dateParser, Messages, Credentials) { - this.$scope = $scope; - this.$location = $location; - this.asDate = asDate; - this.$modal = $modal; - this.Employee = Employee; - this.dateParser = dateParser; - this.Messages = Messages; - this.Credentials = Credentials; - this.voucher = $scope.$parent.res.voucher; - this._voucher_Date = dateParser.parse(this.voucher.Date, "dd-MMM-yyyy"); - } - SalaryDeductionController.prototype.voucher_Date = function (value) { - if (arguments.length) { - this.voucher.Date = this.asDate(value); - this._voucher_Date = value; - } - return this._voucher_Date; - }; - SalaryDeductionController.prototype.getOldItem = function (ledgerID, items) { - for (var i = 0, l = items.length; i < l; i++) { - if (items[i].Journal.Ledger.LedgerID === ledgerID) { - return items[i]; - } - } - }; - SalaryDeductionController.prototype.daysInMonthFunction = function (date) { - if (angular.isDate(date)) { - return new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate(); - } - var months = { - Jan: 1, - Feb: 2, - Mar: 3, - Apr: 4, - May: 5, - Jun: 6, - Jul: 7, - Aug: 8, - Sep: 9, - Oct: 10, - Nov: 11, - Dec: 12 - }; - if (!date.match(/^\d{2}-[\w]{3}-[\d]{4}$/g)) { - return; - } - var parts = date.split("-"); - return new Date(parseInt(parts[2], 10), months[parts[1]], 0).getDate(); - }; - SalaryDeductionController.prototype.getEsi = function (grossSalary, daysWorked, daysInMonth) { - var limit = 15000, employeeRate = 0.0175, employerRate = 0.0475, employee = (grossSalary > limit) ? 0 : Math.ceil(employeeRate * grossSalary * daysWorked / daysInMonth), employer = (grossSalary > limit) ? 0 : Math.ceil(employerRate * grossSalary * daysWorked / daysInMonth); - return { ee: employee, er: employer, both: employee + employer }; - }; - SalaryDeductionController.prototype.getPf = function (grossSalary, daysWorked, daysInMonth) { - var limit = 15000, employeeRate = 0.12, employerRate = 0.12 + 0.011 + 0.005 + 0.0001, employee = (grossSalary > limit) ? 0 : Math.ceil(employeeRate * grossSalary * daysWorked / daysInMonth), employer = (grossSalary > limit) ? 0 : Math.ceil(employerRate * grossSalary * daysWorked / daysInMonth); - return { ee: employee, er: employer, both: employee + employer }; - }; - SalaryDeductionController.prototype.add = function () { - var oldJournal = this.getOldItem(this.employee.LedgerID, this.voucher.SalaryDeductions), grossSalary = parseInt(this.grossSalary, 10), daysWorked = parseInt(this.daysWorked, 10), daysInMonth = this.daysInMonthFunction(this.voucher.Date), esi = this.getEsi(grossSalary, daysWorked, daysInMonth), pf = this.getPf(grossSalary, daysWorked, daysInMonth); - if (!angular.isUndefined(oldJournal)) { - this.Messages.push({ Type: 'Danger', Message: 'Employee has already been added!' }); - } - else { - this.voucher.SalaryDeductions.push({ - Journal: { Ledger: this.employee }, - GrossSalary: grossSalary, - DaysWorked: daysWorked, - EsiEmployee: esi.ee, - PfEmployee: pf.ee, - EsiEmployer: esi.er, - PfEmployer: pf.er - }); - } - delete this.employee; - delete this.grossSalary; - delete this.daysWorked; - this.foEmployee = true; - }; - SalaryDeductionController.prototype.remove = function (deduction) { - var index = this.voucher.SalaryDeductions.indexOf(deduction); - this.voucher.SalaryDeductions.splice(index, 1); - }; - SalaryDeductionController.prototype.preventAlteration = function (voucher) { - if (angular.isUndefined(this.Credentials.Perms)) { - return false; - } - else if (angular.isUndefined(voucher.VoucherID)) { - return !this.Credentials.Perms['Salary Deduction']; - } - else if (voucher.Posted && !this.Credentials.Perms['Edit Posted Vouchers']) { - return true; - } - else if (voucher.User.UserID !== this.Credentials.Auth.UserID && !this.Credentials.Perms["Edit Other User's Vouchers"]) { - return true; - } - else { - return false; - } - }; - SalaryDeductionController.prototype.save = function () { - var _this = this; - this.voucher.$save({ type: 'Salary Deduction' }, function (u) { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/SalaryDeduction/' + u.VoucherID); - }, function (data) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - SalaryDeductionController.prototype.delete = function () { - var _this = this; - this.voucher.$delete(function () { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/SalaryDeduction').replace(); - }, function (data) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - SalaryDeductionController.prototype.post = function () { - var _this = this; - this.voucher.$post(function (u, putResponseHeaders) { - _this.Messages.push({ Type: 'Success', Message: '' }); - }, function (data, status) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - SalaryDeductionController.prototype.confirm = function () { - var _this = this; - var modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', /** @class */ (function () { - function class_1($modalInstance) { - this.$modalInstance = $modalInstance; - this.title = "Delete Voucher"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - class_1.prototype.ok = function () { - this.$modalInstance.close(); - }; - class_1.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - return class_1; - }())] - }); - modalInstance.result.then(function () { - _this.delete(); - }); - }; - SalaryDeductionController.prototype.employees = function ($viewValue) { - return this.Employee.autocomplete({ term: $viewValue, count: 20 }).$promise; - }; - SalaryDeductionController.$inject = ['$scope', '$location', 'asDateFilter', '$uibModal', 'Employee', 'uibDateParser', 'Messages', 'Credentials']; - return SalaryDeductionController; -}()); -exports.SalaryDeductionController = SalaryDeductionController; -//# sourceMappingURL=salary-deduction.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/salary-deduction/salary-deduction.controller.js.map b/brewman/static/src/app/salary-deduction/salary-deduction.controller.js.map deleted file mode 100644 index 52457d3f..00000000 --- a/brewman/static/src/app/salary-deduction/salary-deduction.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"salary-deduction.controller.js","sourceRoot":"","sources":["salary-deduction.controller.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC;IASI,mCAAmB,MAAM,EAAS,SAAS,EAAS,MAAM,EAAS,MAAM,EAAS,QAAQ,EAAS,UAAU,EAAS,QAAQ,EAAS,WAAW;QAA/H,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,aAAQ,GAAR,QAAQ,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QAAS,aAAQ,GAAR,QAAQ,CAAA;QAAS,gBAAW,GAAX,WAAW,CAAA;QAC9I,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;QAC1C,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAC5E,CAAC;IAED,gDAAY,GAAZ,UAAa,KAAK;QACd,IAAI,SAAS,CAAC,MAAM,EAAE;YAClB,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvC,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;SAC9B;QACD,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED,8CAAU,GAAV,UAAW,QAAQ,EAAE,KAAK;QACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;YAC1C,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,KAAK,QAAQ,EAAE;gBAC/C,OA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AC,QAAQ,CAAC,CAAC;oBAC1C,CAAC;oBACL,cAAC;gBAAD,CAAC,AAlBiC,IAkBhC;SACL,CAAC,CAAC;QACH,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC;YACtB,KAAI,CAAC,MAAM,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACP,CAAC;IAED,6CAAS,GAAT,UAAU,UAAU;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;IAC9E,CAAC;IAjLM,iCAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;IAkLlI,gCAAC;CAAA,AAnLD,IAmLC;AAnLY,8DAAyB"} \ No newline at end of file diff --git a/brewman/static/src/app/salary-deduction/salary-deduction.controller.ts b/brewman/static/src/app/salary-deduction/salary-deduction.controller.ts deleted file mode 100644 index 2db9898f..00000000 --- a/brewman/static/src/app/salary-deduction/salary-deduction.controller.ts +++ /dev/null @@ -1,182 +0,0 @@ -import * as angular from 'angular'; - -export class SalaryDeductionController { - static $inject = ['$scope', '$location', 'asDateFilter', '$uibModal', 'Employee', 'uibDateParser', 'Messages', 'Credentials']; - _voucher_Date: any; - employee: any; - grossSalary: any; - daysWorked: any; - foEmployee: any; - voucher: any; - - constructor(public $scope, public $location, public asDate, public $modal, public Employee, public dateParser, public Messages, public Credentials) { - this.voucher = $scope.$parent.res.voucher; - this._voucher_Date = dateParser.parse(this.voucher.Date, "dd-MMM-yyyy"); - } - - voucher_Date(value) { - if (arguments.length) { - this.voucher.Date = this.asDate(value); - this._voucher_Date = value; - } - return this._voucher_Date; - } - - getOldItem(ledgerID, items) { - for (let i = 0, l = items.length; i < l; i++) { - if (items[i].Journal.Ledger.LedgerID === ledgerID) { - return items[i]; - } - } - } - - daysInMonthFunction(date) { - if (angular.isDate(date)) { - return new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate(); - } - - const months = { - Jan: 1, - Feb: 2, - Mar: 3, - Apr: 4, - May: 5, - Jun: 6, - Jul: 7, - Aug: 8, - Sep: 9, - Oct: 10, - Nov: 11, - Dec: 12 - }; - if (!date.match(/^\d{2}-[\w]{3}-[\d]{4}$/g)) { - return; - } - const parts = date.split("-"); - return new Date(parseInt(parts[2], 10), months[parts[1]], 0).getDate(); - } - - getEsi(grossSalary, daysWorked, daysInMonth) { - const limit = 15000, - employeeRate = 0.0175, - employerRate = 0.0475, - employee = (grossSalary > limit) ? 0 : Math.ceil(employeeRate * grossSalary * daysWorked / daysInMonth), - employer = (grossSalary > limit) ? 0 : Math.ceil(employerRate * grossSalary * daysWorked / daysInMonth); - return {ee: employee, er: employer, both: employee + employer}; - } - - getPf(grossSalary, daysWorked, daysInMonth) { - const limit = 15000, - employeeRate = 0.12, - employerRate = 0.12 + 0.011 + 0.005 + 0.0001, - employee = (grossSalary > limit) ? 0 : Math.ceil(employeeRate * grossSalary * daysWorked / daysInMonth), - employer = (grossSalary > limit) ? 0 : Math.ceil(employerRate * grossSalary * daysWorked / daysInMonth); - return {ee: employee, er: employer, both: employee + employer}; - } - - add() { - const oldJournal = this.getOldItem(this.employee.LedgerID, this.voucher.SalaryDeductions), - grossSalary = parseInt(this.grossSalary, 10), - daysWorked = parseInt(this.daysWorked, 10), - daysInMonth = this.daysInMonthFunction(this.voucher.Date), - esi = this.getEsi(grossSalary, daysWorked, daysInMonth), - pf = this.getPf(grossSalary, daysWorked, daysInMonth); - - if (!angular.isUndefined(oldJournal)) { - this.Messages.push({Type: 'Danger', Message: 'Employee has already been added!'}); - } else { - this.voucher.SalaryDeductions.push({ - Journal: {Ledger: this.employee}, - GrossSalary: grossSalary, - DaysWorked: daysWorked, - EsiEmployee: esi.ee, - PfEmployee: pf.ee, - EsiEmployer: esi.er, - PfEmployer: pf.er - }); - } - delete this.employee; - delete this.grossSalary; - delete this.daysWorked; - this.foEmployee = true; - } - - remove(deduction) { - const index = this.voucher.SalaryDeductions.indexOf(deduction); - this.voucher.SalaryDeductions.splice(index, 1); - } - - preventAlteration(voucher) { - if (angular.isUndefined(this.Credentials.Perms)) { - return false; - } else if (angular.isUndefined(voucher.VoucherID)) { - return !this.Credentials.Perms['Salary Deduction']; - } else if (voucher.Posted && !this.Credentials.Perms['Edit Posted Vouchers']) { - return true; - } else if (voucher.User.UserID !== this.Credentials.Auth.UserID && !this.Credentials.Perms["Edit Other User's Vouchers"]) { - return true; - } else { - return false; - } - } - - save() { - this.voucher.$save({type: 'Salary Deduction'}, (u) => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/SalaryDeduction/' + u.VoucherID); - }, (data) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - delete() { - this.voucher.$delete(() => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/SalaryDeduction').replace(); - }, (data) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - post() { - this.voucher.$post((u, putResponseHeaders) => { - this.Messages.push({Type: 'Success', Message: ''}); - }, (data, status) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - confirm() { - const modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controllerAs: 'vmModal', - controller: ['$uibModalInstance', class { - title: any; - body: any; - isDelete: boolean; - - constructor(public $modalInstance) { - this.title = "Delete Voucher"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - - ok() { - this.$modalInstance.close(); - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - }] - }); - modalInstance.result.then(() => { - this.delete(); - }); - } - - employees($viewValue) { - return this.Employee.autocomplete({term: $viewValue, count: 20}).$promise; - } -} diff --git a/brewman/static/src/app/salary-deduction/salary-deduction.html b/brewman/static/src/app/salary-deduction/salary-deduction.html deleted file mode 100644 index b07d7e45..00000000 --- a/brewman/static/src/app/salary-deduction/salary-deduction.html +++ /dev/null @@ -1,88 +0,0 @@ -
-

Credit Esi / Pf

- -
- - -
-
- - - - -
-
-
-
- - -
- -
-
- -
-
- -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDesignationDepartmentGross SalaryDays WorkedEsi EEPf EEEsi ERPf ERDelete
{{deduction.Journal.Ledger.Name}}{{deduction.Journal.Ledger.Designation}}{{deduction.Journal.Ledger.CostCentre.Name}}{{deduction.GrossSalary}}{{deduction.DaysWorked}}{{deduction.EsiEmployee}}{{deduction.PfEmployee}}{{deduction.EsiEmployer}}{{deduction.PfEmployer}} - -
-
- - - -
-
- Created on {{vm.voucher.CreationDate | localTime}} and Last Edited on {{vm.voucher.LastEditDate | localTime}} by - {{vm.voucher.User.Name}}. Posted by {{vm.voucher.Poster}} -
-
diff --git a/brewman/static/src/app/settings/lock-info.resolver.js b/brewman/static/src/app/settings/lock-info.resolver.js deleted file mode 100644 index 26b953d9..00000000 --- a/brewman/static/src/app/settings/lock-info.resolver.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var LockInfoResolver = /** @class */ (function () { - function LockInfoResolver($http) { - this.$http = $http; - return $http.get('/api/LockInfo', {}).then(function (data) { - return data.data; - }); - } - return LockInfoResolver; -}()); -exports.LockInfoResolver = LockInfoResolver; -//# sourceMappingURL=lock-info.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/settings/lock-info.resolver.js.map b/brewman/static/src/app/settings/lock-info.resolver.js.map deleted file mode 100644 index 98b7db0d..00000000 --- a/brewman/static/src/app/settings/lock-info.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lock-info.resolver.js","sourceRoot":"","sources":["lock-info.resolver.ts"],"names":[],"mappings":";;AAEA;IACI,0BAAmB,KAAK;QAAL,UAAK,GAAL,KAAK,CAAA;QACpB,OAAO,KAAK,CAAC,GAAG,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI;YACrD,OAAO,IAAI,CAAC,IAAI,CAAC;QACrB,CAAC,CAAC,CAAC;IACP,CAAC;IACL,uBAAC;AAAD,CAAC,AAND,IAMC;AANY,4CAAgB"} \ No newline at end of file diff --git a/brewman/static/src/app/settings/lock-info.resolver.ts b/brewman/static/src/app/settings/lock-info.resolver.ts deleted file mode 100644 index 7b64b4ea..00000000 --- a/brewman/static/src/app/settings/lock-info.resolver.ts +++ /dev/null @@ -1,9 +0,0 @@ -import * as angular from 'angular'; - -export class LockInfoResolver { - constructor(public $http) { - return $http.get('/api/LockInfo', {}).then(function (data) { - return data.data; - }); - } -} diff --git a/brewman/static/src/app/settings/maintenance.resolver.js b/brewman/static/src/app/settings/maintenance.resolver.js deleted file mode 100644 index 82e6deaf..00000000 --- a/brewman/static/src/app/settings/maintenance.resolver.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var MaintenanceResolver = /** @class */ (function () { - function MaintenanceResolver($http) { - this.$http = $http; - return $http.get('/api/Maintenance', {}).then(function (data) { - return data.data; - }); - } - return MaintenanceResolver; -}()); -exports.MaintenanceResolver = MaintenanceResolver; -//# sourceMappingURL=maintenance.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/settings/maintenance.resolver.js.map b/brewman/static/src/app/settings/maintenance.resolver.js.map deleted file mode 100644 index f31c8ec7..00000000 --- a/brewman/static/src/app/settings/maintenance.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"maintenance.resolver.js","sourceRoot":"","sources":["maintenance.resolver.ts"],"names":[],"mappings":";;AAEA;IACI,6BAAmB,KAAK;QAAL,UAAK,GAAL,KAAK,CAAA;QACpB,OAAO,KAAK,CAAC,GAAG,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI;YACxD,OAAO,IAAI,CAAC,IAAI,CAAC;QACrB,CAAC,CAAC,CAAC;IACP,CAAC;IACL,0BAAC;AAAD,CAAC,AAND,IAMC;AANY,kDAAmB"} \ No newline at end of file diff --git a/brewman/static/src/app/settings/maintenance.resolver.ts b/brewman/static/src/app/settings/maintenance.resolver.ts deleted file mode 100644 index 34a859c8..00000000 --- a/brewman/static/src/app/settings/maintenance.resolver.ts +++ /dev/null @@ -1,9 +0,0 @@ -import * as angular from 'angular'; - -export class MaintenanceResolver { - constructor(public $http) { - return $http.get('/api/Maintenance', {}).then(function (data) { - return data.data; - }); - } -} diff --git a/brewman/static/src/app/settings/settings.component.js b/brewman/static/src/app/settings/settings.component.js deleted file mode 100644 index aa8c4436..00000000 --- a/brewman/static/src/app/settings/settings.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var settings_controller_1 = require("./settings.controller"); -exports.SettingsComponent = { - templateUrl: '/app/settings/settings.html', - controller: settings_controller_1.SettingsController, - controllerAs: 'vm', -}; -//# sourceMappingURL=settings.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/settings/settings.component.js.map b/brewman/static/src/app/settings/settings.component.js.map deleted file mode 100644 index 695cf31e..00000000 --- a/brewman/static/src/app/settings/settings.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"settings.component.js","sourceRoot":"","sources":["settings.component.ts"],"names":[],"mappings":";;AAAA,6DAAyD;AAE5C,QAAA,iBAAiB,GAAG;IAC7B,WAAW,EAAE,6BAA6B;IAC1C,UAAU,EAAE,wCAAkB;IAC9B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/settings/settings.component.ts b/brewman/static/src/app/settings/settings.component.ts deleted file mode 100644 index b5dad36f..00000000 --- a/brewman/static/src/app/settings/settings.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {SettingsController} from "./settings.controller"; - -export const SettingsComponent = { - templateUrl: '/app/settings/settings.html', - controller: SettingsController, - controllerAs: 'vm', -}; diff --git a/brewman/static/src/app/settings/settings.controller.js b/brewman/static/src/app/settings/settings.controller.js deleted file mode 100644 index cccd5e5b..00000000 --- a/brewman/static/src/app/settings/settings.controller.js +++ /dev/null @@ -1,182 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -var SettingsController = /** @class */ (function () { - function SettingsController($scope, $http, asDate, $modal, Product, dateParser, Messages) { - this.$scope = $scope; - this.$http = $http; - this.asDate = asDate; - this.$modal = $modal; - this.Product = Product; - this.dateParser = dateParser; - this.Messages = Messages; - this.lockInfo = $scope.$parent.res.lockInfo; - this.maintenance = $scope.$parent.res.maintenance; - this._lockInfo_Start_Date = undefined; - this._lockInfo_Finish_Date = undefined; - if (!angular.isUndefined(this.lockInfo.Start.Date)) { - this._lockInfo_Start_Date = dateParser.parse(this.lockInfo.Start.Date, "dd-MMM-yyyy"); - } - if (!angular.isUndefined(this.lockInfo.Finish.Date)) { - this._lockInfo_Finish_Date = dateParser.parse(this.lockInfo.Finish.Date, "dd-MMM-yyyy"); - } - this.rebaseDate = new Date(); - } - SettingsController.prototype.lockInfo_Start_Date = function (value) { - if (arguments.length) { - this.lockInfo.Start.Date = this.asDate(value); - this._lockInfo_Start_Date = value; - } - return this._lockInfo_Start_Date; - }; - SettingsController.prototype.lockInfo_Finish_Date = function (value) { - if (arguments.length) { - this.lockInfo.Finish.Date = this.asDate(value); - this._lockInfo_Finish_Date = value; - } - return this._lockInfo_Finish_Date; - }; - SettingsController.prototype.MaintenanceEnabled = function () { - return this.maintenance.Enabled ? 'Enabled' : 'Disabled'; - }; - SettingsController.prototype.setLockDate = function () { - var _this = this; - if (this.lockInfo.Start.Locked) { - if (this.lockInfo.Start.Rolling) { - this.lockInfo.Start.Days = parseInt(this.lockInfo.Start.Days, 10); - } - } - if (this.lockInfo.Finish.Locked) { - if (this.lockInfo.Finish.Rolling) { - this.lockInfo.Finish.Days = parseInt(this.lockInfo.Finish.Days, 10); - } - } - return this.$http.post('/api/LockInfo', this.lockInfo).then(function (data) { - _this.lockInfo = data.data; - _this.Messages.push({ Type: 'Success', Message: '' }); - }).catch(function (errorMessage) { - _this.Messages.push({ Type: 'Danger', Message: errorMessage }); - }); - }; - SettingsController.prototype.clearLockDate = function () { - var _this = this; - return this.$http.delete('/api/LockInfo').then(function (data) { - _this.lockInfo = data.data; - _this.Messages.push({ Type: 'Success', Message: '' }); - }).catch(function (errorMessage) { - _this.Messages.push({ Type: 'Danger', Message: errorMessage }); - }); - }; - SettingsController.prototype.confirmRebase = function () { - var _this = this; - var modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controller: ['$uibModalInstance', /** @class */ (function () { - function class_1($modalInstance) { - this.$modalInstance = $modalInstance; - this.title = "Rebase Data"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - class_1.prototype.ok = function () { - this.$modalInstance.close(); - }; - class_1.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - return class_1; - }())] - }); - modalInstance.result.then(function () { - _this.rebaseData(); - }); - }; - SettingsController.prototype.rebaseData = function () { - var _this = this; - if (this.rebaseDate === '') { - return; - } - this.$http({ - method: 'POST', url: '/api/Rebase/' + this.asDate(this.rebaseDate) - }).then(function () { - _this.Messages.push({ Type: 'Success', Message: 'Data rebased!' }); - }).catch(function (errorMessage) { - _this.Messages.push({ Type: 'Danger', Message: errorMessage }); - }); - }; - SettingsController.prototype.confirmResetStock = function () { - var _this = this; - var modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controller: ['$uibModalInstance', /** @class */ (function () { - function class_2($modalInstance) { - this.$modalInstance = $modalInstance; - this.title = "Reset Stock"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - class_2.prototype.ok = function () { - this.$modalInstance.close(); - }; - class_2.prototype.cancel = function () { - this.$modalInstance.dismiss('cancel'); - }; - return class_2; - }())] - }); - modalInstance.result.then(function () { - _this.resetStock(); - }); - }; - SettingsController.prototype.resetStock = function () { - var _this = this; - if (angular.isUndefined(this.resetDate) || this.resetDate === '') { - return; - } - if (angular.isUndefined(this.stockDate) || this.stockDate === '') { - return; - } - if (angular.isUndefined(this.product) || this.product === '') { - return; - } - if (angular.isUndefined(this.qty) || this.qty === '') { - return; - } - var qty = Number(this.qty); - this.$http({ - method: 'POST', - url: '/api/ResetStock/' + this.product.ProductID, - params: { StockDate: this.asDate(this.stockDate), ResetDate: this.asDate(this.resetDate), Quantity: qty } - }).then(function () { - _this.Messages.push({ Type: 'Success', Message: 'Data rebased!' }); - }).catch(function (errorMessage) { - _this.Messages.push({ Type: 'Danger', Message: errorMessage }); - }); - }; - SettingsController.prototype.products = function ($viewValue) { - return this.Product.autocomplete({ term: $viewValue, count: 20 }).$promise; - }; - SettingsController.prototype.checkDb = function () { - var _this = this; - return this.$http.post('/api/DbIntegrity', {}).then(function () { - _this.Messages.push({ Type: 'Success', Message: '' }); - }).catch(function (errorMessage) { - this.Messages.push({ Type: 'Danger', Message: errorMessage }); - }); - }; - SettingsController.prototype.setMaintenance = function (status) { - var _this = this; - return this.$http.post('/api/Maintenance', { Enabled: status }).then(function (data) { - _this.maintenance = data; - _this.Messages.push({ Type: 'Success', Message: '' }); - }).catch(function (errorMessage) { - _this.Messages.push({ Type: 'Danger', Message: errorMessage }); - }); - }; - SettingsController.$inject = ['$scope', '$http', 'asDateFilter', '$uibModal', 'Product', 'uibDateParser', 'Messages']; - return SettingsController; -}()); -exports.SettingsController = SettingsController; -//# sourceMappingURL=settings.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/settings/settings.controller.js.map b/brewman/static/src/app/settings/settings.controller.js.map deleted file mode 100644 index 51784484..00000000 --- a/brewman/static/src/app/settings/settings.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"settings.controller.js","sourceRoot":"","sources":["settings.controller.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC;IAYI,4BAAmB,MAAM,EAAS,KAAK,EAAS,MAAM,EAAS,M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AAC,KAAK,CAAC,UAAC,YAAY;YAClB,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAC,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC;IACP,CAAC;IA7LM,0BAAO,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,CAAC,CAAC;IA8L9G,yBAAC;CAAA,AA/LD,IA+LC;AA/LY,gDAAkB"} \ No newline at end of file diff --git a/brewman/static/src/app/settings/settings.controller.ts b/brewman/static/src/app/settings/settings.controller.ts deleted file mode 100644 index 2782ce49..00000000 --- a/brewman/static/src/app/settings/settings.controller.ts +++ /dev/null @@ -1,194 +0,0 @@ -import * as angular from 'angular'; - -export class SettingsController { - static $inject = ['$scope', '$http', 'asDateFilter', '$uibModal', 'Product', 'uibDateParser', 'Messages']; - _lockInfo_Start_Date: any; - _lockInfo_Finish_Date: any; - rebaseDate: any; - resetDate: any; - stockDate: any; - product: any; - qty: any; - lockInfo: any; - maintenance: any; - - constructor(public $scope, public $http, public asDate, public $modal, public Product, public dateParser, public Messages) { - this.lockInfo = $scope.$parent.res.lockInfo; - this.maintenance = $scope.$parent.res.maintenance; - this._lockInfo_Start_Date = undefined; - this._lockInfo_Finish_Date = undefined; - if (!angular.isUndefined(this.lockInfo.Start.Date)) { - this._lockInfo_Start_Date = dateParser.parse(this.lockInfo.Start.Date, "dd-MMM-yyyy"); - } - if (!angular.isUndefined(this.lockInfo.Finish.Date)) { - this._lockInfo_Finish_Date = dateParser.parse(this.lockInfo.Finish.Date, "dd-MMM-yyyy"); - } - this.rebaseDate = new Date(); - } - - lockInfo_Start_Date(value) { - if (arguments.length) { - this.lockInfo.Start.Date = this.asDate(value); - this._lockInfo_Start_Date = value; - } - return this._lockInfo_Start_Date; - } - - lockInfo_Finish_Date(value) { - if (arguments.length) { - this.lockInfo.Finish.Date = this.asDate(value); - this._lockInfo_Finish_Date = value; - } - return this._lockInfo_Finish_Date; - } - - MaintenanceEnabled() { - return this.maintenance.Enabled ? 'Enabled' : 'Disabled'; - } - - setLockDate() { - if (this.lockInfo.Start.Locked) { - if (this.lockInfo.Start.Rolling) { - this.lockInfo.Start.Days = parseInt(this.lockInfo.Start.Days, 10); - } - } - - if (this.lockInfo.Finish.Locked) { - if (this.lockInfo.Finish.Rolling) { - this.lockInfo.Finish.Days = parseInt(this.lockInfo.Finish.Days, 10); - } - } - return this.$http.post('/api/LockInfo', this.lockInfo).then((data) => { - this.lockInfo = data.data; - this.Messages.push({Type: 'Success', Message: ''}); - }).catch((errorMessage) => { - this.Messages.push({Type: 'Danger', Message: errorMessage}); - }); - } - - clearLockDate() { - return this.$http.delete('/api/LockInfo').then((data) => { - this.lockInfo = data.data; - this.Messages.push({Type: 'Success', Message: ''}); - }).catch((errorMessage) => { - this.Messages.push({Type: 'Danger', Message: errorMessage}); - }); - } - - confirmRebase() { - const modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controller: ['$uibModalInstance', class { - title: any; - body: any; - isDelete: boolean; - - constructor(public $modalInstance) { - this.title = "Rebase Data"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - - ok() { - this.$modalInstance.close(); - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - }] - }); - modalInstance.result.then(() => { - this.rebaseData(); - }); - } - - rebaseData() { - if (this.rebaseDate === '') { - return; - } - this.$http({ - method: 'POST', url: '/api/Rebase/' + this.asDate(this.rebaseDate) - }).then(() => { - this.Messages.push({Type: 'Success', Message: 'Data rebased!'}); - }).catch((errorMessage) => { - this.Messages.push({Type: 'Danger', Message: errorMessage}); - }); - } - - confirmResetStock() { - const modalInstance = this.$modal.open({ - backdrop: true, - templateUrl: '/template/modal/confirm.html', - controller: ['$uibModalInstance', class { - title: any; - body: any; - isDelete: boolean; - - constructor(public $modalInstance) { - this.title = "Reset Stock"; - this.body = "Are you sure? This cannot be undone."; - this.isDelete = true; - } - - ok() { - this.$modalInstance.close(); - } - - cancel() { - this.$modalInstance.dismiss('cancel'); - } - }] - }); - modalInstance.result.then(() => { - this.resetStock(); - }); - } - - resetStock() { - if (angular.isUndefined(this.resetDate) || this.resetDate === '') { - return; - } - if (angular.isUndefined(this.stockDate) || this.stockDate === '') { - return; - } - if (angular.isUndefined(this.product) || this.product === '') { - return; - } - if (angular.isUndefined(this.qty) || this.qty === '') { - return; - } - const qty = Number(this.qty); - this.$http({ - method: 'POST', - url: '/api/ResetStock/' + this.product.ProductID, - params: {StockDate: this.asDate(this.stockDate), ResetDate: this.asDate(this.resetDate), Quantity: qty} - }).then(() => { - this.Messages.push({Type: 'Success', Message: 'Data rebased!'}); - }).catch((errorMessage) => { - this.Messages.push({Type: 'Danger', Message: errorMessage}); - }); - } - - products($viewValue) { - return this.Product.autocomplete({term: $viewValue, count: 20}).$promise; - } - - checkDb() { - return this.$http.post('/api/DbIntegrity', {}).then(() => { - this.Messages.push({Type: 'Success', Message: ''}); - }).catch(function (errorMessage) { - this.Messages.push({Type: 'Danger', Message: errorMessage}); - }); - } - - setMaintenance(status) { - return this.$http.post('/api/Maintenance', {Enabled: status}).then((data) => { - this.maintenance = data; - this.Messages.push({Type: 'Success', Message: ''}); - }).catch((errorMessage) => { - this.Messages.push({Type: 'Danger', Message: errorMessage}); - }); - } -} diff --git a/brewman/static/src/app/settings/settings.html b/brewman/static/src/app/settings/settings.html deleted file mode 100644 index 683f5090..00000000 --- a/brewman/static/src/app/settings/settings.html +++ /dev/null @@ -1,156 +0,0 @@ -
-

Settings

- -
- - -
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- - - - -
-
-
- -
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- - - - -
-
-
-
-
- -
-
- -
- -
- -
- - -
-
- - - - -
-
-
- -
-
- -
- - -
-
- - - - -
-
-
-
- - - - -
-
- -
- -
-
- -
- -
- -
-
-
- - -
- -
-
-
- - -
- -
-
- -
-
- Maintenance mode is {{vm.MaintenanceEnabled()}} by user {{vm.maintenance.User}} -
-
-
diff --git a/brewman/static/src/app/stock-movement/stock-movement.component.js b/brewman/static/src/app/stock-movement/stock-movement.component.js deleted file mode 100644 index b650c836..00000000 --- a/brewman/static/src/app/stock-movement/stock-movement.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var stock_movement_controller_1 = require("./stock-movement.controller"); -exports.StockMovementComponent = { - templateUrl: '/app/stock-movement/stock-movement.html', - controller: stock_movement_controller_1.StockMovementController, - controllerAs: 'vm', -}; -//# sourceMappingURL=stock-movement.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/stock-movement/stock-movement.component.js.map b/brewman/static/src/app/stock-movement/stock-movement.component.js.map deleted file mode 100644 index cb0bcd1b..00000000 --- a/brewman/static/src/app/stock-movement/stock-movement.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stock-movement.component.js","sourceRoot":"","sources":["stock-movement.component.ts"],"names":[],"mappings":";;AAAA,yEAAoE;AAEvD,QAAA,sBAAsB,GAAG;IAClC,WAAW,EAAE,yCAAyC;IACtD,UAAU,EAAE,mDAAuB;IACnC,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/stock-movement/stock-movement.component.ts b/brewman/static/src/app/stock-movement/stock-movement.component.ts deleted file mode 100644 index 4cacb3ad..00000000 --- a/brewman/static/src/app/stock-movement/stock-movement.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {StockMovementController} from "./stock-movement.controller"; - -export const StockMovementComponent = { - templateUrl: '/app/stock-movement/stock-movement.html', - controller: StockMovementController, - controllerAs: 'vm', -}; diff --git a/brewman/static/src/app/stock-movement/stock-movement.controller.js b/brewman/static/src/app/stock-movement/stock-movement.controller.js deleted file mode 100644 index 384d182f..00000000 --- a/brewman/static/src/app/stock-movement/stock-movement.controller.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var StockMovementController = /** @class */ (function () { - function StockMovementController($scope, $location, asDate, dateParser) { - this.$scope = $scope; - this.$location = $location; - this.asDate = asDate; - this.dateParser = dateParser; - this.stockMovement = $scope.$parent.res.stockMovement; - this._info_StartDate = dateParser.parse(this.stockMovement.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.stockMovement.FinishDate, "dd-MMM-yyyy"); - this.info = this.stockMovement; - this.foDate = true; - } - StockMovementController.prototype.info_StartDate = function (value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - }; - StockMovementController.prototype.info_FinishDate = function (value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - }; - StockMovementController.prototype.show = function () { - this.$location.path('/StockMovement').search({ - StartDate: this.info.StartDate, - FinishDate: this.info.FinishDate - }); - }; - StockMovementController.$inject = ['$scope', '$location', 'asDateFilter', 'stockMovement', 'uibDateParser']; - return StockMovementController; -}()); -exports.StockMovementController = StockMovementController; -//# sourceMappingURL=stock-movement.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/stock-movement/stock-movement.controller.js.map b/brewman/static/src/app/stock-movement/stock-movement.controller.js.map deleted file mode 100644 index 85403c62..00000000 --- a/brewman/static/src/app/stock-movement/stock-movement.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stock-movement.controller.js","sourceRoot":"","sources":["stock-movement.controller.ts"],"names":[],"mappings":";;AAAA;IAQI,iCAAmB,MAAM,EAAS,SAAS,EAAS,MAAM,EAAS,UAAU;QAA1D,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QACzE,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG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/static/src/app/stock-movement/stock-movement.controller.ts b/brewman/static/src/app/stock-movement/stock-movement.controller.ts deleted file mode 100644 index d535db96..00000000 --- a/brewman/static/src/app/stock-movement/stock-movement.controller.ts +++ /dev/null @@ -1,39 +0,0 @@ -export class StockMovementController { - static $inject = ['$scope', '$location', 'asDateFilter', 'stockMovement', 'uibDateParser']; - _info_StartDate: any; - _info_FinishDate: any; - info: any; - foDate: any; - stockMovement: any; - - constructor(public $scope, public $location, public asDate, public dateParser) { - this.stockMovement = $scope.$parent.res.stockMovement; - this._info_StartDate = dateParser.parse(this.stockMovement.StartDate, "dd-MMM-yyyy"); - this._info_FinishDate = dateParser.parse(this.stockMovement.FinishDate, "dd-MMM-yyyy"); - this.info = this.stockMovement; - this.foDate = true; - } - - info_StartDate(value) { - if (arguments.length) { - this.info.StartDate = this.asDate(value); - this._info_StartDate = value; - } - return this._info_StartDate; - } - - info_FinishDate(value) { - if (arguments.length) { - this.info.FinishDate = this.asDate(value); - this._info_FinishDate = value; - } - return this._info_FinishDate; - } - - show() { - this.$location.path('/StockMovement').search({ - StartDate: this.info.StartDate, - FinishDate: this.info.FinishDate - }); - } -} diff --git a/brewman/static/src/app/stock-movement/stock-movement.html b/brewman/static/src/app/stock-movement/stock-movement.html deleted file mode 100644 index e5c78098..00000000 --- a/brewman/static/src/app/stock-movement/stock-movement.html +++ /dev/null @@ -1,54 +0,0 @@ -
-

Stock Movement

- -
- - -
-
- - - - -
-
-
-
- - - - -
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - -
GroupNameOpeningPurchaseIssueClosing
{{item.Group}}{{item.Name}}{{item.Opening | number:2}}{{item.Purchase | number:2}}{{item.Issue | number:2}}{{item.Closing | number:2}}
-
diff --git a/brewman/static/src/app/stock-movement/stock-movement.resolver.js b/brewman/static/src/app/stock-movement/stock-movement.resolver.js deleted file mode 100644 index 6d954467..00000000 --- a/brewman/static/src/app/stock-movement/stock-movement.resolver.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function StockMovementResolver($route, StockMovement) { - var startDate = $route.current.params.StartDate, finishDate = $route.current.params.FinishDate; - if (angular.isUndefined(startDate) || angular.isUndefined(finishDate)) { - return StockMovement.get({}).$promise; - } - else { - return StockMovement.get({ StartDate: startDate, FinishDate: finishDate }).$promise; - } -} -exports.StockMovementResolver = StockMovementResolver; -//# sourceMappingURL=stock-movement.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/stock-movement/stock-movement.resolver.js.map b/brewman/static/src/app/stock-movement/stock-movement.resolver.js.map deleted file mode 100644 index 5de3f211..00000000 --- a/brewman/static/src/app/stock-movement/stock-movement.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stock-movement.resolver.js","sourceRoot":"","sources":["stock-movement.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,+BAAsC,MAAM,EAAE,aAAa;IACvD,IAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAC7C,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC;IAElD,IAAI,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE;QACnE,OAAO,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;KACzC;SAAM;QACH,OAAO,aAAa,CAAC,GAAG,CAAC,EAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAC,CAAC,CAAC,QAAQ,CAAC;KACrF;AACL,CAAC;AATD,sDASC"} \ No newline at end of file diff --git a/brewman/static/src/app/stock-movement/stock-movement.resolver.ts b/brewman/static/src/app/stock-movement/stock-movement.resolver.ts deleted file mode 100644 index 0c132611..00000000 --- a/brewman/static/src/app/stock-movement/stock-movement.resolver.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as angular from 'angular'; - -export function StockMovementResolver($route, StockMovement) { - const startDate = $route.current.params.StartDate, - finishDate = $route.current.params.FinishDate; - - if (angular.isUndefined(startDate) || angular.isUndefined(finishDate)) { - return StockMovement.get({}).$promise; - } else { - return StockMovement.get({StartDate: startDate, FinishDate: finishDate}).$promise; - } -} diff --git a/brewman/static/src/app/stock-movement/stock-movement.service.js b/brewman/static/src/app/stock-movement/stock-movement.service.js deleted file mode 100644 index 96e744ae..00000000 --- a/brewman/static/src/app/stock-movement/stock-movement.service.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function StockMovement($resource) { - return $resource('/api/StockMovement'); -} -exports.StockMovement = StockMovement; -//# sourceMappingURL=stock-movement.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/stock-movement/stock-movement.service.js.map b/brewman/static/src/app/stock-movement/stock-movement.service.js.map deleted file mode 100644 index 78d31d79..00000000 --- a/brewman/static/src/app/stock-movement/stock-movement.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stock-movement.service.js","sourceRoot":"","sources":["stock-movement.service.ts"],"names":[],"mappings":";;AAAA,uBAA8B,SAAS;IACnC,OAAO,SAAS,CAAC,oBAAoB,CAAC,CAAC;AAC3C,CAAC;AAFD,sCAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/stock-movement/stock-movement.service.ts b/brewman/static/src/app/stock-movement/stock-movement.service.ts deleted file mode 100644 index 54ea2d3b..00000000 --- a/brewman/static/src/app/stock-movement/stock-movement.service.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function StockMovement($resource) { - return $resource('/api/StockMovement'); -} diff --git a/brewman/static/src/app/systemjs.config.js b/brewman/static/src/app/systemjs.config.js deleted file mode 100644 index bda640ab..00000000 --- a/brewman/static/src/app/systemjs.config.js +++ /dev/null @@ -1,86 +0,0 @@ -(function () { - var paths = { - // paths serve as alias - 'npm:': 'node_modules/', - 'js:': 'js/', - '@app/*': ['app/*'] - }; - - var map = { - 'main': 'main.js', - 'app': '/app', - 'angular': 'npm:angular', - 'ngAnimate': 'npm:angular-animate', - 'angular-animate': 'npm:angular-animate', - 'ngAria': 'npm:angular-aria', - 'angular-aria': 'npm:angular-aria', - 'ngCookies': 'npm:angular-cookies', - 'ngLocale': 'npm:angular-i18n', - 'ngMessages': 'npm:angular-messages', - 'ngResource': 'npm:angular-resource', - 'ngRoute': 'npm:angular-route', - 'ngSanitize': 'npm:angular-sanitize', - 'angular-ui-bootstrap': 'npm:angular-ui-bootstrap/', - 'lodash': 'npm:lodash', - 'moment': 'npm:moment', - 'mousetrap': 'npm:mousetrap', - 'bmMousetrap': 'js', - 'jqScrollIntoView': 'js', - 'showdown': 'npm:showdown', - 'mathjs': 'npm:mathjs', - 'jquery': 'npm:jquery', - 'bootstrap': 'npm:bootstrap', - 'json': 'npm:systemjs-plugin-json', - '@angular/animations': 'npm:@angular/animations/bundles/animations.umd.js', - '@angular/animations/browser': 'npm:@angular/animations/bundles/animations-browser.umd.js', - '@angular/core': 'npm:@angular/core/bundles/core.umd.js', - '@angular/common': 'npm:@angular/common/bundles/common.umd.js', - '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js', - '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js', - '@angular/platform-browser/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.umd.js', - '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', - '@angular/http': 'npm:@angular/http/bundles/http.umd.js', - '@angular/router': 'npm:@angular/router/bundles/router.umd.js', - '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', - '@angular/material': 'npm:@angular/material/bundles/material.umd.js', - '@angular/upgrade/static': 'npm:@angular/upgrade/bundles/upgrade-static.umd.js', - 'rxjs': 'npm:rxjs' - }; - - var packages = { - 'app': {main: 'app.module.js', defaultExtension: 'js'}, - 'angular': {main: 'index.js', defaultExtension: 'js'}, - 'ngAnimate': {main: 'index.js', defaultExtension: 'js'}, - 'angular-animate': {main: 'index.js', defaultExtension: 'js'}, - 'ngAria': {main: 'index.js', defaultExtension: 'js'}, - 'angular-aria': {main: 'index.js', defaultExtension: 'js'}, - 'ngCookies': {main: 'index.js', defaultExtension: 'js'}, - 'ngLocale': {main: 'angular-locale_en-in.js', defaultExtension: 'js'}, - 'ngMessages': {main: 'index.js', defaultExtension: 'js'}, - 'ngResource': {main: 'index.js', defaultExtension: 'js'}, - 'ngRoute': {main: 'index.js', defaultExtension: 'js'}, - 'ngSanitize': {main: 'index.js', defaultExtension: 'js'}, - 'angular-ui-bootstrap': {main: 'index.js', defaultExtension: 'js'}, - 'lodash': {main: 'index.js', defaultExtension: 'js'}, - 'moment': {main: 'moment.js', defaultExtension: 'js'}, - 'mousetrap': {main: 'mousetrap.js', defaultExtension: 'js'}, - 'bmMousetrap': {main: 'mousetrap-brewman.js', defaultExtension: 'js'}, - 'jqScrollIntoView': {main: 'jquery.scrolltoview.js', defaultExtension: 'js'}, - 'showdown': {main: 'dist/showdown.js', defaultExtension: 'js'}, - 'mathjs': {main: 'dist/math.js', defaultExtension: 'js'}, - 'jquery': {main: 'dist/jquery.min.js', defaultExtension: 'js'}, - 'bootstrap': {main: 'dist/js/bootstrap.min.js', defaultExtension: 'js'}, - 'json': {main: 'json.js', defaultExtension: 'js'}, - 'rxjs': {main: 'index.js', defaultExtension: 'js'}, - 'rxjs/operators': {main: 'index.js', defaultExtension: 'js'} - - }; - - var config = { - paths: paths, - map: map, - packages: packages - }; - System.config(config); -}) -(); \ No newline at end of file diff --git a/brewman/static/src/app/trial-balance/trial-balance.component.js b/brewman/static/src/app/trial-balance/trial-balance.component.js deleted file mode 100644 index 5c0c4c14..00000000 --- a/brewman/static/src/app/trial-balance/trial-balance.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var trial_balance_controller_1 = require("./trial-balance.controller"); -exports.TrialBalanceComponent = { - templateUrl: '/app/trial-balance/trial-balance.html', - controller: trial_balance_controller_1.TrialBalanceController, - controllerAs: 'vm', -}; -//# sourceMappingURL=trial-balance.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/trial-balance/trial-balance.component.js.map b/brewman/static/src/app/trial-balance/trial-balance.component.js.map deleted file mode 100644 index d03a8616..00000000 --- a/brewman/static/src/app/trial-balance/trial-balance.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"trial-balance.component.js","sourceRoot":"","sources":["trial-balance.component.ts"],"names":[],"mappings":";;AAAA,uEAAkE;AAErD,QAAA,qBAAqB,GAAG;IACjC,WAAW,EAAE,uCAAuC;IACpD,UAAU,EAAE,iDAAsB;IAClC,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/trial-balance/trial-balance.component.ts b/brewman/static/src/app/trial-balance/trial-balance.component.ts deleted file mode 100644 index 8d7dc02e..00000000 --- a/brewman/static/src/app/trial-balance/trial-balance.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {TrialBalanceController} from "./trial-balance.controller"; - -export const TrialBalanceComponent = { - templateUrl: '/app/trial-balance/trial-balance.html', - controller: TrialBalanceController, - controllerAs: 'vm', -}; diff --git a/brewman/static/src/app/trial-balance/trial-balance.controller.js b/brewman/static/src/app/trial-balance/trial-balance.controller.js deleted file mode 100644 index ea0ecddf..00000000 --- a/brewman/static/src/app/trial-balance/trial-balance.controller.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var TrialBalanceController = /** @class */ (function () { - function TrialBalanceController($scope, $location, asDate, dateParser) { - this.$scope = $scope; - this.$location = $location; - this.asDate = asDate; - this.dateParser = dateParser; - this.$inject = ['$scope', '$location', 'asDateFilter', 'uibDateParser']; - this.trialBalance = $scope.$parent.res.trialBalance; - this._info_Date = dateParser.parse(this.trialBalance.Date, "dd-MMM-yyyy"); - this.info = this.trialBalance; - this.foDate = true; - } - TrialBalanceController.prototype.info_Date = function (value) { - if (arguments.length) { - this.info.Date = this.asDate(value); - this._info_Date = value; - } - return this._info_Date; - }; - TrialBalanceController.prototype.show = function () { - this.$location.path('/TrialBalance/' + this.info.Date); - }; - return TrialBalanceController; -}()); -exports.TrialBalanceController = TrialBalanceController; -//# sourceMappingURL=trial-balance.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/trial-balance/trial-balance.controller.js.map b/brewman/static/src/app/trial-balance/trial-balance.controller.js.map deleted file mode 100644 index 25b21bf9..00000000 --- a/brewman/static/src/app/trial-balance/trial-balance.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"trial-balance.controller.js","sourceRoot":"","sources":["trial-balance.controller.ts"],"names":[],"mappings":";;AAAA;IAOI,gCAAmB,MAAM,EAAS,SAAS,EAAS,MAAM,EAAS,UAAU;QAA1D,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,WAAM,GAAN,MAAM,CAAA;QAAS,eAAU,GAAV,UAAU,CAAA;QAN7E,YAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC;QAO/D,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;QACpD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QAC1E,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;IAED,0CAAS,GAAT,UAAU,KAAK;QACX,IAAI,SAAS,CAAC,MAAM,EAAE;YAClB,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACpC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;SAC3B;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,qCAAI,GAAJ;QACI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3D,CAAC;IACL,6BAAC;AAAD,CAAC,AAzBD,IAyBC;AAzBY,wDAAsB"} \ No newline at end of file diff --git a/brewman/static/src/app/trial-balance/trial-balance.controller.ts b/brewman/static/src/app/trial-balance/trial-balance.controller.ts deleted file mode 100644 index 4872936c..00000000 --- a/brewman/static/src/app/trial-balance/trial-balance.controller.ts +++ /dev/null @@ -1,26 +0,0 @@ -export class TrialBalanceController { - $inject = ['$scope', '$location', 'asDateFilter', 'uibDateParser']; - info: any; - _info_Date: any; - foDate: boolean; - trialBalance: any; - - constructor(public $scope, public $location, public asDate, public dateParser) { - this.trialBalance = $scope.$parent.res.trialBalance; - this._info_Date = dateParser.parse(this.trialBalance.Date, "dd-MMM-yyyy"); - this.info = this.trialBalance; - this.foDate = true; - } - - info_Date(value) { - if (arguments.length) { - this.info.Date = this.asDate(value); - this._info_Date = value; - } - return this._info_Date; - } - - show() { - this.$location.path('/TrialBalance/' + this.info.Date); - } -} diff --git a/brewman/static/src/app/trial-balance/trial-balance.html b/brewman/static/src/app/trial-balance/trial-balance.html deleted file mode 100644 index 6687e1a2..00000000 --- a/brewman/static/src/app/trial-balance/trial-balance.html +++ /dev/null @@ -1,39 +0,0 @@ -
-

Trial Balance

- -
- - -
-
- - - - -
-
-
- -
-
- - - - - - - - - - - - - - - - - -
TypeNameDebitCredit
{{item.Type}}{{item.Name}}{{item.Debit | accounting}}{{item.Credit | accounting}}
-
diff --git a/brewman/static/src/app/trial-balance/trial-balance.resolver.js b/brewman/static/src/app/trial-balance/trial-balance.resolver.js deleted file mode 100644 index 9eeb4fe8..00000000 --- a/brewman/static/src/app/trial-balance/trial-balance.resolver.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var angular = require("angular"); -function TrialBalanceResolver($route, TrialBalance) { - var date = $route.current.params.date; - if (angular.isUndefined(date)) { - return TrialBalance.get({}).$promise; - } - else { - return TrialBalance.get({ date: date }).$promise; - } -} -exports.TrialBalanceResolver = TrialBalanceResolver; -//# sourceMappingURL=trial-balance.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/trial-balance/trial-balance.resolver.js.map b/brewman/static/src/app/trial-balance/trial-balance.resolver.js.map deleted file mode 100644 index 6f4df053..00000000 --- a/brewman/static/src/app/trial-balance/trial-balance.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"trial-balance.resolver.js","sourceRoot":"","sources":["trial-balance.resolver.ts"],"names":[],"mappings":";;AAAA,iCAAmC;AAEnC,8BAAqC,MAAM,EAAE,YAAY;IACrD,IAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;IAExC,IAAI,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;QAC3B,OAAO,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;KACxC;SAAM;QACH,OAAO,YAAY,CAAC,GAAG,CAAC,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC,QAAQ,CAAC;KAClD;AACL,CAAC;AARD,oDAQC"} \ No newline at end of file diff --git a/brewman/static/src/app/trial-balance/trial-balance.resolver.ts b/brewman/static/src/app/trial-balance/trial-balance.resolver.ts deleted file mode 100644 index c1c51d92..00000000 --- a/brewman/static/src/app/trial-balance/trial-balance.resolver.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as angular from 'angular'; - -export function TrialBalanceResolver($route, TrialBalance) { - const date = $route.current.params.date; - - if (angular.isUndefined(date)) { - return TrialBalance.get({}).$promise; - } else { - return TrialBalance.get({date: date}).$promise; - } -} diff --git a/brewman/static/src/app/trial-balance/trial-balance.service.js b/brewman/static/src/app/trial-balance/trial-balance.service.js deleted file mode 100644 index cc6c4912..00000000 --- a/brewman/static/src/app/trial-balance/trial-balance.service.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function TrialBalance($resource) { - return $resource('/api/TrialBalance/:date'); -} -exports.TrialBalance = TrialBalance; -//# sourceMappingURL=trial-balance.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/trial-balance/trial-balance.service.js.map b/brewman/static/src/app/trial-balance/trial-balance.service.js.map deleted file mode 100644 index e2487047..00000000 --- a/brewman/static/src/app/trial-balance/trial-balance.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"trial-balance.service.js","sourceRoot":"","sources":["trial-balance.service.ts"],"names":[],"mappings":";;AAAA,sBAA6B,SAAS;IAClC,OAAO,SAAS,CAAC,yBAAyB,CAAC,CAAC;AAChD,CAAC;AAFD,oCAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/trial-balance/trial-balance.service.ts b/brewman/static/src/app/trial-balance/trial-balance.service.ts deleted file mode 100644 index 8ae5b0be..00000000 --- a/brewman/static/src/app/trial-balance/trial-balance.service.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function TrialBalance($resource) { - return $resource('/api/TrialBalance/:date'); -} diff --git a/brewman/static/src/app/unposted/unposted.component.js b/brewman/static/src/app/unposted/unposted.component.js deleted file mode 100644 index f893fdf5..00000000 --- a/brewman/static/src/app/unposted/unposted.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var unposted_controller_1 = require("./unposted.controller"); -exports.UnpostedComponent = { - templateUrl: '/app/unposted/unposted.html', - controller: unposted_controller_1.UnpostedController, - controllerAs: 'vm', -}; -//# sourceMappingURL=unposted.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/unposted/unposted.component.js.map b/brewman/static/src/app/unposted/unposted.component.js.map deleted file mode 100644 index fef82bc7..00000000 --- a/brewman/static/src/app/unposted/unposted.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"unposted.component.js","sourceRoot":"","sources":["unposted.component.ts"],"names":[],"mappings":";;AAAA,6DAAyD;AAE5C,QAAA,iBAAiB,GAAG;IAC7B,WAAW,EAAE,6BAA6B;IAC1C,UAAU,EAAE,wCAAkB;IAC9B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/unposted/unposted.component.ts b/brewman/static/src/app/unposted/unposted.component.ts deleted file mode 100644 index 8986df34..00000000 --- a/brewman/static/src/app/unposted/unposted.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {UnpostedController} from "./unposted.controller"; - -export const UnpostedComponent = { - templateUrl: '/app/unposted/unposted.html', - controller: UnpostedController, - controllerAs: 'vm', -}; diff --git a/brewman/static/src/app/unposted/unposted.controller.js b/brewman/static/src/app/unposted/unposted.controller.js deleted file mode 100644 index b0da0ae4..00000000 --- a/brewman/static/src/app/unposted/unposted.controller.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var UnpostedController = /** @class */ (function () { - function UnpostedController($scope, Unposted) { - this.$scope = $scope; - this.Unposted = Unposted; - this.$inject = ['$scope', 'Unposted']; - this.info = $scope.$parent.res.info; - } - UnpostedController.prototype.refresh = function () { - var _this = this; - this.Unposted.query({}, function (result) { - _this.info = result; - }); - }; - return UnpostedController; -}()); -exports.UnpostedController = UnpostedController; -//# sourceMappingURL=unposted.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/unposted/unposted.controller.js.map b/brewman/static/src/app/unposted/unposted.controller.js.map deleted file mode 100644 index 6c22c3e1..00000000 --- a/brewman/static/src/app/unposted/unposted.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"unposted.controller.js","sourceRoot":"","sources":["unposted.controller.ts"],"names":[],"mappings":";;AAAA;IAII,4BAAmB,MAAM,EAAS,QAAQ;QAAvB,WAAM,GAAN,MAAM,CAAA;QAAS,aAAQ,GAAR,QAAQ,CAAA;QAH1C,YAAO,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QAI7B,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;IACxC,CAAC;IAED,oCAAO,GAAP;QAAA,iBAIC;QAHG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,UAAC,MAAM;YAC3B,KAAI,CAAC,IAAI,GAAG,MAAM,CAAC;QACvB,CAAC,CAAC,CAAC;IACP,CAAC;IACL,yBAAC;AAAD,CAAC,AAbD,IAaC;AAbY,gDAAkB"} \ No newline at end of file diff --git a/brewman/static/src/app/unposted/unposted.controller.ts b/brewman/static/src/app/unposted/unposted.controller.ts deleted file mode 100644 index 876f999d..00000000 --- a/brewman/static/src/app/unposted/unposted.controller.ts +++ /dev/null @@ -1,14 +0,0 @@ -export class UnpostedController { - $inject = ['$scope', 'Unposted']; - info: any; - - constructor(public $scope, public Unposted) { - this.info = $scope.$parent.res.info; - } - - refresh() { - this.Unposted.query({}, (result) => { - this.info = result; - }); - } -} diff --git a/brewman/static/src/app/unposted/unposted.html b/brewman/static/src/app/unposted/unposted.html deleted file mode 100644 index a6b70d67..00000000 --- a/brewman/static/src/app/unposted/unposted.html +++ /dev/null @@ -1,30 +0,0 @@ -
-

Unposted Entries Refresh

- - - - - - - - - - - - - - - - - - - - - - - - - -
SelectDateTypeNarrationDebitAmountCreditAmount
{{item.Date}}{{item.Type}}{{item.Narration}}{{item.DebitN}}{{item.DebitA | currency}}{{item.CreditN}}{{item.CreditA | currency}}
-
diff --git a/brewman/static/src/app/unposted/unposted.resolver.js b/brewman/static/src/app/unposted/unposted.resolver.js deleted file mode 100644 index c6ce90c0..00000000 --- a/brewman/static/src/app/unposted/unposted.resolver.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function UnpostedResolver(Unposted) { - return Unposted.query({}).$promise; -} -exports.UnpostedResolver = UnpostedResolver; -//# sourceMappingURL=unposted.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/unposted/unposted.resolver.js.map b/brewman/static/src/app/unposted/unposted.resolver.js.map deleted file mode 100644 index 75787e6d..00000000 --- a/brewman/static/src/app/unposted/unposted.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"unposted.resolver.js","sourceRoot":"","sources":["unposted.resolver.ts"],"names":[],"mappings":";;AAEA,0BAAiC,QAAQ;IACrC,OAAO,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;AACvC,CAAC;AAFD,4CAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/unposted/unposted.resolver.ts b/brewman/static/src/app/unposted/unposted.resolver.ts deleted file mode 100644 index 4f889c5b..00000000 --- a/brewman/static/src/app/unposted/unposted.resolver.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as angular from 'angular'; - -export function UnpostedResolver(Unposted) { - return Unposted.query({}).$promise; -} - diff --git a/brewman/static/src/app/unposted/unposted.service.js b/brewman/static/src/app/unposted/unposted.service.js deleted file mode 100644 index e024e1a3..00000000 --- a/brewman/static/src/app/unposted/unposted.service.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function Unposted($resource) { - return $resource('/api/Unposted'); -} -exports.Unposted = Unposted; -//# sourceMappingURL=unposted.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/unposted/unposted.service.js.map b/brewman/static/src/app/unposted/unposted.service.js.map deleted file mode 100644 index e8e3d59b..00000000 --- a/brewman/static/src/app/unposted/unposted.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"unposted.service.js","sourceRoot":"","sources":["unposted.service.ts"],"names":[],"mappings":";;AAAA,kBAAyB,SAAS;IAC9B,OAAO,SAAS,CAAC,eAAe,CAAC,CAAC;AACtC,CAAC;AAFD,4BAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/unposted/unposted.service.ts b/brewman/static/src/app/unposted/unposted.service.ts deleted file mode 100644 index ab082d84..00000000 --- a/brewman/static/src/app/unposted/unposted.service.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function Unposted($resource) { - return $resource('/api/Unposted'); -} diff --git a/brewman/static/src/app/user/user-detail.html b/brewman/static/src/app/user/user-detail.html deleted file mode 100644 index 5bad475d..00000000 --- a/brewman/static/src/app/user/user-detail.html +++ /dev/null @@ -1,46 +0,0 @@ -
-

User Detail

- -
- - -
- -
-
- -
- - -
- - -
-
- -
-
- -
-
- -
- - -
-
- - -
-
-
-
-
- -
-
-
diff --git a/brewman/static/src/app/user/user-list.component.js b/brewman/static/src/app/user/user-list.component.js deleted file mode 100644 index 7589b899..00000000 --- a/brewman/static/src/app/user/user-list.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var user_list_controller_1 = require("./user-list.controller"); -exports.UserListComponent = { - templateUrl: '/app/user/user-list.html', - controller: user_list_controller_1.UserListController, - controllerAs: 'vm', -}; -//# sourceMappingURL=user-list.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/user/user-list.component.js.map b/brewman/static/src/app/user/user-list.component.js.map deleted file mode 100644 index f3074a98..00000000 --- a/brewman/static/src/app/user/user-list.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"user-list.component.js","sourceRoot":"","sources":["user-list.component.ts"],"names":[],"mappings":";;AAAA,+DAA0D;AAE7C,QAAA,iBAAiB,GAAG;IAC7B,WAAW,EAAE,0BAA0B;IACvC,UAAU,EAAE,yCAAkB;IAC9B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/user/user-list.component.ts b/brewman/static/src/app/user/user-list.component.ts deleted file mode 100644 index 764c0e11..00000000 --- a/brewman/static/src/app/user/user-list.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {UserListController} from "./user-list.controller"; - -export const UserListComponent = { - templateUrl: '/app/user/user-list.html', - controller: UserListController, - controllerAs: 'vm', -}; diff --git a/brewman/static/src/app/user/user-list.controller.js b/brewman/static/src/app/user/user-list.controller.js deleted file mode 100644 index 59b65dbc..00000000 --- a/brewman/static/src/app/user/user-list.controller.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var UserListController = /** @class */ (function () { - function UserListController($scope) { - this.$scope = $scope; - this.users = $scope.$parent.res.users; - this.info = this.users; - } - UserListController.$inject = ['$scope']; - return UserListController; -}()); -exports.UserListController = UserListController; -//# sourceMappingURL=user-list.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/user/user-list.controller.js.map b/brewman/static/src/app/user/user-list.controller.js.map deleted file mode 100644 index aaaed576..00000000 --- a/brewman/static/src/app/user/user-list.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"user-list.controller.js","sourceRoot":"","sources":["user-list.controller.ts"],"names":[],"mappings":";;AAAA;IAKI,4BAAmB,MAAM;QAAN,WAAM,GAAN,MAAM,CAAA;QACrB,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;IAC3B,CAAC;IAPM,0BAAO,GAAG,CAAC,QAAQ,CAAC,CAAC;IAQhC,yBAAC;CAAA,AATD,IASC;AATY,gDAAkB"} \ No newline at end of file diff --git a/brewman/static/src/app/user/user-list.controller.ts b/brewman/static/src/app/user/user-list.controller.ts deleted file mode 100644 index 2d810a7b..00000000 --- a/brewman/static/src/app/user/user-list.controller.ts +++ /dev/null @@ -1,10 +0,0 @@ -export class UserListController { - static $inject = ['$scope']; - info: any; - users:any; - - constructor(public $scope) { - this.users = $scope.$parent.res.users; - this.info = this.users; - } -} diff --git a/brewman/static/src/app/user/user-list.html b/brewman/static/src/app/user/user-list.html deleted file mode 100644 index 59f2f730..00000000 --- a/brewman/static/src/app/user/user-list.html +++ /dev/null @@ -1,22 +0,0 @@ -

Users Add

- - - - - - - - - - - - - - - -
NameLocked OutGroups
{{item.Name}}{{item.LockedOut}} -
    -
  • {{group}}
  • -
-
- diff --git a/brewman/static/src/app/user/user-list.resolver.js b/brewman/static/src/app/user/user-list.resolver.js deleted file mode 100644 index 7aec3b3d..00000000 --- a/brewman/static/src/app/user/user-list.resolver.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function UserListResolver(User) { - return User.query({}).$promise; -} -exports.UserListResolver = UserListResolver; -//# sourceMappingURL=user-list.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/user/user-list.resolver.js.map b/brewman/static/src/app/user/user-list.resolver.js.map deleted file mode 100644 index e3d07b65..00000000 --- a/brewman/static/src/app/user/user-list.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"user-list.resolver.js","sourceRoot":"","sources":["user-list.resolver.ts"],"names":[],"mappings":";;AAAA,0BAAiC,IAAI;IACjC,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;AACnC,CAAC;AAFD,4CAEC"} \ No newline at end of file diff --git a/brewman/static/src/app/user/user-list.resolver.ts b/brewman/static/src/app/user/user-list.resolver.ts deleted file mode 100644 index 5268037f..00000000 --- a/brewman/static/src/app/user/user-list.resolver.ts +++ /dev/null @@ -1,4 +0,0 @@ -export function UserListResolver(User) { - return User.query({}).$promise; -} - diff --git a/brewman/static/src/app/user/user.component.js b/brewman/static/src/app/user/user.component.js deleted file mode 100644 index 0eef29ef..00000000 --- a/brewman/static/src/app/user/user.component.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var user_controller_1 = require("./user.controller"); -exports.UserComponent = { - templateUrl: '/app/user/user-detail.html', - controller: user_controller_1.UserController, - controllerAs: 'vm', -}; -//# sourceMappingURL=user.component.js.map \ No newline at end of file diff --git a/brewman/static/src/app/user/user.component.js.map b/brewman/static/src/app/user/user.component.js.map deleted file mode 100644 index 6d0b845a..00000000 --- a/brewman/static/src/app/user/user.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"user.component.js","sourceRoot":"","sources":["user.component.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AAEpC,QAAA,aAAa,GAAG;IACzB,WAAW,EAAE,4BAA4B;IACzC,UAAU,EAAE,gCAAc;IAC1B,YAAY,EAAE,IAAI;CACrB,CAAC"} \ No newline at end of file diff --git a/brewman/static/src/app/user/user.component.ts b/brewman/static/src/app/user/user.component.ts deleted file mode 100644 index 6d0751b6..00000000 --- a/brewman/static/src/app/user/user.component.ts +++ /dev/null @@ -1,7 +0,0 @@ -import {UserController} from "./user.controller"; - -export const UserComponent = { - templateUrl: '/app/user/user-detail.html', - controller: UserController, - controllerAs: 'vm', -}; diff --git a/brewman/static/src/app/user/user.controller.js b/brewman/static/src/app/user/user.controller.js deleted file mode 100644 index 346effe0..00000000 --- a/brewman/static/src/app/user/user.controller.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var UserController = /** @class */ (function () { - function UserController($scope, $location, Messages) { - this.$scope = $scope; - this.$location = $location; - this.Messages = Messages; - this.user = $scope.$parent.res.user; - this.foName = true; - } - UserController.prototype.save = function () { - var _this = this; - this.user.$save(function () { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/Users'); - }, function (data) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - UserController.prototype.delete = function () { - var _this = this; - this.user.$delete(function () { - _this.Messages.push({ Type: 'Success', Message: '' }); - _this.$location.path('/Users'); - }, function (data) { - _this.Messages.push({ Type: 'Danger', Message: data.data }); - }); - }; - UserController.$inject = ['$scope', '$location', 'Messages']; - return UserController; -}()); -exports.UserController = UserController; -//# sourceMappingURL=user.controller.js.map \ No newline at end of file diff --git a/brewman/static/src/app/user/user.controller.js.map b/brewman/static/src/app/user/user.controller.js.map deleted file mode 100644 index 617488fc..00000000 --- a/brewman/static/src/app/user/user.controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"user.controller.js","sourceRoot":"","sources":["user.controller.ts"],"names":[],"mappings":";;AAAA;IAKI,wBAAmB,MAAM,EAAS,SAAS,EAAS,QAAQ;QAAzC,WAAM,GAAN,MAAM,CAAA;QAAS,cAAS,GAAT,SAAS,CAAA;QAAS,aAAQ,GAAR,QAAQ,CAAA;QACxD,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;IAED,6BAAI,GAAJ;QAAA,iBAOC;QANG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;YACZ,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAC,CAAC,CAAC;YACnD,KAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC,EAAE,UAAC,IAAI;YACJ,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,EAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACP,CAAC;IAED,+BAAM,GAAN;QAAA,iBAOC;QANG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YACd,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAC,CAAC,CAAC;YACnD,KAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC,EAAE,UAAC,IAAI;YACJ,KAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,EAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACP,CAAC;IAzBM,sBAAO,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;IA0BzD,qBAAC;CAAA,AA3BD,IA2BC;AA3BY,wCAAc"} \ No newline at end of file diff --git a/brewman/static/src/app/user/user.controller.ts b/brewman/static/src/app/user/user.controller.ts deleted file mode 100644 index b9803988..00000000 --- a/brewman/static/src/app/user/user.controller.ts +++ /dev/null @@ -1,28 +0,0 @@ -export class UserController { - static $inject = ['$scope', '$location', 'Messages']; - foName: any; - user: any; - - constructor(public $scope, public $location, public Messages) { - this.user = $scope.$parent.res.user; - this.foName = true; - } - - save() { - this.user.$save(() => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/Users'); - }, (data) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } - - delete() { - this.user.$delete(() => { - this.Messages.push({Type: 'Success', Message: ''}); - this.$location.path('/Users'); - }, (data) => { - this.Messages.push({Type: 'Danger', Message: data.data}); - }); - } -} diff --git a/brewman/static/src/app/user/user.resolver.js b/brewman/static/src/app/user/user.resolver.js deleted file mode 100644 index 42d4622e..00000000 --- a/brewman/static/src/app/user/user.resolver.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function UserResolver($route, User) { - var id = $route.current.params.id; - return User.get({ id: id }).$promise; -} -exports.UserResolver = UserResolver; -//# sourceMappingURL=user.resolver.js.map \ No newline at end of file diff --git a/brewman/static/src/app/user/user.resolver.js.map b/brewman/static/src/app/user/user.resolver.js.map deleted file mode 100644 index 3067c7a6..00000000 --- a/brewman/static/src/app/user/user.resolver.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"user.resolver.js","sourceRoot":"","sources":["user.resolver.ts"],"names":[],"mappings":";;AAAA,sBAA6B,MAAM,EAAE,IAAI;IACrC,IAAM,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;IACpC,OAAO,IAAI,CAAC,GAAG,CAAC,EAAC,EAAE,EAAE,EAAE,EAAC,CAAC,CAAC,QAAQ,CAAC;AACvC,CAAC;AAHD,oCAGC"} \ No newline at end of file diff --git a/brewman/static/src/app/user/user.resolver.ts b/brewman/static/src/app/user/user.resolver.ts deleted file mode 100644 index 326f9e43..00000000 --- a/brewman/static/src/app/user/user.resolver.ts +++ /dev/null @@ -1,4 +0,0 @@ -export function UserResolver($route, User) { - const id = $route.current.params.id; - return User.get({id: id}).$promise; -} diff --git a/brewman/static/src/app/user/user.service.js b/brewman/static/src/app/user/user.service.js deleted file mode 100644 index 54444109..00000000 --- a/brewman/static/src/app/user/user.service.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -function User($resource) { - return $resource('/api/User/:id', { id: '@UserID' }, { - query: { method: 'GET', params: { list: true }, isArray: true }, - names: { method: 'GET', params: { names: true }, isArray: true } - }); -} -exports.User = User; -//# sourceMappingURL=user.service.js.map \ No newline at end of file diff --git a/brewman/static/src/app/user/user.service.js.map b/brewman/static/src/app/user/user.service.js.map deleted file mode 100644 index 3b67475a..00000000 --- a/brewman/static/src/app/user/user.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"user.service.js","sourceRoot":"","sources":["user.service.ts"],"names":[],"mappings":";;AAAA,cAAqB,SAAS;IAC1B,OAAO,SAAS,CAAC,eAAe,EAC5B,EAAC,EAAE,EAAE,SAAS,EAAC,EAAE;QACb,KAAK,EAAE,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,EAAE,OAAO,EAAE,IAAI,EAAC;QAC3D,KAAK,EAAE,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,EAAE,OAAO,EAAE,IAAI,EAAC;KAC/D,CAAC,CAAC;AACX,CAAC;AAND,oBAMC"} \ No newline at end of file diff --git a/brewman/static/src/app/user/user.service.ts b/brewman/static/src/app/user/user.service.ts deleted file mode 100644 index f5cafb83..00000000 --- a/brewman/static/src/app/user/user.service.ts +++ /dev/null @@ -1,7 +0,0 @@ -export function User($resource) { - return $resource('/api/User/:id', - {id: '@UserID'}, { - query: {method: 'GET', params: {list: true}, isArray: true}, - names: {method: 'GET', params: {names: true}, isArray: true} - }); -} diff --git a/brewman/static/src/css/chosen.min.css b/brewman/static/src/css/chosen.min.css deleted file mode 100644 index 5a0c4278..00000000 --- a/brewman/static/src/css/chosen.min.css +++ /dev/null @@ -1,3 +0,0 @@ -/* Chosen v1.3.0 | (c) 2011-2014 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */ - -.chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;zoom:1;*display:inline;-webkit-user-select:none;-moz-user-select:none;user-select:none}.chosen-container *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.chosen-container .chosen-drop{position:absolute;top:100%;left:-9999px;z-index:1010;width:100%;border:1px solid #aaa;border-top:0;background:#fff;box-shadow:0 4px 5px rgba(0,0,0,.15)}.chosen-container.chosen-with-drop .chosen-drop{left:0}.chosen-container a{cursor:pointer}.chosen-container-single .chosen-single{position:relative;display:block;overflow:hidden;padding:0 0 0 8px;height:25px;border:1px solid #aaa;border-radius:5px;background-color:#fff;background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#fff),color-stop(50%,#f6f6f6),color-stop(52%,#eee),color-stop(100%,#f4f4f4));background:-webkit-linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-moz-linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-o-linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background-clip:padding-box;box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chosen-container-single .chosen-default{color:#999}.chosen-container-single .chosen-single span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:6px;right:26px;display:block;width:12px;height:12px;background:url(../img/chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-single .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single.chosen-disabled .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;width:18px;height:100%}.chosen-container-single .chosen-single div b{display:block;width:100%;height:100%;background:url(../img/chosen-sprite.png) no-repeat 0 2px}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type=text]{margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;background:#fff url(../img/chosen-sprite.png) no-repeat 100% -20px;background:url(../img/chosen-sprite.png) no-repeat 100% -20px;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;left:-9999px}.chosen-container .chosen-results{color:#444;position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px;word-wrap:break-word;-webkit-touch-callout:none}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{background-color:#3875d7;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#3875d7),color-stop(90%,#2a62bc));background-image:-webkit-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-moz-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-o-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:linear-gradient(#3875d7 20%,#2a62bc 90%);color:#fff}.chosen-container .chosen-results li.no-results{color:#777;display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-results li.group-option{padding-left:15px}.chosen-container .chosen-results li em{font-style:normal;text-decoration:underline}.chosen-container-multi .chosen-choices{position:relative;overflow:hidden;margin:0;padding:0 5px;width:100%;height:auto!important;height:1%;border:1px solid #aaa;background-color:#fff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(1%,#eee),color-stop(15%,#fff));background-image:-webkit-linear-gradient(#eee 1%,#fff 15%);background-image:-moz-linear-gradient(#eee 1%,#fff 15%);background-image:-o-linear-gradient(#eee 1%,#fff 15%);background-image:linear-gradient(#eee 1%,#fff 15%);cursor:text}.chosen-container-multi .chosen-choices li{float:left;list-style:none}.chosen-container-multi .chosen-choices li.search-field{margin:0;padding:0;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-field input[type=text]{margin:1px 0;padding:0;height:25px;outline:0;border:0!important;background:transparent!important;box-shadow:none;color:#999;font-size:100%;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-multi .chosen-choices li.search-choice{position:relative;margin:3px 5px 3px 0;padding:3px 20px 3px 5px;border:1px solid #aaa;max-width:100%;border-radius:3px;background-color:#eee;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-size:100% 19px;background-repeat:repeat-x;background-clip:padding-box;box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);color:#333;line-height:13px;cursor:default}.chosen-container-multi .chosen-choices li.search-choice span{word-wrap:break-word}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:4px;right:3px;display:block;width:12px;height:12px;background:url(../img/chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover{background-position:-42px -10px}.chosen-container-multi .chosen-choices li.search-choice-disabled{padding-right:5px;border:1px solid #ccc;background-color:#e4e4e4;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(top,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(top,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(top,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(top,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);color:#666}.chosen-container-multi .chosen-choices li.search-choice-focus{background:#d4d4d4}.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close{background-position:-42px -10px}.chosen-container-multi .chosen-results{margin:0;padding:0}.chosen-container-multi .chosen-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chosen-container-active .chosen-single{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active.chosen-with-drop .chosen-single{border:1px solid #aaa;-moz-border-radius-bottomright:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:0;border-bottom-left-radius:0;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#eee),color-stop(80%,#fff));background-image:-webkit-linear-gradient(#eee 20%,#fff 80%);background-image:-moz-linear-gradient(#eee 20%,#fff 80%);background-image:-o-linear-gradient(#eee 20%,#fff 80%);background-image:linear-gradient(#eee 20%,#fff 80%);box-shadow:0 1px 0 #fff inset}.chosen-container-active.chosen-with-drop .chosen-single div{border-left:0;background:transparent}.chosen-container-active.chosen-with-drop .chosen-single div b{background-position:-18px 2px}.chosen-container-active .chosen-choices{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active .chosen-choices li.search-field input[type=text]{color:#222!important}.chosen-disabled{opacity:.5!important;cursor:default}.chosen-disabled .chosen-single{cursor:default}.chosen-disabled .chosen-choices .search-choice .search-choice-close{cursor:default}.chosen-rtl{text-align:right}.chosen-rtl .chosen-single{overflow:visible;padding:0 8px 0 0}.chosen-rtl .chosen-single span{margin-right:0;margin-left:26px;direction:rtl}.chosen-rtl .chosen-single-with-deselect span{margin-left:38px}.chosen-rtl .chosen-single div{right:auto;left:3px}.chosen-rtl .chosen-single abbr{right:auto;left:26px}.chosen-rtl .chosen-choices li{float:right}.chosen-rtl .chosen-choices li.search-field input[type=text]{direction:rtl}.chosen-rtl .chosen-choices li.search-choice{margin:3px 5px 3px 0;padding:3px 5px 3px 19px}.chosen-rtl .chosen-choices li.search-choice .search-choice-close{right:auto;left:4px}.chosen-rtl.chosen-container-single-nosearch .chosen-search,.chosen-rtl .chosen-drop{left:9999px}.chosen-rtl.chosen-container-single .chosen-results{margin:0 0 4px 4px;padding:0 4px 0 0}.chosen-rtl .chosen-results li.group-option{padding-right:15px;padding-left:0}.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div{border-right:0}.chosen-rtl .chosen-search input[type=text]{padding:4px 5px 4px 20px;background:#fff url(../img/chosen-sprite.png) no-repeat -30px -20px;background:url(../img/chosen-sprite.png) no-repeat -30px -20px;direction:rtl}.chosen-rtl.chosen-container-single .chosen-single div b{background-position:6px 2px}.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b{background-position:-12px 2px}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min-resolution:144dpi){.chosen-rtl .chosen-search input[type=text],.chosen-container-single .chosen-single abbr,.chosen-container-single .chosen-single div b,.chosen-container-single .chosen-search input[type=text],.chosen-container-multi .chosen-choices .search-choice .search-choice-close,.chosen-container .chosen-results-scroll-down span,.chosen-container .chosen-results-scroll-up span{background-image:url(../img/chosen-sprite@2x.png)!important;background-size:52px 37px!important;background-repeat:no-repeat!important}} \ No newline at end of file diff --git a/brewman/static/src/css/loading-bar.min.css b/brewman/static/src/css/loading-bar.min.css deleted file mode 100644 index 0f9f1067..00000000 --- a/brewman/static/src/css/loading-bar.min.css +++ /dev/null @@ -1 +0,0 @@ -#loading-bar,#loading-bar-spinner{pointer-events:none;-webkit-pointer-events:none;-webkit-transition:350ms linear all;-moz-transition:350ms linear all;-o-transition:350ms linear all;transition:350ms linear all}#loading-bar-spinner.ng-enter,#loading-bar-spinner.ng-leave.ng-leave-active,#loading-bar.ng-enter,#loading-bar.ng-leave.ng-leave-active{opacity:0}#loading-bar-spinner.ng-enter.ng-enter-active,#loading-bar-spinner.ng-leave,#loading-bar.ng-enter.ng-enter-active,#loading-bar.ng-leave{opacity:1}#loading-bar .bar{-webkit-transition:width 350ms;-moz-transition:width 350ms;-o-transition:width 350ms;transition:width 350ms;background:#29d;position:fixed;z-index:10002;top:0;left:0;width:100%;height:2px;border-bottom-right-radius:1px;border-top-right-radius:1px}#loading-bar .peg{position:absolute;width:70px;right:0;top:0;height:2px;opacity:.45;-moz-box-shadow:#29d 1px 0 6px 1px;-ms-box-shadow:#29d 1px 0 6px 1px;-webkit-box-shadow:#29d 1px 0 6px 1px;box-shadow:#29d 1px 0 6px 1px;-moz-border-radius:100%;-webkit-border-radius:100%;border-radius:100%}#loading-bar-spinner{display:block;position:fixed;z-index:10002;top:10px;left:10px}#loading-bar-spinner .spinner-icon{width:14px;height:14px;border:2px solid transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:loading-bar-spinner 400ms linear infinite;-moz-animation:loading-bar-spinner 400ms linear infinite;-ms-animation:loading-bar-spinner 400ms linear infinite;-o-animation:loading-bar-spinner 400ms linear infinite;animation:loading-bar-spinner 400ms linear infinite}@-webkit-keyframes loading-bar-spinner{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes loading-bar-spinner{0%{-moz-transform:rotate(0);transform:rotate(0)}100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes loading-bar-spinner{0%{-o-transform:rotate(0);transform:rotate(0)}100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@-ms-keyframes loading-bar-spinner{0%{-ms-transform:rotate(0);transform:rotate(0)}100%{-ms-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes loading-bar-spinner{0%{transform:rotate(0)}100%{transform:rotate(360deg)}} \ No newline at end of file diff --git a/brewman/static/src/css/nv.d3.css b/brewman/static/src/css/nv.d3.css deleted file mode 100644 index cae83482..00000000 --- a/brewman/static/src/css/nv.d3.css +++ /dev/null @@ -1,769 +0,0 @@ - -/******************** - * HTML CSS - */ - - -.chartWrap { - margin: 0; - padding: 0; - overflow: hidden; -} - -/******************** - Box shadow and border radius styling -*/ -.nvtooltip.with-3d-shadow, .with-3d-shadow .nvtooltip { - -moz-box-shadow: 0 5px 10px rgba(0,0,0,.2); - -webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2); - box-shadow: 0 5px 10px rgba(0,0,0,.2); - - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; -} - -/******************** - * TOOLTIP CSS - */ - -.nvtooltip { - position: absolute; - background-color: rgba(255,255,255,1.0); - padding: 1px; - border: 1px solid rgba(0,0,0,.2); - z-index: 10000; - - font-family: Arial; - font-size: 13px; - text-align: left; - pointer-events: none; - - white-space: nowrap; - - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -/*Give tooltips that old fade in transition by - putting a "with-transitions" class on the container div. -*/ -.nvtooltip.with-transitions, .with-transitions .nvtooltip { - transition: opacity 250ms linear; - -moz-transition: opacity 250ms linear; - -webkit-transition: opacity 250ms linear; - - transition-delay: 250ms; - -moz-transition-delay: 250ms; - -webkit-transition-delay: 250ms; -} - -.nvtooltip.x-nvtooltip, -.nvtooltip.y-nvtooltip { - padding: 8px; -} - -.nvtooltip h3 { - margin: 0; - padding: 4px 14px; - line-height: 18px; - font-weight: normal; - background-color: rgba(247,247,247,0.75); - text-align: center; - - border-bottom: 1px solid #ebebeb; - - -webkit-border-radius: 5px 5px 0 0; - -moz-border-radius: 5px 5px 0 0; - border-radius: 5px 5px 0 0; -} - -.nvtooltip p { - margin: 0; - padding: 5px 14px; - text-align: center; -} - -.nvtooltip span { - display: inline-block; - margin: 2px 0; -} - -.nvtooltip table { - margin: 6px; - border-spacing:0; -} - - -.nvtooltip table td { - padding: 2px 9px 2px 0; - vertical-align: middle; -} - -.nvtooltip table td.key { - font-weight:normal; -} -.nvtooltip table td.value { - text-align: right; - font-weight: bold; -} - -.nvtooltip table tr.highlight td { - padding: 1px 9px 1px 0; - border-bottom-style: solid; - border-bottom-width: 1px; - border-top-style: solid; - border-top-width: 1px; -} - -.nvtooltip table td.legend-color-guide div { - width: 8px; - height: 8px; - vertical-align: middle; -} - -.nvtooltip .footer { - padding: 3px; - text-align: center; -} - - -.nvtooltip-pending-removal { - position: absolute; - pointer-events: none; -} - - -/******************** - * SVG CSS - */ - - -svg { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - /* Trying to get SVG to act like a greedy block in all browsers */ - display: block; - width:100%; - height:100%; -} - - -svg text { - font: normal 12px Arial; -} - -svg .title { - font: bold 14px Arial; -} - -.nvd3 .nv-background { - fill: white; - fill-opacity: 0; - /* - pointer-events: none; - */ -} - -.nvd3.nv-noData { - font-size: 18px; - font-weight: bold; -} - - -/********** -* Brush -*/ - -.nv-brush .extent { - fill-opacity: .125; - shape-rendering: crispEdges; -} - - - -/********** -* Legend -*/ - -.nvd3 .nv-legend .nv-series { - cursor: pointer; -} - -.nvd3 .nv-legend .disabled circle { - fill-opacity: 0; -} - - - -/********** -* Axes -*/ -.nvd3 .nv-axis { - pointer-events:none; -} - -.nvd3 .nv-axis path { - fill: none; - stroke: #000; - stroke-opacity: .75; - shape-rendering: crispEdges; -} - -.nvd3 .nv-axis path.domain { - stroke-opacity: .75; -} - -.nvd3 .nv-axis.nv-x path.domain { - stroke-opacity: 0; -} - -.nvd3 .nv-axis line { - fill: none; - stroke: #e5e5e5; - shape-rendering: crispEdges; -} - -.nvd3 .nv-axis .zero line, -/*this selector may not be necessary*/ .nvd3 .nv-axis line.zero { - stroke-opacity: .75; -} - -.nvd3 .nv-axis .nv-axisMaxMin text { - font-weight: bold; -} - -.nvd3 .x .nv-axis .nv-axisMaxMin text, -.nvd3 .x2 .nv-axis .nv-axisMaxMin text, -.nvd3 .x3 .nv-axis .nv-axisMaxMin text { - text-anchor: middle -} - - - -/********** -* Brush -*/ - -.nv-brush .resize path { - fill: #eee; - stroke: #666; -} - - - -/********** -* Bars -*/ - -.nvd3 .nv-bars .negative rect { - zfill: brown; -} - -.nvd3 .nv-bars rect { - zfill: steelblue; - fill-opacity: .75; - - transition: fill-opacity 250ms linear; - -moz-transition: fill-opacity 250ms linear; - -webkit-transition: fill-opacity 250ms linear; -} - -.nvd3 .nv-bars rect.hover { - fill-opacity: 1; -} - -.nvd3 .nv-bars .hover rect { - fill: lightblue; -} - -.nvd3 .nv-bars text { - fill: rgba(0,0,0,0); -} - -.nvd3 .nv-bars .hover text { - fill: rgba(0,0,0,1); -} - - -/********** -* Bars -*/ - -.nvd3 .nv-multibar .nv-groups rect, -.nvd3 .nv-multibarHorizontal .nv-groups rect, -.nvd3 .nv-discretebar .nv-groups rect { - stroke-opacity: 0; - - transition: fill-opacity 250ms linear; - -moz-transition: fill-opacity 250ms linear; - -webkit-transition: fill-opacity 250ms linear; -} - -.nvd3 .nv-multibar .nv-groups rect:hover, -.nvd3 .nv-multibarHorizontal .nv-groups rect:hover, -.nvd3 .nv-discretebar .nv-groups rect:hover { - fill-opacity: 1; -} - -.nvd3 .nv-discretebar .nv-groups text, -.nvd3 .nv-multibarHorizontal .nv-groups text { - font-weight: bold; - fill: rgba(0,0,0,1); - stroke: rgba(0,0,0,0); -} - -/*********** -* Pie Chart -*/ - -.nvd3.nv-pie path { - stroke-opacity: 0; - transition: fill-opacity 250ms linear, stroke-width 250ms linear, stroke-opacity 250ms linear; - -moz-transition: fill-opacity 250ms linear, stroke-width 250ms linear, stroke-opacity 250ms linear; - -webkit-transition: fill-opacity 250ms linear, stroke-width 250ms linear, stroke-opacity 250ms linear; - -} - -.nvd3.nv-pie .nv-slice text { - stroke: #000; - stroke-width: 0; -} - -.nvd3.nv-pie path { - stroke: #fff; - stroke-width: 1px; - stroke-opacity: 1; -} - -.nvd3.nv-pie .hover path { - fill-opacity: .7; -} -.nvd3.nv-pie .nv-label { - pointer-events: none; -} -.nvd3.nv-pie .nv-label rect { - fill-opacity: 0; - stroke-opacity: 0; -} - -/********** -* Lines -*/ - -.nvd3 .nv-groups path.nv-line { - fill: none; - stroke-width: 1.5px; - /* - stroke-linecap: round; - shape-rendering: geometricPrecision; - - transition: stroke-width 250ms linear; - -moz-transition: stroke-width 250ms linear; - -webkit-transition: stroke-width 250ms linear; - - transition-delay: 250ms - -moz-transition-delay: 250ms; - -webkit-transition-delay: 250ms; - */ -} - -.nvd3 .nv-groups path.nv-line.nv-thin-line { - stroke-width: 1px; -} - - -.nvd3 .nv-groups path.nv-area { - stroke: none; - /* - stroke-linecap: round; - shape-rendering: geometricPrecision; - - stroke-width: 2.5px; - transition: stroke-width 250ms linear; - -moz-transition: stroke-width 250ms linear; - -webkit-transition: stroke-width 250ms linear; - - transition-delay: 250ms - -moz-transition-delay: 250ms; - -webkit-transition-delay: 250ms; - */ -} - -.nvd3 .nv-line.hover path { - stroke-width: 6px; -} - -/* -.nvd3.scatter .groups .point { - fill-opacity: 0.1; - stroke-opacity: 0.1; -} - */ - -.nvd3.nv-line .nvd3.nv-scatter .nv-groups .nv-point { - fill-opacity: 0; - stroke-opacity: 0; -} - -.nvd3.nv-scatter.nv-single-point .nv-groups .nv-point { - fill-opacity: .5 !important; - stroke-opacity: .5 !important; -} - - -.with-transitions .nvd3 .nv-groups .nv-point { - transition: stroke-width 250ms linear, stroke-opacity 250ms linear; - -moz-transition: stroke-width 250ms linear, stroke-opacity 250ms linear; - -webkit-transition: stroke-width 250ms linear, stroke-opacity 250ms linear; - -} - -.nvd3.nv-scatter .nv-groups .nv-point.hover, -.nvd3 .nv-groups .nv-point.hover { - stroke-width: 7px; - fill-opacity: .95 !important; - stroke-opacity: .95 !important; -} - - -.nvd3 .nv-point-paths path { - stroke: #aaa; - stroke-opacity: 0; - fill: #eee; - fill-opacity: 0; -} - - - -.nvd3 .nv-indexLine { - cursor: ew-resize; -} - - -/********** -* Distribution -*/ - -.nvd3 .nv-distribution { - pointer-events: none; -} - - - -/********** -* Scatter -*/ - -/* **Attempting to remove this for useVoronoi(false), need to see if it's required anywhere -.nvd3 .nv-groups .nv-point { - pointer-events: none; -} -*/ - -.nvd3 .nv-groups .nv-point.hover { - stroke-width: 20px; - stroke-opacity: .5; -} - -.nvd3 .nv-scatter .nv-point.hover { - fill-opacity: 1; -} - -/* -.nv-group.hover .nv-point { - fill-opacity: 1; -} -*/ - - -/********** -* Stacked Area -*/ - -.nvd3.nv-stackedarea path.nv-area { - fill-opacity: .7; - /* - stroke-opacity: .65; - fill-opacity: 1; - */ - stroke-opacity: 0; - - transition: fill-opacity 250ms linear, stroke-opacity 250ms linear; - -moz-transition: fill-opacity 250ms linear, stroke-opacity 250ms linear; - -webkit-transition: fill-opacity 250ms linear, stroke-opacity 250ms linear; - - /* - transition-delay: 500ms; - -moz-transition-delay: 500ms; - -webkit-transition-delay: 500ms; - */ - -} - -.nvd3.nv-stackedarea path.nv-area.hover { - fill-opacity: .9; - /* - stroke-opacity: .85; - */ -} -/* -.d3stackedarea .groups path { - stroke-opacity: 0; -} - */ - - - -.nvd3.nv-stackedarea .nv-groups .nv-point { - stroke-opacity: 0; - fill-opacity: 0; -} - -/* -.nvd3.nv-stackedarea .nv-groups .nv-point.hover { - stroke-width: 20px; - stroke-opacity: .75; - fill-opacity: 1; -}*/ - - - -/********** -* Line Plus Bar -*/ - -.nvd3.nv-linePlusBar .nv-bar rect { - fill-opacity: .75; -} - -.nvd3.nv-linePlusBar .nv-bar rect:hover { - fill-opacity: 1; -} - - -/********** -* Bullet -*/ - -.nvd3.nv-bullet { font: 10px sans-serif; } -.nvd3.nv-bullet .nv-measure { fill-opacity: .8; } -.nvd3.nv-bullet .nv-measure:hover { fill-opacity: 1; } -.nvd3.nv-bullet .nv-marker { stroke: #000; stroke-width: 2px; } -.nvd3.nv-bullet .nv-markerTriangle { stroke: #000; fill: #fff; stroke-width: 1.5px; } -.nvd3.nv-bullet .nv-tick line { stroke: #666; stroke-width: .5px; } -.nvd3.nv-bullet .nv-range.nv-s0 { fill: #eee; } -.nvd3.nv-bullet .nv-range.nv-s1 { fill: #ddd; } -.nvd3.nv-bullet .nv-range.nv-s2 { fill: #ccc; } -.nvd3.nv-bullet .nv-title { font-size: 14px; font-weight: bold; } -.nvd3.nv-bullet .nv-subtitle { fill: #999; } - - -.nvd3.nv-bullet .nv-range { - fill: #bababa; - fill-opacity: .4; -} -.nvd3.nv-bullet .nv-range:hover { - fill-opacity: .7; -} - - - -/********** -* Sparkline -*/ - -.nvd3.nv-sparkline path { - fill: none; -} - -.nvd3.nv-sparklineplus g.nv-hoverValue { - pointer-events: none; -} - -.nvd3.nv-sparklineplus .nv-hoverValue line { - stroke: #333; - stroke-width: 1.5px; - } - -.nvd3.nv-sparklineplus, -.nvd3.nv-sparklineplus g { - pointer-events: all; -} - -.nvd3 .nv-hoverArea { - fill-opacity: 0; - stroke-opacity: 0; -} - -.nvd3.nv-sparklineplus .nv-xValue, -.nvd3.nv-sparklineplus .nv-yValue { - /* - stroke: #666; - */ - stroke-width: 0; - font-size: .9em; - font-weight: normal; -} - -.nvd3.nv-sparklineplus .nv-yValue { - stroke: #f66; -} - -.nvd3.nv-sparklineplus .nv-maxValue { - stroke: #2ca02c; - fill: #2ca02c; -} - -.nvd3.nv-sparklineplus .nv-minValue { - stroke: #d62728; - fill: #d62728; -} - -.nvd3.nv-sparklineplus .nv-currentValue { - /* - stroke: #444; - fill: #000; - */ - font-weight: bold; - font-size: 1.1em; -} - -/********** -* historical stock -*/ - -.nvd3.nv-ohlcBar .nv-ticks .nv-tick { - stroke-width: 2px; -} - -.nvd3.nv-ohlcBar .nv-ticks .nv-tick.hover { - stroke-width: 4px; -} - -.nvd3.nv-ohlcBar .nv-ticks .nv-tick.positive { - stroke: #2ca02c; -} - -.nvd3.nv-ohlcBar .nv-ticks .nv-tick.negative { - stroke: #d62728; -} - -.nvd3.nv-historicalStockChart .nv-axis .nv-axislabel { - font-weight: bold; -} - -.nvd3.nv-historicalStockChart .nv-dragTarget { - fill-opacity: 0; - stroke: none; - cursor: move; -} - -.nvd3 .nv-brush .extent { - /* - cursor: ew-resize !important; - */ - fill-opacity: 0 !important; -} - -.nvd3 .nv-brushBackground rect { - stroke: #000; - stroke-width: .4; - fill: #fff; - fill-opacity: .7; -} - - - -/********** -* Indented Tree -*/ - - -/** - * TODO: the following 3 selectors are based on classes used in the example. I should either make them standard and leave them here, or move to a CSS file not included in the library - */ -.nvd3.nv-indentedtree .name { - margin-left: 5px; -} - -.nvd3.nv-indentedtree .clickable { - color: #08C; - cursor: pointer; -} - -.nvd3.nv-indentedtree span.clickable:hover { - color: #005580; - text-decoration: underline; -} - - -.nvd3.nv-indentedtree .nv-childrenCount { - display: inline-block; - margin-left: 5px; -} - -.nvd3.nv-indentedtree .nv-treeicon { - cursor: pointer; - /* - cursor: n-resize; - */ -} - -.nvd3.nv-indentedtree .nv-treeicon.nv-folded { - cursor: pointer; - /* - cursor: s-resize; - */ -} - -/********** -* Parallel Coordinates -*/ - -.nvd3 .background path { - fill: none; - stroke: #ccc; - stroke-opacity: .4; - shape-rendering: crispEdges; -} - -.nvd3 .foreground path { - fill: none; - stroke: steelblue; - stroke-opacity: .7; -} - -.nvd3 .brush .extent { - fill-opacity: .3; - stroke: #fff; - shape-rendering: crispEdges; -} - -.nvd3 .axis line, .axis path { - fill: none; - stroke: #000; - shape-rendering: crispEdges; -} - -.nvd3 .axis text { - text-shadow: 0 1px 0 #fff; -} - -/**** -Interactive Layer -*/ -.nvd3 .nv-interactiveGuideLine { - pointer-events:none; -} -.nvd3 line.nv-guideline { - stroke: #ccc; -} \ No newline at end of file diff --git a/brewman/static/src/css/spinner.css b/brewman/static/src/css/spinner.css deleted file mode 100644 index 52cb5c55..00000000 --- a/brewman/static/src/css/spinner.css +++ /dev/null @@ -1,119 +0,0 @@ -#spinner { - position: fixed; - /*top: 0;*/ - /*left: 0;*/ - /*width: 128px;*/ - /*height: 128px;*/ - /*! important !*/ - display: none; - /* last attribute set darkness on scale: 0...1.0 */ - /*background-color: rgba(0, 0, 0, 0.8);*/ - text-align: center; - z-index: 101; -} - -#circleG { - width: 112px; -} - -.circleG { - background-color: #FFFFFF; - float: left; - height: 24px; - margin-left: 13px; - width: 24px; - -webkit-animation-name: bounce_circleG; - -webkit-border-radius: 16px; - -webkit-animation-duration: 1.9500000000000002s; - -webkit-animation-iteration-count: infinite; - -webkit-animation-direction: linear; - -moz-animation-name: bounce_circleG; - -moz-border-radius: 16px; - -moz-animation-duration: 1.9500000000000002s; - -moz-animation-iteration-count: infinite; - -moz-animation-direction: linear; - opacity: 0.3; - -o-animation-name: bounce_circleG; - border-radius: 16px; - -o-animation-duration: 1.9500000000000002s; - -o-animation-iteration-count: infinite; - -o-animation-direction: linear; - -ms-animation-name: bounce_circleG; - -ms-animation-duration: 1.9500000000000002s; - -ms-animation-iteration-count: infinite; - -ms-animation-direction: linear; - opacity: 0.3 -} - -#circleG_1 { - -webkit-animation-delay: 0.39s; - -moz-animation-delay: 0.39s; - -o-animation-delay: 0.39s; - -ms-animation-delay: 0.39s; -} - -#circleG_2 { - -webkit-animation-delay: 0.91s; - -moz-animation-delay: 0.91s; - -o-animation-delay: 0.91s; - -ms-animation-delay: 0.91s; -} - -#circleG_3 { - -webkit-animation-delay: 1.17s; - -moz-animation-delay: 1.17s; - -o-animation-delay: 1.17s; - -ms-animation-delay: 1.17s; -} - -@-webkit-keyframes bounce_circleG{ -0%{ -opacity:0.3} - -50%{ -opacity:1; -background-color:#000000} - -100%{ -opacity:0.3} - -} - -@-moz-keyframes bounce_circleG{ -0%{ -opacity:0.3} - -50%{ -opacity:1; -background-color:#000000} - -100%{ -opacity:0.3} - -} - -@-o-keyframes bounce_circleG{ -0%{ -opacity:0.3} - -50%{ -opacity:1; -background-color:#000000} - -100%{ -opacity:0.3} - -} - -@-ms-keyframes bounce_circleG{ -0%{ -opacity:0.3} - -50%{ -opacity:1; -background-color:#000000} - -100%{ -opacity:0.3} - -} diff --git a/brewman/static/src/css/table.css b/brewman/static/src/css/table.css deleted file mode 100644 index 7e15a04c..00000000 --- a/brewman/static/src/css/table.css +++ /dev/null @@ -1,73 +0,0 @@ -/* Table for Issue */ -.no-wrap { - white-space: nowrap -} - -.hide { - display: none; -} - -.table tbody tr.Present td:not(.no-bg) { - background-color: #228B22; -} - -.table tbody tr.Off td:not(.no-bg) { - background-color: #87CEFA; -} - -.table tbody tr.Leave td:not(.no-bg) { - background-color: #CD5C5C; -} - -.table tbody tr.Absent td:not(.no-bg) { - background-color: #CD0000; -} - -.table tbody tr.HalfDay td:not(.no-bg) { - background-color: #98FB98; -} - -.table tbody tr.Double td:not(.no-bg) { - background-color: #006400; -} - -.table tbody tr.PaidLeaveAvailed td:not(.no-bg) { - background-color: #EEEE00; -} - -.table tbody tr.CasualLeaveAvailed td:not(.no-bg) { - background-color: #800080; -} - -.table tbody tr.COff td:not(.no-bg) { - background-color: #F5DEB3; -} - -.table tbody tr.HalfPL td:not(.no-bg) { - background-color: #FFF68F; -} - -.table tbody tr.HalfCL td:not(.no-bg) { - background-color: #FF00FF; -} - -.img-container { - position: relative; - display: inline-block; - cursor: crosshair; -} - -.img-container > .overlay { - position: absolute; - top: 14px; - right: 14px; - display: none; -} - -.img-container:hover .overlay { - display: block; -} - -/*.img-container:hover ~ .img-container > .overlay:hover {*/ - /*display: block;*/ -/*}*/ \ No newline at end of file diff --git a/brewman/static/src/favicon.ico b/brewman/static/src/favicon.ico deleted file mode 100644 index 5acbe77119c75670dae715d3d7cc1aa59d3fc6cb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3126 zcmc&#dvKgp75_HQa9Q8S&yC4-9IoRI zrHTDAzTqO04zJ9qfvXmdgEDX&H28*#gpx}-;Aw!nZYetoTb53Zact4A!q=Jj?VqN^u9ihbwOF=z`3yx{`Tu4CqL2YmBSZ| z0o;vob`*wXoYsxhPNa4uZ|I?vu`S*^id3=dIT0Tqy%%XcNbM4-l=k>eV*t-dvZLtK zXM>CZ*XCiQ_1==-uxzt2-MQx+JWX--1T|!wM*2WgQ`5k}z@D83Rb~>!+*BS_xFGczG1R+31JG5p(Thw+sFON2dl@SCGievEgfZU$I#Rvwh(p9EP#EGdOt zo-cb0UfM&J29MZe79x`^eGsnA{H6`SxrygU?L+bgo+X8Pm|pOA0A9X9rl7lgj6T&M znYVg9?J?yf`FwZsPFeIlF&F*3^&7`1%M50|yUNZ$Qrwi$&U;ZWU%RBXp5eTMhv)zK zbH^ah=JH4Xq3r=A71J&sjl3OsUG6O-)DuBtV7SzA^q$G{hir}v+yPO;lUogKVy1dhU5Y~E3eUAt@0+}w=1x;i}i*lXB$ z_sdwBdjL`qq$EfUaq|vO@2dyP1;XJlSW7T7GlTj0d9aFL=Z_9R>WF*G8R{NJ!M0Ys z{?;7jo2aJ^uF^rUWI@W4)JW&XetdaNE&e(GF&@~({9vV%I_EAE|98>{jAKeW`iI}c z!iU#*mmcbnyzQc_U~NcV--EpJLul@NpYkUtuTr*yvJyAOoQ3|0XOFE+&5+U>=~ix(k3jfC80 z@P`5UVAXz*lrk;Ajk+TAZ5FH0|RnR~F~z7w2Ol(WvN{ijk)MtGfClX2-mN&qbqi z3k!2GbWYX&US0i}l-b$yg1jwVNVh(%s^sx~1W6Ohqz=V#1D@Vz;3JAM z_8A^gRfAQPc(0;}k-<1Vq{GZ4Qk%ul-_h9>$GZhMRbMY`vFIC`TUz5V2jLi8Ur+qF zMQJ>-6y^A2eT*!YW86`@3=W0rbi84^mM%sN@0v|69C+V+M*Hk(by4S0{){FBPcpH}Mnt+tE9DHf4{Qw!Aeq9Rn-q{wp~B8JxUFB;y(@s$=?x-^iWmRcWt)s?Ib9;J^1aQ&IVff zU{%#aCfm0R)b_C5{s>_u7z`3G4g_`t0$($ch~ICue$#4yz;0*Uh?fTp+G;X=)nvNM zIH%Qax0fl(y}{tUF}T=dT4yqqP=)N+WVe?pN?9W1old96>-C#VsiL2hos*Mi&0m{X gP>?7D+_YlF=M6~uFC`@0VzsW+vBbpH$@o9hrz{VD9{>OV diff --git a/brewman/static/src/fonts/glyphicons-halflings-regular.eot b/brewman/static/src/fonts/glyphicons-halflings-regular.eot deleted file mode 100644 index 4a4ca865d67e86f961bc6e2ef00bffa4e34bb9ed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20335 zcma%iRa9Lu*X_aGIXLtH2X}XOcXxM};>BGK?k>gMi@Uo+afec%&=$Y_zI(@iAMVRd zMzYtMnVHGh`(bBgBrYld0G2WU0R1n+0{)ZW{#ye8Pyh%N;2)-_`hS4`dHjR_o8s?3 z%Kr!aAA=Sk15gC$0aO9906BmJKn0)-&;W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MHI2^Lq9 zN)VG}(M5cuIe|8Czv84=B1p?kNhb&-+kCJ~Cp@^WbcRlQNgg+8V1=ctJWBX)kq0fd zAfF&H0wQim;D^RNLt*)8>Blbt34>^ZniMi^9|qnB%ES;E!kSQ!IK8Y>A1x=m76zre zZ2g#{aC_l);B}ZbGf3Y$5Pf?Ha!#0t3<5F`ED$p<#rl0e5CFtqc!!Oi7M~UH7I8~> zKcNUu8%}Z~Bb?-HK-;xoKCjL8>_&0cLO;{MS&3$vA|)_!KSn*s%ug690fdLcraD7- fD&x8tjE$WbXjs&snU8)|^B;s6yTptcKAzx$Qp3K0 diff --git a/brewman/static/src/fonts/glyphicons-halflings-regular.svg b/brewman/static/src/fonts/glyphicons-halflings-regular.svg deleted file mode 100644 index 25691af8..00000000 --- a/brewman/static/src/fonts/glyphicons-halflings-regular.svg +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/brewman/static/src/fonts/glyphicons-halflings-regular.ttf b/brewman/static/src/fonts/glyphicons-halflings-regular.ttf deleted file mode 100644 index 67fa00bf83801d2fa568546b982c80d27f6ef74e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 41280 zcmc${2b>$#wLd<0X4JKkMs=IoY9(#guC%-Ix~!LV@5XgawLzwtVoFRi&4B<;Yzzq| z1QHw)z@da0*@PsIyqA!`6G@b6oWOe_b_$P#@)GbXG2Zd-d+unfZAkvV-{LBX3Wc;?Pswd9i3FaAXkSUrx`&zn7GF0_`M^SUUB}0?t9iO6@<@rQX4MYaNTB6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OU?u&~|U2Lo-Yv0LF-c-zuuGv-f|u^6tOX-BUMM z=3RvSy&Avr8vOn(w7LVS#{O12$LEn}AzIvk_L_ZSSmx}L`|S8_e)+JEJlIPSJOeNc zEXKYFAjRQh07s(z!pdFtBU2|f;QKusr!FxbXop%U7$*`Z@o;{XAc>MBLj==};nL6a z?GBd_*55FxH4UAr>3BexA!8&{vSch~`hOUa69KQZ4t% ze2lxUkuS*t`LcXP?uWykg;FbZvPixvi{)#wL>@FAdZa;?p-X?cG|37$rfiXwvPxD< ztF%eGtdWOgt#nAItdsS!K{iU4d|e)vP4W$SM7}AH%C}^*Jcj?2CuEC!Te{^tvQ@q- z+vG{vF5g3U)b}w^c$e&!r{rn*f$WiIn=9Fe1POnxdoavaldekLd772JvZTzchIIW51CGZ^)7R(>h3$*<&fc|*?0ujMyb z+zv~>%J1a&asge!7v)X)16Cq zNZSZVyK+doa!9*!NV{@K8)uGJ?Z!ab_>ja=;;7viq!Ukxr^Hj@De-*7^AXQSJRk9V z#Pbo)M?4?#e8lq+&rdu*@%+T|6VFdPKk@v;^ApccJU{UQ#0wBFK)e9)0>ldtFF?Ei z@dCsP5HCo)An}643lc9#ydd#{#0wHHNW38NLc|LZCq$eOaYDoi5hp~P5OG4p2@@ww zyTZf^6E94>F!92~3llF)yfE=1#ETFwLc9p^BE*XjFG9Qs@gl^F5HCu+DDk4iixMwN zyeRRa#EUw3O5Q7ZujIXYopMV4EBUYFzmoq-{ww*ftO8zVPujIdy|4RNV`LE=^ zlK)EnEBUYFzmoq-{ww*ftO8zVPujIdy|4RNV`Hv+t&3R&ulK)EnEBUYFzmoq- z{ww*ftO8zVPujIXw_e$O?d9UO>y#F|MkoQX7D|xTvy^{Az-Ya>pA%_o2{ww*f ztO8zVPujIdy|4RNV`LE=^lK)EnV@(LhUh-eben*C^B33F^`zzF+C&yytvzO0{|1%B6xsj) diff --git a/brewman/static/src/fonts/glyphicons-halflings-regular.woff b/brewman/static/src/fonts/glyphicons-halflings-regular.woff deleted file mode 100644 index 8c54182aa5d4d1ab3c9171976b615c1dcb1dc187..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 23320 zcmY&6mA1(8T6a0V( z7zzkXUYUXEN9+9I!ap!DFOd#1wlTB=0s{G=z_>rwLFyJd-Ppy62nY!Dzg$rNAC#b> zW_IQ_KN{(eU)_(Nsd6JjiMgTUPb}E#|M~#|A(>mdoBe3JKtOVEKtTU^2nd*oEldqf zfPj=PfBaZ}zy@NZ@n!KN0s$!#{qXEt`TP45!w50c8!{TL10RAG)dniu*zrR^LTrn}O+tRb0xd~0E&>H($0brSGJ*iX z8bUAslphEzmTHiWB72`anLv4VuEY~_ za}WVZu^zT;R-~y&T~BYSiJ>00^O~gpl9q$zHI%Y>Lhsr-MaOrb%y%q|(42pX<4bce z&%S(EIYGx}q8~@4pX*EKdS?h=SI&tEv`GGM8)AScL0;U}brn10v;~p2;1NOn2Um$W z*U=i%VuwBRz@Z11qKr(qgO8vr*&X5{?12dd{6*l`Yp`?k3MDcih%qI+g!qV2n61L{ zS-80y9H-NmrN`sSUC*p$lut-w`?nyb*goYXni_zf3okCBA{zrCwXDq^$DQB5U?DQ* z61o2X9r4;yA!5sN`)f6pe9e8pguH(cK5%0-vMf9zrWWth^A{_9wXmH0nW$}wo9hf@Mt&V*5m2_W0Zac{Bwl*3N0W}7D6V5mO|AbT zMePe7b5d1qntWOB)2(kfH3+1h@`qdCj$7%?Ws`6C=E;z?vBmFy(ZuU>?ZKAjdKnE_$3iyZHlp%_ z77-FteGS2x>7s==RC=EgNc20pi}B5ZYP?<*;Yn$7M)<7;<>9ljc|Q@}q1HAXA>?XX z{-<=FYU*8Yx_bmPn*eq|(6}#S=KV{`|BZ*Xn#BSEOxT0n<2%3UJglMVh`FJxT)N*_o6m(8iH0h%=F{CzZaZ8j3d^x{KT0bRC__^79ko z=tr+cA_{hBgbop+gr}pTjdh4lR9OGJYID{f-h7TdFVsTYrJ)sVL)@`Nes|mRJSCBQ z1vY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yZ~6O0^V?1%{=1UASqa<2Pgnk7fs!OIs9gh{NCN+@=) z>Gfttd5uq;oeR{%NHjtqV~jEQeY?tDff=(jqx>~SZ_e+iN26HR*`0Q!Re)~HD85p> zbL()Mw}bI^#`7wp0+cv&7*LhrtOmR)?PK>(-BeLm#jL5Jfogv-QS(TBnUb;))Krqm zD}uDDeVLNhm1G*pFB`O?iA=dnWBEpqHk8Yh%Qu45EIG=&F-dDmt|;|nN@|3lOkVZ7>z*~a1?_t?U)c+&|JFJke1`&0-a z#PjhRlg?=$KTo4|rU@NyV_fzDy@>h!lVyKShsO8>V>$xyIXRbHK%H~^Aaz=s$Jz^V zlb?KfaKdZqu3^#m$mintvgJ15@j`sb2Zr%69Sn=xN01Tm5r)NQanT=jhwm7zqj2>O cEB}D~0$b-QdD7|v=>Px#07*qoM6N<$g6AXnUH||9 diff --git a/brewman/static/src/img/chosen-sprite@2x.png b/brewman/static/src/img/chosen-sprite@2x.png deleted file mode 100644 index 6b50545202cb4770039362c55025b0b9824663ad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 738 zcmV<80v-K{P)oJoIWh{eAG@xkM<0ryd(K3(} zP8JV&;uuIJ4nL%g8!wSG9E$P+3QVMGgj><+00}M5I5kMzaT<~M;uJ`UhLfbp9Ahdsrux5(g+(>Q*+9wU{AuYPH0}W_u4`|q(9c->{ zt>Jn|lbhH<_x5jU6prFi#S}&XMZ=~Y5VyC3+ZN%hXciz8 zPcLpJgbIK#a49e31-%wf2zh2F&&(Nq;AL%4zA(=QJRGq`sx3y3#0_cg9Fim739XTOu1NKKjlWs`52Q+3 Uja*K~(*OVf07*qoM6N<$g3mu-GXMYp diff --git a/brewman/static/src/img/favicon.ico b/brewman/static/src/img/favicon.ico deleted file mode 100644 index 5acbe77119c75670dae715d3d7cc1aa59d3fc6cb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3126 zcmc&#dvKgp75_HQa9Q8S&yC4-9IoRI zrHTD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Q&IVff zU{%#aCfm0R)b_C5{s>_u7z`3G4g_`t0$($ch~ICue$#4yz;0*Uh?fTp+G;X=)nvNM zIH%Qax0fl(y}{tUF}T=dT4yqqP=)N+WVe?pN?9W1old96>-C#VsiL2hos*Mi&0m{X gP>?7D+_YlF=M6~uFC`@0VzsW+vBbpH$@o9hrz{VD9{>OV diff --git a/brewman/static/src/img/glyphicons-halflings-white.png b/brewman/static/src/img/glyphicons-halflings-white.png deleted file mode 100644 index 3bf6484a29d8da269f9bc874b25493a45fae3bae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8777 zcmZvC1yGz#v+m*$LXcp=A$ZWB0fL7wNbp_U*$~{_gL`my3oP#L!5tQYy99Ta`+g_q zKlj|KJ2f@c)ARJx{q*bbkhN_!|Wn*Vos8{TEhUT@5e;_WJsIMMcG5%>DiS&dv_N`4@J0cnAQ-#>RjZ z00W5t&tJ^l-QC*ST1-p~00u^9XJ=AUl7oW-;2a+x2k__T=grN{+1c4XK0ZL~^z^i$ zp&>vEhr@4fZWb380S18T&!0cQ3IKpHF)?v=b_NIm0Q>vwY7D0baZ)n z31Fa5sELUQARIVaU0nqf0XzT+fB_63aA;@<$l~wse|mcA;^G1TmX?-)e)jkGPfkuA z92@|!<>h5S_4f8QP-JRq>d&7)^Yin8l7K8gED$&_FaV?gY+wLjpoW%~7NDe=nHfMG z5DO3j{R9kv5GbssrUpO)OyvVrlx>u0UKD0i;Dpm5S5dY16(DL5l{ixz|mhJU@&-OWCTb7_%}8-fE(P~+XIRO zJU|wp1|S>|J3KrLcz^+v1f&BDpd>&MAaibR4#5A_4(MucZwG9E1h4@u0P@C8;oo+g zIVj7kfJi{oV~E(NZ*h(@^-(Q(C`Psb3KZ{N;^GB(a8NE*Vwc715!9 zr-H4Ao|T_c6+VT_JH9H+P3>iXSt!a$F`>s`jn`w9GZ_~B!{0soaiV|O_c^R2aWa%}O3jUE)WO=pa zs~_Wz08z|ieY5A%$@FcBF9^!1a}m5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*pcP~R z*RuTUzBKLXO~~uMd&o$v3@d0shHfUjC6c539PE6rF&;Ufa(Rw@K1*m7?f5)t`MjH0 z)_V(cajV5Am>f!kWcI@5rE8t6$S>5M=k=aRZROH6fA^jJp~2NlR4;Q2>L$7F#RT#9 z>4@1RhWG`Khy>P2j1Yx^BBL{S`niMaxlSWV-JBU0-T9zZ%>7mR3l$~QV$({o0;jTI ze5=cN^!Bc2bT|BcojXp~K#2cM>OTe*cM{Kg-j*CkiW)EGQot^}s;cy8_1_@JA0Whq zlrNr+R;Efa+`6N)s5rH*|E)nYZ3uqkk2C(E7@A|3YI`ozP~9Lexx#*1(r8luq+YPk z{J}c$s` zPM35Fx(YWB3Z5IYnN+L_4|jaR(5iWJi2~l&xy}aU7kW?o-V*6Av2wyZTG!E2KSW2* zGRLQkQU;Oz##ie-Z4fI)WSRxn$(ZcD;TL+;^r=a4(G~H3ZhK$lSXZj?cvyY8%d9JM zzc3#pD^W_QnWy#rx#;c&N@sqHhrnHRmj#i;s%zLm6SE(n&BWpd&f7>XnjV}OlZntI70fq%8~9<7 zMYaw`E-rp49-oC1N_uZTo)Cu%RR2QWdHpzQIcNsoDp`3xfP+`gI?tVQZ4X={qU?(n zV>0ASES^Xuc;9JBji{)RnFL(Lez;8XbB1uWaMp@p?7xhXk6V#!6B@aP4Rz7-K%a>i z?fvf}va_DGUXlI#4--`A3qK7J?-HwnG7O~H2;zR~RLW)_^#La!=}+>KW#anZ{|^D3 B7G?kd diff --git a/brewman/static/src/img/glyphicons-halflings.png b/brewman/static/src/img/glyphicons-halflings.png deleted file mode 100644 index a9969993201f9cee63cf9f49217646347297b643..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12799 zcma*OWmH^Ivn@*S;K3nSf_t!#;0f+&pm7Po8`nk}2q8f5;M%x$SdAkd9FAvlc$ zx660V9e3Ox@4WZ^?7jZ%QFGU-T~%||Ug4iK6bbQY@zBuF2$hxOw9wF=A)nUSxR_5@ zEX>HBryGrj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InZkj+8*IHP4vKRd zKx_l-i*>A*C@{u%ct`y~s6MWAfO{@FPIX&sg8H{GMDc{4M3%$@c8&RAlw0-R<4DO3 trJqdc$mBpWeznn?E0M$F`|3v=`3%T2A17h;rxP7$%JLd=6(2u;`(N3pt&so# diff --git a/brewman/static/src/index.html b/brewman/static/src/index.html deleted file mode 100644 index e14b366d..00000000 --- a/brewman/static/src/index.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - Hops n Grains - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- -
-
- {{toast.Type}}! {{toast.Message}} -
- -
- -
-

© Amritanshu 2018

-
- -
- - - - - - diff --git a/brewman/static/src/js/jquery.scrolltoview.js b/brewman/static/src/js/jquery.scrolltoview.js deleted file mode 100644 index 4d71303c..00000000 --- a/brewman/static/src/js/jquery.scrolltoview.js +++ /dev/null @@ -1,105 +0,0 @@ -/*! - * jQuery scrollintoview() plugin and :scrollable selector filter - * - * Version 1.8 (14 Jul 2011) - * Requires jQuery 1.4 or newer - * - * Copyright (c) 2011 Robert Koritnik - * Licensed under the terms of the MIT license - * http://www.opensource.org/licenses/mit-license.php - */ - -(function ($) { - var settings = { - topBar: 51 // hack for brewman with bootstrap v3.1.1 - }; - - var rootrx = /^(?:html)$/i; - - // gets border dimensions - var borders = function (domElement, styles) { - styles = styles || (document.defaultView && document.defaultView.getComputedStyle ? document.defaultView.getComputedStyle(domElement, null) : domElement.currentStyle); - var px = document.defaultView && document.defaultView.getComputedStyle ? true : false; - var b = { - top: (parseFloat(px ? styles.borderTopWidth : $.css(domElement, "borderTopWidth")) || 0), - left: (parseFloat(px ? styles.borderLeftWidth : $.css(domElement, "borderLeftWidth")) || 0), - bottom: (parseFloat(px ? styles.borderBottomWidth : $.css(domElement, "borderBottomWidth")) || 0), - right: (parseFloat(px ? styles.borderRightWidth : $.css(domElement, "borderRightWidth")) || 0) - }; - return { - top: b.top, - left: b.left, - bottom: b.bottom, - right: b.right, - vertical: b.top + b.bottom, - horizontal: b.left + b.right - }; - }; - - var dimensions = function ($element) { - var win = $(window); - var isRoot = rootrx.test($element[0].nodeName); - return { - border: isRoot ? { top: 0, left: 0, bottom: 0, right: 0} : borders($element[0]), - scroll: { - top: (isRoot ? win : $element).scrollTop(), - left: (isRoot ? win : $element).scrollLeft() - }, - scrollbar: { - right: isRoot ? 0 : $element.innerWidth() - $element[0].clientWidth, - bottom: isRoot ? 0 : $element.innerHeight() - $element[0].clientHeight - }, - rect: (function () { - var r = $element[0].getBoundingClientRect(); - return { - top: isRoot ? 0 : r.top, - left: isRoot ? 0 : r.left, - bottom: isRoot ? $element[0].clientHeight : r.bottom, - right: isRoot ? $element[0].clientWidth : r.right - }; - })() - }; - }; - - $.fn.extend({ - scrollintoview: function (options) { - /// Scrolls the first element in the set into view by scrolling its closest scrollable parent. - /// Additional options that can configure scrolling: - /// - /// Returns the same jQuery set that this function was run on. - - options = $.extend({}, settings, options); - - var el = this.eq(0); - var scroller = $("html,body"); - - // check if there's anything to scroll in the first place - var dim = { - e: dimensions(el), - s: dimensions(scroller) - }; - - var rel = { - top: dim.e.rect.top, - bottom: dim.s.rect.bottom - dim.s.scrollbar.bottom - dim.e.rect.bottom - }; - - var scrollTop = null; - - // scroll - if (rel.top < options.topBar) { - scrollTop = dim.s.scroll.top + rel.top - options.topBar; - } - else if (rel.top > 0 && rel.bottom < 0) { - scrollTop = dim.s.scroll.top + Math.min(rel.top, -rel.bottom); - } - - // scroll if needed - if (scrollTop !== null) { - scroller.scrollTop(scrollTop); - } - // return set back - return this; - } - }); -})(jQuery); \ No newline at end of file diff --git a/brewman/static/src/js/loading-bar.min.js b/brewman/static/src/js/loading-bar.min.js deleted file mode 100644 index e4b18add..00000000 --- a/brewman/static/src/js/loading-bar.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * angular-loading-bar v0.9.0 - * https://chieffancypants.github.io/angular-loading-bar - * Copyright (c) 2016 Wes Cruver - * License: MIT - */ -!function(){"use strict";angular.module("angular-loading-bar",["cfp.loadingBarInterceptor"]),angular.module("chieffancypants.loadingBar",["cfp.loadingBarInterceptor"]),angular.module("cfp.loadingBarInterceptor",["cfp.loadingBar"]).config(["$httpProvider",function(a){var b=["$q","$cacheFactory","$timeout","$rootScope","$log","cfpLoadingBar",function(b,c,d,e,f,g){function h(){d.cancel(j),g.complete(),l=0,k=0}function i(b){var d,e=c.get("$http"),f=a.defaults;!b.cache&&!f.cache||b.cache===!1||"GET"!==b.method&&"JSONP"!==b.method||(d=angular.isObject(b.cache)?b.cache:angular.isObject(f.cache)?f.cache:e);var g=void 0!==d?void 0!==d.get(b.url):!1;return void 0!==b.cached&&g!==b.cached?b.cached:(b.cached=g,g)}var j,k=0,l=0,m=g.latencyThreshold;return{request:function(a){return a.ignoreLoadingBar||i(a)||(e.$broadcast("cfpLoadingBar:loading",{url:a.url}),0===k&&(j=d(function(){g.start()},m)),k++,g.set(l/k)),a},response:function(a){return a&&a.config?(a.config.ignoreLoadingBar||i(a.config)||(l++,l>=k?(e.$broadcast("cfpLoadingBar:loaded",{url:a.config.url,result:a}),h()):g.set(l/k)),a):(f.error("Broken interceptor detected: Config object not supplied in response:\n https://github.com/chieffancypants/angular-loading-bar/pull/50"),a)},responseError:function(a){return a&&a.config?(a.config.ignoreLoadingBar||i(a.config)||(l++,l>=k?(e.$broadcast("cfpLoadingBar:loaded",{url:a.config.url,result:a}),h()):g.set(l/k)),b.reject(a)):(f.error("Broken interceptor detected: Config object not supplied in rejection:\n https://github.com/chieffancypants/angular-loading-bar/pull/50"),b.reject(a))}}}];a.interceptors.push(b)}]),angular.module("cfp.loadingBar",[]).provider("cfpLoadingBar",function(){this.autoIncrement=!0,this.includeSpinner=!0,this.includeBar=!0,this.latencyThreshold=100,this.startSize=.02,this.parentSelector="body",this.spinnerTemplate='
',this.loadingBarTemplate='
',this.$get=["$injector","$document","$timeout","$rootScope",function(a,b,c,d){function e(){if(k||(k=a.get("$animate")),c.cancel(m),!r){var e=b[0],g=e.querySelector?e.querySelector(n):b.find(n)[0];g||(g=e.getElementsByTagName("body")[0]);var h=angular.element(g),i=g.lastChild&&angular.element(g.lastChild);d.$broadcast("cfpLoadingBar:started"),r=!0,v&&k.enter(o,h,i),u&&k.enter(q,h,o),f(w)}}function f(a){if(r){var b=100*a+"%";p.css("width",b),s=a,t&&(c.cancel(l),l=c(function(){g()},250))}}function g(){if(!(h()>=1)){var a=0,b=h();a=b>=0&&.25>b?(3*Math.random()+3)/100:b>=.25&&.65>b?3*Math.random()/100:b>=.65&&.9>b?2*Math.random()/100:b>=.9&&.99>b?.005:0;var c=h()+a;f(c)}}function h(){return s}function i(){s=0,r=!1}function j(){k||(k=a.get("$animate")),f(1),c.cancel(m),m=c(function(){var a=k.leave(o,i);a&&a.then&&a.then(i),k.leave(q),d.$broadcast("cfpLoadingBar:completed")},500)}var k,l,m,n=this.parentSelector,o=angular.element(this.loadingBarTemplate),p=o.find("div").eq(0),q=angular.element(this.spinnerTemplate),r=!1,s=0,t=this.autoIncrement,u=this.includeSpinner,v=this.includeBar,w=this.startSize;return{start:e,set:f,status:h,inc:g,complete:j,autoIncrement:this.autoIncrement,includeSpinner:this.includeSpinner,latencyThreshold:this.latencyThreshold,parentSelector:this.parentSelector,startSize:this.startSize}}]})}(); \ No newline at end of file diff --git a/brewman/static/src/js/mousetrap-brewman.js b/brewman/static/src/js/mousetrap-brewman.js deleted file mode 100644 index ff2851ff..00000000 --- a/brewman/static/src/js/mousetrap-brewman.js +++ /dev/null @@ -1,50 +0,0 @@ -Mousetrap = (function (Mousetrap) { - 'use strict'; - var self = Mousetrap, - _oldBind = self.bind, - _oldUnbind = self.unbind, - args; - - self.stopCallback = function (e, element) { - - // if the element has the class "mousetrap" then no need to stop - if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) { - return false; - } - - // stop for input, select, and textarea - return ['INPUT', 'SELECT', 'TEXTAREA', 'BUTTON'].indexOf(element.tagName) > -1 || element.isContentEditable; - }; - - self.bind = function () { - args = arguments; - - // normal call - if (typeof args[0] === 'string' || args[0] instanceof Array) { - return _oldBind.apply(this, args); - } - - // object passed in - for (var key in args[0]) { - if (args[0].hasOwnProperty(key)) { - _oldBind(key, args[0][key], args[1]); - } - } - }; - self.unbind = function () { - args = arguments; - - // normal call - if (typeof args[0] === 'string' || args[0] instanceof Array) { - return _oldUnbind.apply(this, args); - } - - // object passed in - for (var key in args[0]) { - if (args[0].hasOwnProperty(key)) { - _oldUnbind(key, args[1]); - } - } - }; - return Mousetrap; -})(Mousetrap); \ No newline at end of file diff --git a/brewman/static/src/js/ui-bootstrap-custom-0.12.0.min.js b/brewman/static/src/js/ui-bootstrap-custom-0.12.0.min.js deleted file mode 100644 index 2479f89e..00000000 --- a/brewman/static/src/js/ui-bootstrap-custom-0.12.0.min.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * angular-ui-bootstrap - * http://angular-ui.github.io/bootstrap/ - - * Version: 0.12.0 - 2014-11-16 - * License: MIT - */ -angular.module("ui.bootstrap",["ui.bootstrap.typeahead","ui.bootstrap.position","ui.bootstrap.bindHtml","ui.bootstrap.modal","ui.bootstrap.transition","ui.bootstrap.datepicker","ui.bootstrap.dateparser"]),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).factory("typeaheadParser",["$parse",function(e){var t=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;return{parse:function(a){var n=a.match(t);if(!n)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+a+'".');return{itemName:n[3],source:e(n[4]),viewMapper:e(n[2]||n[1]),modelMapper:e(n[1])}}}}]).directive("typeahead",["$compile","$parse","$q","$timeout","$document","$position","typeaheadParser",function(e,t,a,n,i,r,o){var l=[9,13,27,38,40];return{require:"ngModel",link:function(c,d,s,u){var p,f=c.$eval(s.typeaheadMinLength)||1,h=c.$eval(s.typeaheadWaitMs)||0,m=c.$eval(s.typeaheadEditable)!==!1,g=t(s.typeaheadLoading).assign||angular.noop,v=t(s.typeaheadOnSelect),y=s.typeaheadInputFormatter?t(s.typeaheadInputFormatter):void 0,b=s.typeaheadAppendToBody?c.$eval(s.typeaheadAppendToBody):!1,w=c.$eval(s.typeaheadFocusFirst)!==!1,$=t(s.ngModel).assign,k=o.parse(s.typeahead),D=c.$new();c.$on("$destroy",function(){D.$destroy()});var M="typeahead-"+D.$id+"-"+Math.floor(1e4*Math.random());d.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":M});var x=angular.element("
");x.attr({id:M,matches:"matches",active:"activeIdx",select:"select(activeIdx)",query:"query",position:"position"}),angular.isDefined(s.typeaheadTemplateUrl)&&x.attr("template-url",s.typeaheadTemplateUrl);var T=function(){D.matches=[],D.activeIdx=-1,d.attr("aria-expanded",!1)},E=function(e){return M+"-option-"+e};D.$watch("activeIdx",function(e){0>e?d.removeAttr("aria-activedescendant"):d.attr("aria-activedescendant",E(e))});var O=function(e){var t={$viewValue:e};g(c,!0),a.when(k.source(c,t)).then(function(a){var n=e===u.$viewValue;if(n&&p)if(a.length>0){D.activeIdx=w?0:-1,D.matches.length=0;for(var i=0;i=f?h>0?(F(),V(e)):O(e):(g(c,!1),F(),T()),m?e:e?void u.$setValidity("editable",!1):(u.$setValidity("editable",!0),e)}),u.$formatters.push(function(e){var t,a,n={};return y?(n.$model=e,y(c,n)):(n[k.itemName]=e,t=k.viewMapper(c,n),n[k.itemName]=void 0,a=k.viewMapper(c,n),t!==a?t:e)}),D.select=function(e){var t,a,i={};i[k.itemName]=a=D.matches[e].model,t=k.modelMapper(c,i),$(c,t),u.$setValidity("editable",!0),v(c,{$item:a,$model:t,$label:k.viewMapper(c,i)}),T(),n(function(){d[0].focus()},0,!1)},d.bind("keydown",function(e){0!==D.matches.length&&-1!==l.indexOf(e.which)&&(-1!=D.activeIdx||13!==e.which&&9!==e.which)&&(e.preventDefault(),40===e.which?(D.activeIdx=(D.activeIdx+1)%D.matches.length,D.$digest()):38===e.which?(D.activeIdx=(D.activeIdx>0?D.activeIdx:D.matches.length)-1,D.$digest()):13===e.which||9===e.which?D.$apply(function(){D.select(D.activeIdx)}):27===e.which&&(e.stopPropagation(),T(),D.$digest()))}),d.bind("blur",function(){p=!1});var S=function(e){d[0]!==e.target&&(T(),D.$digest())};i.bind("click",S),c.$on("$destroy",function(){i.unbind("click",S),b&&I.remove()});var I=e(x)(D);b?i.find("body").append(I):d.after(I)}}}]).directive("typeaheadPopup",function(){return{restrict:"EA",scope:{matches:"=",query:"=",active:"=",position:"=",select:"&"},replace:!0,templateUrl:"/template/typeahead/typeahead-popup.html",link:function(e,t,a){e.templateUrl=a.templateUrl,e.isOpen=function(){return e.matches.length>0},e.isActive=function(t){return e.active==t},e.selectActive=function(t){e.active=t},e.selectMatch=function(t){e.select({activeIdx:t})}}}}).directive("typeaheadMatch",["$http","$templateCache","$compile","$parse",function(e,t,a,n){return{restrict:"EA",scope:{index:"=",match:"=",query:"="},link:function(i,r,o){var l=n(o.templateUrl)(i.$parent)||"/template/typeahead/typeahead-match.html";e.get(l,{cache:t}).success(function(e){r.replaceWith(a(e.trim())(i))})}}}]).filter("typeaheadHighlight",function(){function e(e){return e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}return function(t,a){return a?(""+t).replace(new RegExp(e(a),"gi"),"$&"):t}}),angular.module("ui.bootstrap.position",[]).factory("$position",["$document","$window",function(e,t){function a(e,a){return e.currentStyle?e.currentStyle[a]:t.getComputedStyle?t.getComputedStyle(e)[a]:e.style[a]}function n(e){return"static"===(a(e,"position")||"static")}var i=function(t){for(var a=e[0],i=t.offsetParent||a;i&&i!==a&&n(i);)i=i.offsetParent;return i||a};return{position:function(t){var a=this.offset(t),n={top:0,left:0},r=i(t[0]);r!=e[0]&&(n=this.offset(angular.element(r)),n.top+=r.clientTop-r.scrollTop,n.left+=r.clientLeft-r.scrollLeft);var o=t[0].getBoundingClientRect();return{width:o.width||t.prop("offsetWidth"),height:o.height||t.prop("offsetHeight"),top:a.top-n.top,left:a.left-n.left}},offset:function(a){var n=a[0].getBoundingClientRect();return{width:n.width||a.prop("offsetWidth"),height:n.height||a.prop("offsetHeight"),top:n.top+(t.pageYOffset||e[0].documentElement.scrollTop),left:n.left+(t.pageXOffset||e[0].documentElement.scrollLeft)}},positionElements:function(e,t,a,n){var i,r,o,l,c=a.split("-"),d=c[0],s=c[1]||"center";i=n?this.offset(e):this.position(e),r=t.prop("offsetWidth"),o=t.prop("offsetHeight");var u={center:function(){return i.left+i.width/2-r/2},left:function(){return i.left},right:function(){return i.left+i.width}},p={center:function(){return i.top+i.height/2-o/2},top:function(){return i.top},bottom:function(){return i.top+i.height}};switch(d){case"right":l={top:p[s](),left:u[d]()};break;case"left":l={top:p[s](),left:i.left-r};break;case"bottom":l={top:p[d](),left:u[s]()};break;default:l={top:i.top-o,left:u[s]()}}return l}}}]),angular.module("ui.bootstrap.bindHtml",[]).directive("bindHtmlUnsafe",function(){return function(e,t,a){t.addClass("ng-binding").data("$binding",a.bindHtmlUnsafe),e.$watch(a.bindHtmlUnsafe,function(e){t.html(e||"")})}}),angular.module("ui.bootstrap.modal",["ui.bootstrap.transition"]).factory("$$stackedMap",function(){return{createNew:function(){var e=[];return{add:function(t,a){e.push({key:t,value:a})},get:function(t){for(var a=0;a0),c()})}function c(){if(s&&-1==o()){var e=u;d(s,u,150,function(){e.$destroy(),e=null}),s=void 0,u=void 0}}function d(a,n,i,r){function o(){o.done||(o.done=!0,a.remove(),r&&r())}n.animate=!1;var l=e.transitionEndEventName;if(l){var c=t(o,i);a.bind(l,function(){t.cancel(c),o(),n.$apply()})}else t(o)}var s,u,p="modal-open",f=r.createNew(),h={};return i.$watch(o,function(e){u&&(u.index=e)}),a.bind("keydown",function(e){var t;27===e.which&&(t=f.top(),t&&t.value.keyboard&&(e.preventDefault(),i.$apply(function(){h.dismiss(t.key,"escape key press")})))}),h.open=function(e,t){f.add(e,{deferred:t.deferred,modalScope:t.scope,backdrop:t.backdrop,keyboard:t.keyboard});var r=a.find("body").eq(0),l=o();if(l>=0&&!s){u=i.$new(!0),u.index=l;var c=angular.element("
");c.attr("backdrop-class",t.backdropClass),s=n(c)(u),r.append(s)}var d=angular.element("
");d.attr({"template-url":t.windowTemplateUrl,"window-class":t.windowClass,size:t.size,index:f.length()-1,animate:"animate"}).html(t.content);var h=n(d)(t.scope);f.top().value.modalDomEl=h,r.append(h),r.addClass(p)},h.close=function(e,t){var a=f.get(e);a&&(a.value.deferred.resolve(t),l(e))},h.dismiss=function(e,t){var a=f.get(e);a&&(a.value.deferred.reject(t),l(e))},h.dismissAll=function(e){for(var t=this.getTop();t;)this.dismiss(t.key,e),t=this.getTop()},h.getTop=function(){return f.top()},h}]).provider("$modal",function(){var e={options:{backdrop:!0,keyboard:!0},$get:["$injector","$rootScope","$q","$http","$templateCache","$controller","$modalStack",function(t,a,n,i,r,o,l){function c(e){return e.template?n.when(e.template):i.get(angular.isFunction(e.templateUrl)?e.templateUrl():e.templateUrl,{cache:r}).then(function(e){return e.data})}function d(e){var a=[];return angular.forEach(e,function(e){(angular.isFunction(e)||angular.isArray(e))&&a.push(n.when(t.invoke(e)))}),a}var s={};return s.open=function(t){var i=n.defer(),r=n.defer(),s={result:i.promise,opened:r.promise,close:function(e){l.close(s,e)},dismiss:function(e){l.dismiss(s,e)}};if(t=angular.extend({},e.options,t),t.resolve=t.resolve||{},!t.template&&!t.templateUrl)throw new Error("One of template or templateUrl options is required.");var u=n.all([c(t)].concat(d(t.resolve)));return u.then(function(e){var n=(t.scope||a).$new();n.$close=s.close,n.$dismiss=s.dismiss;var r,c={},d=1;t.controller&&(c.$scope=n,c.$modalInstance=s,angular.forEach(t.resolve,function(t,a){c[a]=e[d++]}),r=o(t.controller,c),t.controllerAs&&(n[t.controllerAs]=r)),l.open(s,{scope:n,deferred:i,content:e[0],backdrop:t.backdrop,keyboard:t.keyboard,backdropClass:t.backdropClass,windowClass:t.windowClass,windowTemplateUrl:t.windowTemplateUrl,size:t.size})},function(e){i.reject(e)}),u.then(function(){r.resolve(!0)},function(){r.reject(!1)}),s},s}]};return e}),angular.module("ui.bootstrap.transition",[]).factory("$transition",["$q","$timeout","$rootScope",function(e,t,a){function n(e){for(var t in e)if(void 0!==r.style[t])return e[t]}var i=function(n,r,o){o=o||{};var l=e.defer(),c=i[o.animation?"animationEndEventName":"transitionEndEventName"],d=function(){a.$apply(function(){n.unbind(c,d),l.resolve(n)})};return c&&n.bind(c,d),t(function(){angular.isString(r)?n.addClass(r):angular.isFunction(r)?r(n):angular.isObject(r)&&n.css(r),c||l.resolve(n)}),l.promise.cancel=function(){c&&n.unbind(c,d),l.reject("Transition cancelled")},l.promise},r=document.createElement("trans"),o={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"},l={WebkitTransition:"webkitAnimationEnd",MozTransition:"animationend",OTransition:"oAnimationEnd",transition:"animationend"};return i.transitionEndEventName=n(o),i.animationEndEventName=n(l),i}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.position"]).constant("datepickerConfig",{formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",datepickerMode:"day",minMode:"day",maxMode:"year",showWeeks:!0,startingDay:0,yearRange:20,minDate:null,maxDate:null}).controller("DatepickerController",["$scope","$attrs","$parse","$interpolate","$timeout","$log","dateFilter","datepickerConfig",function(e,t,a,n,i,r,o,l){var c=this,d={$setViewValue:angular.noop};this.modes=["day","month","year"],angular.forEach(["formatDay","formatMonth","formatYear","formatDayHeader","formatDayTitle","formatMonthTitle","minMode","maxMode","showWeeks","startingDay","yearRange"],function(a,i){c[a]=angular.isDefined(t[a])?8>i?n(t[a])(e.$parent):e.$parent.$eval(t[a]):l[a]}),angular.forEach(["minDate","maxDate"],function(n){t[n]?e.$parent.$watch(a(t[n]),function(e){c[n]=e?new Date(e):null,c.refreshView()}):c[n]=l[n]?new Date(l[n]):null}),e.datepickerMode=e.datepickerMode||l.datepickerMode,e.uniqueId="datepicker-"+e.$id+"-"+Math.floor(1e4*Math.random()),this.activeDate=angular.isDefined(t.initDate)?e.$parent.$eval(t.initDate):new Date,e.isActive=function(t){return 0===c.compare(t.date,c.activeDate)?(e.activeDateId=t.uid,!0):!1},this.init=function(e){d=e,d.$render=function(){c.render()}},this.render=function(){if(d.$modelValue){var e=new Date(d.$modelValue),t=!isNaN(e);t?this.activeDate=e:r.error('Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.'),d.$setValidity("date",t)}this.refreshView()},this.refreshView=function(){if(this.element){this._refreshView();var e=d.$modelValue?new Date(d.$modelValue):null;d.$setValidity("date-disabled",!e||this.element&&!this.isDisabled(e))}},this.createDateObject=function(e,t){var a=d.$modelValue?new Date(d.$modelValue):null;return{date:e,label:o(e,t),selected:a&&0===this.compare(e,a),disabled:this.isDisabled(e),current:0===this.compare(e,new Date)}},this.isDisabled=function(a){return this.minDate&&this.compare(a,this.minDate)<0||this.maxDate&&this.compare(a,this.maxDate)>0||t.dateDisabled&&e.dateDisabled({date:a,mode:e.datepickerMode})},this.split=function(e,t){for(var a=[];e.length>0;)a.push(e.splice(0,t));return a},e.select=function(t){if(e.datepickerMode===c.minMode){var a=d.$modelValue?new Date(d.$modelValue):new Date(0,0,0,0,0,0,0);a.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),d.$setViewValue(a),d.$render()}else c.activeDate=t,e.datepickerMode=c.modes[c.modes.indexOf(e.datepickerMode)-1]},e.move=function(e){var t=c.activeDate.getFullYear()+e*(c.step.years||0),a=c.activeDate.getMonth()+e*(c.step.months||0);c.activeDate.setFullYear(t,a,1),c.refreshView()},e.toggleMode=function(t){t=t||1,e.datepickerMode===c.maxMode&&1===t||e.datepickerMode===c.minMode&&-1===t||(e.datepickerMode=c.modes[c.modes.indexOf(e.datepickerMode)+t])},e.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};var s=function(){i(function(){c.element[0].focus()},0,!1)};e.$on("datepicker.focus",s),e.keydown=function(t){var a=e.keys[t.which];if(a&&!t.shiftKey&&!t.altKey)if(t.preventDefault(),t.stopPropagation(),"enter"===a||"space"===a){if(c.isDisabled(c.activeDate))return;e.select(c.activeDate),s()}else!t.ctrlKey||"up"!==a&&"down"!==a?(c.handleKeyDown(a,t),c.refreshView()):(e.toggleMode("up"===a?1:-1),s())}}]).directive("datepicker",function(){return{restrict:"EA",replace:!0,templateUrl:"/template/datepicker/datepicker.html",scope:{datepickerMode:"=?",dateDisabled:"&"},require:["datepicker","?^ngModel"],controller:"DatepickerController",link:function(e,t,a,n){var i=n[0],r=n[1];r&&i.init(r)}}}).directive("daypicker",["dateFilter",function(e){return{restrict:"EA",replace:!0,templateUrl:"/template/datepicker/day.html",require:"^datepicker",link:function(t,a,n,i){function r(e,t){return 1!==t||e%4!==0||e%100===0&&e%400!==0?c[t]:29}function o(e,t){var a=new Array(t),n=new Date(e),i=0;for(n.setHours(12);t>i;)a[i++]=new Date(n),n.setDate(n.getDate()+1);return a}function l(e){var t=new Date(e);t.setDate(t.getDate()+4-(t.getDay()||7));var a=t.getTime();return t.setMonth(0),t.setDate(1),Math.floor(Math.round((a-t)/864e5)/7)+1}t.showWeeks=i.showWeeks,i.step={months:1},i.element=a;var c=[31,28,31,30,31,30,31,31,30,31,30,31];i._refreshView=function(){var a=i.activeDate.getFullYear(),n=i.activeDate.getMonth(),r=new Date(a,n,1),c=i.startingDay-r.getDay(),d=c>0?7-c:-c,s=new Date(r);d>0&&s.setDate(-d+1);for(var u=o(s,42),p=0;42>p;p++)u[p]=angular.extend(i.createDateObject(u[p],i.formatDay),{secondary:u[p].getMonth()!==n,uid:t.uniqueId+"-"+p});t.labels=new Array(7);for(var f=0;7>f;f++)t.labels[f]={abbr:e(u[f].date,i.formatDayHeader),full:e(u[f].date,"EEEE")};if(t.title=e(i.activeDate,i.formatDayTitle),t.rows=i.split(u,7),t.showWeeks){t.weekNumbers=[];for(var h=l(t.rows[0][0].date),m=t.rows.length;t.weekNumbers.push(h++)r;r++)a[r]=angular.extend(i.createDateObject(new Date(n,r,1),i.formatMonth),{uid:t.uniqueId+"-"+r});t.title=e(i.activeDate,i.formatMonthTitle),t.rows=i.split(a,3)},i.compare=function(e,t){return new Date(e.getFullYear(),e.getMonth())-new Date(t.getFullYear(),t.getMonth())},i.handleKeyDown=function(e){var t=i.activeDate.getMonth();if("left"===e)t-=1;else if("up"===e)t-=3;else if("right"===e)t+=1;else if("down"===e)t+=3;else if("pageup"===e||"pagedown"===e){var a=i.activeDate.getFullYear()+("pageup"===e?-1:1);i.activeDate.setFullYear(a)}else"home"===e?t=0:"end"===e&&(t=11);i.activeDate.setMonth(t)},i.refreshView()}}}]).directive("yearpicker",["dateFilter",function(){return{restrict:"EA",replace:!0,templateUrl:"/template/datepicker/year.html",require:"^datepicker",link:function(e,t,a,n){function i(e){return parseInt((e-1)/r,10)*r+1}var r=n.yearRange;n.step={years:r},n.element=t,n._refreshView=function(){for(var t=new Array(r),a=0,o=i(n.activeDate.getFullYear());r>a;a++)t[a]=angular.extend(n.createDateObject(new Date(o+a,0,1),n.formatYear),{uid:e.uniqueId+"-"+a});e.title=[t[0].label,t[r-1].label].join(" - "),e.rows=n.split(t,5)},n.compare=function(e,t){return e.getFullYear()-t.getFullYear()},n.handleKeyDown=function(e){var t=n.activeDate.getFullYear();"left"===e?t-=1:"up"===e?t-=5:"right"===e?t+=1:"down"===e?t+=5:"pageup"===e||"pagedown"===e?t+=("pageup"===e?-1:1)*n.step.years:"home"===e?t=i(n.activeDate.getFullYear()):"end"===e&&(t=i(n.activeDate.getFullYear())+r-1),n.activeDate.setFullYear(t)},n.refreshView()}}}]).constant("datepickerPopupConfig",{datepickerPopup:"yyyy-MM-dd",currentText:"Today",clearText:"Clear",closeText:"Done",closeOnDateSelection:!0,appendToBody:!1,showButtonBar:!0}).directive("datepickerPopup",["$compile","$parse","$document","$position","dateFilter","dateParser","datepickerPopupConfig",function(e,t,a,n,i,r,o){return{restrict:"EA",require:"ngModel",scope:{isOpen:"=?",currentText:"@",clearText:"@",closeText:"@",dateDisabled:"&"},link:function(l,c,d,s){function u(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}function p(e){if(e){if(angular.isDate(e)&&!isNaN(e))return s.$setValidity("date",!0),e;if(angular.isString(e)){var t=r.parse(e,f)||new Date(e);return isNaN(t)?void s.$setValidity("date",!1):(s.$setValidity("date",!0),t)}return void s.$setValidity("date",!1)}return s.$setValidity("date",!0),null}var f,h=angular.isDefined(d.closeOnDateSelection)?l.$parent.$eval(d.closeOnDateSelection):o.closeOnDateSelection,m=angular.isDefined(d.datepickerAppendToBody)?l.$parent.$eval(d.datepickerAppendToBody):o.appendToBody;l.showButtonBar=angular.isDefined(d.showButtonBar)?l.$parent.$eval(d.showButtonBar):o.showButtonBar,l.getText=function(e){return l[e+"Text"]||o[e+"Text"]},d.$observe("datepickerPopup",function(e){f=e||o.datepickerPopup,s.$render()});var g=angular.element("
");g.attr({"ng-model":"date","ng-change":"dateSelection()"});var v=angular.element(g.children()[0]);d.datepickerOptions&&angular.forEach(l.$parent.$eval(d.datepickerOptions),function(e,t){v.attr(u(t),e)}),l.watchData={},angular.forEach(["minDate","maxDate","datepickerMode"],function(e){if(d[e]){var a=t(d[e]);if(l.$parent.$watch(a,function(t){l.watchData[e]=t}),v.attr(u(e),"watchData."+e),"datepickerMode"===e){var n=a.assign;l.$watch("watchData."+e,function(e,t){e!==t&&n(l.$parent,e)})}}}),d.dateDisabled&&v.attr("date-disabled","dateDisabled({ date: date, mode: mode })"),s.$parsers.unshift(p),l.dateSelection=function(e){angular.isDefined(e)&&(l.date=e),s.$setViewValue(l.date),s.$render(),h&&(l.isOpen=!1,c[0].focus())},c.bind("input change keyup",function(){l.$apply(function(){l.date=s.$modelValue})}),s.$render=function(){var e=s.$viewValue?i(s.$viewValue,f):"";c.val(e),l.date=p(s.$modelValue)};var y=function(e){l.isOpen&&e.target!==c[0]&&l.$apply(function(){l.isOpen=!1})},b=function(e){l.keydown(e)};c.bind("keydown",b),l.keydown=function(e){27===e.which?(e.preventDefault(),e.stopPropagation(),l.close()):40!==e.which||l.isOpen||(l.isOpen=!0)},l.$watch("isOpen",function(e){e?(l.$broadcast("datepicker.focus"),l.position=m?n.offset(c):n.position(c),l.position.top=l.position.top+c.prop("offsetHeight"),a.bind("click",y)):a.unbind("click",y)}),l.select=function(e){if("today"===e){var t=new Date;angular.isDate(s.$modelValue)?(e=new Date(s.$modelValue),e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate())):e=new Date(t.setHours(0,0,0,0))}l.dateSelection(e)},l.close=function(){l.isOpen=!1,c[0].focus()};var w=e(g)(l);g.remove(),m?a.find("body").append(w):c.after(w),l.$on("$destroy",function(){w.remove(),c.unbind("keydown",b),a.unbind("click",y)})}}}]).directive("datepickerPopupWrap",function(){return{restrict:"EA",replace:!0,transclude:!0,templateUrl:"/template/datepicker/popup.html",link:function(e,t){t.bind("click",function(e){e.preventDefault(),e.stopPropagation()})}}}),angular.module("ui.bootstrap.dateparser",[]).service("dateParser",["$locale","orderByFilter",function(e,t){function a(e){var a=[],n=e.split("");return angular.forEach(i,function(t,i){var r=e.indexOf(i);if(r>-1){e=e.split(""),n[r]="("+t.regex+")",e[r]="$";for(var o=r+1,l=r+i.length;l>o;o++)n[o]="",e[o]="$";e=e.join(""),a.push({index:r,apply:t.apply})}}),{regex:new RegExp("^"+n.join("")+"$"),map:t(a,"index")}}function n(e,t,a){return 1===t&&a>28?29===a&&(e%4===0&&e%100!==0||e%400===0):3===t||5===t||8===t||10===t?31>a:!0}this.parsers={};var i={yyyy:{regex:"\\d{4}",apply:function(e){this.year=+e}},yy:{regex:"\\d{2}",apply:function(e){this.year=+e+2e3}},y:{regex:"\\d{1,4}",apply:function(e){this.year=+e}},MMMM:{regex:e.DATETIME_FORMATS.MONTH.join("|"),apply:function(t){this.month=e.DATETIME_FORMATS.MONTH.indexOf(t)}},MMM:{regex:e.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(t){this.month=e.DATETIME_FORMATS.SHORTMONTH.indexOf(t)}},MM:{regex:"0[1-9]|1[0-2]",apply:function(e){this.month=e-1}},M:{regex:"[1-9]|1[0-2]",apply:function(e){this.month=e-1}},dd:{regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(e){this.date=+e}},d:{regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(e){this.date=+e}},EEEE:{regex:e.DATETIME_FORMATS.DAY.join("|")},EEE:{regex:e.DATETIME_FORMATS.SHORTDAY.join("|")}};this.parse=function(t,i){if(!angular.isString(t)||!i)return t;i=e.DATETIME_FORMATS[i]||i,this.parsers[i]||(this.parsers[i]=a(i));var r=this.parsers[i],o=r.regex,l=r.map,c=t.match(o);if(c&&c.length){for(var d,s={year:1900,month:0,date:1,hours:0},u=1,p=c.length;p>u;u++){var f=l[u-1];f.apply&&f.apply.call(s,c[u])}return n(s.year,s.month,s.date)&&(d=new Date(s.year,s.month,s.date,s.hours)),d}}}]); \ No newline at end of file diff --git a/brewman/static/src/js/ui-bootstrap-tpls-2.5.0.min.js b/brewman/static/src/js/ui-bootstrap-tpls-2.5.0.min.js deleted file mode 100644 index 0b1fc7f0..00000000 --- a/brewman/static/src/js/ui-bootstrap-tpls-2.5.0.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/* - * angular-ui-bootstrap - * http://angular-ui.github.io/bootstrap/ - - * Version: 2.5.0 - 2017-01-28 - * License: MIT - */angular.module("ui.bootstrap",["ui.bootstrap.tpls","ui.bootstrap.collapse","ui.bootstrap.tabindex","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.isClass","ui.bootstrap.datepicker","ui.bootstrap.position","ui.bootstrap.datepickerPopup","ui.bootstrap.debounce","ui.bootstrap.multiMap","ui.bootstrap.dropdown","ui.bootstrap.stackedMap","ui.bootstrap.modal","ui.bootstrap.paging","ui.bootstrap.pager","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.tpls",["uib/template/accordion/accordion-group.html","uib/template/accordion/accordion.html","uib/template/alert/alert.html","uib/template/carousel/carousel.html","uib/template/carousel/slide.html","uib/template/datepicker/datepicker.html","uib/template/datepicker/day.html","uib/template/datepicker/month.html","uib/template/datepicker/year.html","uib/template/datepickerPopup/popup.html","uib/template/modal/window.html","uib/template/pager/pager.html","uib/template/pagination/pagination.html","uib/template/tooltip/tooltip-html-popup.html","uib/template/tooltip/tooltip-popup.html","uib/template/tooltip/tooltip-template-popup.html","uib/template/popover/popover-html.html","uib/template/popover/popover-template.html","uib/template/popover/popover.html","uib/template/progressbar/bar.html","uib/template/progressbar/progress.html","uib/template/progressbar/progressbar.html","uib/template/rating/rating.html","uib/template/tabs/tab.html","uib/template/tabs/tabset.html","uib/template/timepicker/timepicker.html","uib/template/typeahead/typeahead-match.html","uib/template/typeahead/typeahead-popup.html"]),angular.module("ui.bootstrap.collapse",[]).directive("uibCollapse",["$animate","$q","$parse","$injector",function(a,b,c,d){var e=d.has("$animateCss")?d.get("$animateCss"):null;return{link:function(d,f,g){function h(){r=!!("horizontal"in g),r?(s={width:""},t={width:"0"}):(s={height:""},t={height:"0"}),d.$eval(g.uibCollapse)||f.addClass("in").addClass("collapse").attr("aria-expanded",!0).attr("aria-hidden",!1).css(s)}function i(a){return r?{width:a.scrollWidth+"px"}:{height:a.scrollHeight+"px"}}function j(){f.hasClass("collapse")&&f.hasClass("in")||b.resolve(n(d)).then(function(){f.removeClass("collapse").addClass("collapsing").attr("aria-expanded",!0).attr("aria-hidden",!1),e?e(f,{addClass:"in",easing:"ease",css:{overflow:"hidden"},to:i(f[0])}).start()["finally"](k):a.addClass(f,"in",{css:{overflow:"hidden"},to:i(f[0])}).then(k)},angular.noop)}function k(){f.removeClass("collapsing").addClass("collapse").css(s),o(d)}function l(){return f.hasClass("collapse")||f.hasClass("in")?void b.resolve(p(d)).then(function(){f.css(i(f[0])).removeClass("collapse").addClass("collapsing").attr("aria-expanded",!1).attr("aria-hidden",!0),e?e(f,{removeClass:"in",to:t}).start()["finally"](m):a.removeClass(f,"in",{to:t}).then(m)},angular.noop):m()}function m(){f.css(t),f.removeClass("collapsing").addClass("collapse"),q(d)}var n=c(g.expanding),o=c(g.expanded),p=c(g.collapsing),q=c(g.collapsed),r=!1,s={},t={};h(),d.$watch(g.uibCollapse,function(a){a?l():j()})}}}]),angular.module("ui.bootstrap.tabindex",[]).directive("uibTabindexToggle",function(){return{restrict:"A",link:function(a,b,c){c.$observe("disabled",function(a){c.$set("tabindex",a?-1:null)})}}}),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse","ui.bootstrap.tabindex"]).constant("uibAccordionConfig",{closeOthers:!0}).controller("UibAccordionController",["$scope","$attrs","uibAccordionConfig",function(a,b,c){this.groups=[],this.closeOthers=function(d){var e=angular.isDefined(b.closeOthers)?a.$eval(b.closeOthers):c.closeOthers;e&&angular.forEach(this.groups,function(a){a!==d&&(a.isOpen=!1)})},this.addGroup=function(a){var b=this;this.groups.push(a),a.$on("$destroy",function(c){b.removeGroup(a)})},this.removeGroup=function(a){var b=this.groups.indexOf(a);-1!==b&&this.groups.splice(b,1)}}]).directive("uibAccordion",function(){return{controller:"UibAccordionController",controllerAs:"accordion",transclude:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/accordion/accordion.html"}}}).directive("uibAccordionGroup",function(){return{require:"^uibAccordion",transclude:!0,restrict:"A",templateUrl:function(a,b){return b.templateUrl||"uib/template/accordion/accordion-group.html"},scope:{heading:"@",panelClass:"@?",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(a){this.heading=a}},link:function(a,b,c,d){b.addClass("panel"),d.addGroup(a),a.openClass=c.openClass||"panel-open",a.panelClass=c.panelClass||"panel-default",a.$watch("isOpen",function(c){b.toggleClass(a.openClass,!!c),c&&d.closeOthers(a)}),a.toggleOpen=function(b){a.isDisabled||b&&32!==b.which||(a.isOpen=!a.isOpen)};var e="accordiongroup-"+a.$id+"-"+Math.floor(1e4*Math.random());a.headingId=e+"-tab",a.panelId=e+"-panel"}}}).directive("uibAccordionHeading",function(){return{transclude:!0,template:"",replace:!0,require:"^uibAccordionGroup",link:function(a,b,c,d,e){d.setHeading(e(a,angular.noop))}}}).directive("uibAccordionTransclude",function(){function a(){return"uib-accordion-header,data-uib-accordion-header,x-uib-accordion-header,uib\\:accordion-header,[uib-accordion-header],[data-uib-accordion-header],[x-uib-accordion-header]"}return{require:"^uibAccordionGroup",link:function(b,c,d,e){b.$watch(function(){return e[d.uibAccordionTransclude]},function(b){if(b){var d=angular.element(c[0].querySelector(a()));d.html(""),d.append(b)}})}}}),angular.module("ui.bootstrap.alert",[]).controller("UibAlertController",["$scope","$element","$attrs","$interpolate","$timeout",function(a,b,c,d,e){a.closeable=!!c.close,b.addClass("alert"),c.$set("role","alert"),a.closeable&&b.addClass("alert-dismissible");var f=angular.isDefined(c.dismissOnTimeout)?d(c.dismissOnTimeout)(a.$parent):null;f&&e(function(){a.close()},parseInt(f,10))}]).directive("uibAlert",function(){return{controller:"UibAlertController",controllerAs:"alert",restrict:"A",templateUrl:function(a,b){return b.templateUrl||"uib/template/alert/alert.html"},transclude:!0,scope:{close:"&"}}}),angular.module("ui.bootstrap.buttons",[]).constant("uibButtonConfig",{activeClass:"active",toggleEvent:"click"}).controller("UibButtonsController",["uibButtonConfig",function(a){this.activeClass=a.activeClass||"active",this.toggleEvent=a.toggleEvent||"click"}]).directive("uibBtnRadio",["$parse",function(a){return{require:["uibBtnRadio","ngModel"],controller:"UibButtonsController",controllerAs:"buttons",link:function(b,c,d,e){var f=e[0],g=e[1],h=a(d.uibUncheckable);c.find("input").css({display:"none"}),g.$render=function(){c.toggleClass(f.activeClass,angular.equals(g.$modelValue,b.$eval(d.uibBtnRadio)))},c.on(f.toggleEvent,function(){if(!d.disabled){var a=c.hasClass(f.activeClass);a&&!angular.isDefined(d.uncheckable)||b.$apply(function(){g.$setViewValue(a?null:b.$eval(d.uibBtnRadio)),g.$render()})}}),d.uibUncheckable&&b.$watch(h,function(a){d.$set("uncheckable",a?"":void 0)})}}}]).directive("uibBtnCheckbox",function(){return{require:["uibBtnCheckbox","ngModel"],controller:"UibButtonsController",controllerAs:"button",link:function(a,b,c,d){function e(){return g(c.btnCheckboxTrue,!0)}function f(){return g(c.btnCheckboxFalse,!1)}function g(b,c){return angular.isDefined(b)?a.$eval(b):c}var h=d[0],i=d[1];b.find("input").css({display:"none"}),i.$render=function(){b.toggleClass(h.activeClass,angular.equals(i.$modelValue,e()))},b.on(h.toggleEvent,function(){c.disabled||a.$apply(function(){i.$setViewValue(b.hasClass(h.activeClass)?f():e()),i.$render()})})}}}),angular.module("ui.bootstrap.carousel",[]).controller("UibCarouselController",["$scope","$element","$interval","$timeout","$animate",function(a,b,c,d,e){function f(a){for(var b=0;b1){p[d].element.data(q,c.direction);var h=o.getCurrentIndex();angular.isNumber(h)&&p[h].element&&p[h].element.data(q,c.direction),a.$currentTransition=!0,e.on("addClass",p[d].element,function(b,c){"close"===c&&(a.$currentTransition=null,e.off("addClass",b))})}a.active=c.index,r=c.index,f(d),k()}}function h(a){for(var b=0;b0&&(m=c(l,b))}function l(){var b=+a.interval;n&&!isNaN(b)&&b>0&&p.length?a.next():a.pause()}var m,n,o=this,p=o.slides=a.slides=[],q="uib-slideDirection",r=a.active,s=!1;b.addClass("carousel"),o.addSlide=function(b,c){p.push({slide:b,element:c}),p.sort(function(a,b){return+a.slide.index-+b.slide.index}),(b.index===a.active||1===p.length&&!angular.isNumber(a.active))&&(a.$currentTransition&&(a.$currentTransition=null),r=b.index,a.active=b.index,f(r),o.select(p[h(b)]),1===p.length&&a.play())},o.getCurrentIndex=function(){for(var a=0;a0&&r===c?c>=p.length?(r=p.length-1,a.active=r,f(r),o.select(p[p.length-1])):(r=c,a.active=r,f(r),o.select(p[c])):r>c&&(r--,a.active=r),0===p.length&&(r=null,a.active=null)},o.select=a.select=function(b,c){var d=h(b.slide);void 0===c&&(c=d>o.getCurrentIndex()?"next":"prev"),b.slide.index===r||a.$currentTransition||g(b.slide,d,c)},a.indexOfSlide=function(a){return+a.slide.index},a.isActive=function(b){return a.active===b.slide.index},a.isPrevDisabled=function(){return 0===a.active&&a.noWrap()},a.isNextDisabled=function(){return a.active===p.length-1&&a.noWrap()},a.pause=function(){a.noPause||(n=!1,i())},a.play=function(){n||(n=!0,k())},b.on("mouseenter",a.pause),b.on("mouseleave",a.play),a.$on("$destroy",function(){s=!0,i()}),a.$watch("noTransition",function(a){e.enabled(b,!a)}),a.$watch("interval",k),a.$watchCollection("slides",j),a.$watch("active",function(a){if(angular.isNumber(a)&&r!==a){for(var b=0;b-1){var f=!1;a=a.split("");for(var g=e;g-1){a=a.split(""),c[e]="("+d.regex+")",a[e]="$";for(var f=e+1,g=e+d.key.length;g>f;f++)c[f]="",a[f]="$";a=a.join(""),b.push({index:e,key:d.key,apply:d.apply,matcher:d.regex})}}),{regex:new RegExp("^"+c.join("")+"$"),map:d(b,"index")}}function h(a){for(var b,c,d=[],e=0;e=a.length||"'"!==a.charAt(e+1))&&(d.push(i(a,c,e)),c=null);else if(e===a.length)for(;cc?!1:1===b&&c>28?29===c&&(a%4===0&&a%100!==0||a%400===0):3===b||5===b||8===b||10===b?31>c:!0}function l(a){return parseInt(a,10)}function m(a,b){return a&&b?q(a,b):a}function n(a,b){return a&&b?q(a,b,!0):a}function o(a,b){a=a.replace(/:/g,"");var c=Date.parse("Jan 01, 1970 00:00:00 "+a)/6e4;return isNaN(c)?b:c}function p(a,b){return a=new Date(a.getTime()),a.setMinutes(a.getMinutes()+b),a}function q(a,b,c){c=c?-1:1;var d=a.getTimezoneOffset(),e=o(b,d);return p(a,c*(e-d))}var r,s,t=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;this.init=function(){r=b.id,this.parsers={},this.formatters={},s=[{key:"yyyy",regex:"\\d{4}",apply:function(a){this.year=+a},formatter:function(a){var b=new Date;return b.setFullYear(Math.abs(a.getFullYear())),c(b,"yyyy")}},{key:"yy",regex:"\\d{2}",apply:function(a){a=+a,this.year=69>a?a+2e3:a+1900},formatter:function(a){var b=new Date;return b.setFullYear(Math.abs(a.getFullYear())),c(b,"yy")}},{key:"y",regex:"\\d{1,4}",apply:function(a){this.year=+a},formatter:function(a){var b=new Date;return b.setFullYear(Math.abs(a.getFullYear())),c(b,"y")}},{key:"M!",regex:"0?[1-9]|1[0-2]",apply:function(a){this.month=a-1},formatter:function(a){var b=a.getMonth();return/^[0-9]$/.test(b)?c(a,"MM"):c(a,"M")}},{key:"MMMM",regex:b.DATETIME_FORMATS.MONTH.join("|"),apply:function(a){this.month=b.DATETIME_FORMATS.MONTH.indexOf(a)},formatter:function(a){return c(a,"MMMM")}},{key:"MMM",regex:b.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(a){this.month=b.DATETIME_FORMATS.SHORTMONTH.indexOf(a)},formatter:function(a){return c(a,"MMM")}},{key:"MM",regex:"0[1-9]|1[0-2]",apply:function(a){this.month=a-1},formatter:function(a){return c(a,"MM")}},{key:"M",regex:"[1-9]|1[0-2]",apply:function(a){this.month=a-1},formatter:function(a){return c(a,"M")}},{key:"d!",regex:"[0-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a},formatter:function(a){var b=a.getDate();return/^[1-9]$/.test(b)?c(a,"dd"):c(a,"d")}},{key:"dd",regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a},formatter:function(a){return c(a,"dd")}},{key:"d",regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a},formatter:function(a){return c(a,"d")}},{key:"EEEE",regex:b.DATETIME_FORMATS.DAY.join("|"),formatter:function(a){return c(a,"EEEE")}},{key:"EEE",regex:b.DATETIME_FORMATS.SHORTDAY.join("|"),formatter:function(a){return c(a,"EEE")}},{key:"HH",regex:"(?:0|1)[0-9]|2[0-3]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"HH")}},{key:"hh",regex:"0[0-9]|1[0-2]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"hh")}},{key:"H",regex:"1?[0-9]|2[0-3]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"H")}},{key:"h",regex:"[0-9]|1[0-2]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"h")}},{key:"mm",regex:"[0-5][0-9]",apply:function(a){this.minutes=+a},formatter:function(a){return c(a,"mm")}},{key:"m",regex:"[0-9]|[1-5][0-9]",apply:function(a){this.minutes=+a},formatter:function(a){return c(a,"m")}},{key:"sss",regex:"[0-9][0-9][0-9]",apply:function(a){this.milliseconds=+a},formatter:function(a){return c(a,"sss")}},{key:"ss",regex:"[0-5][0-9]",apply:function(a){this.seconds=+a},formatter:function(a){return c(a,"ss")}},{key:"s",regex:"[0-9]|[1-5][0-9]",apply:function(a){this.seconds=+a},formatter:function(a){return c(a,"s")}},{key:"a",regex:b.DATETIME_FORMATS.AMPMS.join("|"),apply:function(a){12===this.hours&&(this.hours=0),"PM"===a&&(this.hours+=12)},formatter:function(a){return c(a,"a")}},{key:"Z",regex:"[+-]\\d{4}",apply:function(a){var b=a.match(/([+-])(\d{2})(\d{2})/),c=b[1],d=b[2],e=b[3];this.hours+=l(c+d),this.minutes+=l(c+e)},formatter:function(a){return c(a,"Z")}},{key:"ww",regex:"[0-4][0-9]|5[0-3]",formatter:function(a){return c(a,"ww")}},{key:"w",regex:"[0-9]|[1-4][0-9]|5[0-3]",formatter:function(a){return c(a,"w")}},{key:"GGGG",regex:b.DATETIME_FORMATS.ERANAMES.join("|").replace(/\s/g,"\\s"),formatter:function(a){return c(a,"GGGG")}},{key:"GGG",regex:b.DATETIME_FORMATS.ERAS.join("|"),formatter:function(a){return c(a,"GGG")}},{key:"GG",regex:b.DATETIME_FORMATS.ERAS.join("|"),formatter:function(a){return c(a,"GG")}},{key:"G",regex:b.DATETIME_FORMATS.ERAS.join("|"),formatter:function(a){return c(a,"G")}}],angular.version.major>=1&&angular.version.minor>4&&s.push({key:"LLLL",regex:b.DATETIME_FORMATS.STANDALONEMONTH.join("|"),apply:function(a){this.month=b.DATETIME_FORMATS.STANDALONEMONTH.indexOf(a)},formatter:function(a){return c(a,"LLLL")}})},this.init(),this.getParser=function(a){var b=f(a);return b&&b.apply||null},this.overrideParser=function(a,b){var c=f(a);c&&angular.isFunction(b)&&(this.parsers={},c.apply=b)}.bind(this),this.filter=function(a,c){if(!angular.isDate(a)||isNaN(a)||!c)return"";c=b.DATETIME_FORMATS[c]||c,b.id!==r&&this.init(),this.formatters[c]||(this.formatters[c]=h(c));var d=this.formatters[c];return d.reduce(function(b,c){return b+c(a)},"")},this.parse=function(c,d,e){if(!angular.isString(c)||!d)return c;d=b.DATETIME_FORMATS[d]||d,d=d.replace(t,"\\$&"),b.id!==r&&this.init(),this.parsers[d]||(this.parsers[d]=g(d,"apply"));var f=this.parsers[d],h=f.regex,i=f.map,j=c.match(h),l=!1;if(j&&j.length){var m,n;angular.isDate(e)&&!isNaN(e.getTime())?m={year:e.getFullYear(),month:e.getMonth(),date:e.getDate(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds(),milliseconds:e.getMilliseconds()}:(e&&a.warn("dateparser:","baseDate is not a valid date"),m={year:1900,month:0,date:1,hours:0,minutes:0,seconds:0,milliseconds:0});for(var o=1,p=j.length;p>o;o++){var q=i[o-1];"Z"===q.matcher&&(l=!0),q.apply&&q.apply.call(m,j[o])}var s=l?Date.prototype.setUTCFullYear:Date.prototype.setFullYear,u=l?Date.prototype.setUTCHours:Date.prototype.setHours;return k(m.year,m.month,m.date)&&(!angular.isDate(e)||isNaN(e.getTime())||l?(n=new Date(0),s.call(n,m.year,m.month,m.date),u.call(n,m.hours||0,m.minutes||0,m.seconds||0,m.milliseconds||0)):(n=new Date(e),s.call(n,m.year,m.month,m.date),u.call(n,m.hours,m.minutes,m.seconds,m.milliseconds))),n}},this.toTimezone=m,this.fromTimezone=n,this.timezoneToOffset=o,this.addDateMinutes=p,this.convertTimezoneToLocal=q}]),angular.module("ui.bootstrap.isClass",[]).directive("uibIsClass",["$animate",function(a){var b=/^\s*([\s\S]+?)\s+on\s+([\s\S]+?)\s*$/,c=/^\s*([\s\S]+?)\s+for\s+([\s\S]+?)\s*$/;return{restrict:"A",compile:function(d,e){function f(a,b,c){i.push(a),j.push({scope:a,element:b}),o.forEach(function(b,c){g(b,a)}),a.$on("$destroy",h)}function g(b,d){var e=b.match(c),f=d.$eval(e[1]),g=e[2],h=k[b];if(!h){var i=function(b){var c=null;j.some(function(a){var d=a.scope.$eval(m);return d===b?(c=a,!0):void 0}),h.lastActivated!==c&&(h.lastActivated&&a.removeClass(h.lastActivated.element,f),c&&a.addClass(c.element,f),h.lastActivated=c)};k[b]=h={lastActivated:null,scope:d,watchFn:i,compareWithExp:g,watcher:d.$watch(g,i)}}h.watchFn(d.$eval(g))}function h(a){var b=a.targetScope,c=i.indexOf(b);if(i.splice(c,1),j.splice(c,1),i.length){var d=i[0];angular.forEach(k,function(a){a.scope===b&&(a.watcher=d.$watch(a.compareWithExp,a.watchFn),a.scope=d)})}else k={}}var i=[],j=[],k={},l=e.uibIsClass.match(b),m=l[2],n=l[1],o=n.split(",");return f}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.isClass"]).value("$datepickerSuppressError",!1).value("$datepickerLiteralWarning",!0).constant("uibDatepickerConfig",{datepickerMode:"day",formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",maxDate:null,maxMode:"year",minDate:null,minMode:"day",monthColumns:3,ngModelOptions:{},shortcutPropagation:!1,showWeeks:!0,yearColumns:5,yearRows:4}).controller("UibDatepickerController",["$scope","$element","$attrs","$parse","$interpolate","$locale","$log","dateFilter","uibDatepickerConfig","$datepickerLiteralWarning","$datepickerSuppressError","uibDateParser",function(a,b,c,d,e,f,g,h,i,j,k,l){function m(b){a.datepickerMode=b,a.datepickerOptions.datepickerMode=b}function n(b){var c;if(angular.version.minor<6)c=b.$options||a.datepickerOptions.ngModelOptions||i.ngModelOptions||{},c.getOption=function(a){return c[a]};else{var d=b.$options.getOption("timezone")||(a.datepickerOptions.ngModelOptions?a.datepickerOptions.ngModelOptions.timezone:null)||(i.ngModelOptions?i.ngModelOptions.timezone:null);c=b.$options.createChild(i.ngModelOptions).createChild(a.datepickerOptions.ngModelOptions).createChild(b.$options).createChild({timezone:d})}return c}var o=this,p={$setViewValue:angular.noop},q={},r=[];b.addClass("uib-datepicker"),c.$set("role","application"),a.datepickerOptions||(a.datepickerOptions={}),this.modes=["day","month","year"],["customClass","dateDisabled","datepickerMode","formatDay","formatDayHeader","formatDayTitle","formatMonth","formatMonthTitle","formatYear","maxDate","maxMode","minDate","minMode","monthColumns","showWeeks","shortcutPropagation","startingDay","yearColumns","yearRows"].forEach(function(b){switch(b){case"customClass":case"dateDisabled":a[b]=a.datepickerOptions[b]||angular.noop;break;case"datepickerMode":a.datepickerMode=angular.isDefined(a.datepickerOptions.datepickerMode)?a.datepickerOptions.datepickerMode:i.datepickerMode;break;case"formatDay":case"formatDayHeader":case"formatDayTitle":case"formatMonth":case"formatMonthTitle":case"formatYear":o[b]=angular.isDefined(a.datepickerOptions[b])?e(a.datepickerOptions[b])(a.$parent):i[b];break;case"monthColumns":case"showWeeks":case"shortcutPropagation":case"yearColumns":case"yearRows":o[b]=angular.isDefined(a.datepickerOptions[b])?a.datepickerOptions[b]:i[b];break;case"startingDay":angular.isDefined(a.datepickerOptions.startingDay)?o.startingDay=a.datepickerOptions.startingDay:angular.isNumber(i.startingDay)?o.startingDay=i.startingDay:o.startingDay=(f.DATETIME_FORMATS.FIRSTDAYOFWEEK+8)%7;break;case"maxDate":case"minDate":a.$watch("datepickerOptions."+b,function(a){a?angular.isDate(a)?o[b]=l.fromTimezone(new Date(a),q.getOption("timezone")):(j&&g.warn("Literal date support has been deprecated, please switch to date object usage"),o[b]=new Date(h(a,"medium"))):o[b]=i[b]?l.fromTimezone(new Date(i[b]),q.getOption("timezone")):null,o.refreshView()});break;case"maxMode":case"minMode":a.datepickerOptions[b]?a.$watch(function(){return a.datepickerOptions[b]},function(c){o[b]=a[b]=angular.isDefined(c)?c:a.datepickerOptions[b],("minMode"===b&&o.modes.indexOf(a.datepickerOptions.datepickerMode)o.modes.indexOf(o[b]))&&(a.datepickerMode=o[b],a.datepickerOptions.datepickerMode=o[b])}):o[b]=a[b]=i[b]||null}}),a.uniqueId="datepicker-"+a.$id+"-"+Math.floor(1e4*Math.random()),a.disabled=angular.isDefined(c.disabled)||!1,angular.isDefined(c.ngDisabled)&&r.push(a.$parent.$watch(c.ngDisabled,function(b){a.disabled=b,o.refreshView()})),a.isActive=function(b){return 0===o.compare(b.date,o.activeDate)?(a.activeDateId=b.uid,!0):!1},this.init=function(b){p=b,q=n(p),a.datepickerOptions.initDate?(o.activeDate=l.fromTimezone(a.datepickerOptions.initDate,q.getOption("timezone"))||new Date,a.$watch("datepickerOptions.initDate",function(a){a&&(p.$isEmpty(p.$modelValue)||p.$invalid)&&(o.activeDate=l.fromTimezone(a,q.getOption("timezone")),o.refreshView())})):o.activeDate=new Date;var c=p.$modelValue?new Date(p.$modelValue):new Date;this.activeDate=isNaN(c)?l.fromTimezone(new Date,q.getOption("timezone")):l.fromTimezone(c,q.getOption("timezone")),p.$render=function(){o.render()}},this.render=function(){if(p.$viewValue){var a=new Date(p.$viewValue),b=!isNaN(a);b?this.activeDate=l.fromTimezone(a,q.getOption("timezone")):k||g.error('Datepicker directive: "ng-model" value must be a Date object')}this.refreshView()},this.refreshView=function(){if(this.element){a.selectedDt=null,this._refreshView(),a.activeDt&&(a.activeDateId=a.activeDt.uid);var b=p.$viewValue?new Date(p.$viewValue):null;b=l.fromTimezone(b,q.getOption("timezone")),p.$setValidity("dateDisabled",!b||this.element&&!this.isDisabled(b))}},this.createDateObject=function(b,c){var d=p.$viewValue?new Date(p.$viewValue):null;d=l.fromTimezone(d,q.getOption("timezone"));var e=new Date;e=l.fromTimezone(e,q.getOption("timezone"));var f=this.compare(b,e),g={date:b,label:l.filter(b,c),selected:d&&0===this.compare(b,d),disabled:this.isDisabled(b),past:0>f,current:0===f,future:f>0,customClass:this.customClass(b)||null};return d&&0===this.compare(b,d)&&(a.selectedDt=g),o.activeDate&&0===this.compare(g.date,o.activeDate)&&(a.activeDt=g),g},this.isDisabled=function(b){return a.disabled||this.minDate&&this.compare(b,this.minDate)<0||this.maxDate&&this.compare(b,this.maxDate)>0||a.dateDisabled&&a.dateDisabled({date:b,mode:a.datepickerMode})},this.customClass=function(b){return a.customClass({date:b,mode:a.datepickerMode})},this.split=function(a,b){for(var c=[];a.length>0;)c.push(a.splice(0,b));return c},a.select=function(b){if(a.datepickerMode===o.minMode){var c=p.$viewValue?l.fromTimezone(new Date(p.$viewValue),q.getOption("timezone")):new Date(0,0,0,0,0,0,0);c.setFullYear(b.getFullYear(),b.getMonth(),b.getDate()),c=l.toTimezone(c,q.getOption("timezone")),p.$setViewValue(c),p.$render()}else o.activeDate=b,m(o.modes[o.modes.indexOf(a.datepickerMode)-1]),a.$emit("uib:datepicker.mode");a.$broadcast("uib:datepicker.focus")},a.move=function(a){var b=o.activeDate.getFullYear()+a*(o.step.years||0),c=o.activeDate.getMonth()+a*(o.step.months||0);o.activeDate.setFullYear(b,c,1),o.refreshView()},a.toggleMode=function(b){b=b||1,a.datepickerMode===o.maxMode&&1===b||a.datepickerMode===o.minMode&&-1===b||(m(o.modes[o.modes.indexOf(a.datepickerMode)+b]),a.$emit("uib:datepicker.mode"))},a.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};var s=function(){o.element[0].focus()};a.$on("uib:datepicker.focus",s),a.keydown=function(b){var c=a.keys[b.which];if(c&&!b.shiftKey&&!b.altKey&&!a.disabled)if(b.preventDefault(),o.shortcutPropagation||b.stopPropagation(),"enter"===c||"space"===c){if(o.isDisabled(o.activeDate))return;a.select(o.activeDate)}else!b.ctrlKey||"up"!==c&&"down"!==c?(o.handleKeyDown(c,b),o.refreshView()):a.toggleMode("up"===c?1:-1)},b.on("keydown",function(b){a.$apply(function(){a.keydown(b)})}),a.$on("$destroy",function(){for(;r.length;)r.shift()()})}]).controller("UibDaypickerController",["$scope","$element","dateFilter",function(a,b,c){function d(a,b){return 1!==b||a%4!==0||a%100===0&&a%400!==0?f[b]:29}function e(a){var b=new Date(a);b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1}var f=[31,28,31,30,31,30,31,31,30,31,30,31];this.step={months:1},this.element=b,this.init=function(b){angular.extend(b,this),a.showWeeks=b.showWeeks,b.refreshView()},this.getDates=function(a,b){for(var c,d=new Array(b),e=new Date(a),f=0;b>f;)c=new Date(e),d[f++]=c,e.setDate(e.getDate()+1);return d},this._refreshView=function(){var b=this.activeDate.getFullYear(),d=this.activeDate.getMonth(),f=new Date(this.activeDate);f.setFullYear(b,d,1);var g=this.startingDay-f.getDay(),h=g>0?7-g:-g,i=new Date(f);h>0&&i.setDate(-h+1);for(var j=this.getDates(i,42),k=0;42>k;k++)j[k]=angular.extend(this.createDateObject(j[k],this.formatDay),{secondary:j[k].getMonth()!==d,uid:a.uniqueId+"-"+k});a.labels=new Array(7);for(var l=0;7>l;l++)a.labels[l]={abbr:c(j[l].date,this.formatDayHeader),full:c(j[l].date,"EEEE")};if(a.title=c(this.activeDate,this.formatDayTitle),a.rows=this.split(j,7),a.showWeeks){a.weekNumbers=[];for(var m=(11-this.startingDay)%7,n=a.rows.length,o=0;n>o;o++)a.weekNumbers.push(e(a.rows[o][m].date))}},this.compare=function(a,b){var c=new Date(a.getFullYear(),a.getMonth(),a.getDate()),d=new Date(b.getFullYear(),b.getMonth(),b.getDate());return c.setFullYear(a.getFullYear()),d.setFullYear(b.getFullYear()),c-d},this.handleKeyDown=function(a,b){var c=this.activeDate.getDate();if("left"===a)c-=1;else if("up"===a)c-=7;else if("right"===a)c+=1;else if("down"===a)c+=7;else if("pageup"===a||"pagedown"===a){var e=this.activeDate.getMonth()+("pageup"===a?-1:1);this.activeDate.setMonth(e,1),c=Math.min(d(this.activeDate.getFullYear(),this.activeDate.getMonth()),c)}else"home"===a?c=1:"end"===a&&(c=d(this.activeDate.getFullYear(),this.activeDate.getMonth()));this.activeDate.setDate(c)}}]).controller("UibMonthpickerController",["$scope","$element","dateFilter",function(a,b,c){this.step={years:1},this.element=b,this.init=function(a){angular.extend(a,this),a.refreshView()},this._refreshView=function(){for(var b,d=new Array(12),e=this.activeDate.getFullYear(),f=0;12>f;f++)b=new Date(this.activeDate),b.setFullYear(e,f,1),d[f]=angular.extend(this.createDateObject(b,this.formatMonth),{uid:a.uniqueId+"-"+f});a.title=c(this.activeDate,this.formatMonthTitle),a.rows=this.split(d,this.monthColumns),a.yearHeaderColspan=this.monthColumns>3?this.monthColumns-2:1},this.compare=function(a,b){var c=new Date(a.getFullYear(),a.getMonth()),d=new Date(b.getFullYear(),b.getMonth());return c.setFullYear(a.getFullYear()),d.setFullYear(b.getFullYear()),c-d},this.handleKeyDown=function(a,b){var c=this.activeDate.getMonth();if("left"===a)c-=1;else if("up"===a)c-=this.monthColumns;else if("right"===a)c+=1;else if("down"===a)c+=this.monthColumns;else if("pageup"===a||"pagedown"===a){var d=this.activeDate.getFullYear()+("pageup"===a?-1:1);this.activeDate.setFullYear(d)}else"home"===a?c=0:"end"===a&&(c=11);this.activeDate.setMonth(c)}}]).controller("UibYearpickerController",["$scope","$element","dateFilter",function(a,b,c){function d(a){return parseInt((a-1)/f,10)*f+1}var e,f;this.element=b,this.yearpickerInit=function(){e=this.yearColumns,f=this.yearRows*e,this.step={years:f}},this._refreshView=function(){for(var b,c=new Array(f),g=0,h=d(this.activeDate.getFullYear());f>g;g++)b=new Date(this.activeDate),b.setFullYear(h+g,0,1),c[g]=angular.extend(this.createDateObject(b,this.formatYear),{uid:a.uniqueId+"-"+g});a.title=[c[0].label,c[f-1].label].join(" - "),a.rows=this.split(c,e),a.columns=e},this.compare=function(a,b){return a.getFullYear()-b.getFullYear()},this.handleKeyDown=function(a,b){var c=this.activeDate.getFullYear();"left"===a?c-=1:"up"===a?c-=e:"right"===a?c+=1:"down"===a?c+=e:"pageup"===a||"pagedown"===a?c+=("pageup"===a?-1:1)*f:"home"===a?c=d(this.activeDate.getFullYear()):"end"===a&&(c=d(this.activeDate.getFullYear())+f-1),this.activeDate.setFullYear(c)}}]).directive("uibDatepicker",function(){return{templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/datepicker.html"},scope:{datepickerOptions:"=?"},require:["uibDatepicker","^ngModel"],restrict:"A",controller:"UibDatepickerController",controllerAs:"datepicker",link:function(a,b,c,d){var e=d[0],f=d[1];e.init(f)}}}).directive("uibDaypicker",function(){return{templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/day.html"}, -require:["^uibDatepicker","uibDaypicker"],restrict:"A",controller:"UibDaypickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibMonthpicker",function(){return{templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/month.html"},require:["^uibDatepicker","uibMonthpicker"],restrict:"A",controller:"UibMonthpickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibYearpicker",function(){return{templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/year.html"},require:["^uibDatepicker","uibYearpicker"],restrict:"A",controller:"UibYearpickerController",link:function(a,b,c,d){var e=d[0];angular.extend(e,d[1]),e.yearpickerInit(),e.refreshView()}}}),angular.module("ui.bootstrap.position",[]).factory("$uibPosition",["$document","$window",function(a,b){var c,d,e={normal:/(auto|scroll)/,hidden:/(auto|scroll|hidden)/},f={auto:/\s?auto?\s?/i,primary:/^(top|bottom|left|right)$/,secondary:/^(top|bottom|left|right|center)$/,vertical:/^(top|bottom)$/},g=/(HTML|BODY)/;return{getRawNode:function(a){return a.nodeName?a:a[0]||a},parseStyle:function(a){return a=parseFloat(a),isFinite(a)?a:0},offsetParent:function(c){function d(a){return"static"===(b.getComputedStyle(a).position||"static")}c=this.getRawNode(c);for(var e=c.offsetParent||a[0].documentElement;e&&e!==a[0].documentElement&&d(e);)e=e.offsetParent;return e||a[0].documentElement},scrollbarWidth:function(e){if(e){if(angular.isUndefined(d)){var f=a.find("body");f.addClass("uib-position-body-scrollbar-measure"),d=b.innerWidth-f[0].clientWidth,d=isFinite(d)?d:0,f.removeClass("uib-position-body-scrollbar-measure")}return d}if(angular.isUndefined(c)){var g=angular.element('
');a.find("body").append(g),c=g[0].offsetWidth-g[0].clientWidth,c=isFinite(c)?c:0,g.remove()}return c},scrollbarPadding:function(a){a=this.getRawNode(a);var c=b.getComputedStyle(a),d=this.parseStyle(c.paddingRight),e=this.parseStyle(c.paddingBottom),f=this.scrollParent(a,!1,!0),h=this.scrollbarWidth(g.test(f.tagName));return{scrollbarWidth:h,widthOverflow:f.scrollWidth>f.clientWidth,right:d+h,originalRight:d,heightOverflow:f.scrollHeight>f.clientHeight,bottom:e+h,originalBottom:e}},isScrollable:function(a,c){a=this.getRawNode(a);var d=c?e.hidden:e.normal,f=b.getComputedStyle(a);return d.test(f.overflow+f.overflowY+f.overflowX)},scrollParent:function(c,d,f){c=this.getRawNode(c);var g=d?e.hidden:e.normal,h=a[0].documentElement,i=b.getComputedStyle(c);if(f&&g.test(i.overflow+i.overflowY+i.overflowX))return c;var j="absolute"===i.position,k=c.parentElement||h;if(k===h||"fixed"===i.position)return h;for(;k.parentElement&&k!==h;){var l=b.getComputedStyle(k);if(j&&"static"!==l.position&&(j=!1),!j&&g.test(l.overflow+l.overflowY+l.overflowX))break;k=k.parentElement}return k},position:function(c,d){c=this.getRawNode(c);var e=this.offset(c);if(d){var f=b.getComputedStyle(c);e.top-=this.parseStyle(f.marginTop),e.left-=this.parseStyle(f.marginLeft)}var g=this.offsetParent(c),h={top:0,left:0};return g!==a[0].documentElement&&(h=this.offset(g),h.top+=g.clientTop-g.scrollTop,h.left+=g.clientLeft-g.scrollLeft),{width:Math.round(angular.isNumber(e.width)?e.width:c.offsetWidth),height:Math.round(angular.isNumber(e.height)?e.height:c.offsetHeight),top:Math.round(e.top-h.top),left:Math.round(e.left-h.left)}},offset:function(c){c=this.getRawNode(c);var d=c.getBoundingClientRect();return{width:Math.round(angular.isNumber(d.width)?d.width:c.offsetWidth),height:Math.round(angular.isNumber(d.height)?d.height:c.offsetHeight),top:Math.round(d.top+(b.pageYOffset||a[0].documentElement.scrollTop)),left:Math.round(d.left+(b.pageXOffset||a[0].documentElement.scrollLeft))}},viewportOffset:function(c,d,e){c=this.getRawNode(c),e=e!==!1;var f=c.getBoundingClientRect(),g={top:0,left:0,bottom:0,right:0},h=d?a[0].documentElement:this.scrollParent(c),i=h.getBoundingClientRect();if(g.top=i.top+h.clientTop,g.left=i.left+h.clientLeft,h===a[0].documentElement&&(g.top+=b.pageYOffset,g.left+=b.pageXOffset),g.bottom=g.top+h.clientHeight,g.right=g.left+h.clientWidth,e){var j=b.getComputedStyle(h);g.top+=this.parseStyle(j.paddingTop),g.bottom-=this.parseStyle(j.paddingBottom),g.left+=this.parseStyle(j.paddingLeft),g.right-=this.parseStyle(j.paddingRight)}return{top:Math.round(f.top-g.top),bottom:Math.round(g.bottom-f.bottom),left:Math.round(f.left-g.left),right:Math.round(g.right-f.right)}},parsePlacement:function(a){var b=f.auto.test(a);return b&&(a=a.replace(f.auto,"")),a=a.split("-"),a[0]=a[0]||"top",f.primary.test(a[0])||(a[0]="top"),a[1]=a[1]||"center",f.secondary.test(a[1])||(a[1]="center"),b?a[2]=!0:a[2]=!1,a},positionElements:function(a,c,d,e){a=this.getRawNode(a),c=this.getRawNode(c);var g=angular.isDefined(c.offsetWidth)?c.offsetWidth:c.prop("offsetWidth"),h=angular.isDefined(c.offsetHeight)?c.offsetHeight:c.prop("offsetHeight");d=this.parsePlacement(d);var i=e?this.offset(a):this.position(a),j={top:0,left:0,placement:""};if(d[2]){var k=this.viewportOffset(a,e),l=b.getComputedStyle(c),m={width:g+Math.round(Math.abs(this.parseStyle(l.marginLeft)+this.parseStyle(l.marginRight))),height:h+Math.round(Math.abs(this.parseStyle(l.marginTop)+this.parseStyle(l.marginBottom)))};if(d[0]="top"===d[0]&&m.height>k.top&&m.height<=k.bottom?"bottom":"bottom"===d[0]&&m.height>k.bottom&&m.height<=k.top?"top":"left"===d[0]&&m.width>k.left&&m.width<=k.right?"right":"right"===d[0]&&m.width>k.right&&m.width<=k.left?"left":d[0],d[1]="top"===d[1]&&m.height-i.height>k.bottom&&m.height-i.height<=k.top?"bottom":"bottom"===d[1]&&m.height-i.height>k.top&&m.height-i.height<=k.bottom?"top":"left"===d[1]&&m.width-i.width>k.right&&m.width-i.width<=k.left?"right":"right"===d[1]&&m.width-i.width>k.left&&m.width-i.width<=k.right?"left":d[1],"center"===d[1])if(f.vertical.test(d[0])){var n=i.width/2-g/2;k.left+n<0&&m.width-i.width<=k.right?d[1]="left":k.right+n<0&&m.width-i.width<=k.left&&(d[1]="right")}else{var o=i.height/2-m.height/2;k.top+o<0&&m.height-i.height<=k.bottom?d[1]="top":k.bottom+o<0&&m.height-i.height<=k.top&&(d[1]="bottom")}}switch(d[0]){case"top":j.top=i.top-h;break;case"bottom":j.top=i.top+i.height;break;case"left":j.left=i.left-g;break;case"right":j.left=i.left+i.width}switch(d[1]){case"top":j.top=i.top;break;case"bottom":j.top=i.top+i.height-h;break;case"left":j.left=i.left;break;case"right":j.left=i.left+i.width-g;break;case"center":f.vertical.test(d[0])?j.left=i.left+i.width/2-g/2:j.top=i.top+i.height/2-h/2}return j.top=Math.round(j.top),j.left=Math.round(j.left),j.placement="center"===d[1]?d[0]:d[0]+"-"+d[1],j},adjustTop:function(a,b,c,d){return-1!==a.indexOf("top")&&c!==d?{top:b.top-d+"px"}:void 0},positionArrow:function(a,c){a=this.getRawNode(a);var d=a.querySelector(".tooltip-inner, .popover-inner");if(d){var e=angular.element(d).hasClass("tooltip-inner"),g=e?a.querySelector(".tooltip-arrow"):a.querySelector(".arrow");if(g){var h={top:"",bottom:"",left:"",right:""};if(c=this.parsePlacement(c),"center"===c[1])return void angular.element(g).css(h);var i="border-"+c[0]+"-width",j=b.getComputedStyle(g)[i],k="border-";k+=f.vertical.test(c[0])?c[0]+"-"+c[1]:c[1]+"-"+c[0],k+="-radius";var l=b.getComputedStyle(e?d:a)[k];switch(c[0]){case"top":h.bottom=e?"0":"-"+j;break;case"bottom":h.top=e?"0":"-"+j;break;case"left":h.right=e?"0":"-"+j;break;case"right":h.left=e?"0":"-"+j}h[c[1]]=l,angular.element(g).css(h)}}}}}]),angular.module("ui.bootstrap.datepickerPopup",["ui.bootstrap.datepicker","ui.bootstrap.position"]).value("$datepickerPopupLiteralWarning",!0).constant("uibDatepickerPopupConfig",{altInputFormats:[],appendToBody:!1,clearText:"Clear",closeOnDateSelection:!0,closeText:"Done",currentText:"Today",datepickerPopup:"yyyy-MM-dd",datepickerPopupTemplateUrl:"uib/template/datepickerPopup/popup.html",datepickerTemplateUrl:"uib/template/datepicker/datepicker.html",html5Types:{date:"yyyy-MM-dd","datetime-local":"yyyy-MM-ddTHH:mm:ss.sss",month:"yyyy-MM"},onOpenFocus:!0,showButtonBar:!0,placement:"auto bottom-left"}).controller("UibDatepickerPopupController",["$scope","$element","$attrs","$compile","$log","$parse","$window","$document","$rootScope","$uibPosition","dateFilter","uibDateParser","uibDatepickerPopupConfig","$timeout","uibDatepickerConfig","$datepickerPopupLiteralWarning",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){function q(b){var c=l.parse(b,x,a.date);if(isNaN(c))for(var d=0;d
"),D.attr({"ng-model":"date","ng-change":"dateSelection(date)","template-url":B}),E=angular.element(D.children()[0]),E.attr("template-url",C),a.datepickerOptions||(a.datepickerOptions={}),K&&"month"===c.type&&(a.datepickerOptions.datepickerMode="month",a.datepickerOptions.minMode="month"),E.attr("datepicker-options","datepickerOptions"),K?G.$formatters.push(function(b){return a.date=l.fromTimezone(b,H.getOption("timezone")),b}):(G.$$parserName="date",G.$validators.date=s,G.$parsers.unshift(r),G.$formatters.push(function(b){return G.$isEmpty(b)?(a.date=b,b):(angular.isNumber(b)&&(b=new Date(b)),a.date=l.fromTimezone(b,H.getOption("timezone")),l.filter(a.date,x))})),G.$viewChangeListeners.push(function(){a.date=q(G.$viewValue)}),b.on("keydown",u),I=d(D)(a),D.remove(),z?h.find("body").append(I):b.after(I),a.$on("$destroy",function(){for(a.isOpen===!0&&(i.$$phase||a.$apply(function(){a.isOpen=!1})),I.remove(),b.off("keydown",u),h.off("click",t),F&&F.off("scroll",v),angular.element(g).off("resize",v);L.length;)L.shift()()})},a.getText=function(b){return a[b+"Text"]||m[b+"Text"]},a.isDisabled=function(b){"today"===b&&(b=l.fromTimezone(new Date,H.getOption("timezone")));var c={};return angular.forEach(["minDate","maxDate"],function(b){a.datepickerOptions[b]?angular.isDate(a.datepickerOptions[b])?c[b]=new Date(a.datepickerOptions[b]):(p&&e.warn("Literal date support has been deprecated, please switch to date object usage"),c[b]=new Date(k(a.datepickerOptions[b],"medium"))):c[b]=null}),a.datepickerOptions&&c.minDate&&a.compare(b,c.minDate)<0||c.maxDate&&a.compare(b,c.maxDate)>0},a.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth(),a.getDate())-new Date(b.getFullYear(),b.getMonth(),b.getDate())},a.dateSelection=function(c){a.date=c;var d=a.date?l.filter(a.date,x):null;b.val(d),G.$setViewValue(d),y&&(a.isOpen=!1,b[0].focus())},a.keydown=function(c){27===c.which&&(c.stopPropagation(),a.isOpen=!1,b[0].focus())},a.select=function(b,c){if(c.stopPropagation(),"today"===b){var d=new Date;angular.isDate(a.date)?(b=new Date(a.date),b.setFullYear(d.getFullYear(),d.getMonth(),d.getDate())):(b=l.fromTimezone(d,H.getOption("timezone")),b.setHours(0,0,0,0))}a.dateSelection(b)},a.close=function(c){c.stopPropagation(),a.isOpen=!1,b[0].focus()},a.disabled=angular.isDefined(c.disabled)||!1,c.ngDisabled&&L.push(a.$parent.$watch(f(c.ngDisabled),function(b){a.disabled=b})),a.$watch("isOpen",function(d){d?a.disabled?a.isOpen=!1:n(function(){v(),A&&a.$broadcast("uib:datepicker.focus"),h.on("click",t);var d=c.popupPlacement?c.popupPlacement:m.placement;z||j.parsePlacement(d)[2]?(F=F||angular.element(j.scrollParent(b)),F&&F.on("scroll",v)):F=null,angular.element(g).on("resize",v)},0,!1):(h.off("click",t),F&&F.off("scroll",v),angular.element(g).off("resize",v))}),a.$on("uib:datepicker.mode",function(){n(v,0,!1)})}]).directive("uibDatepickerPopup",function(){return{require:["ngModel","uibDatepickerPopup"],controller:"UibDatepickerPopupController",scope:{datepickerOptions:"=?",isOpen:"=?",currentText:"@",clearText:"@",closeText:"@"},link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibDatepickerPopupWrap",function(){return{restrict:"A",transclude:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepickerPopup/popup.html"}}}),angular.module("ui.bootstrap.debounce",[]).factory("$$debounce",["$timeout",function(a){return function(b,c){var d;return function(){var e=this,f=Array.prototype.slice.call(arguments);d&&a.cancel(d),d=a(function(){b.apply(e,f)},c)}}}]),angular.module("ui.bootstrap.multiMap",[]).factory("$$multiMap",function(){return{createNew:function(){var a={};return{entries:function(){return Object.keys(a).map(function(b){return{key:b,value:a[b]}})},get:function(b){return a[b]},hasKey:function(b){return!!a[b]},keys:function(){return Object.keys(a)},put:function(b,c){a[b]||(a[b]=[]),a[b].push(c)},remove:function(b,c){var d=a[b];if(d){var e=d.indexOf(c);-1!==e&&d.splice(e,1),d.length||delete a[b]}}}}}}),angular.module("ui.bootstrap.dropdown",["ui.bootstrap.multiMap","ui.bootstrap.position"]).constant("uibDropdownConfig",{appendToOpenClass:"uib-dropdown-open",openClass:"open"}).service("uibDropdownService",["$document","$rootScope","$$multiMap",function(a,b,c){var d=null,e=c.createNew();this.isOnlyOpen=function(a,b){var c=e.get(b);if(c){var d=c.reduce(function(b,c){return c.scope===a?c:b},{});if(d)return 1===c.length}return!1},this.open=function(b,c,g){if(d||a.on("click",f),d&&d!==b&&(d.isOpen=!1),d=b,g){var h=e.get(g);if(h){var i=h.map(function(a){return a.scope});-1===i.indexOf(b)&&e.put(g,{scope:b})}else e.put(g,{scope:b})}},this.close=function(b,c,g){if(d===b&&(a.off("click",f),a.off("keydown",this.keybindFilter),d=null),g){var h=e.get(g);if(h){var i=h.reduce(function(a,c){return c.scope===b?c:a},{});i&&e.remove(g,i)}}};var f=function(a){if(d&&d.isOpen&&!(a&&"disabled"===d.getAutoClose()||a&&3===a.which)){var c=d.getToggleElement();if(!(a&&c&&c[0].contains(a.target))){var e=d.getDropdownElement();a&&"outsideClick"===d.getAutoClose()&&e&&e[0].contains(a.target)||(d.focusToggleElement(),d.isOpen=!1,b.$$phase||d.$apply())}}};this.keybindFilter=function(a){if(d){var b=d.getDropdownElement(),c=d.getToggleElement(),e=b&&b[0].contains(a.target),g=c&&c[0].contains(a.target);27===a.which?(a.stopPropagation(),d.focusToggleElement(),f()):d.isKeynavEnabled()&&-1!==[38,40].indexOf(a.which)&&d.isOpen&&(e||g)&&(a.preventDefault(),a.stopPropagation(),d.focusDropdownEntry(a.which))}}}]).controller("UibDropdownController",["$scope","$element","$attrs","$parse","uibDropdownConfig","uibDropdownService","$animate","$uibPosition","$document","$compile","$templateRequest",function(a,b,c,d,e,f,g,h,i,j,k){function l(){b.append(o.dropdownMenu)}var m,n,o=this,p=a.$new(),q=e.appendToOpenClass,r=e.openClass,s=angular.noop,t=c.onToggle?d(c.onToggle):angular.noop,u=!1,v=i.find("body");b.addClass("dropdown"),this.init=function(){c.isOpen&&(n=d(c.isOpen),s=n.assign,a.$watch(n,function(a){p.isOpen=!!a})),u=angular.isDefined(c.keyboardNav)},this.toggle=function(a){return p.isOpen=arguments.length?!!a:!p.isOpen,angular.isFunction(s)&&s(p,p.isOpen),p.isOpen},this.isOpen=function(){return p.isOpen},p.getToggleElement=function(){return o.toggleElement},p.getAutoClose=function(){return c.autoClose||"always"},p.getElement=function(){return b},p.isKeynavEnabled=function(){return u},p.focusDropdownEntry=function(a){var c=o.dropdownMenu?angular.element(o.dropdownMenu).find("a"):b.find("ul").eq(0).find("a");switch(a){case 40:angular.isNumber(o.selectedOption)?o.selectedOption=o.selectedOption===c.length-1?o.selectedOption:o.selectedOption+1:o.selectedOption=0;break;case 38:angular.isNumber(o.selectedOption)?o.selectedOption=0===o.selectedOption?0:o.selectedOption-1:o.selectedOption=c.length-1}c[o.selectedOption].focus()},p.getDropdownElement=function(){return o.dropdownMenu},p.focusToggleElement=function(){o.toggleElement&&o.toggleElement[0].focus()},p.$watch("isOpen",function(e,n){var u=null,w=!1;if(angular.isDefined(c.dropdownAppendTo)){var x=d(c.dropdownAppendTo)(p);x&&(u=angular.element(x))}if(angular.isDefined(c.dropdownAppendToBody)){var y=d(c.dropdownAppendToBody)(p);y!==!1&&(w=!0)}if(w&&!u&&(u=v),u&&o.dropdownMenu&&(e?(u.append(o.dropdownMenu),b.on("$destroy",l)):(b.off("$destroy",l),l())),u&&o.dropdownMenu){var z,A,B,C=h.positionElements(b,o.dropdownMenu,"bottom-left",!0),D=0;if(z={top:C.top+"px",display:e?"block":"none"},A=o.dropdownMenu.hasClass("dropdown-menu-right"),A?(z.left="auto",B=h.scrollbarPadding(u),B.heightOverflow&&B.scrollbarWidth&&(D=B.scrollbarWidth),z.right=window.innerWidth-D-(C.left+b.prop("offsetWidth"))+"px"):(z.left=C.left+"px",z.right="auto"),!w){var E=h.offset(u);z.top=C.top-E.top+"px",A?z.right=window.innerWidth-(C.left-E.left+b.prop("offsetWidth"))+"px":z.left=C.left-E.left+"px"}o.dropdownMenu.css(z)}var F=u?u:b,G=u?q:r,H=F.hasClass(G),I=f.isOnlyOpen(a,u);if(H===!e){var J;J=u?I?"removeClass":"addClass":e?"addClass":"removeClass",g[J](F,G).then(function(){angular.isDefined(e)&&e!==n&&t(a,{open:!!e})})}if(e)o.dropdownMenuTemplateUrl?k(o.dropdownMenuTemplateUrl).then(function(a){m=p.$new(),j(a.trim())(m,function(a){var b=a;o.dropdownMenu.replaceWith(b),o.dropdownMenu=b,i.on("keydown",f.keybindFilter)})}):i.on("keydown",f.keybindFilter),p.focusToggleElement(),f.open(p,b,u);else{if(f.close(p,b,u),o.dropdownMenuTemplateUrl){m&&m.$destroy();var K=angular.element('');o.dropdownMenu.replaceWith(K),o.dropdownMenu=K}o.selectedOption=null}angular.isFunction(s)&&s(a,e)})}]).directive("uibDropdown",function(){return{controller:"UibDropdownController",link:function(a,b,c,d){d.init()}}}).directive("uibDropdownMenu",function(){return{restrict:"A",require:"?^uibDropdown",link:function(a,b,c,d){if(d&&!angular.isDefined(c.dropdownNested)){b.addClass("dropdown-menu");var e=c.templateUrl;e&&(d.dropdownMenuTemplateUrl=e),d.dropdownMenu||(d.dropdownMenu=b)}}}}).directive("uibDropdownToggle",function(){return{require:"?^uibDropdown",link:function(a,b,c,d){if(d){b.addClass("dropdown-toggle"),d.toggleElement=b;var e=function(e){e.preventDefault(),b.hasClass("disabled")||c.disabled||a.$apply(function(){d.toggle()})};b.on("click",e),b.attr({"aria-haspopup":!0,"aria-expanded":!1}),a.$watch(d.isOpen,function(a){b.attr("aria-expanded",!!a)}),a.$on("$destroy",function(){b.off("click",e)})}}}}),angular.module("ui.bootstrap.stackedMap",[]).factory("$$stackedMap",function(){return{createNew:function(){var a=[];return{add:function(b,c){a.push({key:b,value:c})},get:function(b){for(var c=0;c-1&&A>a&&(a=A),a}function m(a,b){var c=x.get(a).value,d=c.appendTo;x.remove(a),B=x.top(),B&&(A=parseInt(B.value.modalDomEl.attr("index"),10)),p(c.modalDomEl,c.modalScope,function(){var b=c.openedClass||w;y.remove(b,a);var e=y.hasKey(b);d.toggleClass(b,e),!e&&v&&v.heightOverflow&&v.scrollbarWidth&&(v.originalRight?d.css({paddingRight:v.originalRight+"px"}):d.css({paddingRight:""}),v=null),n(!0)},c.closedDeferred),o(),b&&b.focus?b.focus():d.focus&&d.focus()}function n(a){var b;x.length()>0&&(b=x.top().value,b.modalDomEl.toggleClass(b.windowTopClass||"",a))}function o(){if(t&&-1===l()){var a=u;p(t,u,function(){a=null}),t=void 0,u=void 0}}function p(b,c,d,e){function g(){g.done||(g.done=!0,a.leave(b).then(function(){d&&d(),b.remove(),e&&e.resolve()}),c.$destroy())}var h,i=null,j=function(){return h||(h=f.defer(),i=h.promise),function(){h.resolve()}};return c.$broadcast(z.NOW_CLOSING_EVENT,j),f.when(i).then(g)}function q(a){if(a.isDefaultPrevented())return a;var b=x.top();if(b)switch(a.which){case 27:b.value.keyboard&&(a.preventDefault(),e.$apply(function(){z.dismiss(b.key,"escape key press")}));break;case 9:var c=z.loadFocusElementList(b),d=!1;a.shiftKey?(z.isFocusInFirstItem(a,c)||z.isModalFocused(a,b))&&(d=z.focusLastFocusableElement(c)):z.isFocusInLastItem(a,c)&&(d=z.focusFirstFocusableElement(c)),d&&(a.preventDefault(),a.stopPropagation())}}function r(a,b,c){return!a.value.modalScope.$broadcast("modal.closing",b,c).defaultPrevented}function s(){Array.prototype.forEach.call(document.querySelectorAll("["+C+"]"),function(a){var b=parseInt(a.getAttribute(C),10),c=b-1;a.setAttribute(C,c),c||(a.removeAttribute(C),a.removeAttribute("aria-hidden"))})}var t,u,v,w="modal-open",x=h.createNew(),y=g.createNew(),z={NOW_CLOSING_EVENT:"modal.stack.now-closing"},A=0,B=null,C="data-bootstrap-modal-aria-hidden-count",D="a[href], area[href], input:not([disabled]):not([tabindex='-1']), button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']), textarea:not([disabled]):not([tabindex='-1']), iframe, object, embed, *[tabindex]:not([tabindex='-1']), *[contenteditable=true]",E=/[A-Z]/g;return e.$watch(l,function(a){u&&(u.index=a)}),c.on("keydown",q),e.$on("$destroy",function(){c.off("keydown",q)}),z.open=function(b,f){function g(a){function b(a){var b=a.parent()?a.parent().children():[];return Array.prototype.filter.call(b,function(b){return b!==a[0]})}if(a&&"BODY"!==a[0].tagName)return b(a).forEach(function(a){var b="true"===a.getAttribute("aria-hidden"),c=parseInt(a.getAttribute(C),10);c||(c=b?1:0),a.setAttribute(C,c+1),a.setAttribute("aria-hidden","true")}),g(a.parent())}var h=c[0].activeElement,k=f.openedClass||w;n(!1),B=x.top(),x.add(b,{deferred:f.deferred,renderDeferred:f.renderDeferred,closedDeferred:f.closedDeferred,modalScope:f.scope,backdrop:f.backdrop,keyboard:f.keyboard,openedClass:f.openedClass,windowTopClass:f.windowTopClass,animation:f.animation,appendTo:f.appendTo}),y.put(k,b);var m=f.appendTo,o=l();o>=0&&!t&&(u=e.$new(!0),u.modalOptions=f,u.index=o,t=angular.element('
'),t.attr({"class":"modal-backdrop","ng-style":"{'z-index': 1040 + (index && 1 || 0) + index*10}","uib-modal-animation-class":"fade","modal-in-class":"in"}),f.backdropClass&&t.addClass(f.backdropClass),f.animation&&t.attr("modal-animation","true"),d(t)(u),a.enter(t,m),i.isScrollable(m)&&(v=i.scrollbarPadding(m),v.heightOverflow&&v.scrollbarWidth&&m.css({paddingRight:v.right+"px"})));var p;f.component?(p=document.createElement(j(f.component.name)),p=angular.element(p),p.attr({resolve:"$resolve","modal-instance":"$uibModalInstance",close:"$close($value)",dismiss:"$dismiss($value)"})):p=f.content,A=B?parseInt(B.value.modalDomEl.attr("index"),10)+1:0;var q=angular.element('
');q.attr({"class":"modal","template-url":f.windowTemplateUrl,"window-top-class":f.windowTopClass,role:"dialog","aria-labelledby":f.ariaLabelledBy,"aria-describedby":f.ariaDescribedBy,size:f.size,index:A,animate:"animate","ng-style":"{'z-index': 1050 + $$topModalIndex*10, display: 'block'}",tabindex:-1,"uib-modal-animation-class":"fade","modal-in-class":"in"}).append(p),f.windowClass&&q.addClass(f.windowClass),f.animation&&q.attr("modal-animation","true"),m.addClass(k),f.scope&&(f.scope.$$topModalIndex=A),a.enter(d(q)(f.scope),m),x.top().value.modalDomEl=q,x.top().value.modalOpener=h,g(q)},z.close=function(a,b){var c=x.get(a);return s(),c&&r(c,b,!0)?(c.value.modalScope.$$uibDestructionScheduled=!0,c.value.deferred.resolve(b),m(a,c.value.modalOpener),!0):!c},z.dismiss=function(a,b){var c=x.get(a);return s(),c&&r(c,b,!1)?(c.value.modalScope.$$uibDestructionScheduled=!0,c.value.deferred.reject(b),m(a,c.value.modalOpener),!0):!c},z.dismissAll=function(a){for(var b=this.getTop();b&&this.dismiss(b.key,a);)b=this.getTop()},z.getTop=function(){return x.top()},z.modalRendered=function(a){var b=x.get(a);b&&b.value.renderDeferred.resolve()},z.focusFirstFocusableElement=function(a){return a.length>0?(a[0].focus(),!0):!1},z.focusLastFocusableElement=function(a){return a.length>0?(a[a.length-1].focus(),!0):!1},z.isModalFocused=function(a,b){if(a&&b){var c=b.value.modalDomEl;if(c&&c.length)return(a.target||a.srcElement)===c[0]}return!1},z.isFocusInFirstItem=function(a,b){return b.length>0?(a.target||a.srcElement)===b[0]:!1},z.isFocusInLastItem=function(a,b){return b.length>0?(a.target||a.srcElement)===b[b.length-1]:!1},z.loadFocusElementList=function(a){if(a){var b=a.value.modalDomEl;if(b&&b.length){var c=b[0].querySelectorAll(D);return c?Array.prototype.filter.call(c,function(a){return k(a)}):c}}},z}]).provider("$uibModal",function(){var a={options:{animation:!0,backdrop:!0,keyboard:!0},$get:["$rootScope","$q","$document","$templateRequest","$controller","$uibResolve","$uibModalStack",function(b,c,d,e,f,g,h){function i(a){return a.template?c.when(a.template):e(angular.isFunction(a.templateUrl)?a.templateUrl():a.templateUrl)}var j={},k=null;return j.getPromiseChain=function(){return k},j.open=function(e){function j(){return q}var l=c.defer(),m=c.defer(),n=c.defer(),o=c.defer(),p={result:l.promise,opened:m.promise,closed:n.promise,rendered:o.promise,close:function(a){return h.close(p,a)},dismiss:function(a){return h.dismiss(p,a)}};if(e=angular.extend({},a.options,e),e.resolve=e.resolve||{},e.appendTo=e.appendTo||d.find("body").eq(0),!e.appendTo.length)throw new Error("appendTo element not found. Make sure that the element passed is in DOM.");if(!e.component&&!e.template&&!e.templateUrl)throw new Error("One of component or template or templateUrl options is required.");var q;q=e.component?c.when(g.resolve(e.resolve,{},null,null)):c.all([i(e),g.resolve(e.resolve,{},null,null)]);var r;return r=k=c.all([k]).then(j,j).then(function(a){function c(b,c,d,e){b.$scope=g,b.$scope.$resolve={},d?b.$scope.$uibModalInstance=p:b.$uibModalInstance=p;var f=c?a[1]:a;angular.forEach(f,function(a,c){e&&(b[c]=a),b.$scope.$resolve[c]=a})}var d=e.scope||b,g=d.$new();g.$close=p.close,g.$dismiss=p.dismiss,g.$on("$destroy",function(){g.$$uibDestructionScheduled||g.$dismiss("$uibUnscheduledDestruction")});var i,j,k={scope:g,deferred:l,renderDeferred:o,closedDeferred:n,animation:e.animation,backdrop:e.backdrop,keyboard:e.keyboard,backdropClass:e.backdropClass,windowTopClass:e.windowTopClass,windowClass:e.windowClass,windowTemplateUrl:e.windowTemplateUrl,ariaLabelledBy:e.ariaLabelledBy,ariaDescribedBy:e.ariaDescribedBy,size:e.size,openedClass:e.openedClass,appendTo:e.appendTo},q={},r={};e.component?(c(q,!1,!0,!1),q.name=e.component,k.component=q):e.controller&&(c(r,!0,!1,!0),j=f(e.controller,r,!0,e.controllerAs),e.controllerAs&&e.bindToController&&(i=j.instance,i.$close=g.$close,i.$dismiss=g.$dismiss,angular.extend(i,{$resolve:r.$scope.$resolve},d)),i=j(),angular.isFunction(i.$onInit)&&i.$onInit()),e.component||(k.content=a[0]),h.open(p,k),m.resolve(!0)},function(a){m.reject(a),l.reject(a)})["finally"](function(){k===r&&(k=null)}),p},j}]};return a}),angular.module("ui.bootstrap.paging",[]).factory("uibPaging",["$parse",function(a){return{create:function(b,c,d){b.setNumPages=d.numPages?a(d.numPages).assign:angular.noop,b.ngModelCtrl={$setViewValue:angular.noop},b._watchers=[],b.init=function(a,e){b.ngModelCtrl=a,b.config=e,a.$render=function(){b.render()},d.itemsPerPage?b._watchers.push(c.$parent.$watch(d.itemsPerPage,function(a){ -b.itemsPerPage=parseInt(a,10),c.totalPages=b.calculateTotalPages(),b.updatePage()})):b.itemsPerPage=e.itemsPerPage,c.$watch("totalItems",function(a,d){(angular.isDefined(a)||a!==d)&&(c.totalPages=b.calculateTotalPages(),b.updatePage())})},b.calculateTotalPages=function(){var a=b.itemsPerPage<1?1:Math.ceil(c.totalItems/b.itemsPerPage);return Math.max(a||0,1)},b.render=function(){c.page=parseInt(b.ngModelCtrl.$viewValue,10)||1},c.selectPage=function(a,d){d&&d.preventDefault();var e=!c.ngDisabled||!d;e&&c.page!==a&&a>0&&a<=c.totalPages&&(d&&d.target&&d.target.blur(),b.ngModelCtrl.$setViewValue(a),b.ngModelCtrl.$render())},c.getText=function(a){return c[a+"Text"]||b.config[a+"Text"]},c.noPrevious=function(){return 1===c.page},c.noNext=function(){return c.page===c.totalPages},b.updatePage=function(){b.setNumPages(c.$parent,c.totalPages),c.page>c.totalPages?c.selectPage(c.totalPages):b.ngModelCtrl.$render()},c.$on("$destroy",function(){for(;b._watchers.length;)b._watchers.shift()()})}}}]),angular.module("ui.bootstrap.pager",["ui.bootstrap.paging","ui.bootstrap.tabindex"]).controller("UibPagerController",["$scope","$attrs","uibPaging","uibPagerConfig",function(a,b,c,d){a.align=angular.isDefined(b.align)?a.$parent.$eval(b.align):d.align,c.create(this,a,b)}]).constant("uibPagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("uibPager",["uibPagerConfig",function(a){return{scope:{totalItems:"=",previousText:"@",nextText:"@",ngDisabled:"="},require:["uibPager","?ngModel"],restrict:"A",controller:"UibPagerController",controllerAs:"pager",templateUrl:function(a,b){return b.templateUrl||"uib/template/pager/pager.html"},link:function(b,c,d,e){c.addClass("pager");var f=e[0],g=e[1];g&&f.init(g,a)}}}]),angular.module("ui.bootstrap.pagination",["ui.bootstrap.paging","ui.bootstrap.tabindex"]).controller("UibPaginationController",["$scope","$attrs","$parse","uibPaging","uibPaginationConfig",function(a,b,c,d,e){function f(a,b,c){return{number:a,text:b,active:c}}function g(a,b){var c=[],d=1,e=b,g=angular.isDefined(i)&&b>i;g&&(j?(d=Math.max(a-Math.floor(i/2),1),e=d+i-1,e>b&&(e=b,d=e-i+1)):(d=(Math.ceil(a/i)-1)*i+1,e=Math.min(d+i-1,b)));for(var h=d;e>=h;h++){var n=f(h,m(h),h===a);c.push(n)}if(g&&i>0&&(!j||k||l)){if(d>1){if(!l||d>3){var o=f(d-1,"...",!1);c.unshift(o)}if(l){if(3===d){var p=f(2,"2",!1);c.unshift(p)}var q=f(1,"1",!1);c.unshift(q)}}if(b>e){if(!l||b-2>e){var r=f(e+1,"...",!1);c.push(r)}if(l){if(e===b-2){var s=f(b-1,b-1,!1);c.push(s)}var t=f(b,b,!1);c.push(t)}}}return c}var h=this,i=angular.isDefined(b.maxSize)?a.$parent.$eval(b.maxSize):e.maxSize,j=angular.isDefined(b.rotate)?a.$parent.$eval(b.rotate):e.rotate,k=angular.isDefined(b.forceEllipses)?a.$parent.$eval(b.forceEllipses):e.forceEllipses,l=angular.isDefined(b.boundaryLinkNumbers)?a.$parent.$eval(b.boundaryLinkNumbers):e.boundaryLinkNumbers,m=angular.isDefined(b.pageLabel)?function(c){return a.$parent.$eval(b.pageLabel,{$page:c})}:angular.identity;a.boundaryLinks=angular.isDefined(b.boundaryLinks)?a.$parent.$eval(b.boundaryLinks):e.boundaryLinks,a.directionLinks=angular.isDefined(b.directionLinks)?a.$parent.$eval(b.directionLinks):e.directionLinks,b.$set("role","menu"),d.create(this,a,b),b.maxSize&&h._watchers.push(a.$parent.$watch(c(b.maxSize),function(a){i=parseInt(a,10),h.render()}));var n=this.render;this.render=function(){n(),a.page>0&&a.page<=a.totalPages&&(a.pages=g(a.page,a.totalPages))}}]).constant("uibPaginationConfig",{itemsPerPage:10,boundaryLinks:!1,boundaryLinkNumbers:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0,forceEllipses:!1}).directive("uibPagination",["$parse","uibPaginationConfig",function(a,b){return{scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@",ngDisabled:"="},require:["uibPagination","?ngModel"],restrict:"A",controller:"UibPaginationController",controllerAs:"pagination",templateUrl:function(a,b){return b.templateUrl||"uib/template/pagination/pagination.html"},link:function(a,c,d,e){c.addClass("pagination");var f=e[0],g=e[1];g&&f.init(g,b)}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.stackedMap"]).provider("$uibTooltip",function(){function a(a){var b=/[A-Z]/g,c="-";return a.replace(b,function(a,b){return(b?c:"")+a.toLowerCase()})}var b={placement:"top",placementClassPrefix:"",animation:!0,popupDelay:0,popupCloseDelay:0,useContentExp:!1},c={mouseenter:"mouseleave",click:"click",outsideClick:"outsideClick",focus:"blur",none:""},d={};this.options=function(a){angular.extend(d,a)},this.setTriggers=function(a){angular.extend(c,a)},this.$get=["$window","$compile","$timeout","$document","$uibPosition","$interpolate","$rootScope","$parse","$$stackedMap",function(e,f,g,h,i,j,k,l,m){function n(a){if(27===a.which){var b=o.top();b&&(b.value.close(),b=null)}}var o=m.createNew();return h.on("keyup",n),k.$on("$destroy",function(){h.off("keyup",n)}),function(e,k,m,n){function p(a){var b=(a||n.trigger||m).split(" "),d=b.map(function(a){return c[a]||a});return{show:b,hide:d}}n=angular.extend({},b,d,n);var q=a(e),r=j.startSymbol(),s=j.endSymbol(),t="
';return{compile:function(a,b){var c=f(t);return function(a,b,d,f){function j(){P.isOpen?q():m()}function m(){O&&!a.$eval(d[k+"Enable"])||(u(),x(),P.popupDelay?H||(H=g(r,P.popupDelay,!1)):r())}function q(){s(),P.popupCloseDelay?I||(I=g(t,P.popupCloseDelay,!1)):t()}function r(){return s(),u(),P.content?(v(),void P.$evalAsync(function(){P.isOpen=!0,y(!0),U()})):angular.noop}function s(){H&&(g.cancel(H),H=null),J&&(g.cancel(J),J=null)}function t(){P&&P.$evalAsync(function(){P&&(P.isOpen=!1,y(!1),P.animation?G||(G=g(w,150,!1)):w())})}function u(){I&&(g.cancel(I),I=null),G&&(g.cancel(G),G=null)}function v(){E||(F=P.$new(),E=c(F,function(a){M?h.find("body").append(a):b.after(a)}),o.add(P,{close:t}),z())}function w(){s(),u(),A(),E&&(E.remove(),E=null,K&&g.cancel(K)),o.remove(P),F&&(F.$destroy(),F=null)}function x(){P.title=d[k+"Title"],S?P.content=S(a):P.content=d[e],P.popupClass=d[k+"Class"],P.placement=angular.isDefined(d[k+"Placement"])?d[k+"Placement"]:n.placement;var b=i.parsePlacement(P.placement);L=b[1]?b[0]+"-"+b[1]:b[0];var c=parseInt(d[k+"PopupDelay"],10),f=parseInt(d[k+"PopupCloseDelay"],10);P.popupDelay=isNaN(c)?n.popupDelay:c,P.popupCloseDelay=isNaN(f)?n.popupCloseDelay:f}function y(b){R&&angular.isFunction(R.assign)&&R.assign(a,b)}function z(){T.length=0,S?(T.push(a.$watch(S,function(a){P.content=a,!a&&P.isOpen&&t()})),T.push(F.$watch(function(){Q||(Q=!0,F.$$postDigest(function(){Q=!1,P&&P.isOpen&&U()}))}))):T.push(d.$observe(e,function(a){P.content=a,!a&&P.isOpen?t():U()})),T.push(d.$observe(k+"Title",function(a){P.title=a,P.isOpen&&U()})),T.push(d.$observe(k+"Placement",function(a){P.placement=a?a:n.placement,P.isOpen&&U()}))}function A(){T.length&&(angular.forEach(T,function(a){a()}),T.length=0)}function B(a){P&&P.isOpen&&E&&(b[0].contains(a.target)||E[0].contains(a.target)||q())}function C(a){27===a.which&&q()}function D(){var c=[],e=[],f=a.$eval(d[k+"Trigger"]);V(),angular.isObject(f)?(Object.keys(f).forEach(function(a){c.push(a),e.push(f[a])}),N={show:c,hide:e}):N=p(f),"none"!==N.show&&N.show.forEach(function(a,c){"outsideClick"===a?(b.on("click",j),h.on("click",B)):a===N.hide[c]?b.on(a,j):a&&(b.on(a,m),b.on(N.hide[c],q)),b.on("keypress",C)})}var E,F,G,H,I,J,K,L,M=angular.isDefined(n.appendToBody)?n.appendToBody:!1,N=p(void 0),O=angular.isDefined(d[k+"Enable"]),P=a.$new(!0),Q=!1,R=angular.isDefined(d[k+"IsOpen"])?l(d[k+"IsOpen"]):!1,S=n.useContentExp?l(d[e]):!1,T=[],U=function(){E&&E.html()&&(J||(J=g(function(){var a=i.positionElements(b,E,P.placement,M),c=angular.isDefined(E.offsetHeight)?E.offsetHeight:E.prop("offsetHeight"),d=M?i.offset(b):i.position(b);E.css({top:a.top+"px",left:a.left+"px"});var e=a.placement.split("-");E.hasClass(e[0])||(E.removeClass(L.split("-")[0]),E.addClass(e[0])),E.hasClass(n.placementClassPrefix+a.placement)||(E.removeClass(n.placementClassPrefix+L),E.addClass(n.placementClassPrefix+a.placement)),K=g(function(){var a=angular.isDefined(E.offsetHeight)?E.offsetHeight:E.prop("offsetHeight"),b=i.adjustTop(e,d,c,a);b&&E.css(b),K=null},0,!1),E.hasClass("uib-position-measure")?(i.positionArrow(E,a.placement),E.removeClass("uib-position-measure")):L!==a.placement&&i.positionArrow(E,a.placement),L=a.placement,J=null},0,!1)))};P.origScope=a,P.isOpen=!1,P.contentExp=function(){return P.content},d.$observe("disabled",function(a){a&&s(),a&&P.isOpen&&t()}),R&&a.$watch(R,function(a){P&&!a===P.isOpen&&j()});var V=function(){N.show.forEach(function(a){"outsideClick"===a?b.off("click",j):(b.off(a,m),b.off(a,j)),b.off("keypress",C)}),N.hide.forEach(function(a){"outsideClick"===a?h.off("click",B):b.off(a,q)})};D();var W=a.$eval(d[k+"Animation"]);P.animation=angular.isDefined(W)?!!W:n.animation;var X,Y=k+"AppendToBody";X=Y in d&&void 0===d[Y]?!0:a.$eval(d[Y]),M=angular.isDefined(X)?X:M,a.$on("$destroy",function(){V(),w(),P=null})}}}}}]}).directive("uibTooltipTemplateTransclude",["$animate","$sce","$compile","$templateRequest",function(a,b,c,d){return{link:function(e,f,g){var h,i,j,k=e.$eval(g.tooltipTemplateTranscludeScope),l=0,m=function(){i&&(i.remove(),i=null),h&&(h.$destroy(),h=null),j&&(a.leave(j).then(function(){i=null}),i=j,j=null)};e.$watch(b.parseAsResourceUrl(g.uibTooltipTemplateTransclude),function(b){var g=++l;b?(d(b,!0).then(function(d){if(g===l){var e=k.$new(),i=d,n=c(i)(e,function(b){m(),a.enter(b,f)});h=e,j=n,h.$emit("$includeContentLoaded",b)}},function(){g===l&&(m(),e.$emit("$includeContentError",b))}),e.$emit("$includeContentRequested",b)):m()}),e.$on("$destroy",m)}}}]).directive("uibTooltipClasses",["$uibPosition",function(a){return{restrict:"A",link:function(b,c,d){if(b.placement){var e=a.parsePlacement(b.placement);c.addClass(e[0])}b.popupClass&&c.addClass(b.popupClass),b.animation&&c.addClass(d.tooltipAnimationClass)}}}]).directive("uibTooltipPopup",function(){return{restrict:"A",scope:{content:"@"},templateUrl:"uib/template/tooltip/tooltip-popup.html"}}).directive("uibTooltip",["$uibTooltip",function(a){return a("uibTooltip","tooltip","mouseenter")}]).directive("uibTooltipTemplatePopup",function(){return{restrict:"A",scope:{contentExp:"&",originScope:"&"},templateUrl:"uib/template/tooltip/tooltip-template-popup.html"}}).directive("uibTooltipTemplate",["$uibTooltip",function(a){return a("uibTooltipTemplate","tooltip","mouseenter",{useContentExp:!0})}]).directive("uibTooltipHtmlPopup",function(){return{restrict:"A",scope:{contentExp:"&"},templateUrl:"uib/template/tooltip/tooltip-html-popup.html"}}).directive("uibTooltipHtml",["$uibTooltip",function(a){return a("uibTooltipHtml","tooltip","mouseenter",{useContentExp:!0})}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("uibPopoverTemplatePopup",function(){return{restrict:"A",scope:{uibTitle:"@",contentExp:"&",originScope:"&"},templateUrl:"uib/template/popover/popover-template.html"}}).directive("uibPopoverTemplate",["$uibTooltip",function(a){return a("uibPopoverTemplate","popover","click",{useContentExp:!0})}]).directive("uibPopoverHtmlPopup",function(){return{restrict:"A",scope:{contentExp:"&",uibTitle:"@"},templateUrl:"uib/template/popover/popover-html.html"}}).directive("uibPopoverHtml",["$uibTooltip",function(a){return a("uibPopoverHtml","popover","click",{useContentExp:!0})}]).directive("uibPopoverPopup",function(){return{restrict:"A",scope:{uibTitle:"@",content:"@"},templateUrl:"uib/template/popover/popover.html"}}).directive("uibPopover",["$uibTooltip",function(a){return a("uibPopover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("uibProgressConfig",{animate:!0,max:100}).controller("UibProgressController",["$scope","$attrs","uibProgressConfig",function(a,b,c){function d(){return angular.isDefined(a.maxParam)?a.maxParam:c.max}var e=this,f=angular.isDefined(b.animate)?a.$parent.$eval(b.animate):c.animate;this.bars=[],a.max=d(),this.addBar=function(a,b,c){f||b.css({transition:"none"}),this.bars.push(a),a.max=d(),a.title=c&&angular.isDefined(c.title)?c.title:"progressbar",a.$watch("value",function(b){a.recalculatePercentage()}),a.recalculatePercentage=function(){var b=e.bars.reduce(function(a,b){return b.percent=+(100*b.value/b.max).toFixed(2),a+b.percent},0);b>100&&(a.percent-=b-100)},a.$on("$destroy",function(){b=null,e.removeBar(a)})},this.removeBar=function(a){this.bars.splice(this.bars.indexOf(a),1),this.bars.forEach(function(a){a.recalculatePercentage()})},a.$watch("maxParam",function(a){e.bars.forEach(function(a){a.max=d(),a.recalculatePercentage()})})}]).directive("uibProgress",function(){return{replace:!0,transclude:!0,controller:"UibProgressController",require:"uibProgress",scope:{maxParam:"=?max"},templateUrl:"uib/template/progressbar/progress.html"}}).directive("uibBar",function(){return{replace:!0,transclude:!0,require:"^uibProgress",scope:{value:"=",type:"@"},templateUrl:"uib/template/progressbar/bar.html",link:function(a,b,c,d){d.addBar(a,b,c)}}}).directive("uibProgressbar",function(){return{replace:!0,transclude:!0,controller:"UibProgressController",scope:{value:"=",maxParam:"=?max",type:"@"},templateUrl:"uib/template/progressbar/progressbar.html",link:function(a,b,c,d){d.addBar(a,angular.element(b.children()[0]),{title:c.title})}}}),angular.module("ui.bootstrap.rating",[]).constant("uibRatingConfig",{max:5,stateOn:null,stateOff:null,enableReset:!0,titles:["one","two","three","four","five"]}).controller("UibRatingController",["$scope","$attrs","uibRatingConfig",function(a,b,c){var d={$setViewValue:angular.noop},e=this;this.init=function(e){d=e,d.$render=this.render,d.$formatters.push(function(a){return angular.isNumber(a)&&a<<0!==a&&(a=Math.round(a)),a}),this.stateOn=angular.isDefined(b.stateOn)?a.$parent.$eval(b.stateOn):c.stateOn,this.stateOff=angular.isDefined(b.stateOff)?a.$parent.$eval(b.stateOff):c.stateOff,this.enableReset=angular.isDefined(b.enableReset)?a.$parent.$eval(b.enableReset):c.enableReset;var f=angular.isDefined(b.titles)?a.$parent.$eval(b.titles):c.titles;this.titles=angular.isArray(f)&&f.length>0?f:c.titles;var g=angular.isDefined(b.ratingStates)?a.$parent.$eval(b.ratingStates):new Array(angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max);a.range=this.buildTemplateObjects(g)},this.buildTemplateObjects=function(a){for(var b=0,c=a.length;c>b;b++)a[b]=angular.extend({index:b},{stateOn:this.stateOn,stateOff:this.stateOff,title:this.getTitle(b)},a[b]);return a},this.getTitle=function(a){return a>=this.titles.length?a+1:this.titles[a]},a.rate=function(b){if(!a.readonly&&b>=0&&b<=a.range.length){var c=e.enableReset&&d.$viewValue===b?0:b;d.$setViewValue(c),d.$render()}},a.enter=function(b){a.readonly||(a.value=b),a.onHover({value:b})},a.reset=function(){a.value=d.$viewValue,a.onLeave()},a.onKeydown=function(b){/(37|38|39|40)/.test(b.which)&&(b.preventDefault(),b.stopPropagation(),a.rate(a.value+(38===b.which||39===b.which?1:-1)))},this.render=function(){a.value=d.$viewValue,a.title=e.getTitle(a.value-1)}}]).directive("uibRating",function(){return{require:["uibRating","ngModel"],restrict:"A",scope:{readonly:"=?readOnly",onHover:"&",onLeave:"&"},controller:"UibRatingController",templateUrl:"uib/template/rating/rating.html",link:function(a,b,c,d){var e=d[0],f=d[1];e.init(f)}}}),angular.module("ui.bootstrap.tabs",[]).controller("UibTabsetController",["$scope",function(a){function b(a){for(var b=0;bb.index?1:a.index0&&13>b:b>=0&&24>b;return c&&""!==a.hours?(a.showMeridian&&(12===b&&(b=0),a.meridian===y[1]&&(b+=12)),b):void 0}function i(){var b=+a.minutes,c=b>=0&&60>b;return c&&""!==a.minutes?b:void 0}function j(){var b=+a.seconds;return b>=0&&60>b?b:void 0}function k(a,b){return null===a?"":angular.isDefined(a)&&a.toString().length<2&&!b?"0"+a:a.toString()}function l(a){m(),x.$setViewValue(new Date(v)),n(a)}function m(){s&&s.$setValidity("hours",!0),t&&t.$setValidity("minutes",!0),u&&u.$setValidity("seconds",!0),x.$setValidity("time",!0),a.invalidHours=!1,a.invalidMinutes=!1,a.invalidSeconds=!1}function n(b){if(x.$modelValue){var c=v.getHours(),d=v.getMinutes(),e=v.getSeconds();a.showMeridian&&(c=0===c||12===c?12:c%12),a.hours="h"===b?c:k(c,!z),"m"!==b&&(a.minutes=k(d)),a.meridian=v.getHours()<12?y[0]:y[1],"s"!==b&&(a.seconds=k(e)),a.meridian=v.getHours()<12?y[0]:y[1]}else a.hours=null,a.minutes=null,a.seconds=null,a.meridian=y[0]}function o(a){v=q(v,a),l()}function p(a,b){return q(a,60*b)}function q(a,b){var c=new Date(a.getTime()+1e3*b),d=new Date(a);return d.setHours(c.getHours(),c.getMinutes(),c.getSeconds()),d}function r(){return(null===a.hours||""===a.hours)&&(null===a.minutes||""===a.minutes)&&(!a.showSeconds||a.showSeconds&&(null===a.seconds||""===a.seconds))}var s,t,u,v=new Date,w=[],x={$setViewValue:angular.noop},y=angular.isDefined(c.meridians)?a.$parent.$eval(c.meridians):g.meridians||f.DATETIME_FORMATS.AMPMS,z=angular.isDefined(c.padHours)?a.$parent.$eval(c.padHours):!0;a.tabindex=angular.isDefined(c.tabindex)?c.tabindex:0,b.removeAttr("tabindex"),this.init=function(b,d){x=b,x.$render=this.render,x.$formatters.unshift(function(a){return a?new Date(a):null});var e=d.eq(0),f=d.eq(1),h=d.eq(2);s=e.controller("ngModel"),t=f.controller("ngModel"),u=h.controller("ngModel");var i=angular.isDefined(c.mousewheel)?a.$parent.$eval(c.mousewheel):g.mousewheel;i&&this.setupMousewheelEvents(e,f,h);var j=angular.isDefined(c.arrowkeys)?a.$parent.$eval(c.arrowkeys):g.arrowkeys;j&&this.setupArrowkeyEvents(e,f,h),a.readonlyInput=angular.isDefined(c.readonlyInput)?a.$parent.$eval(c.readonlyInput):g.readonlyInput,this.setupInputEvents(e,f,h)};var A=g.hourStep;c.hourStep&&w.push(a.$parent.$watch(d(c.hourStep),function(a){A=+a}));var B=g.minuteStep;c.minuteStep&&w.push(a.$parent.$watch(d(c.minuteStep),function(a){B=+a}));var C;w.push(a.$parent.$watch(d(c.min),function(a){var b=new Date(a);C=isNaN(b)?void 0:b}));var D;w.push(a.$parent.$watch(d(c.max),function(a){var b=new Date(a);D=isNaN(b)?void 0:b}));var E=!1;c.ngDisabled&&w.push(a.$parent.$watch(d(c.ngDisabled),function(a){E=a})),a.noIncrementHours=function(){var a=p(v,60*A);return E||a>D||v>a&&C>a},a.noDecrementHours=function(){var a=p(v,60*-A);return E||C>a||a>v&&a>D},a.noIncrementMinutes=function(){var a=p(v,B);return E||a>D||v>a&&C>a},a.noDecrementMinutes=function(){var a=p(v,-B);return E||C>a||a>v&&a>D},a.noIncrementSeconds=function(){var a=q(v,F);return E||a>D||v>a&&C>a},a.noDecrementSeconds=function(){var a=q(v,-F);return E||C>a||a>v&&a>D},a.noToggleMeridian=function(){return v.getHours()<12?E||p(v,720)>D:E||p(v,-720)0};b.on("mousewheel wheel",function(b){E||a.$apply(e(b)?a.incrementHours():a.decrementHours()),b.preventDefault()}),c.on("mousewheel wheel",function(b){E||a.$apply(e(b)?a.incrementMinutes():a.decrementMinutes()),b.preventDefault()}),d.on("mousewheel wheel",function(b){E||a.$apply(e(b)?a.incrementSeconds():a.decrementSeconds()),b.preventDefault()})},this.setupArrowkeyEvents=function(b,c,d){b.on("keydown",function(b){E||(38===b.which?(b.preventDefault(),a.incrementHours(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementHours(),a.$apply()))}),c.on("keydown",function(b){E||(38===b.which?(b.preventDefault(),a.incrementMinutes(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementMinutes(),a.$apply()))}),d.on("keydown",function(b){E||(38===b.which?(b.preventDefault(),a.incrementSeconds(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementSeconds(),a.$apply()))})},this.setupInputEvents=function(b,c,d){if(a.readonlyInput)return a.updateHours=angular.noop,a.updateMinutes=angular.noop,void(a.updateSeconds=angular.noop);var e=function(b,c,d){x.$setViewValue(null),x.$setValidity("time",!1),angular.isDefined(b)&&(a.invalidHours=b,s&&s.$setValidity("hours",!1)),angular.isDefined(c)&&(a.invalidMinutes=c,t&&t.$setValidity("minutes",!1)),angular.isDefined(d)&&(a.invalidSeconds=d,u&&u.$setValidity("seconds",!1))};a.updateHours=function(){var a=h(),b=i();x.$setDirty(),angular.isDefined(a)&&angular.isDefined(b)?(v.setHours(a),v.setMinutes(b),C>v||v>D?e(!0):l("h")):e(!0)},b.on("blur",function(b){x.$setTouched(),r()?m():null===a.hours||""===a.hours?e(!0):!a.invalidHours&&a.hours<10&&a.$apply(function(){a.hours=k(a.hours,!z)})}),a.updateMinutes=function(){var a=i(),b=h();x.$setDirty(),angular.isDefined(a)&&angular.isDefined(b)?(v.setHours(b),v.setMinutes(a),C>v||v>D?e(void 0,!0):l("m")):e(void 0,!0)},c.on("blur",function(b){x.$setTouched(),r()?m():null===a.minutes?e(void 0,!0):!a.invalidMinutes&&a.minutes<10&&a.$apply(function(){a.minutes=k(a.minutes)})}),a.updateSeconds=function(){var a=j();x.$setDirty(),angular.isDefined(a)?(v.setSeconds(a),l("s")):e(void 0,void 0,!0)},d.on("blur",function(b){r()?m():!a.invalidSeconds&&a.seconds<10&&a.$apply(function(){a.seconds=k(a.seconds)})})},this.render=function(){var b=x.$viewValue;isNaN(b)?(x.$setValidity("time",!1),e.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(b&&(v=b),C>v||v>D?(x.$setValidity("time",!1),a.invalidHours=!0,a.invalidMinutes=!0):m(),n())},a.showSpinners=angular.isDefined(c.showSpinners)?a.$parent.$eval(c.showSpinners):g.showSpinners,a.incrementHours=function(){a.noIncrementHours()||o(60*A*60)},a.decrementHours=function(){a.noDecrementHours()||o(60*-A*60)},a.incrementMinutes=function(){a.noIncrementMinutes()||o(60*B)},a.decrementMinutes=function(){a.noDecrementMinutes()||o(60*-B)},a.incrementSeconds=function(){a.noIncrementSeconds()||o(F)},a.decrementSeconds=function(){a.noDecrementSeconds()||o(-F)},a.toggleMeridian=function(){var b=i(),c=h();a.noToggleMeridian()||(angular.isDefined(b)&&angular.isDefined(c)?o(720*(v.getHours()<12?60:-60)):a.meridian=a.meridian===y[0]?y[1]:y[0])},a.blur=function(){x.$setTouched()},a.$on("$destroy",function(){for(;w.length;)w.shift()()})}]).directive("uibTimepicker",["uibTimepickerConfig",function(a){return{require:["uibTimepicker","?^ngModel"],restrict:"A",controller:"UibTimepickerController",controllerAs:"timepicker",scope:{},templateUrl:function(b,c){return c.templateUrl||a.templateUrl},link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f,b.find("input"))}}}]),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.debounce","ui.bootstrap.position"]).factory("uibTypeaheadParser",["$parse",function(a){var b=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;return{parse:function(c){var d=c.match(b);if(!d)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+c+'".');return{itemName:d[3],source:a(d[4]),viewMapper:a(d[2]||d[1]),modelMapper:a(d[1])}}}}]).controller("UibTypeaheadController",["$scope","$element","$attrs","$compile","$parse","$q","$timeout","$document","$window","$rootScope","$$debounce","$uibPosition","uibTypeaheadParser",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){P.moveInProgress||(P.moveInProgress=!0,P.$digest()),$()}function o(){P.position=F?l.offset(b):l.position(b),P.position.top+=b.prop("offsetHeight")}function p(a){var b;return angular.version.minor<6?(b=a.$options||{},b.getOption=function(a){return b[a]}):b=a.$options,b}var q,r,s=[9,13,27,38,40],t=200,u=a.$eval(c.typeaheadMinLength);u||0===u||(u=1),a.$watch(c.typeaheadMinLength,function(a){u=a||0===a?a:1});var v=a.$eval(c.typeaheadWaitMs)||0,w=a.$eval(c.typeaheadEditable)!==!1;a.$watch(c.typeaheadEditable,function(a){w=a!==!1});var x,y,z=e(c.typeaheadLoading).assign||angular.noop,A=c.typeaheadShouldSelect?e(c.typeaheadShouldSelect):function(a,b){var c=b.$event;return 13===c.which||9===c.which},B=e(c.typeaheadOnSelect),C=angular.isDefined(c.typeaheadSelectOnBlur)?a.$eval(c.typeaheadSelectOnBlur):!1,D=e(c.typeaheadNoResults).assign||angular.noop,E=c.typeaheadInputFormatter?e(c.typeaheadInputFormatter):void 0,F=c.typeaheadAppendToBody?a.$eval(c.typeaheadAppendToBody):!1,G=c.typeaheadAppendTo?a.$eval(c.typeaheadAppendTo):null,H=a.$eval(c.typeaheadFocusFirst)!==!1,I=c.typeaheadSelectOnExact?a.$eval(c.typeaheadSelectOnExact):!1,J=e(c.typeaheadIsOpen).assign||angular.noop,K=a.$eval(c.typeaheadShowHint)||!1,L=e(c.ngModel),M=e(c.ngModel+"($$$p)"),N=function(b,c){return angular.isFunction(L(a))&&r.getOption("getterSetter")?M(b,{$$$p:c}):L.assign(b,c)},O=m.parse(c.uibTypeahead),P=a.$new(),Q=a.$on("$destroy",function(){P.$destroy()});P.$on("$destroy",Q);var R="typeahead-"+P.$id+"-"+Math.floor(1e4*Math.random());b.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":R});var S,T;K&&(S=angular.element("
"),S.css("position","relative"),b.after(S),T=b.clone(),T.attr("placeholder",""),T.attr("tabindex","-1"),T.val(""),T.css({position:"absolute",top:"0px",left:"0px","border-color":"transparent","box-shadow":"none",opacity:1,background:"none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255)",color:"#999"}),b.css({position:"relative","vertical-align":"top","background-color":"transparent"}),T.attr("id")&&T.removeAttr("id"),S.append(T),T.after(b));var U=angular.element("
");U.attr({id:R,matches:"matches",active:"activeIdx",select:"select(activeIdx, evt)","move-in-progress":"moveInProgress",query:"query",position:"position","assign-is-open":"assignIsOpen(isOpen)",debounce:"debounceUpdate"}),angular.isDefined(c.typeaheadTemplateUrl)&&U.attr("template-url",c.typeaheadTemplateUrl),angular.isDefined(c.typeaheadPopupTemplateUrl)&&U.attr("popup-template-url",c.typeaheadPopupTemplateUrl);var V=function(){K&&T.val("")},W=function(){P.matches=[],P.activeIdx=-1,b.attr("aria-expanded",!1),V()},X=function(a){return R+"-option-"+a};P.$watch("activeIdx",function(a){0>a?b.removeAttr("aria-activedescendant"):b.attr("aria-activedescendant",X(a))});var Y=function(a,b){return P.matches.length>b&&a?a.toUpperCase()===P.matches[b].label.toUpperCase():!1},Z=function(c,d){var e={$viewValue:c};z(a,!0),D(a,!1),f.when(O.source(a,e)).then(function(f){var g=c===q.$viewValue;if(g&&x)if(f&&f.length>0){P.activeIdx=H?0:-1,D(a,!1),P.matches.length=0;for(var h=0;h0&&i.slice(0,c.length).toUpperCase()===c.toUpperCase()?T.val(c+i.slice(c.length)):T.val("")}}else W(),D(a,!0);g&&z(a,!1)},function(){W(),z(a,!1),D(a,!0)})};F&&(angular.element(i).on("resize",n),h.find("body").on("scroll",n));var $=k(function(){P.matches.length&&o(),P.moveInProgress=!1},t);P.moveInProgress=!1,P.query=void 0;var _,aa=function(a){_=g(function(){Z(a)},v)},ba=function(){_&&g.cancel(_)};W(),P.assignIsOpen=function(b){J(a,b)},P.select=function(d,e){var f,h,i={};y=!0,i[O.itemName]=h=P.matches[d].model,f=O.modelMapper(a,i),N(a,f),q.$setValidity("editable",!0),q.$setValidity("parse",!0),B(a,{$item:h,$model:f,$label:O.viewMapper(a,i),$event:e}),W(),P.$eval(c.typeaheadFocusOnSelect)!==!1&&g(function(){b[0].focus()},0,!1)},b.on("keydown",function(b){if(0!==P.matches.length&&-1!==s.indexOf(b.which)){var c=A(a,{$event:b});if(-1===P.activeIdx&&c||9===b.which&&b.shiftKey)return W(),void P.$digest();b.preventDefault();var d;switch(b.which){case 27:b.stopPropagation(),W(),a.$digest();break;case 38:P.activeIdx=(P.activeIdx>0?P.activeIdx:P.matches.length)-1,P.$digest(),d=U[0].querySelectorAll(".uib-typeahead-match")[P.activeIdx],d.parentNode.scrollTop=d.offsetTop;break;case 40:P.activeIdx=(P.activeIdx+1)%P.matches.length,P.$digest(),d=U[0].querySelectorAll(".uib-typeahead-match")[P.activeIdx], -d.parentNode.scrollTop=d.offsetTop;break;default:c&&P.$apply(function(){angular.isNumber(P.debounceUpdate)||angular.isObject(P.debounceUpdate)?k(function(){P.select(P.activeIdx,b)},angular.isNumber(P.debounceUpdate)?P.debounceUpdate:P.debounceUpdate["default"]):P.select(P.activeIdx,b)})}}}),b.on("focus",function(a){x=!0,0!==u||q.$viewValue||g(function(){Z(q.$viewValue,a)},0)}),b.on("blur",function(a){C&&P.matches.length&&-1!==P.activeIdx&&!y&&(y=!0,P.$apply(function(){angular.isObject(P.debounceUpdate)&&angular.isNumber(P.debounceUpdate.blur)?k(function(){P.select(P.activeIdx,a)},P.debounceUpdate.blur):P.select(P.activeIdx,a)})),!w&&q.$error.editable&&(q.$setViewValue(),P.$apply(function(){q.$setValidity("editable",!0),q.$setValidity("parse",!0)}),b.val("")),x=!1,y=!1});var ca=function(c){b[0]!==c.target&&3!==c.which&&0!==P.matches.length&&(W(),j.$$phase||a.$digest())};h.on("click",ca),a.$on("$destroy",function(){h.off("click",ca),(F||G)&&da.remove(),F&&(angular.element(i).off("resize",n),h.find("body").off("scroll",n)),U.remove(),K&&S.remove()});var da=d(U)(P);F?h.find("body").append(da):G?angular.element(G).eq(0).append(da):b.after(da),this.init=function(b){q=b,r=p(q),P.debounceUpdate=e(r.getOption("debounce"))(a),q.$parsers.unshift(function(b){return x=!0,0===u||b&&b.length>=u?v>0?(ba(),aa(b)):Z(b):(z(a,!1),ba(),W()),w?b:b?void q.$setValidity("editable",!1):(q.$setValidity("editable",!0),null)}),q.$formatters.push(function(b){var c,d,e={};return w||q.$setValidity("editable",!0),E?(e.$model=b,E(a,e)):(e[O.itemName]=b,c=O.viewMapper(a,e),e[O.itemName]=void 0,d=O.viewMapper(a,e),c!==d?c:b)})}}]).directive("uibTypeahead",function(){return{controller:"UibTypeaheadController",require:["ngModel","uibTypeahead"],link:function(a,b,c,d){d[1].init(d[0])}}}).directive("uibTypeaheadPopup",["$$debounce",function(a){return{scope:{matches:"=",query:"=",active:"=",position:"&",moveInProgress:"=",select:"&",assignIsOpen:"&",debounce:"&"},replace:!0,templateUrl:function(a,b){return b.popupTemplateUrl||"uib/template/typeahead/typeahead-popup.html"},link:function(b,c,d){b.templateUrl=d.templateUrl,b.isOpen=function(){var a=b.matches.length>0;return b.assignIsOpen({isOpen:a}),a},b.isActive=function(a){return b.active===a},b.selectActive=function(a){b.active=a},b.selectMatch=function(c,d){var e=b.debounce();angular.isNumber(e)||angular.isObject(e)?a(function(){b.select({activeIdx:c,evt:d})},angular.isNumber(e)?e:e["default"]):b.select({activeIdx:c,evt:d})}}}}]).directive("uibTypeaheadMatch",["$templateRequest","$compile","$parse",function(a,b,c){return{scope:{index:"=",match:"=",query:"="},link:function(d,e,f){var g=c(f.templateUrl)(d.$parent)||"uib/template/typeahead/typeahead-match.html";a(g).then(function(a){var c=angular.element(a.trim());e.replaceWith(c),b(c)(d)})}}}]).filter("uibTypeaheadHighlight",["$sce","$injector","$log",function(a,b,c){function d(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}function e(a){return/<.*>/g.test(a)}var f;return f=b.has("$sanitize"),function(b,g){return!f&&e(b)&&c.warn("Unsafe use of typeahead please use ngSanitize"),b=g?(""+b).replace(new RegExp(d(g),"gi"),"$&"):b,f||(b=a.trustAsHtml(b)),b}}]),angular.module("uib/template/accordion/accordion-group.html",[]).run(["$templateCache",function(a){a.put("uib/template/accordion/accordion-group.html",'\n
\n
\n
\n')}]),angular.module("uib/template/accordion/accordion.html",[]).run(["$templateCache",function(a){a.put("uib/template/accordion/accordion.html",'
')}]),angular.module("uib/template/alert/alert.html",[]).run(["$templateCache",function(a){a.put("uib/template/alert/alert.html",'\n
\n')}]),angular.module("uib/template/carousel/carousel.html",[]).run(["$templateCache",function(a){a.put("uib/template/carousel/carousel.html",'\n\n \n previous\n\n\n \n next\n\n\n')}]),angular.module("uib/template/carousel/slide.html",[]).run(["$templateCache",function(a){a.put("uib/template/carousel/slide.html",'
\n')}]),angular.module("uib/template/datepicker/datepicker.html",[]).run(["$templateCache",function(a){a.put("uib/template/datepicker/datepicker.html",'
\n
\n
\n
\n
\n')}]),angular.module("uib/template/datepicker/day.html",[]).run(["$templateCache",function(a){a.put("uib/template/datepicker/day.html",'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
{{::label.abbr}}
{{ weekNumbers[$index] }}\n \n
\n')}]),angular.module("uib/template/datepicker/month.html",[]).run(["$templateCache",function(a){a.put("uib/template/datepicker/month.html",'\n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n')}]),angular.module("uib/template/datepicker/year.html",[]).run(["$templateCache",function(a){a.put("uib/template/datepicker/year.html",'\n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n')}]),angular.module("uib/template/datepickerPopup/popup.html",[]).run(["$templateCache",function(a){a.put("uib/template/datepickerPopup/popup.html",'\n')}]),angular.module("uib/template/modal/window.html",[]).run(["$templateCache",function(a){a.put("uib/template/modal/window.html","
\n")}]),angular.module("uib/template/pager/pager.html",[]).run(["$templateCache",function(a){a.put("uib/template/pager/pager.html",'
  • {{::getText(\'previous\')}}
  • \n
  • {{::getText(\'next\')}}
  • \n')}]),angular.module("uib/template/pagination/pagination.html",[]).run(["$templateCache",function(a){a.put("uib/template/pagination/pagination.html",'\n\n\n\n\n')}]),angular.module("uib/template/tooltip/tooltip-html-popup.html",[]).run(["$templateCache",function(a){a.put("uib/template/tooltip/tooltip-html-popup.html",'
    \n
    \n')}]),angular.module("uib/template/tooltip/tooltip-popup.html",[]).run(["$templateCache",function(a){a.put("uib/template/tooltip/tooltip-popup.html",'
    \n
    \n')}]),angular.module("uib/template/tooltip/tooltip-template-popup.html",[]).run(["$templateCache",function(a){a.put("uib/template/tooltip/tooltip-template-popup.html",'
    \n
    \n')}]),angular.module("uib/template/popover/popover-html.html",[]).run(["$templateCache",function(a){a.put("uib/template/popover/popover-html.html",'
    \n\n
    \n

    \n
    \n
    \n')}]),angular.module("uib/template/popover/popover-template.html",[]).run(["$templateCache",function(a){a.put("uib/template/popover/popover-template.html",'
    \n\n
    \n

    \n
    \n
    \n')}]),angular.module("uib/template/popover/popover.html",[]).run(["$templateCache",function(a){a.put("uib/template/popover/popover.html",'
    \n\n
    \n

    \n
    \n
    \n')}]),angular.module("uib/template/progressbar/bar.html",[]).run(["$templateCache",function(a){a.put("uib/template/progressbar/bar.html",'
    \n')}]),angular.module("uib/template/progressbar/progress.html",[]).run(["$templateCache",function(a){a.put("uib/template/progressbar/progress.html",'
    ')}]),angular.module("uib/template/progressbar/progressbar.html",[]).run(["$templateCache",function(a){a.put("uib/template/progressbar/progressbar.html",'
    \n
    \n
    \n')}]),angular.module("uib/template/rating/rating.html",[]).run(["$templateCache",function(a){a.put("uib/template/rating/rating.html",'\n ({{ $index < value ? \'*\' : \' \' }})\n \n\n')}]),angular.module("uib/template/tabs/tab.html",[]).run(["$templateCache",function(a){a.put("uib/template/tabs/tab.html",'\n')}]),angular.module("uib/template/tabs/tabset.html",[]).run(["$templateCache",function(a){a.put("uib/template/tabs/tabset.html",'
    \n \n
    \n
    \n
    \n
    \n
    \n')}]),angular.module("uib/template/timepicker/timepicker.html",[]).run(["$templateCache",function(a){a.put("uib/template/timepicker/timepicker.html",'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
      
    \n \n :\n \n :\n \n
      
    \n')}]),angular.module("uib/template/typeahead/typeahead-match.html",[]).run(["$templateCache",function(a){a.put("uib/template/typeahead/typeahead-match.html",'\n')}]),angular.module("uib/template/typeahead/typeahead-popup.html",[]).run(["$templateCache",function(a){a.put("uib/template/typeahead/typeahead-popup.html",'\n')}]),angular.module("ui.bootstrap.carousel").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibCarouselCss&&angular.element(document).find("head").prepend(''),angular.$$uibCarouselCss=!0}),angular.module("ui.bootstrap.datepicker").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibDatepickerCss&&angular.element(document).find("head").prepend(''),angular.$$uibDatepickerCss=!0}),angular.module("ui.bootstrap.position").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibPositionCss&&angular.element(document).find("head").prepend(''),angular.$$uibPositionCss=!0}),angular.module("ui.bootstrap.datepickerPopup").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibDatepickerpopupCss&&angular.element(document).find("head").prepend(''),angular.$$uibDatepickerpopupCss=!0}),angular.module("ui.bootstrap.tooltip").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTooltipCss&&angular.element(document).find("head").prepend(''),angular.$$uibTooltipCss=!0}),angular.module("ui.bootstrap.timepicker").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTimepickerCss&&angular.element(document).find("head").prepend(''),angular.$$uibTimepickerCss=!0}),angular.module("ui.bootstrap.typeahead").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTypeaheadCss&&angular.element(document).find("head").prepend(''),angular.$$uibTypeaheadCss=!0}); \ No newline at end of file diff --git a/brewman/static/src/template/modal/confirm-material.html b/brewman/static/src/template/modal/confirm-material.html deleted file mode 100644 index 1c8e5017..00000000 --- a/brewman/static/src/template/modal/confirm-material.html +++ /dev/null @@ -1,10 +0,0 @@ - - ', -

    {{ title }}

    -

    {{ body }}

    -
    - - Cancel - {{isDelete ? 'Delete' : 'Okay'}} - -
    diff --git a/brewman/static/src/template/modal/confirm.html b/brewman/static/src/template/modal/confirm.html deleted file mode 100644 index ee1efdf1..00000000 --- a/brewman/static/src/template/modal/confirm.html +++ /dev/null @@ -1,13 +0,0 @@ - - - diff --git a/brewman/static/src/template/modal/image.html b/brewman/static/src/template/modal/image.html deleted file mode 100644 index 967d164c..00000000 --- a/brewman/static/src/template/modal/image.html +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/brewman/views/Management/settings.py b/brewman/views/Management/settings.py index 5dad7c0b..d46f03bf 100644 --- a/brewman/views/Management/settings.py +++ b/brewman/views/Management/settings.py @@ -1,9 +1,9 @@ import datetime import pkg_resources +import transaction from pyramid.response import FileResponse from pyramid.view import view_config -import transaction from brewman.models.auth import User from brewman.models.master import DbSetting @@ -11,31 +11,32 @@ from brewman.models.master import DbSetting @view_config(route_name='settings', permission='Authenticated') def html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) -@view_config(request_method='POST', route_name='api_lock_info', renderer='json', permission='Lock Date', trans=True) +@view_config(request_method='POST', route_name='api_lock_information', renderer='json', permission='Lock Date', + trans=True) def set_lock_info(request): - start_locked = request.json_body['Start']['Locked'] - finish_locked = request.json_body['Finish']['Locked'] + start_locked = request.json_body['lockOlder'] + finish_locked = request.json_body['lockNewer'] data = {'Start': {'Locked': start_locked}, 'Finish': {'Locked': finish_locked}} if start_locked: - rolling = request.json_body['Start']['Rolling'] + rolling = request.json_body['olderRolling'] data['Start']['Rolling'] = rolling if rolling: - data['Start']['Days'] = request.json_body['Start']['Days'] + data['Start']['Days'] = request.json_body['olderDays'] else: - data['Start']['Date'] = datetime.datetime.strptime(request.json_body['Start']['Date'], '%d-%b-%Y') + data['Start']['Date'] = datetime.datetime.strptime(request.json_body['olderDate'], '%d-%b-%Y') if finish_locked: - rolling = request.json_body['Finish']['Rolling'] + rolling = request.json_body['newerRolling'] data['Finish']['Rolling'] = rolling if rolling: - data['Finish']['Days'] = request.json_body['Finish']['Days'] + data['Finish']['Days'] = request.json_body['newerDays'] else: - data['Finish']['Date'] = datetime.datetime.strptime(request.json_body['Finish']['Date'], '%d-%b-%Y') + data['Finish']['Date'] = datetime.datetime.strptime(request.json_body['newerDate'], '%d-%b-%Y') lock_date = request.dbsession.query(DbSetting).filter(DbSetting.name == 'Lock Info').first() if lock_date is not None: @@ -47,7 +48,8 @@ def set_lock_info(request): return get_lock_info(request) -@view_config(request_method='DELETE', route_name='api_lock_info', renderer='json', permission='Lock Date', trans=True) +@view_config(request_method='DELETE', route_name='api_lock_information', renderer='json', permission='Lock Date', + trans=True) def clear_lock_info(request): lock_date = request.dbsession.query(DbSetting).filter(DbSetting.name == 'Lock Info').first() if lock_date is not None and lock_date.data is not None: @@ -56,26 +58,26 @@ def clear_lock_info(request): return {} -@view_config(request_method='GET', route_name='api_lock_info', renderer='json', permission='Authenticated') +@view_config(request_method='GET', route_name='api_lock_information', renderer='json', permission='Authenticated') def get_lock_info(request): data = request.dbsession.query(DbSetting).filter(DbSetting.name == 'Lock Info').first() if data is None: - return {'Start': {'Locked': False}, 'Finish': {'Locked': False}} + return {'lockOlder': False, 'lockNewer': False} data = data.data - info = {'Start': {'Locked': data['Start']['Locked']}, 'Finish': {'Locked': data['Finish']['Locked']}} + info = {'lockOlder': data['Start']['Locked'], 'lockNewer': data['Finish']['Locked']} if data['Start']['Locked']: - info['Start']['Rolling'] = data['Start']['Rolling'] + info['olderRolling'] = data['Start']['Rolling'] if data['Start']['Rolling']: - info['Start']['Days'] = data['Start']['Days'] + info['olderDays'] = data['Start']['Days'] else: - info['Start']['Date'] = data['Start']['Date'].strftime('%d-%b-%Y') + info['olderDate'] = data['Start']['Date'].strftime('%d-%b-%Y') if data['Finish']['Locked']: - info['Finish']['Rolling'] = data['Finish']['Rolling'] + info['newerRolling'] = data['Finish']['Rolling'] if data['Finish']['Rolling']: - info['Finish']['Days'] = data['Finish']['Days'] + info['newerDays'] = data['Finish']['Days'] else: - info['Finish']['Date'] = data['Finish']['Date'].strftime('%d-%b-%Y') + info['newerDate'] = data['Finish']['Date'].strftime('%d-%b-%Y') return info @@ -83,14 +85,14 @@ def get_lock_info(request): def get_maintenance(request): data = request.dbsession.query(DbSetting).filter(DbSetting.name == 'Maintenance').first() if data is None: - return {'Enabled': False, 'User': ''} + return {'enabled': False, 'user': ''} user = request.dbsession.query(User).filter(User.id == data.data).one() - return {'Enabled': True, 'User': user.name} + return {'enabled': True, 'user': user.name} @view_config(request_method='POST', route_name='api_maintenance', renderer='json', permission='Maintenance', trans=True) def set_maintenance(request): - status = request.json_body['Enabled'] + status = request.json_body['enabled'] maintenance = request.dbsession.query(DbSetting).filter(DbSetting.name == 'Maintenance').first() if status is False and maintenance is not None: request.dbsession.delete(maintenance) @@ -101,5 +103,3 @@ def set_maintenance(request): maintenance.data = request.authenticated_userid transaction.commit() return get_maintenance(request) - - diff --git a/brewman/views/__init__.py b/brewman/views/__init__.py index 2c43c3a3..61ac6be1 100644 --- a/brewman/views/__init__.py +++ b/brewman/views/__init__.py @@ -16,32 +16,10 @@ from brewman.models.voucher import DbImage @view_config(route_name='home') @view_config(request_method='GET', route_name='login') def home(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) - -# @view_config(route_name='tsconfig') -# def tsconfig(request): -# package, resource = 'brewman:static/tsconfig.json'.split(':', 1) -# file = pkg_resources.resource_filename(package, resource) -# return FileResponse(file, request=request) -# -# -@view_config(route_name='systemjs') -def systemjs(request): - package, resource = 'brewman:static/src/app/systemjs.config.js'.split(':', 1) - file = pkg_resources.resource_filename(package, resource) - return FileResponse(file, request=request) - - -# @view_config(route_name='main.js') -# def mainjs(request): -# package, resource = 'brewman:static/main.js'.split(':', 1) -# file = pkg_resources.resource_filename(package, resource) -# return FileResponse(file, request=request) -# - @view_config(context=HTTPForbidden) def forbidden(request): if 'X-Requested-With' in request.headers and request.headers['X-Requested-With'] == 'XMLHttpRequest': @@ -49,14 +27,7 @@ def forbidden(request): response.status_int = 401 return response else: - return HTTPFound(location=request.route_url('login', _query={'came_from': request.path_qs})) - - -@view_config(route_name='favicon') -def favicon(request): - package, resource = 'brewman:static/src/favicon.ico'.split(':', 1) - icon = pkg_resources.resource_filename(package, resource) - return FileResponse(icon, request=request) + return HTTPFound(location=request.route_url('login', _query={'returnUrl': request.path_qs})) @view_config(route_name='db_image') diff --git a/brewman/views/account.py b/brewman/views/account.py index 67a3daaf..1f79aa30 100644 --- a/brewman/views/account.py +++ b/brewman/views/account.py @@ -1,11 +1,11 @@ import datetime -import pkg_resources -from sqlalchemy import func -import transaction import uuid +import pkg_resources +import transaction from pyramid.response import Response, FileResponse from pyramid.view import view_config +from sqlalchemy import func from sqlalchemy.orm import joinedload_all from brewman.models.master import CostCentre, Ledger, LedgerType, LedgerBase @@ -17,33 +17,33 @@ from brewman.models.voucher import Voucher, Journal, VoucherType @view_config(request_method='GET', route_name='account_id', permission='Accounts') @view_config(request_method='GET', route_name='account', permission='Accounts') def html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) @view_config(request_method='POST', route_name='api_account', renderer='json', permission='Accounts', trans=True) def save(request): - item = Ledger(code=0, name=request.json_body['Name'], type=int(request.json_body['Type']), - is_active=request.json_body['IsActive'], is_reconcilable=request.json_body['IsReconcilable'], - cost_centre_id=uuid.UUID(request.json_body['CostCentre']['CostCentreID'])).create(request.dbsession) + item = Ledger(code=0, name=request.json_body['name'], type=int(request.json_body['type']), + is_active=request.json_body['isActive'], is_reconcilable=request.json_body['isReconcilable'], + cost_centre_id=uuid.UUID(request.json_body['costCentre']['id'])).create(request.dbsession) transaction.commit() return account_info(item.id, request.dbsession) -@view_config(request_method='POST', route_name='api_account_id', renderer='json', permission='Accounts', trans=True) +@view_config(request_method='PUT', route_name='api_account_id', renderer='json', permission='Accounts', trans=True) def update(request): item = request.dbsession.query(Ledger).filter(Ledger.id == uuid.UUID(request.matchdict['id'])).first() if item.is_fixture: raise ValidationError("{0} is a fixture and cannot be edited or deleted.".format(item.name)) - new_type = int(request.json_body['Type']) + new_type = int(request.json_body['type']) if not item.type == new_type: item.code = Ledger.get_code(new_type, request.dbsession) item.type = new_type - item.name = request.json_body['Name'] - item.is_active = request.json_body['IsActive'] - item.is_reconcilable = request.json_body['IsReconcilable'] - item.cost_centre_id = uuid.UUID(request.json_body['CostCentre']['CostCentreID']) + item.name = request.json_body['name'] + item.is_active = request.json_body['isActive'] + item.is_reconcilable = request.json_body['isReconcilable'] + item.cost_centre_id = uuid.UUID(request.json_body['costCentre']['id']) transaction.commit() return account_info(item.id, request.dbsession) @@ -69,7 +69,7 @@ def show_balance(request): date = request.GET.get('d', None) date = None if date is None or date == '' else datetime.datetime.strptime(date, '%d-%b-%Y') id = uuid.UUID(request.matchdict['id']) - return {'Date': balance(id, date, request.dbsession), 'Total': balance(id, None, request.dbsession)} + return {'date': balance(id, date, request.dbsession), 'total': balance(id, None, request.dbsession)} def balance(id_, date, dbsession): @@ -97,35 +97,35 @@ def show_blank(request): return account_info(None, request.dbsession) -@view_config(request_method='GET', route_name='api_account', renderer='json', request_param='list', +@view_config(request_method='GET', route_name='api_account', renderer='json', request_param='l', permission='Authenticated') def show_list(request): list = request.dbsession.query(Ledger).order_by(Ledger.type).order_by(Ledger.name).order_by(Ledger.code).all() ledgers = [] for item in list: - ledgers.append({'Name': item.name, 'Type': item.type_object.name, 'IsActive': 'Yes' if item.is_active else 'No', - 'IsReconcilable': 'Yes' if item.is_reconcilable else '', 'CostCentre': item.cost_centre.name, - 'IsFixture': item.is_fixture, 'Url': request.route_url('account_id', id=item.id)}) + ledgers.append({'id': item.id, 'name': item.name, 'type': item.type_object.name, 'isActive': item.is_active, + 'isReconcilable': item.is_reconcilable, 'costCentre': item.cost_centre.name, + 'isFixture': item.is_fixture}) return ledgers -@view_config(request_method='GET', route_name='api_account', renderer='json', request_param='term', +@view_config(request_method='GET', route_name='api_account', renderer='json', request_param='q', permission='Authenticated') def show_term(request): - type = request.GET.get('type', None) + type = request.GET.get('t', None) type = int(type) if type is not None else None - filter = request.GET.get('term', None) + filter = request.GET.get('q', None) filter = filter if filter is not None and filter is not '' else None reconcilable = request.GET.get('r', None) reconcilable = reconcilable if reconcilable is not None else None active = request.GET.get('a', None) active = active if active is not None else None - count = request.GET.get('count', None) + count = request.GET.get('c', None) count = None if count is None or count == '' else int(count) list = [] for index, item in enumerate(LedgerBase.list(type, filter, reconcilable, active, request.dbsession)): - list.append({'LedgerID': item.id, 'Name': item.name}) + list.append({'id': item.id, 'name': item.name}) if count is not None and index == count - 1: break return list @@ -135,20 +135,20 @@ def show_term(request): def account_type_list(request): account_types = [] for item in LedgerType.list(): - account_types.append({'AccountTypeID': item.id, 'Name': item.name}) + account_types.append({'id': item.id, 'name': item.name}) return account_types def account_info(id, dbsession): if id is None: - account = {'Code': '(Auto)', 'Type': LedgerType.by_name('Creditors').id, 'IsActive': True, - 'IsReconcilable': False, 'CostCentre': CostCentre.overall()} + account = {'code': '(Auto)', 'type': LedgerType.by_name('Creditors').id, 'isActive': True, + 'isReconcilable': False, 'costCentre': CostCentre.overall()} else: account = dbsession.query(Ledger).filter(Ledger.id == id).first() - account = {'LedgerID': account.id, 'Code': account.code, 'Name': account.name, 'Type': account.type, - 'IsActive': account.is_active, 'IsReconcilable': account.is_reconcilable, - 'IsFixture': account.is_fixture, - 'CostCentre': {'CostCentreID': account.cost_centre_id, 'Name': account.cost_centre.name}} + account = {'id': account.id, 'code': account.code, 'name': account.name, 'type': account.type, + 'isActive': account.is_active, 'isReconcilable': account.is_reconcilable, + 'isFixture': account.is_fixture, + 'costCentre': {'id': account.cost_centre_id, 'name': account.cost_centre.name}} return account diff --git a/brewman/views/attendance.py b/brewman/views/attendance.py index 054aa17f..f340fdf6 100644 --- a/brewman/views/attendance.py +++ b/brewman/views/attendance.py @@ -2,10 +2,10 @@ import datetime import uuid import pkg_resources +import transaction from pyramid.response import FileResponse from pyramid.view import view_config from sqlalchemy import or_ -import transaction from brewman.models.master import AttendanceType, Employee from brewman.models.validation_exception import ValidationError @@ -19,7 +19,7 @@ from brewman.views.services.session import session_period_start, session_period_ @view_config(request_method='GET', route_name='employee_attendance_id', permission='Attendance') @view_config(request_method='GET', route_name='employee_attendance', permission='Attendance') def html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) @@ -29,13 +29,13 @@ def show_list(request): list = AttendanceType.list() attendance_types = [] for item in list: - attendance_types.append({'AttendanceTypeID': item.id, 'Name': item.name, 'Value': item.value}) + attendance_types.append({'id': item.id, 'name': item.name, 'value': item.value}) return attendance_types @view_config(request_method='GET', route_name='api_attendance', renderer='json', permission='Attendance') def attendance_blank(request): - return {'Date': session_current_date(request), 'Body': []} + return {'date': session_current_date(request), 'body': []} @view_config(request_method='GET', route_name='api_attendance_date', renderer='json', permission='Attendance') @@ -45,7 +45,7 @@ def attendance_date(request): def attendance_date_report(date, dbsession): - report = {'Date': date, 'Body': []} + report = {'date': date, 'body': []} date = datetime.datetime.strptime(date, '%d-%b-%Y') employees = dbsession.query(Employee) \ .filter(Employee.joining_date <= date) \ @@ -57,9 +57,11 @@ def attendance_date_report(date, dbsession): att = 0 if att is None else att.attendance_type prints, hours, worked = get_prints(item.id, date, dbsession) - report['Body'].append({'id': item.id, 'Code': item.code, 'Name': item.name, 'Designation': item.designation, - 'Department': item.cost_centre.name, 'AttendanceTypeID': att, 'Prints': prints, - 'Hours': hours, 'Worked': worked}) + report['body'].append({ + 'id': item.id, 'code': item.code, 'name': item.name, 'designation': item.designation, + 'department': item.cost_centre.name, 'attendanceType': {'id': att}, 'prints': prints, + 'hours': hours, 'worked': worked + }) return report @@ -70,12 +72,13 @@ def save(request): date = request.matchdict.get('date', None) date_object = datetime.datetime.strptime(date, '%d-%b-%Y') - for item in request.json_body['Body']: + for item in request.json_body['body']: employee_id = uuid.UUID(item['id']) - attendance_type = item['AttendanceTypeID'] + attendance_type = item['attendanceType']['id'] if attendance_type != 0: - attendance = Attendance(employee_id=employee_id, date=date_object, attendance_type=attendance_type, - user_id=user_id) + attendance = Attendance( + employee_id=employee_id, date=date_object, attendance_type=attendance_type, user_id=user_id + ) attendance.create(request.dbsession) transaction.commit() return attendance_date_report(date, request.dbsession) @@ -83,8 +86,8 @@ def save(request): @view_config(request_method='GET', route_name='api_employee_attendance', renderer='json', permission='Attendance') def employee_attendance_blank(request): - return {'StartDate': session_period_start(request), - 'FinishDate': session_period_finish(request), 'Employee': None, 'Body': []} + return {'startDate': session_period_start(request), + 'finishDate': session_period_finish(request), 'employee': None, 'body': []} @view_config(request_method='GET', route_name='api_employee_attendance_id', renderer='json', permission='Attendance') @@ -92,15 +95,17 @@ def employee_attendance_report(request): employee = request.dbsession.query(Employee).filter(Employee.id == uuid.UUID(request.matchdict['id'])).first() if employee is None: raise ValidationError('Employee id is wrong') - start_date = request.GET.get('StartDate', session_period_start(request)) - finish_date = request.GET.get('FinishDate', session_period_finish(request)) - info = {'StartDate': start_date, 'FinishDate': finish_date, - 'Employee': {'LedgerID': employee.id, 'Name': employee.name}} + start_date = request.GET.get('s', session_period_start(request)) + finish_date = request.GET.get('f', session_period_finish(request)) + info = { + 'startDate': start_date, 'finishDate': finish_date, + 'employee': {'id': employee.id, 'name': employee.name} + } start_date = datetime.datetime.strptime(start_date, '%d-%b-%Y') finish_date = datetime.datetime.strptime(finish_date, '%d-%b-%Y') start_date = employee.joining_date if employee.joining_date > start_date else start_date finish_date = employee.leaving_date if not employee.is_active and employee.leaving_date < finish_date else finish_date - info['Body'] = employee_attendance(employee, start_date, finish_date, request.dbsession) + info['body'] = employee_attendance(employee, start_date, finish_date, request.dbsession) return info @@ -118,8 +123,10 @@ def employee_attendance(employee, start_date, finish_date, dbsession): .first() att = 0 if att is None else att.attendance_type prints, hours, worked = get_prints(employee.id, item, dbsession) - list.append({'Date': item.strftime('%d-%b-%Y'), 'AttendanceTypeID': att, 'Prints': prints, 'Hours': hours, - 'Worked': worked}) + list.append({ + 'date': item.strftime('%d-%b-%Y'), 'attendanceType': {'id': att}, 'prints': prints, 'hours': hours, + 'worked': worked + }) return list @@ -130,21 +137,21 @@ def save_employee_attendance(request): finish_date = None user_id = uuid.UUID(request.authenticated_userid) employee = request.dbsession.query(Employee).filter(Employee.id == uuid.UUID(request.matchdict['id'])).first() - for item in request.json_body['Body']: + for item in request.json_body['body']: if start_date is None: - start_date = item['Date'] - finish_date = item['Date'] + start_date = item['date'] + finish_date = item['date'] - attendance_type = item['AttendanceTypeID'] + attendance_type = item['attendanceType']['id'] if attendance_type != 0: - date = datetime.datetime.strptime(item['Date'], '%d-%b-%Y') + date = datetime.datetime.strptime(item['date'], '%d-%b-%Y') attendance = Attendance(employee_id=employee.id, date=date, attendance_type=attendance_type, user_id=user_id) attendance.create(request.dbsession) transaction.commit() - return {'StartDate': start_date, 'FinishDate': finish_date, - 'Employee': {'LedgerID': employee.id, 'Name': employee.name}, - 'Body': employee_attendance(employee, start_date, finish_date, request.dbsession)} + return {'startDate': start_date, 'finishDate': finish_date, + 'employee': {'id': employee.id, 'name': employee.name}, + 'body': employee_attendance(employee, start_date, finish_date, request.dbsession)} def daterange(start, stop, step=datetime.timedelta(days=1), inclusive=False): diff --git a/brewman/views/auth/client.py b/brewman/views/auth/client.py index 47b0938c..173d1af3 100644 --- a/brewman/views/auth/client.py +++ b/brewman/views/auth/client.py @@ -12,18 +12,18 @@ from brewman.models.auth import Client, LoginHistory @view_config(request_method='GET', route_name='client_list', permission='Clients') @view_config(request_method='GET', route_name='client_id', permission='Clients') def html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) -@view_config(request_method='POST', route_name='api_client_id', renderer='json', permission='Clients', trans=True) +@view_config(request_method='PUT', route_name='api_client_id', renderer='json', permission='Clients', trans=True) def update(request): item = request.dbsession.query(Client).filter(Client.id == uuid.UUID(request.matchdict['id'])).first() - item.enabled = request.json_body['Enabled'] + item.enabled = request.json_body['enabled'] if item.enabled: item.otp = None - item.name = request.json_body['Name'] + item.name = request.json_body['name'] transaction.commit() return {} @@ -43,7 +43,7 @@ def delete(request): return {} -@view_config(request_method='GET', route_name='api_client', request_param='list', renderer='json', permission='Clients') +@view_config(request_method='GET', route_name='api_client', request_param='l', renderer='json', permission='Clients') def show_list(request): list = request.dbsession.query(Client).order_by(Client.name).all() clients = [] @@ -52,13 +52,12 @@ def show_list(request): .filter(LoginHistory.client_id == item.id).order_by(desc(LoginHistory.date)).first() last_login = 'Never' if last_login is None else last_login.date.strftime('%d-%b-%Y %H:%M') clients.append( - {'ClientID': item.id, 'Code': item.code, 'Name': item.name, 'Enabled': item.enabled, 'OTP': item.otp, - 'CreationDate': item.creation_date.strftime('%d-%b-%Y %H:%M'), 'LastLogin': last_login, - 'Url': request.route_url('client_id', id=item.id)}) + {'id': item.id, 'code': item.code, 'name': item.name, 'enabled': item.enabled, 'otp': item.otp, + 'creationDate': item.creation_date.strftime('%d-%b-%Y %H:%M'), 'lastLogin': last_login}) return clients @view_config(request_method='GET', route_name='api_client_id', renderer='json', permission='Clients') def show_id(request): item = request.dbsession.query(Client).filter(Client.id == uuid.UUID(request.matchdict['id'])).first() - return {'ClientID': item.id, 'Code': item.code, 'Name': item.name, 'Enabled': item.enabled, 'OTP': item.otp} + return {'id': item.id, 'code': item.code, 'name': item.name, 'enabled': item.enabled, 'otp': item.otp} diff --git a/brewman/views/auth/group.py b/brewman/views/auth/group.py index 12538ac3..8825e4f7 100644 --- a/brewman/views/auth/group.py +++ b/brewman/views/auth/group.py @@ -1,9 +1,10 @@ import uuid -import pkg_resources +import pkg_resources +import transaction from pyramid.response import Response, FileResponse from pyramid.view import view_config -import transaction + from brewman.models.auth import Group, Role @@ -11,38 +12,38 @@ from brewman.models.auth import Group, Role @view_config(request_method='GET', route_name='group_id', permission='Users') @view_config(request_method='GET', route_name='group', permission='Users') def html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) @view_config(request_method='POST', route_name='api_group', renderer='json', permission='Users', trans=True) def save(request): - group = Group(request.json_body['Name']) + group = Group(request.json_body['name']) request.dbsession.add(group) - add_permissions(group, request.json_body['Permissions'], request.dbsession) + add_permissions(group, request.json_body['permissions'], request.dbsession) transaction.commit() return group_info(group.id, request.dbsession) -@view_config(request_method='POST', route_name='api_group_id', renderer='json', permission='Users', trans=True) +@view_config(request_method='PUT', route_name='api_group_id', renderer='json', permission='Users', trans=True) def update(request): id = request.matchdict.get('id', None) group = request.dbsession.query(Group).filter(Group.id == uuid.UUID(id)).one() - group.name = request.json_body['Name'] - add_permissions(group, request.json_body['Permissions'], request.dbsession) + group.name = request.json_body['name'] + add_permissions(group, request.json_body['permissions'], request.dbsession) transaction.commit() return group_info(group.id, request.dbsession) def add_permissions(group, permissions, dbsession): for permission in permissions: - id = uuid.UUID(permission['PermissionID']) + id = uuid.UUID(permission['id']) gp = [p for p in group.roles if p.id == id] gp = None if len(gp) == 0 else gp[0] - if permission['Enabled'] and gp is None: + if permission['enabled'] and gp is None: group.roles.append(dbsession.query(Role).filter(Role.id == id).one()) - elif not permission['Enabled'] and gp: + elif not permission['enabled'] and gp: group.roles.remove(gp) @@ -69,28 +70,31 @@ def show_blank(request): return group_info(None, request.dbsession) -@view_config(request_method='GET', route_name='api_group', renderer='json', request_param='list', permission='Users') +@view_config(request_method='GET', route_name='api_group', renderer='json', request_param='l', permission='Users') def show_list(request): list = request.dbsession.query(Group).order_by(Group.name).all() groups = [] for item in list: - group = {'Name': item.name, 'Permissions': [], 'Url': request.route_url('group_id', id=item.id)} + group = {'id':item.id ,'name': item.name, 'permissions': []} for permission in sorted(item.roles, key=lambda p: p.name): - group['Permissions'].append(permission.name) + group['permissions'].append(permission.name) groups.append(group) return groups def group_info(id, dbsession): if id is None: - group = {'Name': '', 'Permissions': []} + group = {'name': '', 'permissions': []} for item in dbsession.query(Role).order_by(Role.name).all(): - group['Permissions'].append({'PermissionID': item.id, 'Name': item.name, 'Enabled': False}) + group['permissions'].append({'id': item.id, 'name': item.name, 'enabled': False}) else: group_object = dbsession.query(Group).filter(Group.id == id).one() - group = {'GroupID': group_object.id, 'Name': group_object.name, 'Permissions': []} + group = {'id': group_object.id, 'name': group_object.name, 'permissions': []} for item in dbsession.query(Role).order_by(Role.name).all(): - group['Permissions'].append( - {'PermissionID': item.id, 'Name': item.name, 'Enabled': True if item in group_object.roles else False}) + group['permissions'].append({ + 'id': item.id, + 'name': item.name, + 'enabled': True if item in group_object.roles else False + }) return group diff --git a/brewman/views/auth/user.py b/brewman/views/auth/user.py index 357fd5a0..2c3921d4 100644 --- a/brewman/views/auth/user.py +++ b/brewman/views/auth/user.py @@ -1,8 +1,8 @@ -import pkg_resources import re -import transaction import uuid +import pkg_resources +import transaction from pyramid.response import Response, FileResponse from pyramid.view import view_config @@ -22,7 +22,7 @@ class UserView(object): @view_config(request_method='GET', route_name='user_id', permission='Authenticated') @view_config(request_method='GET', route_name='user', permission='Users') def html(self): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=self.request) @@ -31,14 +31,14 @@ class UserView(object): return self.save_user() def save_user(self): - user = User(self.request.json_body['Name'], self.request.json_body['Password'], - self.request.json_body['LockedOut']) + user = User(self.request.json_body['name'], self.request.json_body['password'], + self.request.json_body['lockedOut']) self.request.dbsession.add(user) - self.add_groups(user, self.request.json_body['Groups']) + self.add_groups(user, self.request.json_body['groups']) transaction.commit() return self.user_info(user.id) - @view_config(request_method='POST', route_name='api_user_id', renderer='json', permission='Authenticated', + @view_config(request_method='PUT', route_name='api_user_id', renderer='json', permission='Authenticated', trans=True) def update(self): id = self.request.matchdict['id'] @@ -53,12 +53,12 @@ class UserView(object): if user is None: raise ValidationError('User name / id not found') if self.request.has_permission('Users'): - user.name = self.request.json_body['Name'] - user.locked_out = self.request.json_body['LockedOut'] - self.add_groups(user, self.request.json_body['Groups']) + user.name = self.request.json_body['name'] + user.locked_out = self.request.json_body['lockedOut'] + self.add_groups(user, self.request.json_body['groups']) - if self.request.json_body['Password'] != '' and self.request.json_body['Password'] != user.password: - user.password = self.request.json_body['Password'] + if self.request.json_body['password'] != '' and self.request.json_body['password'] != user.password: + user.password = self.request.json_body['password'] transaction.commit() return self.user_info(user.id) @@ -86,30 +86,27 @@ class UserView(object): def show_blank(self): return self.user_info(None) - @view_config(request_method='GET', route_name='api_user', renderer='json', request_param='list', permission='Users') + @view_config(request_method='GET', route_name='api_user', renderer='json', request_param='l', permission='Users') def show_list(self): list = self.request.dbsession.query(User).order_by(User.name).all() users = [] for item in list: - user = {'Name': item.name, 'LockedOut': item.locked_out, - 'Groups': [], 'Url': self.request.route_url('user_id', id=item.name)} - for group in item.groups: - user['Groups'].append(group.name) + user = {'name': item.name, 'lockedOut': item.locked_out, 'groups': [g.name for g in item.groups]} users.append(user) return users - @view_config(request_method='GET', route_name='api_user', renderer='json', request_param='names', + @view_config(request_method='GET', route_name='api_user', renderer='json', request_param='n', permission='Authenticated') def show_name(self): list = self.request.dbsession.query(User).filter(User.locked_out == False).order_by(User.name).all() - users = [{'Name': item.name} for item in list] + users = [{'name': item.name} for item in list] return users def user_info(self, id): if id is None: - account = {'Name': '', 'LockedOut': False, 'Groups': []} + account = {'name': '', 'lockedOut': False, 'groups': []} for item in self.request.dbsession.query(Group).order_by(Group.name).all(): - account['Groups'].append({'GroupID': item.id, 'Name': item.name, 'Enabled': False}) + account['groups'].append({'id': item.id, 'name': item.name, 'enabled': False}) return account if isinstance(id, uuid.UUID): @@ -118,12 +115,12 @@ class UserView(object): user = self.request.dbsession.query(User).filter(User.name.ilike(id)).first() if self.request.has_permission('Users'): - account = {'UserID': user.id, 'Name': user.name, 'Password': '', 'LockedOut': user.locked_out, 'Groups': []} + account = {'id': user.id, 'name': user.name, 'password': '', 'lockedOut': user.locked_out, 'groups': []} for item in self.request.dbsession.query(Group).order_by(Group.name).all(): - account['Groups'].append( - {'GroupID': item.id, 'Name': item.name, 'Enabled': True if item in user.groups else False}) + account['groups'].append( + {'id': item.id, 'name': item.name, 'enabled': True if item in user.groups else False}) elif self.user.id == user.id: - account = {'UserID': user.id, 'Name': user.name, 'Password': '', 'LockedOut': user.locked_out, 'Groups': []} + account = {'id': user.id, 'name': user.name, 'password': '', 'lockedOut': user.locked_out, 'groups': []} else: response = Response("User can only update his/her password") response.status_int = 500 @@ -132,11 +129,11 @@ class UserView(object): def add_groups(self, user, groups): for group in groups: - id = uuid.UUID(group['GroupID']) + id = uuid.UUID(group['id']) ug = [g for g in user.groups if g.id == id] ug = None if len(ug) == 0 else ug[0] - if group['Enabled'] and ug is None: + if group['enabled'] and ug is None: group_object = self.request.dbsession.query(Group).filter(Group.id == id).one() user.groups.append(group_object) - elif not group['Enabled'] and ug: + elif not group['enabled'] and ug: user.groups.remove(ug) diff --git a/brewman/views/cost_centre.py b/brewman/views/cost_centre.py index 1ce8adfe..011e92b2 100644 --- a/brewman/views/cost_centre.py +++ b/brewman/views/cost_centre.py @@ -13,7 +13,7 @@ from brewman.models.validation_exception import ValidationError @view_config(request_method='GET', route_name='cost_centre_id', permission='Cost Centres') @view_config(request_method='GET', route_name='cost_centre', permission='Cost Centres') def html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) @@ -21,19 +21,19 @@ def html(request): @view_config(request_method='POST', route_name='api_cost_centre', renderer='json', permission='Cost Centres', trans=True) def save(request): - item = CostCentre(request.json_body['Name']) + item = CostCentre(request.json_body['name']) request.dbsession.add(item) transaction.commit() return cost_centre_info(item.id, request.dbsession) -@view_config(request_method='POST', route_name='api_cost_centre_id', renderer='json', permission='Cost Centres', +@view_config(request_method='PUT', route_name='api_cost_centre_id', renderer='json', permission='Cost Centres', trans=True) def update(request): item = request.dbsession.query(CostCentre).filter(CostCentre.id == uuid.UUID(request.matchdict['id'])).first() if item.is_fixture: raise ValidationError("{0} is a fixture and cannot be edited or deleted.".format(item.name)) - item.name = request.json_body['Name'] + item.name = request.json_body['name'] transaction.commit() return cost_centre_info(item.id, request.dbsession) @@ -64,14 +64,13 @@ def show_blank(request): return cost_centre_info(None, request.dbsession) -@view_config(request_method='GET', route_name='api_cost_centre', request_param='list', renderer='json', +@view_config(request_method='GET', route_name='api_cost_centre', request_param='l', renderer='json', permission='Authenticated') def show_list(request): list = request.dbsession.query(CostCentre).order_by(CostCentre.name).all() cost_centres = [] for item in list: - cost_centres.append({'CostCentreID': item.id, 'Name': item.name, 'IsFixture': item.is_fixture, - 'Url': request.route_url('cost_centre_id', id=item.id)}) + cost_centres.append({'id': item.id, 'name': item.name, 'isFixture': item.is_fixture}) return cost_centres @@ -80,4 +79,4 @@ def cost_centre_info(id, dbsession): return {} else: cost_centre = dbsession.query(CostCentre).filter(CostCentre.id == id).first() - return {'CostCentreID': cost_centre.id, 'Name': cost_centre.name, 'IsFixture': cost_centre.is_fixture} + return {'id': cost_centre.id, 'name': cost_centre.name, 'isFixture': cost_centre.is_fixture} diff --git a/brewman/views/employee.py b/brewman/views/employee.py index 63416d1f..56fda25f 100644 --- a/brewman/views/employee.py +++ b/brewman/views/employee.py @@ -1,9 +1,9 @@ import datetime +import uuid +from decimal import Decimal + import pkg_resources import transaction -import uuid - -from decimal import Decimal from pyramid.response import Response, FileResponse from pyramid.view import view_config from sqlalchemy import desc @@ -20,45 +20,45 @@ from brewman.views import to_uuid @view_config(request_method='GET', route_name='employee', permission='Employees') @view_config(request_method='GET', route_name='employee_functions', permission='Employees') def html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) @view_config(request_method='POST', route_name='api_employee', renderer='json', permission='Employees', trans=True) def save(request): - name = request.json_body.get('Name', '').strip() + name = request.json_body.get('name', '').strip() if name == '': raise ValidationError('Name cannot be blank') - cost_centre_id = uuid.UUID(request.json_body['CostCentre']['CostCentreID']) - designation = request.json_body.get('Designation', '').strip() + cost_centre_id = uuid.UUID(request.json_body['costCentre']['id']) + designation = request.json_body.get('designation', '').strip() try: - salary = int(request.json_body['Salary']) + salary = int(request.json_body['salary']) if salary < 0: raise ValidationError("Salary must be an integer >= 0") except (ValueError, KeyError): raise ValidationError("Salary must be an integer >= 0") try: - service_points = round(Decimal(request.json_body['ServicePoints']), 2) + service_points = round(Decimal(request.json_body['points']), 2) if service_points < 0: - raise ValidationError("Service Points must be a decimal >= 0 and < 1000") + raise ValidationError("Points must be a decimal >= 0 and < 1000") except (ValueError, KeyError): - raise ValidationError("Service Points must be a decimal >= 0 and < 1000") + raise ValidationError("Points must be a decimal >= 0 and < 1000") try: - joining_date = datetime.datetime.strptime(request.json_body['JoiningDate'], '%d-%b-%Y') + joining_date = datetime.datetime.strptime(request.json_body['joiningDate'], '%d-%b-%Y') except (ValueError, KeyError, TypeError): raise ValidationError("Joining Date is not a valid date") - is_active = request.json_body['IsActive'] + is_active = request.json_body['isActive'] try: if is_active: leaving_date = None else: - leaving_date = datetime.datetime.strptime(request.json_body['LeavingDate'], '%d-%b-%Y') + leaving_date = datetime.datetime.strptime(request.json_body['leavingDate'], '%d-%b-%Y') if leaving_date < joining_date: raise ValidationError("Leaving Date cannot be less than Joining Date") except (ValueError, KeyError, TypeError): @@ -70,44 +70,44 @@ def save(request): return employee_info(item.id, request.dbsession) -@view_config(request_method='POST', route_name='api_employee_id', renderer='json', permission='Employees', trans=True) +@view_config(request_method='PUT', route_name='api_employee_id', renderer='json', permission='Employees', trans=True) def update(request): item = request.dbsession.query(Employee).filter(Employee.id == uuid.UUID(request.matchdict['id'])).first() if item.is_fixture: raise ValidationError("{0} is a fixture and cannot be edited or deleted.".format(item.name)) - item.name = request.json_body.get('Name', '').strip() + item.name = request.json_body.get('name', '').strip() if item.name == '': raise ValidationError('Name cannot be blank') - item.cost_centre_id = uuid.UUID(request.json_body['CostCentre']['CostCentreID']) - item.designation = request.json_body.get('Designation', '').strip() + item.cost_centre_id = uuid.UUID(request.json_body['costCentre']['id']) + item.designation = request.json_body.get('designation', '').strip() try: - item.salary = int(request.json_body['Salary']) + item.salary = int(request.json_body['salary']) if item.salary < 0: raise ValidationError("Salary must be an integer >= 0") except (ValueError, KeyError): raise ValidationError("Salary must be an integer >= 0") try: - item.service_points = round(Decimal(request.json_body['ServicePoints']), 2) + item.service_points = round(Decimal(request.json_body['points']), 2) if item.service_points < 0: - raise ValidationError("Service Points must be a decimal >= 0") + raise ValidationError("Points must be a decimal >= 0") except (ValueError, KeyError): - raise ValidationError("Service Points must be a decimal >= 0") + raise ValidationError("Points must be a decimal >= 0") try: - item.joining_date = datetime.datetime.strptime(request.json_body['JoiningDate'], '%d-%b-%Y') + item.joining_date = datetime.datetime.strptime(request.json_body['joiningDate'], '%d-%b-%Y') except (ValueError, KeyError, TypeError): raise ValidationError("Joining Date is not a valid date") - item.is_active = request.json_body['IsActive'] + item.is_active = request.json_body['isActive'] try: if item.is_active: item.leaving_date = None else: - item.leaving_date = datetime.datetime.strptime(request.json_body['LeavingDate'], '%d-%b-%Y') + item.leaving_date = datetime.datetime.strptime(request.json_body['leavingDate'], '%d-%b-%Y') if item.leaving_date < item.joining_date: raise ValidationError("Leaving Date cannot be less than Joining Date") except (ValueError, KeyError, TypeError): @@ -145,34 +145,34 @@ def show_blank(request): return employee_info(None, request.dbsession) -@view_config(request_method='GET', route_name='api_employee', request_param='list', renderer='json', +@view_config(request_method='GET', route_name='api_employee', request_param='l', renderer='json', permission='Authenticated') def show_list(request): list = request.dbsession.query(Employee).order_by(desc(Employee.is_active)).order_by( Ledger.cost_centre_id).order_by(Employee.designation).order_by(Employee.name).all() ledgers = [] for item in list: - ledgers.append( - {'Code': item.code, 'Name': item.name, 'Designation': item.designation, 'Salary': item.salary, - 'ServicePoints': item.service_points, 'IsActive': item.is_active, - 'CostCentre': item.cost_centre.name, 'Url': request.route_url('employee_id', id=item.id), - 'JoiningDate': item.joining_date.strftime('%d-%b-%Y'), - 'LeavingDate': '' if item.is_active else item.leaving_date.strftime('%d-%b-%Y')}) + ledgers.append({ + 'id': item.id, 'code': item.code, 'name': item.name, 'designation': item.designation, 'salary': item.salary, + 'points': item.service_points, 'isActive': item.is_active, 'costCentre': item.cost_centre.name, + 'url': request.route_url('employee_id', id=item.id), 'joiningDate': item.joining_date.strftime('%d-%b-%Y'), + 'leavingDate': '' if item.is_active else item.leaving_date.strftime('%d-%b-%Y') + }) return ledgers -@view_config(request_method='GET', route_name='api_employee', renderer='json', request_param='term', +@view_config(request_method='GET', route_name='api_employee', renderer='json', request_param='q', permission='Authenticated') def show_term(request): - filter = request.GET.get('term', None) + filter = request.GET.get('q', None) filter = None if filter == '' else filter - count = request.GET.get('count', None) + count = request.GET.get('c', None) count = None if count is None or count == '' else int(count) list = [] for index, item in enumerate(LedgerBase.list(10, filter, dbsession=request.dbsession)): - list.append({'LedgerID': item.id, 'Name': item.name, 'Designation': item.designation, - 'CostCentre': {'CostCentreID': item.cost_centre.id, 'Name': item.cost_centre.name}}) + list.append({'id': item.id, 'name': item.name, 'designation': item.designation, + 'costCentre': {'id': item.cost_centre.id, 'name': item.cost_centre.name}}) if count is not None and index == count - 1: break return list @@ -180,16 +180,16 @@ def show_term(request): def employee_info(id, dbsession): if id is None: - employee = {'Code': '(Auto)', 'IsActive': True, 'CostCentre': CostCentre.overall()} + employee = {'code': '(Auto)', 'isActive': True, 'costCentre': CostCentre.overall()} else: employee = dbsession.query(Employee).filter(Employee.id == id).first() if employee is None: raise ValidationError("Invalid Employee") - employee = {'LedgerID': employee.id, 'Code': employee.code, 'Name': employee.name, - 'IsActive': employee.is_active, 'Designation': employee.designation, 'Salary': employee.salary, - 'ServicePoints': employee.service_points, 'JoiningDate': employee.joining_date.strftime('%d-%b-%Y'), - 'LeavingDate': None if employee.is_active else employee.leaving_date.strftime('%d-%b-%Y'), - 'CostCentre': {'CostCentreID': employee.cost_centre_id, 'Name': employee.cost_centre.name}} + employee = {'id': employee.id, 'code': employee.code, 'name': employee.name, 'isActive': employee.is_active, + 'designation': employee.designation, 'salary': employee.salary, 'points': employee.service_points, + 'joiningDate': employee.joining_date.strftime('%d-%b-%Y'), + 'leavingDate': None if employee.is_active else employee.leaving_date.strftime('%d-%b-%Y'), + 'costCentre': {'id': employee.cost_centre_id, 'name': employee.cost_centre.name}} return employee diff --git a/brewman/views/fingerprint.py b/brewman/views/fingerprint.py index 69c6abf2..21518a24 100644 --- a/brewman/views/fingerprint.py +++ b/brewman/views/fingerprint.py @@ -1,8 +1,14 @@ import csv import datetime +import uuid from io import StringIO -from pyramid.view import view_config + import transaction +from pyramid.view import view_config +from sqlalchemy import bindparam, select, exists, and_ +from sqlalchemy.dialects.postgresql import insert as pg_insert +from zope.sqlalchemy import mark_changed + from brewman.models.master import Employee from brewman.models.voucher import Fingerprint @@ -10,13 +16,41 @@ from brewman.models.voucher import Fingerprint @view_config(request_method='POST', route_name='api_fingerprint', renderer='json', permission='Authenticated', trans=True) def show_list(request): - filename = request.POST['uploadedFile'].filename - input_file = request.POST['uploadedFile'].file - reader = csv.reader(read_file(input_file), delimiter="\t") - for row in reader: - add_fingerprint(row, request.dbsession) + fingerprints_file = request.POST['uploadedFile'].file + employees = {} + for id, code in request.dbsession.query(Employee.id, Employee.code).all(): + employees[code] = id + data = fp(csv.reader(read_file(fingerprints_file), delimiter="\t"), employees) + paged_data = [data[i:i + 100] for i in range(0, len(data), 100)] + for i, page in enumerate(paged_data): + print('Processing page ', i, ' of ', len(paged_data)) + request.dbsession.execute(get_query(9.4), page) + + mark_changed(request.dbsession) transaction.commit() - return filename + return {} + + +def get_query(version): + if version == 9.5: + return pg_insert(Fingerprint).values( + { + 'FingerprintID': bindparam('id'), + 'EmployeeID': bindparam('employee_id'), + 'Date': bindparam('date') + } + + ).on_conflict_do_nothing() + else: + sel = select([bindparam('id'), bindparam('employee_id'), bindparam('date')]).where( + ~exists([Fingerprint.id]).where( + and_( + Fingerprint.employee_id == bindparam('employee_id'), Fingerprint.date == bindparam('date') + ) + ) + ) + return Fingerprint.__table__.insert().from_select([Fingerprint.id, Fingerprint.employee_id, Fingerprint.date], + sel) def read_file(input_file): @@ -30,19 +64,32 @@ def read_file(input_file): return StringIO(output) -def add_fingerprint(row, dbsession): - try: - employee_code = int(row[2]) - date = datetime.datetime.strptime(row[6], '%Y/%m/%d %H:%M:%S') - except ValueError: - return - employee = dbsession.query(Employee).filter(Employee.code == employee_code).first() - if employee is not None: - fp = Fingerprint(employee_id=employee.id, date=date) - old = dbsession.query(Fingerprint).filter(Fingerprint.date == date) \ - .filter(Fingerprint.employee_id == employee.id).first() - if old is None: - dbsession.add(fp) +def fp(reader, employees): + fingerprints = [] + for row in reader: + try: + employee_code = int(row[2]) + date = datetime.datetime.strptime(row[6], '%Y/%m/%d %H:%M:%S') + if employee_code in employees.keys(): + fingerprints.append({ + 'id': uuid.uuid4(), + 'employee_id': employees[employee_code], + 'date': date + }) + except ValueError: + continue + return fingerprints + + +# # Upsert using subquery +# sel = select([literal(uuid.uuid4()), literal(employee_id), literal(date)]).where( +# ~exists([Fingerprint.id]).where( +# and_( +# Fingerprint.employee_id == employee_id, Fingerprint.date == date +# ) +# ) +# ) +# return Fingerprint.__table__.insert().from_select([Fingerprint.id, Fingerprint.employee_id, Fingerprint.date], sel) def get_prints(employee_id, date, dbsession): diff --git a/brewman/views/product.py b/brewman/views/product.py index 0154d009..ad546469 100644 --- a/brewman/views/product.py +++ b/brewman/views/product.py @@ -1,8 +1,8 @@ +import uuid +from decimal import Decimal, InvalidOperation + import pkg_resources import transaction -import uuid - -from decimal import Decimal, InvalidOperation from pyramid.response import Response, FileResponse from pyramid.view import view_config from sqlalchemy import desc @@ -17,7 +17,7 @@ from brewman.models.voucher import Voucher, Batch, Inventory, VoucherType @view_config(request_method='GET', route_name='product_id', permission='Products') @view_config(request_method='GET', route_name='product', permission='Products') def html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) @@ -26,93 +26,93 @@ def html(request): def save(request): json = request.json_body - name = json.get('Name', '').strip() + name = json.get('name', '').strip() if name == '': raise ValidationError('Name cannot be blank') - units = json.get('Units', '').strip() + units = json.get('units', '').strip() try: - fraction = Decimal(json.get('Fraction', 0)) + fraction = Decimal(json.get('fraction', 0)) if fraction <= 0: raise ValidationError("Fraction must be a decimal > 0") except (ValueError, InvalidOperation): raise ValidationError("Fraction must be a decimal > 0") - fraction_units = json.get('FractionUnits', '').strip() + fraction_units = json.get('fractionUnits', '').strip() try: - product_yield = Decimal(json.get('ProductYield', 1)) + product_yield = Decimal(json.get('productYield', 1)) if product_yield <= 0 or product_yield > 1: raise ValidationError("Yield must be a decimal > 0 <= 1") except (ValueError, InvalidOperation): raise ValidationError("Yield must be a decimal > 0 <= 1") - product_group = json.get('ProductGroup', None) + product_group = json.get('productGroup', None) if product_group is None: - raise ValidationError('Please choose a product group') - product_group_id = uuid.UUID(product_group['ProductGroupID']) + raise ValidationError('please choose a product group') + product_group_id = uuid.UUID(product_group['id']) try: - price = Decimal(json.get('Price', 0)) + price = Decimal(json.get('price', 0)) if price < 0: raise ValidationError("Price must be a decimal >= 0") except (ValueError, InvalidOperation): raise ValidationError("Price must be a decimal >= 0") try: - sale_price = Decimal(json.get('SalePrice', 0)) + sale_price = Decimal(json.get('salePrice', 0)) if price < 0: raise ValidationError("Sale Price must be a decimal >= 0") except (ValueError, InvalidOperation): raise ValidationError("Price must be a decimal >= 0") - is_active = json.get('IsActive', True) - is_purchased = json.get('IsPurchased', True) - is_sold = json.get('IsSold', True) + is_active = json.get('isActive', True) + is_purchased = json.get('isPurchased', True) + is_sold = json.get('isSold', True) item = Product(0, name, units, fraction, fraction_units, product_yield, product_group_id, Ledger.all_purchases(), price, sale_price, is_active, is_purchased, is_sold).create(request.dbsession) transaction.commit() return product_info(item.id, request.dbsession) -@view_config(request_method='POST', route_name='api_product_id', renderer='json', permission='Products', trans=True) +@view_config(request_method='PUT', route_name='api_product_id', renderer='json', permission='Products', trans=True) def update(request): item = request.dbsession.query(Product).filter(Product.id == uuid.UUID(request.matchdict['id'])).first() if item.is_fixture: raise ValidationError("{0} is a fixture and cannot be edited or deleted.".format(item.full_name)) - item.name = request.json_body['Name'].strip() - item.units = request.json_body['Units'].strip() + item.name = request.json_body['name'].strip() + item.units = request.json_body['units'].strip() try: - item.fraction = Decimal(request.json_body['Fraction']) + item.fraction = Decimal(request.json_body['fraction']) if item.fraction <= 0: raise ValidationError("Fraction must be a decimal > 0") except (ValueError, InvalidOperation): raise ValidationError("Fraction must be a decimal > 0") - item.fraction_units = request.json_body['FractionUnits'] + item.fraction_units = request.json_body['fractionUnits'] try: - item.product_yield = Decimal(request.json_body['ProductYield']) + item.product_yield = Decimal(request.json_body['productYield']) if item.product_yield <= 0 or item.product_yield > 1: raise ValidationError("Yield must be a decimal > 0 <= 1") except (ValueError, InvalidOperation): raise ValidationError("Yield must be a decimal > 0 <= 1") - item.product_group_id = uuid.UUID(request.json_body['ProductGroup']['ProductGroupID']) + item.product_group_id = uuid.UUID(request.json_body['productGroup']['id']) item.ledger_id = Ledger.all_purchases() try: - item.price = Decimal(request.json_body['Price']) + item.price = Decimal(request.json_body['price']) if item.price < 0: raise ValidationError("Price must be a decimal >= 0") except (ValueError, InvalidOperation): raise ValidationError("Price must be a decimal >= 0") try: - item.sale_price = Decimal(request.json_body['SalePrice']) + item.sale_price = Decimal(request.json_body['salePrice']) if item.sale_price < 0: raise ValidationError("Sale Price must be a decimal >= 0") except (ValueError, InvalidOperation): raise ValidationError("Sale Price must be a decimal >= 0") - item.is_active = request.json_body['IsActive'] - item.is_fixture = request.json_body['IsFixture'] - item.is_purchased = request.json_body['IsPurchased'] - item.is_sold = request.json_body['IsSold'] + item.is_active = request.json_body['isActive'] + item.is_fixture = request.json_body['isFixture'] + item.is_purchased = request.json_body['isPurchased'] + item.is_sold = request.json_body['isSold'] transaction.commit() return product_info(item.id, request.dbsession) @@ -143,29 +143,30 @@ def show_blank(request): return product_info(None, request.dbsession) -@view_config(request_method='GET', route_name='api_product', request_param='list', renderer='json', +@view_config(request_method='GET', route_name='api_product', request_param='l', renderer='json', permission='Authenticated') def show_list(request): list = request.dbsession.query(Product).order_by(desc(Product.is_active)).order_by( Product.product_group_id).order_by(Product.name).all() products = [] for item in list: - products.append({'Code': item.code, 'Name': item.name, 'Units': item.units, 'CostPrice': item.price, - 'SalePrice': item.sale_price, 'ProductGroup': item.product_group.name, - 'IsActive': item.is_active, 'Fraction': item.fraction, 'FractionUnits': item.fraction_units, - 'IsPurchased': item.is_purchased, 'IsSold': item.is_sold, 'ProductYield': item.product_yield, - 'IsFixture': item.is_fixture, 'Url': request.route_url('product_id', id=item.id)}) + products.append({ + 'id': item.id, 'code': item.code, 'name': item.name, 'units': item.units, 'costPrice': item.price, + 'salePrice': item.sale_price, 'productGroup': item.product_group.name, + 'isActive': item.is_active, 'fraction': item.fraction, 'fractionUnits': item.fraction_units, + 'isPurchased': item.is_purchased, 'isSold': item.is_sold, 'productYield': item.product_yield, + 'isFixture': item.is_fixture}) return products -@view_config(request_method='GET', route_name='api_product', renderer='json', request_param='term', +@view_config(request_method='GET', route_name='api_product', renderer='json', request_param='t', permission='Authenticated') def show_term(request): - term = request.GET.get('term', None) + term = request.GET.get('t', None) term = term.strip() if term is not None and term.strip() is not '' else None active = request.GET.get('a', None) active = active if active is not None else None - count = request.GET.get('count', None) + count = request.GET.get('c', None) count = None if count is None or count == '' else int(count) is_purchased = request.GET.get('p', None) is_purchased = is_purchased if is_purchased is not None else None @@ -175,11 +176,11 @@ def show_term(request): local_results = [] for index, item in enumerate(query): if extended: - product = {'ProductID': item.id, 'Name': item.full_name, 'Price': item.price, 'Units': item.units, - 'Fraction': item.fraction, 'FractionUnits': item.fraction_units, - 'ProductYield': item.product_yield, 'IsSold': item.is_sold, 'SalePrice': item.sale_price} + product = {'id': item.id, 'name': item.full_name, 'price': item.price, 'units': item.units, + 'fraction': item.fraction, 'fractionUnits': item.fraction_units, + 'productYield': item.product_yield, 'isSold': item.is_sold, 'salePrice': item.sale_price} else: - product = {'ProductID': item.id, 'Name': item.full_name, 'Price': item.price} + product = {'id': item.id, 'name': item.full_name, 'price': item.price} local_results.append(product) if count is not None and index == count - 1: break @@ -192,26 +193,27 @@ def show_term(request): query = query.filter(Product.is_active == active) if is_purchased is not None: query = query.filter(Product.is_purchased == is_purchased) - for item in term.split(): - if item.strip() != '': - query = query.filter(Product.name.ilike('%' + item + '%')) + if term is not None: + for item in term.split(): + if item.strip() != '': + query = query.filter(Product.name.ilike('%' + item + '%')) result_list += add_list(query) - return sorted(result_list, key=lambda k: k['Name']) + return sorted(result_list, key=lambda k: k['name']) def product_info(id, dbsession): if id is None: - product = {'Code': '(Auto)', 'IsActive': True, 'IsPurchased': True, 'IsSold': False} + product = {'code': '(Auto)', 'isActive': True, 'isPurchased': True, 'isSold': False} else: product = dbsession.query(Product).filter(Product.id == id).first() - product = {'ProductID': product.id, 'Code': product.code, 'Name': product.name, 'Units': product.units, - 'Fraction': product.fraction, 'FractionUnits': product.fraction_units, - 'ProductYield': product.product_yield, 'Price': product.price, 'SalePrice': product.sale_price, - 'IsActive': product.is_active, 'IsFixture': product.is_fixture, - 'IsPurchased': product.is_purchased, 'IsSold': product.is_sold, - 'ProductGroup': {'ProductGroupID': product.product_group_id}, - 'Ledger': {'LedgerID': product.ledger_id}} + product = {'id': product.id, 'code': product.code, 'name': product.name, 'units': product.units, + 'fraction': product.fraction, 'fractionUnits': product.fraction_units, + 'productYield': product.product_yield, 'price': product.price, 'salePrice': product.sale_price, + 'isActive': product.is_active, 'isFixture': product.is_fixture, + 'isPurchased': product.is_purchased, 'isSold': product.is_sold, + 'productGroup': {'id': product.product_group_id}, + 'account': {'id': product.ledger_id}} return product diff --git a/brewman/views/product_group.py b/brewman/views/product_group.py index 10349e94..20226eaf 100644 --- a/brewman/views/product_group.py +++ b/brewman/views/product_group.py @@ -13,7 +13,7 @@ from brewman.models.validation_exception import ValidationError @view_config(request_method='GET', route_name='product_group_id', permission='Product Groups') @view_config(request_method='GET', route_name='product_group', permission='Product Groups') def html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) @@ -21,19 +21,19 @@ def html(request): @view_config(request_method='POST', route_name='api_product_group', renderer='json', permission='Product Groups', trans=True) def save(request): - item = ProductGroup(request.json_body['Name']) + item = ProductGroup(request.json_body['name']) request.dbsession.add(item) transaction.commit() return product_group_info(item.id, request.dbsession) -@view_config(request_method='POST', route_name='api_product_group_id', renderer='json', permission='Product Groups', +@view_config(request_method='PUT', route_name='api_product_group_id', renderer='json', permission='Product Groups', trans=True) def update(request): item = request.dbsession.query(ProductGroup).filter(ProductGroup.id == uuid.UUID(request.matchdict['id'])).first() if item.is_fixture: raise ValidationError("{0} is a fixture and cannot be edited or deleted.".format(item.name)) - item.name = request.json_body['Name'] + item.name = request.json_body['name'] transaction.commit() return product_group_info(item.id, request.dbsession) @@ -64,14 +64,13 @@ def show_blank(request): return product_group_info(None, request.dbsession) -@view_config(request_method='GET', route_name='api_product_group', request_param='list', renderer='json', +@view_config(request_method='GET', route_name='api_product_group', request_param='l', renderer='json', permission='Authenticated') def show_list(request): list = request.dbsession.query(ProductGroup).order_by(ProductGroup.name).all() product_groups = [] for item in list: - product_groups.append({'ProductGroupID': item.id, 'Name': item.name, 'IsFixture': item.is_fixture, - 'Url': request.route_url('product_group_id', id=item.id)}) + product_groups.append({'id': item.id, 'name': item.name, 'isFixture': item.is_fixture}) return product_groups @@ -80,4 +79,4 @@ def product_group_info(id, dbsession): return {} else: product_group = dbsession.query(ProductGroup).filter(ProductGroup.id == id).first() - return {'ProductGroupID': product_group.id, 'Name': product_group.name, 'IsFixture': product_group.is_fixture} + return {'id': product_group.id, 'name': product_group.name, 'isFixture': product_group.is_fixture} diff --git a/brewman/views/recipe.py b/brewman/views/recipe.py index 29b2e56f..91f5034c 100644 --- a/brewman/views/recipe.py +++ b/brewman/views/recipe.py @@ -20,7 +20,7 @@ from brewman.views.services.session import session_period_start, session_period_ @view_config(request_method='GET', route_name='recipe_id', permission='Recipes') @view_config(request_method='GET', route_name='recipe', permission='Recipes') def html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) diff --git a/brewman/views/reports/balance_sheet.py b/brewman/views/reports/balance_sheet.py index 4189b0c2..f821f407 100644 --- a/brewman/views/reports/balance_sheet.py +++ b/brewman/views/reports/balance_sheet.py @@ -16,21 +16,21 @@ from brewman.views.services.session import session_period_finish @view_config(request_method='GET', route_name='balance_sheet', permission='Balance Sheet') @view_config(request_method='GET', route_name='balance_sheet_date', permission='Balance Sheet') def html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) @view_config(request_method='GET', route_name='api_balance_sheet', renderer='json', permission='Balance Sheet') def report_blank(request): - return {'Date': session_period_finish(request), 'Body': [], 'Footer': []} + return {'date': session_period_finish(request), 'body': [], 'footer': []} @view_config(request_method='GET', route_name='api_balance_sheet_date', renderer='json', permission='Balance Sheet') def report_data(request): date = request.matchdict.get('date', None) body, footer = build_balance_sheet(date, request.dbsession) - return {'Date': date, 'Body': body, 'Footer': footer} + return {'date': date, 'body': body, 'footer': footer} def build_balance_sheet(finish_date, dbsession): @@ -43,16 +43,16 @@ def build_balance_sheet(finish_date, dbsession): closing_stock = get_closing_stock(finish_date, dbsession) net_profit = get_accumulated_profit(finish_date, dbsession) - closing_stock total_amount = net_profit - report.append({'Name': 'Net Loss' if net_profit >= 0 else 'Net Profit', 'SubAmount': net_profit, 'Order': 79}) + report.append({'name': 'Net Loss' if net_profit >= 0 else 'Net Profit', 'subAmount': net_profit, 'order': 79}) capital_group = LedgerType.by_id(5) - groups[capital_group.id] = {'Group': capital_group.name, 'Amount': total_amount, 'Order': capital_group.order} + groups[capital_group.id] = {'group': capital_group.name, 'amount': total_amount, 'order': capital_group.order} total_amount += closing_stock - report.append({'Name': 'Closing Stock', 'SubAmount': closing_stock, 'Order': 20.001}) + report.append({'name': 'Closing Stock', 'subAmount': closing_stock, 'order': 20.001}) asset_group = LedgerType.by_id(4) - groups[asset_group.id] = {'Group': asset_group.name, 'Amount': closing_stock, 'Order': asset_group.order} + groups[asset_group.id] = {'group': asset_group.name, 'amount': closing_stock, 'order': asset_group.order} amount_sum = func.sum(Journal.amount * Journal.debit) query = dbsession.query(LedgerBase, amount_sum) \ @@ -72,15 +72,15 @@ def build_balance_sheet(finish_date, dbsession): if amount != 0: counter += .001 report.append( - {'Name': ledger.name, 'SubAmount': amount, 'Order': ledger_type.order + counter}) + {'name': ledger.name, 'subAmount': amount, 'order': ledger_type.order + counter}) if ledger_type.id in groups: - groups[ledger_type.id]['Amount'] += amount + groups[ledger_type.id]['amount'] += amount else: - groups[ledger_type.id] = {'Group': ledger_type.name, 'Amount': amount, 'Order': ledger_type.order} + groups[ledger_type.id] = {'group': ledger_type.name, 'amount': amount, 'order': ledger_type.order} # Add Subtotals for item in groups.values(): report.append(item) - footer = [{'Name': 'Total', 'Amount': total_amount, 'Order': 100}] - return sorted(report, key=lambda d: d['Order']), footer + footer = {'name': 'Total', 'amount': total_amount, 'order': 100} + return sorted(report, key=lambda d: d['order']), footer diff --git a/brewman/views/reports/cash_flow.py b/brewman/views/reports/cash_flow.py index febe7167..d19a37ac 100644 --- a/brewman/views/reports/cash_flow.py +++ b/brewman/views/reports/cash_flow.py @@ -14,32 +14,32 @@ from brewman.views.services.session import session_period_start, session_period_ @view_config(request_method='GET', route_name='cash_flow', permission='Cash Flow') @view_config(request_method='GET', route_name='cash_flow_id', permission='Cash Flow') def get_html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) @view_config(request_method='GET', route_name='api_cash_flow', renderer='json', permission='Cash Flow') def get_cash_flow(request): - start_date = request.GET.get('StartDate', None) - finish_date = request.GET.get('FinishDate', None) + start_date = request.GET.get('s', None) + finish_date = request.GET.get('f', None) if start_date and finish_date: return build_report(request, start_date, finish_date) else: - return {'StartDate': session_period_start(request), - 'FinishDate': session_period_finish(request), 'Body': [], 'Footer': {}} + return {'startDate': session_period_start(request), + 'finishDate': session_period_finish(request), 'body': [], 'footer': {}} @view_config(request_method='GET', route_name='api_cash_flow_id', renderer='json', permission='Cash Flow') def get_cash_flow_id(request): id = request.matchdict.get('id', None) - start_date = request.GET.get('StartDate', None) - finish_date = request.GET.get('FinishDate', None) + start_date = request.GET.get('s', None) + finish_date = request.GET.get('f', None) return build_report_id(request, int(id), start_date, finish_date) def build_report(request, start_date, finish_date): - report = {'StartDate': start_date, 'FinishDate': finish_date} + report = {'startDate': start_date, 'finishDate': finish_date} sub_voucher = aliased(Voucher) sub_journal = aliased(Journal) sub_ledger = aliased(LedgerBase) @@ -68,22 +68,22 @@ def build_report(request, start_date, finish_date): ).all() total_amount = 0 - cf = {'Operating': [], 'Investing': [], 'Financing': []} + cf = {'operating': [], 'investing': [], 'financing': []} for ledgerType, amount in query: lt = LedgerType.by_id(ledgerType) total_amount += (amount * -1) - cf[lt.cash_flow_classification].append( + cf[lt.cash_flow_classification.lower()].append( { - 'Name': lt.name, - 'Url': request.route_url( + 'name': lt.name, + 'url': request.route_url( 'cash_flow_id', id=str(lt.id), - _query={'StartDate': start_date, 'FinishDate': finish_date} + _query={'startDate': start_date, 'finishDate': finish_date} ), - 'Amount': amount * -1 + 'amount': amount * -1 } ) - report['Body'] = cf + report['body'] = cf opening = request.dbsession.query( func.sum(Journal.amount * Journal.debit) @@ -105,14 +105,14 @@ def build_report(request, start_date, finish_date): LedgerBase.type == LedgerType.by_name('Cash').id ).scalar() - report['Footer'] = [{'Name': 'Net increase in cash and cash equivalents', 'Amount': total_amount}, - {'Name': 'Cash and cash equivalents at beginning of period', 'Amount': opening}, - {'Name': 'Cash and cash equivalents at end of period', 'Amount': closing}] + report['Footer'] = [{'name': 'Net increase in cash and cash equivalents', 'amount': total_amount}, + {'name': 'Cash and cash equivalents at beginning of period', 'amount': opening}, + {'name': 'Cash and cash equivalents at end of period', 'amount': closing}] return report def build_report_id(request, ledger_type, start_date, finish_date): - report = {'StartDate': start_date, 'FinishDate': finish_date, 'Body': {'Details': []}} + report = {'startDate': start_date, 'finishDate': finish_date, 'body': {'details': []}} sub_voucher = aliased(Voucher) sub_journal = aliased(Journal) sub_ledger = aliased(LedgerBase) @@ -142,16 +142,16 @@ def build_report_id(request, ledger_type, start_date, finish_date): total_amount = 0 for ledger, amount in query: total_amount += (amount * -1) - report['Body']['Details'].append( + report['body']['details'].append( { - 'Name': ledger.name, - 'Url': request.route_url( + 'name': ledger.name, + 'url': request.route_url( 'ledger_id', id=ledger.id, - _query={'StartDate': start_date, 'FinishDate': finish_date} + _query={'startDate': start_date, 'finishDate': finish_date} ), - 'Amount': amount * -1 + 'amount': amount * -1 } ) - report['Footer'] = [{'Name': 'Total', 'Amount': total_amount}] + report['footer'] = [{'name': 'total', 'amount': total_amount}] return report diff --git a/brewman/views/reports/closing_stock.py b/brewman/views/reports/closing_stock.py index ce9677d8..7d894f0f 100644 --- a/brewman/views/reports/closing_stock.py +++ b/brewman/views/reports/closing_stock.py @@ -1,12 +1,11 @@ import datetime + import pkg_resources from pyramid.response import FileResponse +from pyramid.view import view_config from sqlalchemy.sql.expression import func -from pyramid.view import view_config - from brewman.models.master import Product, CostCentre - from brewman.models.voucher import Voucher, Journal, Inventory from brewman.views.services.session import session_period_finish @@ -14,20 +13,20 @@ from brewman.views.services.session import session_period_finish @view_config(request_method='GET', route_name='closing_stock', permission='Closing Stock') @view_config(request_method='GET', route_name='closing_stock_date', permission='Closing Stock') def html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) @view_config(request_method='GET', route_name='api_closing_stock', renderer='json', permission='Closing Stock') def report_blank(request): - return {'Date': session_period_finish(request), 'Body': []} + return {'date': session_period_finish(request), 'body': []} @view_config(request_method='GET', route_name='api_closing_stock_date', renderer='json', permission='Closing Stock') def report_data(request): date = request.matchdict.get('date', None) - return {'Date': date, 'Body': build_report(date, request.dbsession)} + return {'date': date, 'body': build_report(date, request.dbsession)} def build_report(date, dbsession): @@ -44,8 +43,8 @@ def build_report(date, dbsession): body = [] for product, quantity, amount in query: if quantity != 0 and amount != 0: - body.append({'Product': product.full_name, 'Group': product.product_group.name, - 'Quantity': quantity, 'Amount': amount}) + body.append({'product': product.full_name, 'group': product.product_group.name, + 'quantity': quantity, 'amount': amount}) return body diff --git a/brewman/views/reports/daybook.py b/brewman/views/reports/daybook.py index 351bafcb..da56007b 100644 --- a/brewman/views/reports/daybook.py +++ b/brewman/views/reports/daybook.py @@ -1,9 +1,9 @@ import datetime + import pkg_resources from pyramid.response import FileResponse -from sqlalchemy.orm import joinedload_all - from pyramid.view import view_config +from sqlalchemy.orm import joinedload_all from brewman.models.voucher import Voucher, Journal, VoucherType from brewman.views.services.session import session_period_finish, session_period_start @@ -12,24 +12,24 @@ from brewman.views.services.voucher import get_edit_url @view_config(request_method='GET', route_name='daybook', permission='Daybook') def daybook_get(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) @view_config(request_method='GET', route_name='api_daybook', renderer='json', permission='Daybook') def daybook_report(request): - start_date = request.GET.get('StartDate', None) - finish_date = request.GET.get('FinishDate', None) + start_date = request.GET.get('s', None) + finish_date = request.GET.get('f', None) if start_date and finish_date: return build_report(request, start_date, finish_date) else: - return {'StartDate': session_period_start(request), - 'FinishDate': session_period_finish(request), 'Body': []} + return {'startDate': session_period_start(request), + 'finishDate': session_period_finish(request), 'body': []} def build_report(request, start_date, finish_date): - report = {'StartDate': start_date, 'FinishDate': finish_date, 'Body': []} + report = {'startDate': start_date, 'finishDate': finish_date, 'body': []} query = request.dbsession.query(Voucher).options(joinedload_all(Voucher.journals, Journal.ledger, innerjoin=True)) \ .filter(Voucher.date >= datetime.datetime.strptime(start_date, '%d-%b-%Y')) \ @@ -52,8 +52,11 @@ def build_report(request, start_date, finish_date): name_debit = name_debit[:-3] name_credit = name_credit[:-3] - report['Body'].append({'Date': voucher.date.strftime('%d-%b-%Y'), 'Url': get_edit_url(request, voucher), - 'Type': VoucherType.by_id(voucher.type).name, - 'Narration': voucher.narration, 'Posted': voucher.posted, - 'DebitN': name_debit, 'DebitA': debit, 'CreditN': name_credit, 'CreditA': credit}) + report['body'].append({ + 'id': voucher.id, 'date': voucher.date.strftime('%d-%b-%Y'), 'url': get_edit_url(request, voucher), + 'type': VoucherType.by_id(voucher.type).name, + 'narration': voucher.narration, 'posted': voucher.posted, + 'debitText': name_debit, 'debitAmount': debit, + 'creditText': name_credit, 'creditAmount': credit + }) return report diff --git a/brewman/views/reports/ledger.py b/brewman/views/reports/ledger.py index 7dc7cf4b..e8417565 100644 --- a/brewman/views/reports/ledger.py +++ b/brewman/views/reports/ledger.py @@ -16,38 +16,38 @@ from brewman.views.services.voucher import get_edit_url @view_config(request_method='GET', route_name='ledger_id', permission='Ledger') @view_config(request_method='GET', route_name='ledger', permission='Ledger') def html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) @view_config(request_method='GET', route_name='api_ledger', renderer='json', permission='Ledger') def show_blank(request): - return {'StartDate': session_period_start(request), - 'FinishDate': session_period_finish(request), 'Ledger': None, 'Body': []} + return {'startDate': session_period_start(request), + 'finishDate': session_period_finish(request), 'account': None, 'body': []} @view_config(request_method='GET', route_name='api_ledger_id', renderer='json', permission='Ledger', trans=True) def show_data(request): ledger = request.dbsession.query(LedgerBase).filter(LedgerBase.id == uuid.UUID(request.matchdict['id'])).first() - start_date = request.GET.get('StartDate', session_period_start(request)) - finish_date = request.GET.get('FinishDate', session_period_finish(request)) - info = {'StartDate': start_date, 'FinishDate': finish_date, - 'Ledger': {'LedgerID': ledger.id, 'Name': ledger.name}, - 'Body': []} + start_date = request.GET.get('s', session_period_start(request)) + finish_date = request.GET.get('f', session_period_finish(request)) + info = {'startDate': start_date, 'finishDate': finish_date, + 'account': {'id': ledger.id, 'name': ledger.name}, + 'body': []} build_report(request, info) return info def build_report(request, info): - ledger_id = info['Ledger']['LedgerID'] - start_date = info['StartDate'] - finish_date = info['FinishDate'] - opening = opening_balance(ledger_id, start_date, request.dbsession) - info['Body'].append(opening) + account_id = info['account']['id'] + start_date = info['startDate'] + finish_date = info['finishDate'] + opening = opening_balance(account_id, start_date, request.dbsession) + info['body'].append(opening) query = request.dbsession.query(Voucher).options(joinedload_all(Voucher.journals, Journal.ledger, innerjoin=True)) \ - .filter(Voucher.journals.any(Journal.ledger_id == ledger_id)) \ + .filter(Voucher.journals.any(Journal.ledger_id == account_id)) \ .filter(Voucher.date >= datetime.datetime.strptime(start_date, '%d-%b-%Y')) \ .filter(Voucher.date <= datetime.datetime.strptime(finish_date, '%d-%b-%Y')) \ .filter(Voucher.type != VoucherType.by_name('Issue').id) \ @@ -59,7 +59,7 @@ def build_report(request, info): journal_debit = 0 name = "" for journal in voucher.journals: - if journal.ledger_id == ledger_id: + if journal.ledger_id == account_id: journal_debit = journal.debit if journal.debit == 1: debit = journal.amount @@ -71,18 +71,18 @@ def build_report(request, info): if journal.debit != journal_debit: name += "{0} / ".format(journal.ledger.name) name = name[:-3] - info['Body'].append( - {'ID': voucher.id, 'Date': voucher.date.strftime('%d-%b-%Y'), 'Name': name, - 'Url': get_edit_url(request, voucher), 'Type': VoucherType.by_id(voucher.type).name, - 'Narration': voucher.narration, 'Debit': debit, 'Credit': credit, 'Posted': voucher.posted}) + info['body'].append( + {'id': voucher.id, 'date': voucher.date.strftime('%d-%b-%Y'), 'name': name, + 'url': get_edit_url(request, voucher), 'type': VoucherType.by_id(voucher.type).name, + 'narration': voucher.narration, 'debit': debit, 'credit': credit, 'posted': voucher.posted}) -def opening_balance(ledger_id, start_date, dbsession): +def opening_balance(account_id, start_date, dbsession): opening = dbsession.query(func.sum(Journal.amount * Journal.debit)) \ .join(Journal.voucher) \ .filter(Voucher.date < datetime.datetime.strptime(start_date, '%d-%b-%Y')) \ .filter(Voucher.type != VoucherType.by_name('Issue').id) \ - .filter(Journal.ledger_id == ledger_id) \ + .filter(Journal.ledger_id == account_id) \ .scalar() opening = 0 if opening is None else opening if opening < 0: @@ -91,5 +91,5 @@ def opening_balance(ledger_id, start_date, dbsession): else: debit = opening credit = 0 - return {'Date': start_date, 'ID': 'OB', 'Name': 'Opening Balance', 'Type': 'Opening Balance', - 'Narration': '', 'Debit': debit, 'Credit': credit, 'Posted': True} + return {'date': start_date, 'id': 'OB', 'name': 'Opening Balance', 'type': 'Opening Balance', + 'narration': '', 'debit': debit, 'credit': credit, 'posted': True} diff --git a/brewman/views/reports/net_transactions.py b/brewman/views/reports/net_transactions.py index d010e140..f4e972f9 100644 --- a/brewman/views/reports/net_transactions.py +++ b/brewman/views/reports/net_transactions.py @@ -13,21 +13,21 @@ from brewman.views.services.session import session_period_finish, session_period @view_config(request_method='GET', route_name='net_transactions', permission='Net Transactions') def html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) @view_config(request_method='GET', route_name='api_net_transactions', renderer='json', permission='Net Transactions') def report(request): - start_date = request.GET.get('StartDate', None) - finish_date = request.GET.get('FinishDate', None) + start_date = request.GET.get('s', None) + finish_date = request.GET.get('f', None) if start_date and finish_date: - return {'StartDate': start_date, 'FinishDate': finish_date, - 'Body': build_report(start_date, finish_date, request.dbsession)} + return {'startDate': start_date, 'finishDate': finish_date, + 'body': build_report(start_date, finish_date, request.dbsession)} else: - return {'StartDate': session_period_start(request), - 'FinishDate': session_period_finish(request), 'Body': []} + return {'startDate': session_period_start(request), + 'finishDate': session_period_finish(request), 'body': []} def build_report(start_date, finish_date, dbsession): @@ -47,6 +47,6 @@ def build_report(start_date, finish_date, dbsession): body = [] for ledger, amount in query: if amount != 0: - tag = 'Debit' if amount > 0 else 'Credit' - body.append({'Type': ledger.type_object.name, 'Name': ledger.name, tag: amount}) + tag = 'debit' if amount > 0 else 'credit' + body.append({'type': ledger.type_object.name, 'name': ledger.name, tag: amount}) return body diff --git a/brewman/views/reports/product_ledger.py b/brewman/views/reports/product_ledger.py index 62915740..7571c578 100644 --- a/brewman/views/reports/product_ledger.py +++ b/brewman/views/reports/product_ledger.py @@ -1,14 +1,13 @@ import datetime + import pkg_resources from pyramid.response import FileResponse +from pyramid.view import view_config from sqlalchemy.orm import joinedload from sqlalchemy.sql.expression import func -from pyramid.view import view_config - from brewman.models.master import Product, CostCentre from brewman.models.validation_exception import ValidationError - from brewman.models.voucher import Voucher, Journal, VoucherType, Inventory from brewman.views import to_uuid from brewman.views.services.session import session_period_start, session_period_finish @@ -18,15 +17,15 @@ from brewman.views.services.voucher import get_edit_url @view_config(request_method='GET', route_name='product_ledger_id', permission='Product Ledger') @view_config(request_method='GET', route_name='product_ledger', permission='Product Ledger') def html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) @view_config(request_method='GET', route_name='api_product_ledger', renderer='json', permission='Product Ledger') def show_blank(request): - return {'StartDate': session_period_start(request), - 'FinishDate': session_period_finish(request), 'Product': None, 'Body': [], 'Footer': {}} + return {'startDate': session_period_start(request), + 'finishDate': session_period_finish(request), 'product': None, 'body': []} @view_config(request_method='GET', route_name='api_product_ledger_id', renderer='json', permission='Product Ledger', @@ -36,19 +35,19 @@ def show_data(request): if id is None: raise ValidationError("Invalid Product") product = request.dbsession.query(Product).filter(Product.id == id).first() - start_date = request.GET.get('StartDate', session_period_start(request)) - finish_date = request.GET.get('FinishDate', session_period_finish(request)) - info = {'StartDate': start_date, 'FinishDate': finish_date, - 'Product': {'ProductID': product.id, 'Name': product.name}, - 'Body': [], 'Footer': {}} + start_date = request.GET.get('s', session_period_start(request)) + finish_date = request.GET.get('f', session_period_finish(request)) + info = {'startDate': start_date, 'finishDate': finish_date, + 'product': {'id': product.id, 'name': product.name}, + 'body': []} build_report(request, info, request.dbsession) return info def build_report(request, info, dbsession): - product_id = info['Product']['ProductID'] - start_date = info['StartDate'] - finish_date = info['FinishDate'] + product_id = info['product']['id'] + start_date = info['startDate'] + finish_date = info['finishDate'] running_total_q, running_total_a, opening = opening_balance(product_id, start_date, dbsession) total_debit_q = running_total_q @@ -56,7 +55,7 @@ def build_report(request, info, dbsession): total_credit_q = 0 total_credit_a = 0 - info['Body'].append(opening) + info['body'].append(opening) query = request.dbsession.query(Voucher, Inventory, Journal).options( joinedload(Journal.ledger, innerjoin=True), @@ -88,11 +87,15 @@ def build_report(request, info, dbsession): total_credit_q += row.Inventory.quantity total_credit_a += row.Inventory.amount - info['Body'].append( - {'Date': row.Voucher.date.strftime('%d-%b-%Y'), 'Name': name, 'Url': get_edit_url(request, row.Voucher), - 'Type': VoucherType.by_id(row.Voucher.type).name, 'Narration': row.Voucher.narration, 'DebitQ': debit_q, - 'DebitA': debit_a, 'CreditQ': credit_q, 'CreditA': credit_a, 'RunningQ': running_total_q, - 'RunningA': running_total_a}) + info['body'].append({ + 'id': row.Voucher.id, 'date': row.Voucher.date.strftime('%d-%b-%Y'), 'name': name, + 'url': get_edit_url(request, row.Voucher), 'type': VoucherType.by_id(row.Voucher.type).name, + 'narration': row.Voucher.narration, + 'posted': row.Voucher.posted or VoucherType.by_id(row.Voucher.type).name == 'Issue', + 'debitQuantity': debit_q, 'debitAmount': debit_a, + 'creditQuantity': credit_q, 'creditAmount': credit_a, + 'runningQuantity': running_total_q, 'runningAmount': running_total_a + }) info['Footer'] = { 'Date': finish_date, 'Name': 'Closing Balance', 'Type': 'Closing Balance', 'Narration': '', @@ -129,6 +132,9 @@ def opening_balance(product_id, start_date, dbsession): quantity = 0 amount = 0 - return quantity, amount, {'Date': start_date, 'Name': 'Opening Balance', 'Type': 'Opening Balance', 'Narration': '', - 'DebitQ': debit_quantity, 'DebitA': debit_amount, 'RunningQ': quantity, - 'RunningA': amount} + return quantity, amount, { + 'date': start_date, 'name': 'Opening Balance', 'type': 'Opening Balance', 'narration': '', 'posted': True, + 'debitQuantity': debit_quantity, 'debitAmount': debit_amount, + 'creditQuantity': 0, 'creditAmount': 0, + 'runningQuantity': quantity, 'runningAmount': amount + } diff --git a/brewman/views/reports/profit_loss.py b/brewman/views/reports/profit_loss.py index 8aa664a9..0c16b6d4 100644 --- a/brewman/views/reports/profit_loss.py +++ b/brewman/views/reports/profit_loss.py @@ -1,12 +1,11 @@ import datetime + import pkg_resources from pyramid.response import FileResponse +from pyramid.view import view_config from sqlalchemy.sql.expression import func, desc -from pyramid.view import view_config - from brewman.models.master import LedgerType, LedgerBase - from brewman.models.voucher import Voucher, Journal, VoucherType from brewman.views.reports.closing_stock import get_opening_stock, get_closing_stock from brewman.views.services.session import session_period_start, session_period_finish @@ -14,24 +13,24 @@ from brewman.views.services.session import session_period_start, session_period_ @view_config(request_method='GET', route_name='profit_loss', permission='Profit & Loss') def html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) @view_config(request_method='GET', route_name='api_profit_loss', renderer='json', permission='Profit & Loss') def get_profit_loss(request): - start_date = request.GET.get('StartDate', None) - finish_date = request.GET.get('FinishDate', None) + start_date = request.GET.get('s', None) + finish_date = request.GET.get('f', None) if start_date and finish_date: - report = {'StartDate': start_date, 'FinishDate': finish_date} + report = {'startDate': start_date, 'finishDate': finish_date} start_date = datetime.datetime.strptime(start_date, '%d-%b-%Y') finish_date = datetime.datetime.strptime(finish_date, '%d-%b-%Y') - report['Body'], report['Footer'] = build_profit_loss(start_date, finish_date, request.dbsession) + report['body'], report['footer'] = build_profit_loss(start_date, finish_date, request.dbsession) return report else: - return {'StartDate': session_period_start(request), - 'FinishDate': session_period_finish(request), 'Body': [], 'Footer': {}} + return {'startDate': session_period_start(request), + 'finishDate': session_period_finish(request), 'body': [], 'footer': {}} def build_profit_loss(start_date, finish_date, dbsession): @@ -53,10 +52,10 @@ def build_profit_loss(start_date, finish_date, dbsession): closing_stock = get_closing_stock(finish_date, dbsession) total_amount = (opening_stock - closing_stock) * -1 - report.append({'Name': 'Opening Stock', 'SubAmount': opening_stock * -1, 'Order': 20.0001}) - report.append({'Name': 'Closing Stock', 'SubAmount': closing_stock, 'Order': 29}) + report.append({'name': 'Opening Stock', 'amount': opening_stock * -1, 'order': 20.0001}) + report.append({'name': 'Closing Stock', 'amount': closing_stock, 'order': 29}) purchase_group = LedgerType.by_id(2) - groups[purchase_group.id] = {'Group': purchase_group.name, 'Amount': total_amount, 'Order': purchase_group.order} + groups[purchase_group.id] = {'group': purchase_group.name, 'total': total_amount, 'order': purchase_group.order} counter = 0 for ledger, amount in query: @@ -67,24 +66,20 @@ def build_profit_loss(start_date, finish_date, dbsession): if amount != 0: counter += .001 - report.append({'Name': ledger.name, 'SubAmount': amount, 'Order': ledger_type.order + counter}) + report.append({'name': ledger.name, 'amount': amount, 'order': ledger_type.order + counter}) if ledger_type.id in groups: - groups[ledger_type.id]['Amount'] += amount + groups[ledger_type.id]['total'] += amount else: - groups[ledger_type.id] = {'Group': ledger_type.name, 'Amount': amount, 'Order': ledger_type.order} + groups[ledger_type.id] = {'group': ledger_type.name, 'total': amount, 'order': ledger_type.order} # Add Subtotals for item in groups.values(): report.append(item) - footer = [] # Add Net - if total_amount > 0: - footer.append({'Group': 'Net Profit', 'Amount': total_amount, 'Order': 100}) - else: - footer.append({'Group': 'Net Loss', 'Amount': total_amount, 'Order': 100}) + footer = footer = {'group': 'Net Profit' if total_amount > 0 else 'Net Loss', 'total': total_amount, 'order': 100} - return sorted(report, key=lambda d: d['Order']), footer + return sorted(report, key=lambda d: d['order']), footer def get_accumulated_profit(finish_date, dbsession): diff --git a/brewman/views/reports/purchase_entries.py b/brewman/views/reports/purchase_entries.py index 1ea44950..f979d14e 100644 --- a/brewman/views/reports/purchase_entries.py +++ b/brewman/views/reports/purchase_entries.py @@ -1,6 +1,6 @@ import datetime -import pkg_resources +import pkg_resources from pyramid.response import FileResponse from pyramid.view import view_config @@ -11,27 +11,27 @@ from brewman.views.services.voucher import get_edit_url @view_config(request_method='GET', route_name='purchase_entries', permission='Purchase Entries') def html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) @view_config(request_method='GET', route_name='api_purchase_entries', renderer='json', permission='Purchase Entries') def report_blank(request): - return {'StartDate': session_period_start(request), - 'FinishDate': session_period_finish(request), 'Body': [], 'Footer': {}} + return {'startDate': session_period_start(request), + 'finishDate': session_period_finish(request), 'body': []} -@view_config(request_method='GET', route_name='api_purchase_entries', request_param='StartDate', renderer='json', +@view_config(request_method='GET', route_name='api_purchase_entries', request_param='s', renderer='json', permission='Purchase Entries') def report_data(request): - start_date = request.GET.get('StartDate', None) - finish_date = request.GET.get('FinishDate', None) + start_date = request.GET.get('s', None) + finish_date = request.GET.get('f', None) return build_report(request, start_date, finish_date) def build_report(request, start_date, finish_date): - report = {'StartDate': start_date, 'FinishDate': finish_date, 'Body': []} + report = {'startDate': start_date, 'finishDate': finish_date, 'body': []} start_date = datetime.datetime.strptime(start_date, '%d-%b-%Y') finish_date = datetime.datetime.strptime(finish_date, '%d-%b-%Y') @@ -44,11 +44,17 @@ def build_report(request, start_date, finish_date): for voucher in query: journal = [j for j in voucher.journals if j.debit == -1] journal = journal[0] - row = {'Date': voucher.date.strftime('%d-%b-%Y'), 'Supplier': journal.ledger.name, - 'Url': get_edit_url(request, voucher), 'Products': []} for item in voucher.inventories: - row['Products'].append( - {'Product': item.product.full_name, 'Quantity': item.quantity, 'Rate': item.rate, 'Tax': item.tax, - 'Amount': item.amount}) - report['Body'].append(row) + row = { + 'date': voucher.date.strftime('%d-%b-%Y'), + 'supplier': journal.ledger.name, + 'url': get_edit_url(request, voucher), + 'products': [], + 'product': item.product.full_name, + 'quantity': item.quantity, + 'rate': item.rate, + 'tax': item.tax, + 'amount': item.amount + } + report['body'].append(row) return report diff --git a/brewman/views/reports/purchases.py b/brewman/views/reports/purchases.py index c27a9e35..49905a18 100644 --- a/brewman/views/reports/purchases.py +++ b/brewman/views/reports/purchases.py @@ -1,26 +1,30 @@ import datetime + import pkg_resources from pyramid.response import FileResponse +from pyramid.view import view_config from sqlalchemy.sql.expression import func, desc -from pyramid.view import view_config - from brewman.models.master import CostCentre, Product - from brewman.models.voucher import Voucher, Journal, Inventory, VoucherType from brewman.views.services.session import session_period_start, session_period_finish @view_config(request_method='GET', route_name='purchases', permission='Purchases') def html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) @view_config(request_method='GET', route_name='api_purchases', renderer='json', permission='Purchases') def report_blank(request): - return {'StartDate': session_period_start(request), 'FinishDate': session_period_finish(request), 'Body': []} + return { + 'startDate': session_period_start(request), + 'finishDate': session_period_finish(request), + 'body': [], + 'footer': {} + } @view_config(request_method='GET', route_name='api_purchases', request_param='s', renderer='json', @@ -32,7 +36,7 @@ def report_data(request): def build_report(request, start_date, finish_date): - report = {'StartDate': start_date, 'FinishDate': finish_date, 'Body': []} + report = {'startDate': start_date, 'finishDate': finish_date, 'body': [], 'footer':{}} quantity_sum = func.sum(Journal.debit * Inventory.quantity).label('quantity') amount_sum = func.sum(Journal.debit * Inventory.quantity * Inventory.rate * (1 + Inventory.tax)).label('amount') @@ -48,11 +52,9 @@ def build_report(request, start_date, finish_date): for product, quantity, amount in query: rate = amount / quantity if quantity != 0 else 0 total_amount += amount - row = {'Name': product.full_name, 'Quantity': quantity, 'Rate': rate, 'Amount': amount, - 'Url': request.route_url('product_ledger_id', id=product.id, - _query={'StartDate': start_date, 'FinishDate': finish_date})} - report['Body'].append(row) - report['Footer'] = [{'Name': "Total", 'Amount': total_amount}] + row = {'name': product.full_name, 'quantity': quantity, 'rate': rate, 'amount': amount, + 'url': request.route_url('product_ledger_id', id=product.id, + _query={'startDate': start_date, 'finishDate': finish_date})} + report['body'].append(row) + report['footer'] = {'name': "Total", 'amount': total_amount} return report - - diff --git a/brewman/views/reports/raw_material_cost.py b/brewman/views/reports/raw_material_cost.py index b5cd4bc1..6475d577 100644 --- a/brewman/views/reports/raw_material_cost.py +++ b/brewman/views/reports/raw_material_cost.py @@ -1,13 +1,12 @@ import datetime import uuid + import pkg_resources from pyramid.response import FileResponse +from pyramid.view import view_config from sqlalchemy.sql.expression import func, case -from pyramid.view import view_config - from brewman.models.master import LedgerBase, CostCentre, Product, ProductGroup - from brewman.models.voucher import Voucher, Journal, Inventory from brewman.views.services.session import session_period_start, session_period_finish @@ -15,36 +14,36 @@ from brewman.views.services.session import session_period_start, session_period_ @view_config(request_method='GET', route_name='raw_material_cost', permission='Raw Material Cost') @view_config(request_method='GET', route_name='raw_material_cost_id', permission='Raw Material Cost') def get_html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) @view_config(request_method='GET', route_name='api_raw_material_cost', renderer='json', permission='Raw Material Cost') def report_blank(request): - return {'StartDate': session_period_start(request), - 'FinishDate': session_period_finish(request), 'Body': [], 'Footer': {}} + return {'startDate': session_period_start(request), + 'finishDate': session_period_finish(request), 'body': [], 'footer': {}} -@view_config(request_method='GET', route_name='api_raw_material_cost', request_param='StartDate', renderer='json', +@view_config(request_method='GET', route_name='api_raw_material_cost', request_param='s', renderer='json', permission='Raw Material Cost') def report_data(request): - start_date = request.GET.get('StartDate', None) - finish_date = request.GET.get('FinishDate', None) + start_date = request.GET.get('s', None) + finish_date = request.GET.get('f', None) return build_report(request, start_date, finish_date) -@view_config(request_method='GET', route_name='api_raw_material_cost_id', request_param='StartDate', renderer='json', +@view_config(request_method='GET', route_name='api_raw_material_cost_id', request_param='s', renderer='json', permission='Raw Material Cost') def report_id(request): id = request.matchdict.get('id', None) - start_date = request.GET.get('StartDate', None) - finish_date = request.GET.get('FinishDate', None) + start_date = request.GET.get('s', None) + finish_date = request.GET.get('f', None) return build_report_id(request, uuid.UUID(id), start_date, finish_date) def build_report(request, start_date, finish_date): - report = {'StartDate': start_date, 'FinishDate': finish_date, 'Body': [], 'Footer': []} + report = {'startDate': start_date, 'finishDate': finish_date, 'body': [], 'footer': {}} sum_issue = func.sum(case([(LedgerBase.type == 2, Journal.signed_amount)], else_=0)).label('issue') sum_sale = func.sum(case([(LedgerBase.type == 3, Journal.signed_amount * -1)], else_=0)).label('sale') @@ -64,19 +63,19 @@ def build_report(request, start_date, finish_date): issues += issue sales += sale rmc = 0 if sale == 0 else issue / sale - report['Body'].append( - {'Name': cost_centre.name, 'Issue': issue, 'Sale': sale, 'Rmc': rmc, - 'Url': request.route_url('raw_material_cost_id', id=str(cost_centre.id), - _query={'StartDate': start_date, 'FinishDate': finish_date})}) + report['body'].append( + {'name': cost_centre.name, 'issue': issue, 'sale': sale, 'rmc': rmc, + 'url': request.route_url('raw_material_cost_id', id=str(cost_centre.id), + _query={'startDate': start_date, 'finishDate': finish_date})}) rmc = 0 if sales == 0 else issues / sales - report['Footer'].append({'Name': 'Total', 'Issue': issues, 'Sale': sales, 'Rmc': rmc}) + report['footer'] = {'name': 'Total', 'issue': issues, 'sale': sales, 'rmc': rmc} return report def build_report_id(request, cost_centre_id, start_date, finish_date): - report = {'StartDate': start_date, 'FinishDate': finish_date, 'Body': []} + report = {'id': cost_centre_id, 'startDate': start_date, 'finishDate': finish_date, 'body': []} sum_quantity = func.sum(Inventory.quantity * Journal.debit).label('quantity') sum_net = func.sum(Inventory.rate * Inventory.quantity * Journal.debit).label('net') @@ -97,19 +96,19 @@ def build_report_id(request, cost_centre_id, start_date, finish_date): for product, quantity, net, gross in query: if product.product_group_id in groups: group = groups[product.product_group_id] - group['Net'] += net - group['Gross'] += gross + group['net'] += net + group['gross'] += gross else: counter += 500 - group = {'Group': product.product_group.name, 'Net': net, 'Gross': gross, 'Order': counter, 'Heading': True} + group = {'group': product.product_group.name, 'net': net, 'gross': gross, 'order': counter, 'heading': True} groups[product.product_group_id] = group counter += 1 list.append( - {'Name': product.full_name, 'Group': product.product_group.name, 'Quantity': quantity, 'Net': net, - 'Gross': gross, 'Order': counter, 'Heading': False}) + {'name': product.full_name, 'group': product.product_group.name, 'quantity': quantity, 'net': net, + 'gross': gross, 'order': counter, 'heading': False}) for item in groups.values(): list.append(item) - report['Body'] = sorted(list, key=lambda d: d['Order']) + report['body'] = sorted(list, key=lambda d: d['order']) return report diff --git a/brewman/views/reports/reconcile.py b/brewman/views/reports/reconcile.py index f98fb673..9ba03c1f 100644 --- a/brewman/views/reports/reconcile.py +++ b/brewman/views/reports/reconcile.py @@ -18,7 +18,7 @@ from brewman.views.services.voucher import get_edit_url @view_config(request_method='GET', route_name='reconcile_id', permission='Reconcile') @view_config(request_method='GET', route_name='reconcile', permission='Reconcile') def html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) diff --git a/brewman/views/reports/stock_movement.py b/brewman/views/reports/stock_movement.py index c0984bdb..b08f639a 100644 --- a/brewman/views/reports/stock_movement.py +++ b/brewman/views/reports/stock_movement.py @@ -1,36 +1,35 @@ import datetime + import pkg_resources from pyramid.response import FileResponse +from pyramid.view import view_config from sqlalchemy.sql.expression import func -from pyramid.view import view_config - from brewman.models.master import Product, CostCentre - from brewman.models.voucher import Voucher, Journal, VoucherType, Inventory from brewman.views.services.session import session_period_start, session_period_finish @view_config(request_method='GET', route_name='stock_movement', permission='Stock Movement') def html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) @view_config(request_method='GET', route_name='api_stock_movement', renderer='json', permission='Stock Movement') def get_stock_movement(request): - start_date = request.GET.get('StartDate', None) - finish_date = request.GET.get('FinishDate', None) + start_date = request.GET.get('s', None) + finish_date = request.GET.get('f', None) if start_date and finish_date: - report = {'StartDate': start_date, 'FinishDate': finish_date} + report = {'startDate': start_date, 'finishDate': finish_date} start_date = datetime.datetime.strptime(start_date, '%d-%b-%Y') finish_date = datetime.datetime.strptime(finish_date, '%d-%b-%Y') - report['Body'] = build_stock_movement(start_date, finish_date, request.dbsession) + report['body'] = build_stock_movement(start_date, finish_date, request.dbsession) return report else: - return {'StartDate': session_period_start(request), - 'FinishDate': session_period_finish(request), 'Body': []} + return {'startDate': session_period_start(request), + 'finishDate': session_period_finish(request), 'body': []} def build_stock_movement(start_date, finish_date, dbsession): @@ -42,8 +41,8 @@ def build_stock_movement(start_date, finish_date, dbsession): .filter(Journal.cost_centre_id == CostCentre.cost_centre_purchase()) \ .group_by(Product).all() for product, quantity in openings: - dict[product.id] = {'ProductID': product.id, 'Name': product.full_name, 'Group': product.product_group.name, - 'Opening': quantity} + dict[product.id] = {'id': product.id, 'name': product.full_name, 'group': product.product_group.name, + 'opening': quantity} purchases = dbsession.query(Product, quantity_sum) \ .join(Product.inventories).join(Inventory.voucher).join(Voucher.journals) \ .filter(Voucher.date >= start_date) \ @@ -53,10 +52,10 @@ def build_stock_movement(start_date, finish_date, dbsession): .group_by(Product).all() for product, quantity in purchases: if product.id in dict: - dict[product.id]['Purchase'] = quantity + dict[product.id]['purchase'] = quantity else: - dict[product.id] = {'ProductID': product.id, 'Name': product.full_name, 'Group': product.product_group.name, - 'Purchase': quantity} + dict[product.id] = {'id': product.id, 'name': product.full_name, 'group': product.product_group.name, + 'purchase': quantity} issues = dbsession.query(Product, quantity_sum) \ .join(Product.inventories).join(Inventory.voucher).join(Voucher.journals) \ .filter(Voucher.date >= start_date) \ @@ -66,22 +65,22 @@ def build_stock_movement(start_date, finish_date, dbsession): .group_by(Product).all() for product, quantity in issues: if product.id in dict: - dict[product.id]['Issue'] = quantity * -1 + dict[product.id]['issue'] = quantity * -1 else: - dict[product.id] = {'ProductID': product.id, 'Name': product.full_name, 'Group': product.product_group.name, - 'Issue': quantity * -1} + dict[product.id] = {'id': product.id, 'name': product.full_name, 'group': product.product_group.name, + 'issue': quantity * -1} list = [value for key, value in dict.items()] - list = sorted(list, key=lambda x: x['Name'].lower()) - list = sorted(list, key=lambda x: x['Group'].lower()) + list = sorted(list, key=lambda x: x['name'].lower()) + list = sorted(list, key=lambda x: x['group'].lower()) for i in range(len(list), 0, -1): item = list[i - 1] - opening = item['Opening'] if 'Opening' in item else 0 - purchase = item['Purchase'] if 'Purchase' in item else 0 - issue = item['Issue'] if 'Issue' in item else 0 + opening = item['opening'] if 'opening' in item else 0 + purchase = item['purchase'] if 'purchase' in item else 0 + issue = item['issue'] if 'issue' in item else 0 closing = opening + purchase - issue if opening == 0 and purchase == 0 and issue == 0: list.remove(item) else: - item['Closing'] = closing + item['closing'] = closing return list diff --git a/brewman/views/reports/trial_balance.py b/brewman/views/reports/trial_balance.py index f946314b..49b8837c 100644 --- a/brewman/views/reports/trial_balance.py +++ b/brewman/views/reports/trial_balance.py @@ -1,12 +1,11 @@ import datetime + import pkg_resources from pyramid.response import FileResponse +from pyramid.view import view_config from sqlalchemy.sql.expression import func -from pyramid.view import view_config - from brewman.models.master import LedgerBase - from brewman.models.voucher import Voucher, Journal, VoucherType from brewman.views.services.session import session_period_finish @@ -14,20 +13,20 @@ from brewman.views.services.session import session_period_finish @view_config(request_method='GET', route_name='trial_balance', permission='Trial Balance') @view_config(request_method='GET', route_name='trial_balance_date', permission='Trial Balance') def html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) @view_config(request_method='GET', route_name='api_trial_balance', renderer='json', permission='Trial Balance') def report_blank(request): - return {'Date': session_period_finish(request), 'Body': []} + return {'date': session_period_finish(request), 'body': []} @view_config(request_method='GET', route_name='api_trial_balance_date', renderer='json', permission='Trial Balance') def report_data(request): date = request.matchdict.get('date', None) - return {'Date': date, 'Body': build_report(date, request.dbsession)} + return {'date': date, 'body': build_report(date, request.dbsession)} def build_report(date, dbsession): @@ -41,6 +40,6 @@ def build_report(date, dbsession): body = [] for ledger, amount in query: if amount != 0: - tag = 'Debit' if amount > 0 else 'Credit' - body.append({'Type': ledger.type_object.name, 'Name': ledger.name, tag: amount}) + tag = 'debit' if amount > 0 else 'credit' + body.append({'type': ledger.type_object.name, 'name': ledger.name, tag: amount}) return body diff --git a/brewman/views/reports/unposted.py b/brewman/views/reports/unposted.py index fc3c5c9f..0f814600 100644 --- a/brewman/views/reports/unposted.py +++ b/brewman/views/reports/unposted.py @@ -1,8 +1,7 @@ import pkg_resources from pyramid.response import FileResponse -from sqlalchemy.orm import joinedload_all - from pyramid.view import view_config +from sqlalchemy.orm import joinedload_all from brewman.models.voucher import Voucher, Journal, VoucherType from brewman.views.services.voucher import get_edit_url @@ -10,7 +9,7 @@ from brewman.views.services.voucher import get_edit_url @view_config(request_method='GET', route_name='unposted', permission='Post Vouchers') def html(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) @@ -43,9 +42,9 @@ def build_report(request): name_debit = name_debit[:-3] name_credit = name_credit[:-3] - body.append({'Date': voucher.date.strftime('%d-%b-%Y'), 'Url': get_edit_url(request, voucher), - 'Type': VoucherType.by_id(voucher.type).name, - 'Narration': voucher.narration, 'Posted': voucher.posted, - 'DebitN': name_debit, 'DebitA': debit, 'CreditN': name_credit, 'CreditA': credit}) + body.append({'date': voucher.date.strftime('%d-%b-%Y'), 'Url': get_edit_url(request, voucher), + 'voucherType': VoucherType.by_id(voucher.type).name, + 'narration': voucher.narration, 'isPosted': voucher.posted, + 'debitName': name_debit, 'debitAmount': debit, 'creditName': name_credit, 'creditAmount': credit}) return body diff --git a/brewman/views/services/batch.py b/brewman/views/services/batch.py index 754d9051..1c5ec095 100644 --- a/brewman/views/services/batch.py +++ b/brewman/views/services/batch.py @@ -1,15 +1,17 @@ import datetime + from pyramid.view import view_config + from brewman.models.voucher import Batch @view_config(request_method='GET', route_name='api_batch', renderer='json', permission='Authenticated') def batch_term(request): - filter = request.GET.get('term', None) + filter = request.GET.get('t', None) filter = filter if filter is not None and filter.strip() is not '' else None - count = request.GET.get('count', None) + count = request.GET.get('c', None) count = None if count is None or count == '' else int(count) - date = request.GET.get('date', None) + date = request.GET.get('d', None) date = None if date is None or date == '' else datetime.datetime.strptime(date, '%d-%b-%Y') list = [] for index, item in enumerate(Batch.list(filter, include_nil=False, date=date, dbsession=request.dbsession)): @@ -21,9 +23,9 @@ def batch_term(request): item.name.strftime('%d-%b-%Y') ) list.append({ - 'BatchID': item.id, 'Name': text, 'QuantityRemaining': item.quantity_remaining, - 'Rate': item.rate, 'Tax': item.tax, 'Discount': item.discount, - 'Product': {'ProductID': item.product.id, 'Name': item.product.name, 'Units': item.product.units} + 'id': item.id, 'name': text, 'quantityRemaining': item.quantity_remaining, 'rate': item.rate, + 'tax': item.tax, 'discount': item.discount, + 'product': {'id': item.product.id, 'name': item.product.name, 'units': item.product.units} }) if count is not None and index == count - 1: break diff --git a/brewman/views/services/cost_centre.py b/brewman/views/services/cost_centre.py index c6930455..42925a58 100644 --- a/brewman/views/services/cost_centre.py +++ b/brewman/views/services/cost_centre.py @@ -8,39 +8,30 @@ from sqlalchemy.sql.expression import and_ from brewman.models.voucher import Voucher, Journal, VoucherType -@view_config(route_name='api_issues_grid', request_param='Source', renderer='json', permission='Issue', trans=True) +@view_config(route_name='api_issue_grid', renderer='json', permission='Issue', trans=True) def grid_date(request): date = datetime.datetime.strptime(request.matchdict['date'], '%d-%b-%Y') - return get_grid(date, uuid.UUID(request.GET['Source']), uuid.UUID(request.GET['Destination']), request.dbsession) + return get_grid(date, request.dbsession) -@view_config(route_name='api_issues_grid', renderer='json', permission='Issue', trans=True) -def grid_voucher(request): - voucher = request.dbsession.query(Voucher).filter(Voucher.id == uuid.UUID(request.matchdict['date'])).first() - source = [j.cost_centre_id for j in voucher.journals if j.debit == -1] - source = source[0] - destination = [j.cost_centre_id for j in voucher.journals if j.debit == 1] - destination = destination[0] - return get_grid(voucher.date, source, destination, request.dbsession) - - -def get_grid(date, source, destination, dbsession): +def get_grid(date, dbsession): list = [] source_journal = aliased(Journal) destination_journal = aliased(Journal) - source_or = (and_(source_journal.cost_centre_id == source, source_journal.debit == -1)) - destination_or = (and_(destination_journal.cost_centre_id == destination, destination_journal.debit == 1)) query = dbsession.query(Voucher, source_journal.amount) \ .join(source_journal, Voucher.journals) \ .join(destination_journal, Voucher.journals) \ .filter(Voucher.date == date) \ .filter(Voucher.type == VoucherType.by_name('Issue').id) \ - .filter(and_(source_or, destination_or)) \ .order_by(Voucher.creation_date) \ .all() for voucher, amount in query: - list.append( - {'VoucherID': str(voucher.id), 'Amount': amount}) + list.append({ + 'id': str(voucher.id), + 'amount': amount, + 'source': [j.cost_centre.name for j in voucher.journals if j.debit == -1], + 'destination': [j.cost_centre.name for j in voucher.journals if j.debit == 1] + }) return list diff --git a/brewman/views/services/login.py b/brewman/views/services/login.py index 29c19ba3..67e6e106 100644 --- a/brewman/views/services/login.py +++ b/brewman/views/services/login.py @@ -1,14 +1,14 @@ -import transaction from datetime import datetime, timedelta +import transaction from pyramid.httpexceptions import HTTPFound from pyramid.response import Response from pyramid.security import remember, forget from pyramid.view import view_config - from sqlalchemy import and_ from brewman.models.auth import User, Client, LoginHistory +from brewman.security import f7 @view_config(route_name='logout') @@ -18,15 +18,22 @@ def logout(request): return HTTPFound(location=request.route_url('home'), headers=headers) +@view_config(request_method='POST', route_name='api_logout', renderer='json') +def api_logout(request): + request.session.invalidate() + request.response.headers = forget(request) + return {'isAuthenticated': False, 'perms': {}} + + @view_config(request_method='POST', route_name='api_login', renderer='json', trans=True) def login(request): - username = request.json_body.get('username', None) + username = request.json_body.get('name', None) password = request.json_body.get('password', None) found, user = User.auth(username, password, request.dbsession) client = Client.by_code(request.cookies.get('ClientID', None), request.dbsession) otp = request.json_body.get('otp', None) - client_name = request.json_body.get('ClientName', None) + client_name = request.json_body.get('clientName', None) if user is not None: allowed, client, response = check_client(client, otp, client_name, user, request.dbsession) @@ -36,7 +43,13 @@ def login(request): request.response.set_cookie('ClientID', value=str(client.code), max_age=365 * 24 * 60 * 60) record_login(user.id, client, request.dbsession) transaction.commit() - return request.response + + return { + 'id': user.id, + 'name': user.name, + 'isAuthenticated': True, + 'perms': sorted(f7([p.name for g in user.groups for p in g.roles])) + } elif not found: response = Response("Login failed") response.status_int = 403 diff --git a/brewman/views/services/session.py b/brewman/views/services/session.py index 58830aef..281f7f34 100644 --- a/brewman/views/services/session.py +++ b/brewman/views/services/session.py @@ -1,9 +1,10 @@ import uuid - from datetime import date, timedelta + from pyramid.view import view_config -from brewman.models.auth import Role, User +from brewman.models.auth import User +from brewman.security import f7 def session_current_date(request): @@ -48,9 +49,12 @@ def user_permission(request): auth = request.session['auth'] else: user = request.dbsession.query(User).filter(User.id == uuid.UUID(user_id)).one() - auth = {'isAuthenticated': True, 'Name': user.name, 'UserID': user.id, 'perms': {}} - for item in request.dbsession.query(Role).order_by(Role.name).all(): - auth['perms'][item.name] = request.has_permission(item.name) + auth = { + 'id': user.id, + 'name': user.name, + 'isAuthenticated': True, + 'perms': sorted(f7([p.name for g in user.groups for p in g.roles])) + } request.session['auth'] = auth return auth diff --git a/brewman/views/services/voucher/__init__.py b/brewman/views/services/voucher/__init__.py index 49938ec1..7e6ffafb 100644 --- a/brewman/views/services/voucher/__init__.py +++ b/brewman/views/services/voucher/__init__.py @@ -1,9 +1,9 @@ import datetime +import uuid +from decimal import Decimal + import pkg_resources import transaction -import uuid - -from decimal import Decimal from pyramid.response import Response, FileResponse from pyramid.view import view_config from sqlalchemy import func, or_ @@ -32,17 +32,17 @@ from ..session import get_first_day @view_config(request_method='GET', route_name='purchase_return', permission='Purchase Return') @view_config(request_method='GET', route_name='issue_id', permission='Issue') @view_config(request_method='GET', route_name='issue', permission='Issue') -@view_config(request_method='GET', route_name='salary_deduction_id', permission='Issue') -@view_config(request_method='GET', route_name='salary_deduction', permission='Issue') -@view_config(request_method='GET', route_name='service_charge_id', permission='Service Charge') -@view_config(request_method='GET', route_name='service_charge', permission='Service Charge') +@view_config(request_method='GET', route_name='employee_benefits_id', permission='Issue') +@view_config(request_method='GET', route_name='employee_benefits', permission='Issue') +@view_config(request_method='GET', route_name='incentive_id', permission='Service Charge') +@view_config(request_method='GET', route_name='incentive', permission='Service Charge') def journal_get(request): - package, resource = 'brewman:static/src/index.html'.split(':', 1) + package, resource = 'brewman:static/index.html'.split(':', 1) file = pkg_resources.resource_filename(package, resource) return FileResponse(file, request=request) -@view_config(request_method='POST', route_name='api_voucher_id', request_param='post', renderer='json', +@view_config(request_method='POST', route_name='api_voucher_id', request_param='p', renderer='json', permission='Post Vouchers', trans=True) def voucher_post(request): user = request.dbsession.query(User).filter(User.id == uuid.UUID(request.authenticated_userid)).one() @@ -147,137 +147,153 @@ def get_old(request): def voucher_info(voucher, request): - json_voucher = {'VoucherID': voucher.id, - 'Date': voucher.date.strftime('%d-%b-%Y'), - 'Type': VoucherType.by_id(voucher.type).name, - 'Posted': voucher.posted, - 'Narration': voucher.narration, - 'Journals': [], - 'Inventories': [], - 'SalaryDeductions': [], - 'ServiceCharges': [], - 'Files': [], - 'CreationDate': voucher.creation_date.strftime('%d-%b-%Y %H:%M'), - 'LastEditDate': voucher.last_edit_date.strftime('%d-%b-%Y %H:%M'), - 'User': {'UserID': voucher.user.id, 'Name': voucher.user.name}, - 'Poster': voucher.poster.name if voucher.posted else ''} + json_voucher = {'id': voucher.id, + 'date': voucher.date.strftime('%d-%b-%Y'), + 'type': VoucherType.by_id(voucher.type).name, + 'posted': voucher.posted, + 'narration': voucher.narration, + 'journals': [], + 'inventories': [], + 'employeeBenefits': [], + 'incentives': [], + 'files': [], + 'creationDate': voucher.creation_date.strftime('%d-%b-%Y %H:%M'), + 'lastEditDate': voucher.last_edit_date.strftime('%d-%b-%Y %H:%M'), + 'user': {'id': voucher.user.id, 'name': voucher.user.name}, + 'poster': voucher.poster.name if voucher.posted else ''} if voucher.reconcile_date is not None: - json_voucher['ReconcileDate'] = voucher.reconcile_date.strftime('%d-%b-%Y %H:%M') + json_voucher['reconcileDate'] = voucher.reconcile_date.strftime('%d-%b-%Y %H:%M') for item in voucher.journals: - json_voucher['Journals'].append({'JournalID': item.id, 'Debit': item.debit, 'Amount': item.amount, - 'Ledger': {'LedgerID': item.ledger.id, 'Name': item.ledger.name}, - 'CostCentre': {'CostCentreID': item.cost_centre_id}}) + json_voucher['journals'].append({'id': item.id, 'debit': item.debit, 'amount': item.amount, + 'account': {'id': item.ledger.id, 'name': item.ledger.name}, + 'costCentre': {'id': item.cost_centre_id}}) for item in voucher.salary_deductions: - json_voucher['SalaryDeductions'].append( - {'GrossSalary': item.gross_salary, - 'DaysWorked': item.days_worked, - 'EsiEmployee': item.esi_ee, - 'PfEmployee': item.pf_ee, - 'EsiEmployer': item.esi_er, - 'PfEmployer': item.pf_er, - 'Journal': {'JournalID': item.journal.id, - 'Ledger': {'LedgerID': item.journal.ledger.id, 'Name': item.journal.ledger.name, - 'Designation': item.journal.ledger.designation, - 'CostCentre': {'CostCentreID': item.journal.ledger.cost_centre.id, - 'Name': item.journal.ledger.cost_centre.name}}}}) + json_voucher['employeeBenefits'].append( + {'grossSalary': item.gross_salary, + 'daysWorked': item.days_worked, + 'esiEmployee': item.esi_ee, + 'pfEmployee': item.pf_ee, + 'esiEmployer': item.esi_er, + 'pfEmployer': item.pf_er, + 'journal': {'id': item.journal.id, + 'account': {'id': item.journal.ledger.id, 'name': item.journal.ledger.name, + 'designation': item.journal.ledger.designation, + 'costCentre': {'id': item.journal.ledger.cost_centre.id, + 'name': item.journal.ledger.cost_centre.name}}}}) for item in voucher.service_charges: employee = request.dbsession.query(Employee).filter(Employee.id == item.journal.ledger_id).first() - json_voucher['ServiceCharges'].append( - {'EmployeeID': item.journal.ledger_id, 'Name': item.journal.ledger.name, - 'Designation': employee.designation, - 'Department': item.journal.ledger.cost_centre.name, 'DaysWorked': item.days_worked, 'Points': item.points}) - if len(json_voucher['ServiceCharges']) > 0: - json_voucher['ServiceCharge'] = [x.amount for x in voucher.journals if + json_voucher['incentives'].append( + {'id': item.journal.ledger_id, 'name': item.journal.ledger.name, + 'designation': employee.designation, + 'department': item.journal.ledger.cost_centre.name, 'daysWorked': item.days_worked, 'points': item.points}) + if len(json_voucher['incentives']) > 0: + json_voucher['incentive'] = [x.amount for x in voucher.journals if x.ledger_id == Ledger.service_charge_id()][0] for item in voucher.inventories: text = "{0} ({1}) {2:.2f}@{3:.2f} from {4}".format(item.product.name, item.product.units, item.batch.quantity_remaining, item.batch.rate, item.batch.name.strftime('%d-%b-%Y')) - json_voucher['Inventories'].append( - {'InventoryID': item.id, 'Quantity': item.quantity, 'Rate': item.rate, - 'Tax': item.tax, 'Discount': item.discount, 'Amount': item.amount, - 'Product': {'ProductID': item.product.id, 'Name': item.product.full_name, 'Units': item.product.units, - 'Price': item.rate}, - 'Batch': {'BatchID': item.batch.id, 'Name': text, - 'QuantityRemaining': item.batch.quantity_remaining, 'Tax': item.batch.tax, - 'Discount': item.batch.discount, 'Rate': item.batch.rate, - 'Product': {'ProductID': item.batch.product.id, 'Name': item.batch.product.full_name}}}) + json_voucher['inventories'].append({ + 'id': item.id, + 'quantity': item.quantity, + 'rate': item.rate, + 'tax': item.tax, + 'discount': item.discount, + 'amount': item.amount, + 'product': { + 'id': item.product.id, + 'name': item.product.full_name, + 'units': item.product.units, + 'price': item.rate + }, + 'batch': { + 'id': item.batch.id, + 'name': text, + 'quantityRemaining': item.batch.quantity_remaining, + 'tax': item.batch.tax, + 'discount': item.batch.discount, + 'rate': item.batch.rate, + 'product': { + 'id': item.batch.product.id, 'name': item.batch.product.full_name + } + } + }) images = request.dbsession.query(DbImage).filter(DbImage.resource_id == voucher.id).all() for image in images: resized = request.route_url('db_image', id=image.id, type='resized') thumbnail = request.route_url('db_image', id=image.id, type='thumbnail') - json_voucher['Files'].append({'ID': image.id, 'Resized': resized, 'Thumbnail': thumbnail}) + json_voucher['files'].append({'id': image.id, 'resized': resized, 'thumbnail': thumbnail}) return json_voucher def blank_voucher(info, dbsession): - if 'Type' not in info: + if 'type' not in info: raise ValidationError('Voucher Type is null') - type = info['Type'] - if 'Date' not in info: + type = info['type'] + if 'date' not in info: raise ValidationError('Date cannot be null') - json_voucher = {'Type': type, 'Date': info['Date'], 'Posted': False, 'Narration': "", 'Journals': [], - 'Inventories': []} + json_voucher = {'type': type, 'date': info['date'], 'posted': False, 'narration': "", 'journals': [], + 'inventories': []} if type == 'Journal': pass elif type == 'Payment': ledger = None - if info is not None and 'Account' in info and info['Account'] is not None: - ledger = dbsession.query(LedgerBase).filter(LedgerBase.id == uuid.UUID(info['Account'])).first() + if info is not None and 'account' in info and info['account'] is not None: + ledger = dbsession.query(LedgerBase).filter(LedgerBase.id == uuid.UUID(info['account'])).first() if ledger is not None: - ledger = {'LedgerID': ledger.id, 'Name': ledger.name} + ledger = {'id': ledger.id, 'name': ledger.name} else: ledger = LedgerBase.cash_in_hand() - json_voucher['Journals'].append({'Ledger': ledger, 'Amount': 0, 'Debit': -1}) + json_voucher['journals'].append({'account': ledger, 'amount': 0, 'debit': -1}) elif type == 'Receipt': ledger = None - if info is not None and 'Account' in info and info['Account'] is not None: - ledger = dbsession.query(LedgerBase).filter(LedgerBase.id == uuid.UUID(info['Account'])).first() + if info is not None and 'account' in info and info['account'] is not None: + ledger = dbsession.query(LedgerBase).filter(LedgerBase.id == uuid.UUID(info['account'])).first() if ledger is not None: - ledger = {'LedgerID': ledger.id, 'Name': ledger.name} + ledger = {'id': ledger.id, 'name': ledger.name} else: ledger = LedgerBase.cash_in_hand() - json_voucher['Journals'].append({'Ledger': ledger, 'Amount': 0, 'Debit': 1}) + json_voucher['journals'].append({'account': ledger, 'amount': 0, 'debit': 1}) elif type == 'Purchase': - json_voucher['Journals'].append({'Ledger': LedgerBase.local_purchase(), 'Amount': 0, 'Debit': -1}) + json_voucher['journals'].append({'account': LedgerBase.local_purchase(), 'amount': 0, 'debit': -1}) elif type == 'Purchase Return': - json_voucher['Journals'].append({'Ledger': LedgerBase.local_purchase(), 'Amount': 0, 'Debit': 1}) + json_voucher['journals'].append({'account': LedgerBase.local_purchase(), 'amount': 0, 'debit': 1}) elif type == 'Issue': - if 'Source' in info and 'Destination' in info: - json_voucher['Journals'].append({'Ledger': {'LedgerID': LedgerBase.all_purchases()}, - 'Amount': 0, - 'Debit': -1, - 'CostCentre': {'CostCentreID': info['Source']}}) - json_voucher['Journals'].append({'Ledger': {'LedgerID': LedgerBase.all_purchases()}, - 'Amount': 0, - 'Debit': 1, - 'CostCentre': {'CostCentreID': info['Destination']}}) - elif 'Journals' not in info: - json_voucher['Journals'].append({'Ledger': {'LedgerID': LedgerBase.all_purchases()}, - 'Amount': 0, - 'Debit': -1, - 'CostCentre': {'CostCentreID': CostCentre.cost_centre_purchase()}}) - json_voucher['Journals'].append({'Ledger': {'LedgerID': LedgerBase.all_purchases()}, - 'Amount': 0, - 'Debit': 1, - 'CostCentre': {'CostCentreID': CostCentre.cost_centre_kitchen()}}) + if 'dource' in info and 'destination' in info: + json_voucher['journals'].append({'account': {'id': LedgerBase.all_purchases()}, + 'amount': 0, + 'debit': -1, + 'costCentre': {'id': info['source']}}) + json_voucher['journals'].append({'account': {'id': LedgerBase.all_purchases()}, + 'amount': 0, + 'debit': 1, + 'costCentre': {'id': info['destination']}}) + elif 'journals' not in info: + json_voucher['journals'].append({'account': {'id': LedgerBase.all_purchases()}, + 'amount': 0, + 'debit': -1, + 'costCentre': {'id': CostCentre.cost_centre_purchase()}}) + json_voucher['journals'].append({'account': {'id': LedgerBase.all_purchases()}, + 'amount': 0, + 'debit': 1, + 'costCentre': {'id': CostCentre.cost_centre_kitchen()}}) else: - json_voucher['Date'] = info['Date'] - for item in info['Journals']: - json_voucher['Journals'].append({'Ledger': {'LedgerID': item['Ledger']['LedgerID']}, - 'Amount': 0, - 'Debit': item['Debit'], - 'CostCentre': {'CostCentreID': item['CostCentre']['CostCentreID']}}) + json_voucher['date'] = info['date'] + for item in info['journals']: + json_voucher['journals'].append({'account': {'id': item['account']['id']}, + 'amount': 0, + 'debit': item['debit'], + 'costCentre': {'id': item['costCentre']['id']}}) elif type == 'Salary Deduction': - json_voucher['SalaryDeductions'] = [] + json_voucher['employeeBenefits'] = [] elif type == 'Service Charge': - json_voucher['ServiceCharges'], json_voucher['ServiceCharge'] = service_charge_employees( - info['Date'], dbsession + json_voucher['incentives'], json_voucher['incentive'] = service_charge_employees( + info['date'], dbsession ) else: raise ValidationError("Voucher of type \"{0}\" does not exist.".format(type)) - json_voucher['Files'] = [] + json_voucher['files'] = [] return json_voucher @@ -298,8 +314,8 @@ def service_charge_employees(date, dbsession): .filter(Attendance.is_valid == True) \ .all() att = sum(map(lambda x: AttendanceType.by_id(x.attendance_type).value, att)) - details.append({'EmployeeID': employee.id, 'Name': employee.name, 'Designation': employee.designation, - 'Department': employee.cost_centre.name, 'DaysWorked': att, 'Points': employee.service_points}) + details.append({'id': employee.id, 'name': employee.name, 'designation': employee.designation, + 'department': employee.cost_centre.name, 'daysWorked': att, 'points': employee.service_points}) amount = dbsession.query(func.sum(Journal.amount * Journal.debit)) \ .join(Journal.voucher) \ @@ -325,8 +341,8 @@ def get_edit_url(request, voucher): elif voucher.type == 6: return request.route_url('purchase_return_id', id=voucher.id) elif voucher.type == 12: - return request.route_url('salary_deduction_id', id=voucher.id) + return request.route_url('employee_benefits_id', id=voucher.id) elif voucher.type == 13: - return request.route_url('service_charge_id', id=voucher.id) + return request.route_url('incentive_id', id=voucher.id) else: return '#' diff --git a/brewman/views/services/voucher/credit_salary.py b/brewman/views/services/voucher/credit_salary.py index 19d935d6..3dc41d63 100644 --- a/brewman/views/services/voucher/credit_salary.py +++ b/brewman/views/services/voucher/credit_salary.py @@ -16,7 +16,7 @@ from ..session import get_first_day, get_last_day trans=True) def credit_salary(request): user = request.dbsession.query(User).filter(User.id == uuid.UUID(request.authenticated_userid)).one() - month = datetime.datetime.strptime(request.json_body['Month'], '%d-%b-%Y') + month = datetime.datetime.strptime(request.json_body['month'], '%d-%b-%Y') start_date = get_first_day(month) finish_date = get_last_day(month) @@ -52,6 +52,6 @@ def salary_journals(start_date, finish_date, dbsession): amount += att journals.append( Journal(amount=att, debit=-1, ledger_id=employee.id, cost_centre_id=employee.cost_centre_id)) - salary = dbsession.query(Ledger).filter(Ledger.id == uuid.UUID(Ledger.salary()['LedgerID'])).first() + salary = dbsession.query(Ledger).filter(Ledger.id == uuid.UUID(Ledger.salary()['id'])).first() journals.append(Journal(amount=amount, debit=1, ledger_id=salary.id, cost_centre_id=salary.cost_centre_id)) return journals diff --git a/brewman/views/services/voucher/emptyvoucher.py b/brewman/views/services/voucher/emptyvoucher.py index e2e2644e..785a7394 100644 --- a/brewman/views/services/voucher/emptyvoucher.py +++ b/brewman/views/services/voucher/emptyvoucher.py @@ -8,58 +8,58 @@ class EmptyVoucher(object): def __init__(self, request): self.request = request - @view_config(request_param='type=Journal', permission='Journal') + @view_config(request_param='t=Journal', permission='Journal') def journal(self): return self.get_blank() - @view_config(request_param='type=Payment', permission='Payment') + @view_config(request_param='t=Payment', permission='Payment') def payment(self): account = self.request.GET.get('a', None) - return self.get_blank({'Account': account}) + return self.get_blank({'account': account}) - @view_config(request_param='type=Receipt', permission='Receipt') + @view_config(request_param='t=Receipt', permission='Receipt') def receipt(self): account = self.request.GET.get('a', None) - return self.get_blank({'Account': account}) + return self.get_blank({'account': account}) - @view_config(request_param='type=Purchase', permission='Purchase') + @view_config(request_param='t=Purchase', permission='Purchase') def purchase(self): return self.get_blank() - @view_config(request_param='type=Purchase Return', permission='Purchase Return') + @view_config(request_param='t=Purchase Return', permission='Purchase Return') def purchase_return(self): return self.get_blank() - @view_config(request_param='type=Salary Deduction', permission='Purchase Return') + @view_config(request_param='t=Salary Deduction', permission='Purchase Return') def purchase_return(self): return self.get_blank() - @view_config(request_param='type=Issue', permission='Issue') + @view_config(request_param='t=Issue', permission='Issue') def issue(self): - voucher_type = self.request.GET.get('type', None) - date = self.request.GET.get('Date', None) - source = self.request.GET.get('Source', None) - destination = self.request.GET.get('Destination', None) + voucher_type = self.request.GET.get('t', None) + date = self.request.GET.get('date', None) + source = self.request.GET.get('source', None) + destination = self.request.GET.get('destination', None) if date is not None and source is not None and destination is not None: - return blank_voucher({'Type': voucher_type, 'Date': date, 'Source': source, 'Destination': destination}, + return blank_voucher({'type': voucher_type, 'date': date, 'source': source, 'destination': destination}, self.request.dbsession) else: return self.get_blank() - @view_config(request_param='type=Service Charge', permission='Service Charge') + @view_config(request_param='t=Service Charge', permission='Service Charge') def service_charge(self): - voucher_type = self.request.GET.get('type', None) - date = self.request.GET.get('Date', None) + voucher_type = self.request.GET.get('t', None) + date = self.request.GET.get('d', None) if date is not None: - return blank_voucher({'Type': voucher_type, 'Date': date}, self.request.dbsession) + return blank_voucher({'type': voucher_type, 'date': date}, self.request.dbsession) else: return self.get_blank() def get_blank(self, additional_info=None): - voucher_type = self.request.GET.get('type', None) + voucher_type = self.request.GET.get('t', None) if additional_info is None: additional_info = {} - additional_info['Date'] = session_current_date(self.request) - additional_info['Type'] = voucher_type + additional_info['date'] = session_current_date(self.request) + additional_info['type'] = voucher_type return blank_voucher(additional_info, self.request.dbsession) diff --git a/brewman/views/services/voucher/issue.py b/brewman/views/services/voucher/issue.py index 574d43a5..08e2a5e2 100644 --- a/brewman/views/services/voucher/issue.py +++ b/brewman/views/services/voucher/issue.py @@ -8,15 +8,15 @@ from brewman.models.voucher import Voucher, VoucherType, Batch, Inventory, Journ def issue_create_voucher(json, user, dbsession): - dt = datetime.datetime.strptime(json['Date'], '%d-%b-%Y') - voucher = Voucher(date=dt, narration=json['Narration'], user_id=user.id, type=VoucherType.by_name('Issue')) + dt = datetime.datetime.strptime(json['date'], '%d-%b-%Y') + voucher = Voucher(date=dt, narration=json['narration'], user_id=user.id, type=VoucherType.by_name('Issue')) dbsession.add(voucher) - for item in json['Journals']: - if int(item['Debit']) == 1: - destination = uuid.UUID(item['CostCentre']['CostCentreID']) + for item in json['journals']: + if int(item['debit']) == 1: + destination = uuid.UUID(item['costCentre']['id']) else: - source = uuid.UUID(item['CostCentre']['CostCentreID']) + source = uuid.UUID(item['costCentre']['id']) if source == destination: raise ValidationError("Source cannot be the same as destination") if source == CostCentre.cost_centre_purchase(): @@ -25,7 +25,7 @@ def issue_create_voucher(json, user, dbsession): batch_consumed = False else: batch_consumed = None - for item in json['Inventories']: + for item in json['inventories']: issue_create_inventory(voucher, item, batch_consumed, dbsession) for item in issue_create_journals(voucher.inventories, source, destination): voucher.journals.append(item) @@ -36,9 +36,9 @@ def issue_create_voucher(json, user, dbsession): def issue_create_inventory(voucher, item, batch_consumed, dbsession): - batch = dbsession.query(Batch).filter(Batch.id == uuid.UUID(item['Batch']['BatchID'])).first() - inventory_id = uuid.UUID(item['InventoryID']) if 'InventoryID' in item else None - quantity = round(Decimal(item['Quantity']), 2) + batch = dbsession.query(Batch).filter(Batch.id == uuid.UUID(item['batch']['id'])).first() + inventory_id = uuid.UUID(item['id']) if 'id' in item and item['id'] is not None else None + quantity = round(Decimal(item['quantity']), 2) if quantity <= 0: raise ValidationError("Quantity of {0} cannot be zero".format(item.product.name)) @@ -70,8 +70,8 @@ def issue_create_journals(inventories, source, destination): def issue_update_voucher(voucher, json, user, dbsession): - voucher.date = datetime.datetime.strptime(json['Date'], '%d-%b-%Y') - voucher.narration = json['Narration'] + voucher.date = datetime.datetime.strptime(json['date'], '%d-%b-%Y') + voucher.narration = json['narration'] voucher.user_id = user.id voucher.last_edit_date = datetime.datetime.utcnow() @@ -87,11 +87,11 @@ def issue_update_voucher(voucher, json, user, dbsession): else: old_batch_consumed = None - for item in json['Journals']: - if int(item['Debit']) == 1: - destination = uuid.UUID(item['CostCentre']['CostCentreID']) + for item in json['journals']: + if int(item['debit']) == 1: + destination = uuid.UUID(item['costCentre']['id']) else: - source = uuid.UUID(item['CostCentre']['CostCentreID']) + source = uuid.UUID(item['costCentre']['id']) if source == destination: raise ValidationError("Source cannot be the same as destination") @@ -105,7 +105,7 @@ def issue_update_voucher(voucher, json, user, dbsession): if new_batch_consumed != old_batch_consumed: raise ValidationError("Purchase cost centre cannot be changed") - issue_update_inventory(voucher, json['Inventories'], old_batch_consumed, dbsession) + issue_update_inventory(voucher, json['inventories'], old_batch_consumed, dbsession) issue_update_journals(voucher, source, destination) journals_valid(voucher) inventory_valid(voucher) @@ -118,12 +118,12 @@ def issue_update_inventory(voucher, new_inventories, batch_consumed, dbsession): found = False for j in range(len(new_inventories), 0, -1): i = new_inventories[j - 1] - if 'InventoryID' in i and item.id == uuid.UUID(i['InventoryID']): - batch = dbsession.query(Batch).filter(Batch.id == uuid.UUID(i['Batch']['BatchID'])).first() + if 'id' in i and i['id'] is not None and item.id == uuid.UUID(i['id']): + batch = dbsession.query(Batch).filter(Batch.id == uuid.UUID(i['batch']['id'])).first() found = True if item.batch_id != batch.id: raise ValidationError('Product / Batch cannot be changed') - new_quantity = round(Decimal(i['Quantity']), 2) + new_quantity = round(Decimal(i['quantity']), 2) old_quantity = round(Decimal(item.quantity), 2) quantity_remaining = round(Decimal(item.batch.quantity_remaining), 2) if new_quantity <= 0: diff --git a/brewman/views/services/voucher/journal.py b/brewman/views/services/voucher/journal.py index ed8be42c..79f9631b 100644 --- a/brewman/views/services/voucher/journal.py +++ b/brewman/views/services/voucher/journal.py @@ -8,14 +8,14 @@ from brewman.models.voucher import Journal, Voucher, VoucherType, DbImage def journal_create_voucher(json, files, user, dbsession): - dt = datetime.datetime.strptime(json['Date'], '%d-%b-%Y') - voucher = Voucher(date=dt, narration=json['Narration'], user_id=user.id, type=VoucherType.by_name(json['Type'])) + dt = datetime.datetime.strptime(json['date'], '%d-%b-%Y') + voucher = Voucher(date=dt, narration=json['narration'], user_id=user.id, type=VoucherType.by_name(json['type'])) dbsession.add(voucher) - for item in json['Journals']: - ledger = dbsession.query(LedgerBase).filter(LedgerBase.id == uuid.UUID(item['Ledger']['LedgerID'])).first() - journal_id = uuid.UUID(item['JournalID']) if 'JournalID' in item else None - amount = round(Decimal(item['Amount']), 2) - journal = Journal(id=journal_id, amount=amount, debit=int(item['Debit']), ledger_id=ledger.id, + for item in json['journals']: + ledger = dbsession.query(LedgerBase).filter(LedgerBase.id == uuid.UUID(item['account']['id'])).first() + journal_id = uuid.UUID(item['id']) if 'id' in item and item['id'] is not None else None + amount = round(Decimal(item['amount']), 2) + journal = Journal(id=journal_id, amount=amount, debit=int(item['debit']), ledger_id=ledger.id, cost_centre_id=ledger.cost_centre_id) voucher.journals.append(journal) dbsession.add(journal) @@ -26,24 +26,24 @@ def journal_create_voucher(json, files, user, dbsession): def journal_update_voucher(voucher, json, files, user, dbsession): - voucher.date = datetime.datetime.strptime(json['Date'], '%d-%b-%Y') - voucher.narration = json['Narration'] + voucher.date = datetime.datetime.strptime(json['date'], '%d-%b-%Y') + voucher.narration = json['narration'] voucher.user_id = user.id voucher.posted = False voucher.last_edit_date = datetime.datetime.utcnow() - new_journals = json['Journals'] + new_journals = json['journals'] for i in range(len(voucher.journals), 0, -1): item = voucher.journals[i - 1] found = False for j in range(len(new_journals), 0, -1): new_item = new_journals[j - 1] - if 'JournalID' in new_item and item.id == uuid.UUID(new_item['JournalID']): + if 'id' in new_item and new_item['id'] is not None and item.id == uuid.UUID(new_item['id']): ledger = dbsession.query(LedgerBase).filter( - LedgerBase.id == uuid.UUID(new_item['Ledger']['LedgerID'])).first() + LedgerBase.id == uuid.UUID(new_item['account']['id'])).first() found = True - item.debit = int(new_item['Debit']) - item.amount = round(Decimal(new_item['Amount']), 2) + item.debit = int(new_item['debit']) + item.amount = round(Decimal(new_item['amount']), 2) item.ledger_id = ledger.id item.cost_centre_id = ledger.cost_centre_id new_journals.remove(new_item) @@ -51,15 +51,15 @@ def journal_update_voucher(voucher, json, files, user, dbsession): if not found: voucher.journals.remove(item) for new_item in new_journals: - ledger = dbsession.query(LedgerBase).filter(LedgerBase.id == uuid.UUID(new_item['Ledger']['LedgerID'])).first() - journal = Journal(id=None, amount=round(Decimal(new_item['Amount']), 2), debit=int(new_item['Debit']), + ledger = dbsession.query(LedgerBase).filter(LedgerBase.id == uuid.UUID(new_item['account']['id'])).first() + journal = Journal(id=None, amount=round(Decimal(new_item['amount']), 2), debit=int(new_item['debit']), ledger_id=ledger.id, cost_centre_id=ledger.cost_centre_id) dbsession.add(journal) voucher.journals.append(journal) journals_valid(voucher) - old_files = [uuid.UUID(f['ID']) for f in json['Files'] if 'ID' in f] + old_files = [uuid.UUID(f['id']) for f in json['files'] if 'id' in f and f['id'] is not None ] images = dbsession.query(DbImage).filter(DbImage.resource_id == voucher.id).all() for image in [i for i in images if i.id not in old_files]: dbsession.delete(image) diff --git a/brewman/views/services/voucher/purchase.py b/brewman/views/services/voucher/purchase.py index 1ec08b3b..e0f5f9c7 100644 --- a/brewman/views/services/voucher/purchase.py +++ b/brewman/views/services/voucher/purchase.py @@ -11,13 +11,13 @@ from brewman.models.voucher import Voucher, VoucherType, Batch, Inventory, Journ def purchase_create_voucher(json, files, user, dbsession): - dt = datetime.datetime.strptime(json['Date'], '%d-%b-%Y') - voucher = Voucher(date=dt, narration=json['Narration'], user_id=user.id, type=VoucherType.by_name(json['Type'])) + dt = datetime.datetime.strptime(json['date'], '%d-%b-%Y') + voucher = Voucher(date=dt, narration=json['narration'], user_id=user.id, type=VoucherType.by_name(json['type'])) dbsession.add(voucher) - for item in json['Inventories']: + for item in json['inventories']: purchase_create_inventory(voucher, item, dt, dbsession) - for item in purchase_create_journals(voucher.inventories, json['Journals'][0]['Ledger']['LedgerID'], dbsession): + for item in purchase_create_journals(voucher.inventories, json['journals'][0]['account']['id'], dbsession): voucher.journals.append(item) dbsession.add(item) journals_valid(voucher) @@ -28,16 +28,16 @@ def purchase_create_voucher(json, files, user, dbsession): def purchase_create_inventory(voucher, item, date, dbsession): - if 'Product' not in item or 'ProductID' not in item['Product']: + if 'product' not in item or 'id' not in item['product']: raise ValidationError('No Product in item') - product = dbsession.query(Product).filter(Product.id == uuid.UUID(item['Product']['ProductID'])).first() + product = dbsession.query(Product).filter(Product.id == uuid.UUID(item['product']['id'])).first() if product is None: raise ValidationError('No Product in item') - inventory_id = uuid.UUID(item['InventoryID']) if 'InventoryID' in item else None - quantity = round(Decimal(item['Quantity']), 2) - rate = round(Decimal(item['Rate']), 2) - tax = round(Decimal(item['Tax']), 5) - discount = round(Decimal(item['Discount']), 5) + inventory_id = uuid.UUID(item['id']) if 'id' in item and item['id'] is not None else None + quantity = round(Decimal(item['quantity']), 2) + rate = round(Decimal(item['rate']), 2) + tax = round(Decimal(item['tax']), 5) + discount = round(Decimal(item['discount']), 5) batch = Batch(name=date, product_id=product.id, quantity_remaining=quantity, rate=rate, tax=tax, discount=discount) dbsession.add(batch) @@ -68,18 +68,18 @@ def purchase_create_journals(inventories, ledger_id, dbsession): def purchase_update_voucher(voucher, json, files, user, dbsession): - voucher.date = datetime.datetime.strptime(json['Date'], '%d-%b-%Y') - voucher.narration = json['Narration'] + voucher.date = datetime.datetime.strptime(json['date'], '%d-%b-%Y') + voucher.narration = json['narration'] voucher.user_id = user.id voucher.posted = False voucher.last_edit_date = datetime.datetime.utcnow() - purchase_update_inventory(voucher, json['Inventories'], dbsession) - purchase_update_journals(voucher, json['Journals'], dbsession) + purchase_update_inventory(voucher, json['inventories'], dbsession) + purchase_update_journals(voucher, json['journals'], dbsession) journals_valid(voucher) inventory_valid(voucher) - old_files = [uuid.UUID(f['ID']) for f in json['Files'] if 'ID' in f] + old_files = [uuid.UUID(f['id']) for f in json['files'] if 'id' in f and f['id'] is not None] images = dbsession.query(DbImage).filter(DbImage.resource_id == voucher.id).all() for image in [i for i in images if i.id not in old_files]: dbsession.delete(image) @@ -94,12 +94,12 @@ def purchase_update_inventory(voucher, new_inventories, dbsession): found = False for j in range(len(new_inventories), 0, -1): i = new_inventories[j - 1] - if 'InventoryID' in i and item.id == uuid.UUID(i['InventoryID']): - product = dbsession.query(Product).filter(Product.id == uuid.UUID(i['Product']['ProductID'])).first() + if 'id' in i and i['id'] is not None and item.id == uuid.UUID(i['id']): + product = dbsession.query(Product).filter(Product.id == uuid.UUID(i['product']['id'])).first() found = True if item.product_id != product.id: raise ValidationError('Product cannot be changed') - new_quantity = round(Decimal(i['Quantity']), 2) + new_quantity = round(Decimal(i['quantity']), 2) old_quantity = round(Decimal(item.quantity), 2) quantity_remaining = round(Decimal(item.batch.quantity_remaining), 2) if new_quantity <= 0: @@ -109,9 +109,9 @@ def purchase_update_inventory(voucher, new_inventories, dbsession): old_quantity - quantity_remaining)) item.batch.quantity_remaining -= (old_quantity - new_quantity) item.quantity = new_quantity - rate = round(Decimal(i['Rate']), 2) - discount = round(Decimal(i['Discount']), 5) - tax = round(Decimal(i['Tax']), 5) + rate = round(Decimal(i['rate']), 2) + discount = round(Decimal(i['discount']), 5) + tax = round(Decimal(i['tax']), 5) if voucher.date != item.batch.name: item.batch.name = voucher.date if voucher.date < item.batch.name: @@ -138,11 +138,11 @@ def purchase_update_inventory(voucher, new_inventories, dbsession): dbsession.delete(item) voucher.inventories.remove(item) for i in new_inventories: - product = dbsession.query(Product).filter(Product.id == uuid.UUID(i['Product']['ProductID'])).first() - new_quantity = round(Decimal(i['Quantity']), 2) - rate = round(Decimal(i['Rate']), 2) - tax = round(Decimal(i['Tax']), 5) - discount = round(Decimal(i['Discount']), 5) + product = dbsession.query(Product).filter(Product.id == uuid.UUID(i['product']['id'])).first() + new_quantity = round(Decimal(i['quantity']), 2) + rate = round(Decimal(i['rate']), 2) + tax = round(Decimal(i['tax']), 5) + discount = round(Decimal(i['discount']), 5) batch = Batch(name=voucher.date, product_id=product.id, quantity_remaining=new_quantity, rate=rate, tax=tax, discount=discount) inventory = Inventory(id=None, product_id=product.id, batch=batch, quantity=new_quantity, rate=rate, tax=tax, @@ -156,9 +156,9 @@ def purchase_update_inventory(voucher, new_inventories, dbsession): def purchase_update_journals(voucher, journals, dbsession): - other_ledger = [ff for ff in journals if ff['Debit'] == -1] + other_ledger = [ff for ff in journals if ff['debit'] == -1] other_ledger = dbsession.query(LedgerBase).filter( - LedgerBase.id == uuid.UUID(other_ledger[0]['Ledger']['LedgerID'])).first() + LedgerBase.id == uuid.UUID(other_ledger[0]['account']['id'])).first() journals = dict() amount = 0 for item in voucher.inventories: diff --git a/brewman/views/services/voucher/purchase_return.py b/brewman/views/services/voucher/purchase_return.py index 4f6f70e4..a9db545c 100644 --- a/brewman/views/services/voucher/purchase_return.py +++ b/brewman/views/services/voucher/purchase_return.py @@ -8,13 +8,13 @@ from brewman.models.voucher import Voucher, VoucherType, Batch, Inventory, Journ def purchase_return_create_voucher(json, files, user, dbsession): - dt = datetime.datetime.strptime(json['Date'], '%d-%b-%Y') - voucher = Voucher(date=dt, narration=json['Narration'], user_id=user.id, type=VoucherType.by_name(json['Type'])) + dt = datetime.datetime.strptime(json['date'], '%d-%b-%Y') + voucher = Voucher(date=dt, narration=json['narration'], user_id=user.id, type=VoucherType.by_name(json['type'])) dbsession.add(voucher) - for item in json['Inventories']: + for item in json['inventories']: purchase_return_create_inventory(voucher, item, dbsession) - for item in purchase_return_create_journals(voucher.inventories, json['Journals'][0]['Ledger']['LedgerID'], + for item in purchase_return_create_journals(voucher.inventories, json['journals'][0]['account']['id'], dbsession): voucher.journals.append(item) dbsession.add(item) @@ -26,9 +26,9 @@ def purchase_return_create_voucher(json, files, user, dbsession): def purchase_return_create_inventory(voucher, item, dbsession): - batch = dbsession.query(Batch).filter(Batch.id == uuid.UUID(item['Batch']['BatchID'])).first() - inventory_id = uuid.UUID(item['InventoryID']) if 'InventoryID' in item else None - quantity = Decimal(item['Quantity']) + batch = dbsession.query(Batch).filter(Batch.id == uuid.UUID(item['batch']['id'])).first() + inventory_id = uuid.UUID(item['id']) if 'id' in item and item['id'] is not None else None + quantity = Decimal(item['quantity']) if quantity <= 0: raise ValidationError("Quantity of {0} cannot be zero".format(item.product.name)) @@ -64,18 +64,18 @@ def purchase_return_create_journals(inventories, ledger_id, dbsession): def purchase_return_update_voucher(voucher, json, files, user, dbsession): - voucher.date = datetime.datetime.strptime(json['Date'], '%d-%b-%Y') - voucher.narration = json['Narration'] + voucher.date = datetime.datetime.strptime(json['date'], '%d-%b-%Y') + voucher.narration = json['narration'] voucher.user_id = user.id voucher.posted = False voucher.last_edit_date = datetime.datetime.utcnow() - purchase_return_update_inventory(voucher, json['Inventories'], json['Date'], dbsession) - purchase_return_update_journals(voucher, json['Journals'], dbsession) + purchase_return_update_inventory(voucher, json['inventories'], json['date'], dbsession) + purchase_return_update_journals(voucher, json['journals'], dbsession) journals_valid(voucher) inventory_valid(voucher) - old_files = [uuid.UUID(f['ID']) for f in json['Files'] if 'ID' in f] + old_files = [uuid.UUID(f['id']) for f in json['files'] if 'id' in f and f['id'] is not None] images = dbsession.query(DbImage).filter(DbImage.resource_id == voucher.id).all() for image in [i for i in images if i.id not in old_files]: dbsession.delete(image) @@ -90,12 +90,12 @@ def purchase_return_update_inventory(voucher, new_inventories, date, dbsession): found = False for j in range(len(new_inventories), 0, -1): i = new_inventories[j - 1] - if 'InventoryID' in i and item.id == uuid.UUID(i['InventoryID']): - product = dbsession.query(Product).filter(Product.id == uuid.UUID(i['Product']['ProductID'])).first() + if 'id' in i and i['id'] is not None and item.id == uuid.UUID(i['id']): + product = dbsession.query(Product).filter(Product.id == uuid.UUID(i['product']['id'])).first() found = True if item.product_id != product.id: raise ValidationError('Product cannot be changed') - quantity = round(Decimal(i['Quantity']), 2) + quantity = round(Decimal(i['quantity']), 2) if quantity == 0: raise ValidationError("Quantity of {0} cannot be zero".format(item.product.name)) if quantity - item.quantity > item.batch.quantity_remaining: @@ -119,9 +119,9 @@ def purchase_return_update_inventory(voucher, new_inventories, date, dbsession): def purchase_return_update_journals(voucher, journals, dbsession): - other_ledger = [ff for ff in journals if ff['Debit'] == 1] + other_ledger = [ff for ff in journals if ff['debit'] == 1] other_ledger = dbsession.query(LedgerBase).filter( - LedgerBase.id == uuid.UUID(other_ledger[0]['Ledger']['LedgerID'])).first() + LedgerBase.id == uuid.UUID(other_ledger[0]['account']['id'])).first() journals = dict() amount = 0 for item in voucher.inventories: diff --git a/brewman/views/services/voucher/salary_deduction.py b/brewman/views/services/voucher/salary_deduction.py index 104b6e35..0a7bf863 100644 --- a/brewman/views/services/voucher/salary_deduction.py +++ b/brewman/views/services/voucher/salary_deduction.py @@ -9,12 +9,12 @@ from brewman.views.services.session import get_last_day def salary_deduction_create_voucher(json, user, dbsession): - dt = get_last_day(datetime.datetime.strptime(json['Date'], '%d-%b-%Y')) + dt = get_last_day(datetime.datetime.strptime(json['date'], '%d-%b-%Y')) days_in_month = dt.day voucher = Voucher(date=dt, user_id=user.id, type=VoucherType.by_id(12)) dbsession.add(voucher) exp, total = 0, 0 - for item in json['SalaryDeductions']: + for item in json['employeeBenefits']: item_exp, item_total = add_salary_deduction(item, days_in_month, voucher, dbsession) exp += item_exp total += item_total @@ -32,7 +32,7 @@ def salary_deduction_create_voucher(json, user, dbsession): def salary_deduction_update_voucher(voucher, json, user, dbsession): - dt = get_last_day(datetime.datetime.strptime(json['Date'], '%d-%b-%Y')) + dt = get_last_day(datetime.datetime.strptime(json['date'], '%d-%b-%Y')) if dt != voucher.date.date(): raise ValidationError("Date Cannot be changed for Salary Deduction voucher!") days_in_month = voucher.date.day @@ -40,14 +40,14 @@ def salary_deduction_update_voucher(voucher, json, user, dbsession): voucher.posted = False voucher.last_edit_date = datetime.datetime.utcnow() - new_deductions = json['SalaryDeductions'] + new_deductions = json['employeeBenefits'] exp, total, journals = 0, 0, [] for i in range(len(voucher.salary_deductions), 0, -1): item = voucher.salary_deductions[i - 1] found = False for j in range(len(new_deductions), 0, -1): new_item = new_deductions[j - 1] - if 'SalaryDeductionID' in new_item and item.id == uuid.UUID(new_item['SalaryDeductionID']): + if 'id' in new_item and new_item['id'] is not None and item.id == uuid.UUID(new_item['id']): journals.append(item.journal.id) exp += item.esi_er + item.pf_er total += item.esi_ee + item.pf_ee + item.esi_er + item.pf_er @@ -73,9 +73,9 @@ def salary_deduction_update_voucher(voucher, json, user, dbsession): def add_salary_deduction(item, days_in_month, voucher, dbsession): - ledger = dbsession.query(Employee).filter(Employee.id == uuid.UUID(item['Journal']['Ledger']['LedgerID'])).first() - gross_salary = int(item['GrossSalary']) - days_worked = int(item['DaysWorked']) + ledger = dbsession.query(Employee).filter(Employee.id == uuid.UUID(item['journal']['account']['id'])).first() + gross_salary = int(item['grossSalary']) + days_worked = int(item['daysWorked']) esi_ee, esi_er, esi_both = esi_contribution(gross_salary, days_worked, days_in_month) pf_ee, pf_er, pf_both = pf_contribution(gross_salary, days_worked, days_in_month) journal = Journal(amount=esi_ee + pf_ee, debit=1, ledger_id=ledger.id, cost_centre_id=ledger.cost_centre_id) diff --git a/brewman/views/services/voucher/savevoucher.py b/brewman/views/services/voucher/savevoucher.py index 84bc22f7..6ffe5ba6 100644 --- a/brewman/views/services/voucher/savevoucher.py +++ b/brewman/views/services/voucher/savevoucher.py @@ -38,37 +38,37 @@ class SaveVoucher(object): self.user = request.dbsession.query(User).filter(User.id == uuid.UUID(request.authenticated_userid)).one() self.json, self.files = parse_post(request) self.start, self.finish = get_lock_info(request.dbsession) - self.voucher_date = datetime.datetime.strptime(self.json['Date'], '%d-%b-%Y') + self.voucher_date = datetime.datetime.strptime(self.json['date'], '%d-%b-%Y') - @view_config(request_param='type=Journal', permission='Journal') + @view_config(request_param='t=Journal', permission='Journal') def journal(self): return self.save() - @view_config(request_param='type=Payment', permission='Payment') + @view_config(request_param='t=Payment', permission='Payment') def payment(self): return self.save() - @view_config(request_param='type=Receipt', permission='Receipt') + @view_config(request_param='t=Receipt', permission='Receipt') def receipt(self): return self.save() - @view_config(request_param='type=Purchase', permission='Purchase') + @view_config(request_param='t=Purchase', permission='Purchase') def purchase(self): return self.save() - @view_config(request_param='type=Purchase Return', permission='Purchase Return') + @view_config(request_param='t=Purchase Return', permission='Purchase Return') def purchase_return(self): return self.save() - @view_config(request_param='type=Issue', permission='Issue') + @view_config(request_param='t=Issue', permission='Issue') def issue(self): return self.save() - @view_config(request_param='type=Salary Deduction', permission='Salary Deduction') + @view_config(request_param='t=Salary Deduction', permission='Salary Deduction') def salary_deduction(self): return self.save() - @view_config(request_param='type=Service Charge', permission='Service Charge') + @view_config(request_param='t=Service Charge', permission='Service Charge') def salary_deduction(self): return self.save() @@ -78,19 +78,19 @@ class SaveVoucher(object): elif self.finish is not None and self.finish < self.voucher_date: raise ValidationError("Vouchers after {0} have been locked.".format(self.finish.strftime('%d-%b-%Y'))) - if self.json['Type'] in ['Journal', 'Payment', 'Receipt']: + if self.json['type'] in ['Journal', 'Payment', 'Receipt']: voucher = journal_create_voucher(self.json, self.files, self.user, self.request.dbsession) - elif self.json['Type'] in ['Purchase']: + elif self.json['type'] in ['Purchase']: voucher = purchase_create_voucher(self.json, self.files, self.user, self.request.dbsession) - elif self.json['Type'] in ['Purchase Return']: + elif self.json['type'] in ['Purchase Return']: voucher = purchase_return_create_voucher(self.json, self.files, self.user, self.request.dbsession) - elif self.json['Type'] in ['Issue']: + elif self.json['type'] in ['Issue']: voucher = issue_create_voucher(self.json, self.user, self.request.dbsession) - elif self.json['Type'] in ['Salary Deduction']: + elif self.json['type'] in ['Salary Deduction']: voucher = salary_deduction_create_voucher(self.json, self.user, self.request.dbsession) - elif self.json['Type'] in ['Service Charge']: + elif self.json['type'] in ['Service Charge']: voucher = service_charge_create_voucher(self.json, self.user, self.request.dbsession) transaction.commit() - session_current_date_set(self.request, self.json['Date']) + session_current_date_set(self.request, self.json['date']) new_voucher = self.request.dbsession.query(Voucher).filter(Voucher.id == voucher.id).first() return voucher_info(new_voucher, self.request) diff --git a/brewman/views/services/voucher/service_charge.py b/brewman/views/services/voucher/service_charge.py index d8a75cc8..4da50bae 100644 --- a/brewman/views/services/voucher/service_charge.py +++ b/brewman/views/services/voucher/service_charge.py @@ -1,6 +1,6 @@ import datetime -from decimal import Decimal import uuid +from decimal import Decimal from sqlalchemy import or_, func @@ -11,26 +11,26 @@ from brewman.views.services.session import get_first_day def service_charge_create_voucher(json, user, dbsession): - date = datetime.datetime.strptime(json['Date'], '%d-%b-%Y') + date = datetime.datetime.strptime(json['date'], '%d-%b-%Y') voucher = Voucher(date=date, user_id=user.id, type=VoucherType.by_id(13)) dbsession.add(voucher) - employees = get_employees(get_first_day(date), date + datetime.timedelta(1), json['ServiceCharges'], + employees = get_employees(get_first_day(date), date + datetime.timedelta(1), json['incentives'], dbsession=dbsession) amount = balance(date, dbsession=dbsession) * Decimal(.7) * Decimal(.9) total_points = 0 for item in employees: - total_points += item['Points'] * item['DaysWorked'] + total_points += item['points'] * item['daysWorked'] point_value = round(amount / total_points, 2) total_amount = 0 for item in employees: - item_amount = round(item['Points'] * item['DaysWorked'] * point_value) - employee = item['Employee'] + item_amount = round(item['points'] * item['daysWorked'] * point_value) + employee = item['employee'] journal = Journal(amount=item_amount, debit=-1, ledger_id=employee.id, cost_centre_id=employee.cost_centre_id) - sc = ServiceCharge(journal=journal, days_worked=item['DaysWorked'], points=item['Points']) + sc = ServiceCharge(journal=journal, days_worked=item['daysWorked'], points=item['points']) voucher.journals.append(journal) voucher.service_charges.append(sc) dbsession.add(journal) @@ -46,27 +46,32 @@ def service_charge_create_voucher(json, user, dbsession): def service_charge_update_voucher(voucher, json, user, dbsession): - date = datetime.datetime.strptime(json['Date'], '%d-%b-%Y') + date = datetime.datetime.strptime(json['date'], '%d-%b-%Y') voucher.date = date voucher.user_id = user.id voucher.posted = False voucher.last_edit_date = datetime.datetime.utcnow() - employees = get_employees(get_first_day(date), date + datetime.timedelta(1), json['ServiceCharges'], - voucher.journals, dbsession=dbsession) + employees = get_employees( + get_first_day(date), + date + datetime.timedelta(1), + json['incentives'], + voucher.journals, + dbsession=dbsession + ) amount = balance(date, voucher.id, dbsession) * Decimal(.7) * Decimal(.9) total_points = 0 for item in employees: - total_points += item['Points'] * item['DaysWorked'] + total_points += item['points'] * item['daysWorked'] point_value = round(amount / total_points, 2) total_amount = 0 for item in voucher.service_charges: - employee = [e for e in employees if e['Employee'].id == item.journal.ledger_id][0] - item_amount = round(employee['Points'] * employee['DaysWorked'] * point_value) - item.days_worked = employee['DaysWorked'] - item.points = employee['Points'] + employee = [e for e in employees if e['employee'].id == item.journal.ledger_id][0] + item_amount = round(employee['points'] * employee['daysWorked'] * point_value) + item.days_worked = employee['daysWorked'] + item.points = employee['points'] item.journal.amount = item_amount total_amount += item_amount @@ -79,10 +84,13 @@ def service_charge_update_voucher(voucher, json, user, dbsession): def get_employees(start_date, finish_date, json, voucher_employees=None, dbsession=None): details = [] - employees = dbsession.query(Employee) \ - .filter(Employee.joining_date <= finish_date) \ - .filter(or_(Employee.is_active, Employee.leaving_date >= start_date)) \ - .order_by(Employee.cost_centre_id).order_by(Employee.designation).order_by(Employee.name).all() + employees = dbsession.query( + Employee + ).filter( + Employee.joining_date <= finish_date + ).filter( + or_(Employee.is_active, Employee.leaving_date >= start_date) + ).order_by(Employee.cost_centre_id).order_by(Employee.designation).order_by(Employee.name).all() check_if_employees_changed(json, employees, voucher_employees) @@ -94,10 +102,10 @@ def get_employees(start_date, finish_date, json, voucher_employees=None, dbsessi .filter(Attendance.is_valid == True) \ .all() att = sum(map(lambda x: AttendanceType.by_id(x.attendance_type).value, att)) - details.append({'Employee': employee, 'DaysWorked': round(Decimal(att), 2)}) + details.append({'employee': employee, 'daysWorked': round(Decimal(att), 2)}) for item in details: - j = [x for x in json if uuid.UUID(x['EmployeeID']) == item['Employee'].id][0] - item['Points'] = round(Decimal(j['Points']), 2) + j = [x for x in json if uuid.UUID(x['id']) == item['employee'].id][0] + item['points'] = round(Decimal(j['points']), 2) json.remove(j) return details @@ -115,16 +123,12 @@ def balance(date, voucher_id=None, dbsession=None): def check_if_employees_changed(json, db, voucher): - json = set([uuid.UUID(x['EmployeeID']) for x in json]) + json = set([uuid.UUID(x['id']) for x in json]) db = set([x.id for x in db]) - voucher = set([x.ledger_id for x in voucher]) if voucher is not None else None + voucher = set([x.ledger_id for x in voucher if x.ledger_id != Ledger.service_charge_id()]) if voucher is not None else None if voucher is None: - if len(json) != len(db): - raise ValueError("Employee missing in json data") if len(json ^ db) != 0: raise ValueError("Employee missing in json data") else: - if len(json) != len(db) != len(voucher): - raise ValueError("Employee missing in json data") if len(json ^ db) != 0 or len(db ^ voucher) != 0: raise ValueError("Employee missing in json data") diff --git a/brewman/views/services/voucher/updatevoucher.py b/brewman/views/services/voucher/updatevoucher.py index 7dc06f05..d0425a97 100644 --- a/brewman/views/services/voucher/updatevoucher.py +++ b/brewman/views/services/voucher/updatevoucher.py @@ -40,7 +40,7 @@ class UpdateVoucher(object): Voucher.id == uuid.UUID(request.matchdict['id'])).first() self.json, self.files = parse_post(request) self.start, self.finish = get_lock_info(request.dbsession) - self.voucher_date = datetime.datetime.strptime(self.json['Date'], '%d-%b-%Y') + self.voucher_date = datetime.datetime.strptime(self.json['date'], '%d-%b-%Y') if self.voucher.posted and not request.has_permission('Edit Posted Vouchers'): response = Response("You are not allowed to edit posted vouchers") @@ -61,56 +61,56 @@ class UpdateVoucher(object): else: self.error = None - @view_config(request_param='type=Journal', permission='Journal') + @view_config(request_param='t=Journal', permission='Journal') def journal(self): return self.update() - @view_config(request_param='type=Payment', permission='Payment') + @view_config(request_param='t=Payment', permission='Payment') def payment(self): return self.update() - @view_config(request_param='type=Receipt', permission='Receipt') + @view_config(request_param='t=Receipt', permission='Receipt') def receipt(self): return self.update() - @view_config(request_param='type=Purchase', permission='Purchase') + @view_config(request_param='t=Purchase', permission='Purchase') def purchase(self): return self.update() - @view_config(request_param='type=Purchase Return', permission='Purchase Return') + @view_config(request_param='t=Purchase Return', permission='Purchase Return') def purchase_return(self): return self.update() - @view_config(request_param='type=Issue', permission='Issue') + @view_config(request_param='t=Issue', permission='Issue') def issue(self): return self.update() - @view_config(request_param='type=Salary Deduction', permission='Salary Deduction') + @view_config(request_param='t=Salary Deduction', permission='Salary Deduction') def salary_deduction(self): return self.update() - @view_config(request_param='type=Service Charge', permission='Service Charge') + @view_config(request_param='t=Service Charge', permission='Service Charge') def service_charge(self): return self.update() def update(self): if self.error is not None: return self.error - if self.json['Type'] in ['Journal', 'Payment', 'Receipt']: + if self.json['type'] in ['Journal', 'Payment', 'Receipt']: voucher = journal_update_voucher(self.voucher, self.json, self.files, self.user, self.request.dbsession) - elif self.json['Type'] in ['Purchase']: + elif self.json['type'] in ['Purchase']: voucher = purchase_update_voucher(self.voucher, self.json, self.files, self.user, self.request.dbsession) - elif self.json['Type'] in ['Purchase Return']: + elif self.json['type'] in ['Purchase Return']: voucher = purchase_return_update_voucher( self.voucher, self.json, self.files, self.user, self.request.dbsession ) - elif self.json['Type'] in ['Issue']: + elif self.json['type'] in ['Issue']: voucher = issue_update_voucher(self.voucher, self.json, self.user, self.request.dbsession) - elif self.json['Type'] in ['Salary Deduction']: + elif self.json['type'] in ['Salary Deduction']: voucher = salary_deduction_update_voucher(self.voucher, self.json, self.user, self.request.dbsession) - elif self.json['Type'] in ['Service Charge']: + elif self.json['type'] in ['Service Charge']: voucher = service_charge_update_voucher(self.voucher, self.json, self.user, self.request.dbsession) transaction.commit() - session_current_date_set(self.request, self.json['Date']) + session_current_date_set(self.request, self.json['date']) new_voucher = self.request.dbsession.query(Voucher).filter(Voucher.id == voucher.id).first() return voucher_info(new_voucher, self.request) diff --git a/development.ini b/development.ini index 82b0f108..234382c5 100644 --- a/development.ini +++ b/development.ini @@ -6,7 +6,7 @@ pyramid.debug_authorization = false pyramid.debug_notfound = false pyramid.debug_routematch = false pyramid.default_locale_name = en -# sqlalchemy.url = postgresql://hops:123456@localhost:8765/hops +# sqlalchemy.url = postgresql://hops:123456@localhost:7654/hops sqlalchemy.url = postgresql://postgres:123456@localhost:5432/hops [server:main] diff --git a/overlord/.editorconfig b/overlord/.editorconfig new file mode 100644 index 00000000..6e87a003 --- /dev/null +++ b/overlord/.editorconfig @@ -0,0 +1,13 @@ +# Editor configuration, see http://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +max_line_length = off +trim_trailing_whitespace = false diff --git a/overlord/.gitignore b/overlord/.gitignore new file mode 100644 index 00000000..ee5c9d83 --- /dev/null +++ b/overlord/.gitignore @@ -0,0 +1,39 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist +/tmp +/out-tsc + +# dependencies +/node_modules + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# misc +/.sass-cache +/connect.lock +/coverage +/libpeerconnection.log +npm-debug.log +yarn-error.log +testem.log +/typings + +# System Files +.DS_Store +Thumbs.db diff --git a/overlord/README.md b/overlord/README.md new file mode 100644 index 00000000..170ad4b0 --- /dev/null +++ b/overlord/README.md @@ -0,0 +1,27 @@ +# Overlord + +This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.0.0. + +## Development server + +Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. + +## Code scaffolding + +Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. + +## Build + +Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. + +## Running unit tests + +Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). + +## Running end-to-end tests + +Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). + +## Further help + +To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). diff --git a/overlord/angular.json b/overlord/angular.json new file mode 100644 index 00000000..0474a345 --- /dev/null +++ b/overlord/angular.json @@ -0,0 +1,129 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "overlord": { + "root": "", + "sourceRoot": "src", + "projectType": "application", + "prefix": "app", + "schematics": {}, + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "../brewman/static", + "index": "src/index.html", + "main": "src/main.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "src/tsconfig.app.json", + "assets": [ + "src/favicon.ico", + "src/assets" + ], + "styles": [ + { + "input": "node_modules/@angular/material/prebuilt-themes/indigo-pink.css" + }, + "src/styles.css" + ], + "scripts": [] + }, + "configurations": { + "production": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "extractCss": true, + "namedChunks": false, + "aot": true, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true + } + } + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "browserTarget": "overlord:build", + "proxyConfig": "proxy.conf.json" + }, + "configurations": { + "production": { + "browserTarget": "overlord:build:production" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "overlord:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "src/test.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "src/tsconfig.spec.json", + "karmaConfig": "src/karma.conf.js", + "styles": [ + { + "input": "node_modules/@angular/material/prebuilt-themes/indigo-pink.css" + }, + "styles.css" + ], + "scripts": [], + "assets": [ + "src/favicon.ico", + "src/assets" + ] + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "src/tsconfig.app.json", + "src/tsconfig.spec.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + } + } + }, + "overlord-e2e": { + "root": "e2e/", + "projectType": "application", + "architect": { + "e2e": { + "builder": "@angular-devkit/build-angular:protractor", + "options": { + "protractorConfig": "e2e/protractor.conf.js", + "devServerTarget": "overlord:serve" + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": "e2e/tsconfig.e2e.json", + "exclude": [ + "**/node_modules/**" + ] + } + } + } + } + }, + "defaultProject": "overlord" +} diff --git a/overlord/e2e/protractor.conf.js b/overlord/e2e/protractor.conf.js new file mode 100644 index 00000000..86776a39 --- /dev/null +++ b/overlord/e2e/protractor.conf.js @@ -0,0 +1,28 @@ +// Protractor configuration file, see link for more information +// https://github.com/angular/protractor/blob/master/lib/config.ts + +const { SpecReporter } = require('jasmine-spec-reporter'); + +exports.config = { + allScriptsTimeout: 11000, + specs: [ + './src/**/*.e2e-spec.ts' + ], + capabilities: { + 'browserName': 'chrome' + }, + directConnect: true, + baseUrl: 'http://localhost:4200/', + framework: 'jasmine', + jasmineNodeOpts: { + showColors: true, + defaultTimeoutInterval: 30000, + print: function() {} + }, + onPrepare() { + require('ts-node').register({ + project: require('path').join(__dirname, './tsconfig.e2e.json') + }); + jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); + } +}; \ No newline at end of file diff --git a/overlord/e2e/src/app.e2e-spec.ts b/overlord/e2e/src/app.e2e-spec.ts new file mode 100644 index 00000000..e42d1f96 --- /dev/null +++ b/overlord/e2e/src/app.e2e-spec.ts @@ -0,0 +1,14 @@ +import { AppPage } from './app.po'; + +describe('workspace-project App', () => { + let page: AppPage; + + beforeEach(() => { + page = new AppPage(); + }); + + it('should display welcome message', () => { + page.navigateTo(); + expect(page.getParagraphText()).toEqual('Welcome to app!'); + }); +}); diff --git a/overlord/e2e/src/app.po.ts b/overlord/e2e/src/app.po.ts new file mode 100644 index 00000000..82ea75ba --- /dev/null +++ b/overlord/e2e/src/app.po.ts @@ -0,0 +1,11 @@ +import { browser, by, element } from 'protractor'; + +export class AppPage { + navigateTo() { + return browser.get('/'); + } + + getParagraphText() { + return element(by.css('app-root h1')).getText(); + } +} diff --git a/overlord/e2e/tsconfig.e2e.json b/overlord/e2e/tsconfig.e2e.json new file mode 100644 index 00000000..a6dd6220 --- /dev/null +++ b/overlord/e2e/tsconfig.e2e.json @@ -0,0 +1,13 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/app", + "module": "commonjs", + "target": "es5", + "types": [ + "jasmine", + "jasminewd2", + "node" + ] + } +} \ No newline at end of file diff --git a/overlord/package.json b/overlord/package.json new file mode 100644 index 00000000..5a455efa --- /dev/null +++ b/overlord/package.json @@ -0,0 +1,54 @@ +{ + "name": "overlord", + "version": "0.0.0", + "scripts": { + "ng": "ng", + "start": "ng serve", + "build": "ng build", + "test": "ng test", + "lint": "ng lint", + "e2e": "ng e2e" + }, + "private": true, + "dependencies": { + "@angular/animations": "^6.0.3", + "@angular/cdk": "^6.1.0", + "@angular/common": "^6.0.3", + "@angular/compiler": "^6.0.3", + "@angular/core": "^6.0.3", + "@angular/flex-layout": "^6.0.0-beta.15", + "@angular/forms": "^6.0.3", + "@angular/http": "^6.0.3", + "@angular/material": "^6.1.0", + "@angular/material-moment-adapter": "^6.1.0", + "@angular/platform-browser": "^6.0.3", + "@angular/platform-browser-dynamic": "^6.0.3", + "@angular/router": "^6.0.3", + "core-js": "^2.5.4", + "moment": "^2.22.1", + "rxjs": "^6.2.0", + "zone.js": "^0.8.26" + }, + "devDependencies": { + "@angular-devkit/build-angular": "~0.6.0", + "@angular/cli": "~6.0.0", + "@angular/compiler-cli": "^6.0.3", + "@angular/language-service": "^6.0.3", + "@types/jasmine": "~2.8.6", + "@types/jasminewd2": "~2.0.3", + "@types/node": "~8.9.4", + "codelyzer": "~4.2.1", + "jasmine-core": "~2.99.1", + "jasmine-spec-reporter": "~4.2.1", + "karma": "~1.7.1", + "karma-chrome-launcher": "~2.2.0", + "karma-coverage-istanbul-reporter": "~1.4.2", + "karma-jasmine": "~1.1.1", + "karma-jasmine-html-reporter": "^0.2.2", + "protractor": "~5.3.0", + "standard-version": "^4.4.0", + "ts-node": "~5.0.1", + "tslint": "~5.9.1", + "typescript": "~2.7.2" + } +} diff --git a/overlord/proxy.conf.json b/overlord/proxy.conf.json new file mode 100644 index 00000000..3f3209c2 --- /dev/null +++ b/overlord/proxy.conf.json @@ -0,0 +1,7 @@ +{ + "/api": { + "target": "http://localhost:6543", + "secure": false, + "logLevel": "debug" + } +} diff --git a/brewman/static/src/app/home/home.html b/overlord/src/app/account/account-detail/account-detail.component.css similarity index 100% rename from brewman/static/src/app/home/home.html rename to overlord/src/app/account/account-detail/account-detail.component.css diff --git a/overlord/src/app/account/account-detail/account-detail.component.html b/overlord/src/app/account/account-detail/account-detail.component.html new file mode 100644 index 00000000..d6649996 --- /dev/null +++ b/overlord/src/app/account/account-detail/account-detail.component.html @@ -0,0 +1,56 @@ +
    + + + Account + + +
    +
    + + Code + + +
    +
    + + Name + + +
    +
    + + Account Type + + + {{ at.name }} + + + +
    +
    + Is Active? + Is Reconcilable? +
    +
    + + Cost Centre + + + {{ cs.name }} + + + +
    +
    +
    + + + + +
    +
    diff --git a/overlord/src/app/account/account-detail/account-detail.component.spec.ts b/overlord/src/app/account/account-detail/account-detail.component.spec.ts new file mode 100644 index 00000000..533600b2 --- /dev/null +++ b/overlord/src/app/account/account-detail/account-detail.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {AccountDetailComponent} from './account-detail.component'; + +describe('AccountDetailComponent', () => { + let component: AccountDetailComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [AccountDetailComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AccountDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/account/account-detail/account-detail.component.ts b/overlord/src/app/account/account-detail/account-detail.component.ts new file mode 100644 index 00000000..68514a7a --- /dev/null +++ b/overlord/src/app/account/account-detail/account-detail.component.ts @@ -0,0 +1,121 @@ +import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; +import {ToasterService} from '../../core/toaster.service'; +import {ActivatedRoute, Router} from '@angular/router'; +import {AccountService} from '../account.service'; +import {Account} from '../account'; +import {AccountType} from '../account-type'; +import {CostCentre} from '../../cost-centre/cost-centre'; +import {ConfirmDialogComponent} from '../../shared/confirm-dialog/confirm-dialog.component'; +import {MatDialog} from '@angular/material'; +import {FormBuilder, FormGroup} from '@angular/forms'; + +@Component({ + selector: 'app-account-detail', + templateUrl: './account-detail.component.html', + styleUrls: ['./account-detail.component.css'] +}) +export class AccountDetailComponent implements OnInit, AfterViewInit { + @ViewChild('nameElement') nameElement: ElementRef; + form: FormGroup; + accountTypes: AccountType[]; + costCentres: CostCentre[]; + item: Account; + + constructor( + private route: ActivatedRoute, + private router: Router, + private dialog: MatDialog, + private fb: FormBuilder, + private toaster: ToasterService, + private ser: AccountService + ) { + this.createForm(); + } + + createForm() { + this.form = this.fb.group({ + code: {value: '', disabled: true}, + name: '', + type: '', + isActive: '', + isReconcilable: '', + costCentre: '' + }); + } + + ngOnInit() { + this.route.data + .subscribe((data: { item: Account, accountTypes: AccountType[], costCentres: CostCentre[] }) => { + this.accountTypes = data.accountTypes; + this.costCentres = data.costCentres; + this.showItem(data.item); + }); + } + + showItem(item: Account) { + this.item = item; + this.form.setValue({ + code: this.item.code || '(Auto)', + name: this.item.name, + type: this.item.type, + isActive: this.item.isActive, + isReconcilable: this.item.isReconcilable, + costCentre: this.item.costCentre.id + }); + } + + ngAfterViewInit() { + setTimeout(() => { + this.nameElement.nativeElement.focus(); + }, 0); + } + + save() { + this.ser.saveOrUpdate(this.getItem()) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigateByUrl('/Accounts'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + delete() { + this.ser.delete(this.item.id) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigateByUrl('/Accounts'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + confirmDelete(): void { + const dialogRef = this.dialog.open(ConfirmDialogComponent, { + width: '250px', + data: {title: 'Delete Account?', content: 'Are you sure? This cannot be undone.'} + }); + + dialogRef.afterClosed().subscribe((result: boolean) => { + if (result) { + this.delete(); + } + }); + } + + getItem(): Account { + const formModel = this.form.value; + this.item.name = formModel.name; + this.item.type.id = formModel.type; + this.item.isActive = formModel.isActive; + this.item.isReconcilable = formModel.isReconcilable; + this.item.costCentre.id = formModel.costCentre; + return this.item; + } +} diff --git a/overlord/src/app/account/account-list-resolver.service.spec.ts b/overlord/src/app/account/account-list-resolver.service.spec.ts new file mode 100644 index 00000000..44442cef --- /dev/null +++ b/overlord/src/app/account/account-list-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {AccountListResolverService} from './account-list-resolver.service'; + +describe('AccountListResolverService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [AccountListResolverService] + }); + }); + + it('should be created', inject([AccountListResolverService], (service: AccountListResolverService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/account/account-list-resolver.service.ts b/overlord/src/app/account/account-list-resolver.service.ts new file mode 100644 index 00000000..cc96d40f --- /dev/null +++ b/overlord/src/app/account/account-list-resolver.service.ts @@ -0,0 +1,18 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Account} from './account'; +import {Observable} from 'rxjs/internal/Observable'; +import {AccountService} from './account.service'; + +@Injectable({ + providedIn: 'root' +}) +export class AccountListResolver implements Resolve { + + constructor(private ser: AccountService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + return this.ser.list(); + } +} diff --git a/overlord/src/app/account/account-list/account-list-datasource.ts b/overlord/src/app/account/account-list/account-list-datasource.ts new file mode 100644 index 00000000..285a17f1 --- /dev/null +++ b/overlord/src/app/account/account-list/account-list-datasource.ts @@ -0,0 +1,79 @@ +import {DataSource} from '@angular/cdk/collections'; +import {MatPaginator, MatSort} from '@angular/material'; +import {map, tap} from 'rxjs/operators'; +import {merge, Observable, of as observableOf} from 'rxjs'; +import {Account} from '../account'; + + +export class AccountListDataSource extends DataSource { + private dataObservable: Observable; + private filterValue: string; + + constructor(private paginator: MatPaginator, private sort: MatSort, private filter: Observable, public data: Account[]) { + super(); + this.filter = filter.pipe( + tap(x => this.filterValue = x) + ); + } + + connect(): Observable { + this.dataObservable = observableOf(this.data); + const dataMutations = [ + this.dataObservable, + this.filter, + this.paginator.page, + this.sort.sortChange + ]; + + return merge(...dataMutations).pipe( + map((x: any) => { + return this.getPagedData(this.getSortedData(this.getFilteredData([...this.data]))); + }), + tap((x: Account[]) => this.paginator.length = x.length) + ); + } + + disconnect() { + } + + private getFilteredData(data: Account[]): Account[] { + const filter = (this.filterValue === undefined) ? '' : this.filterValue; + return filter.split(' ').reduce((p: Account[], c: string) => { + return p.filter(x => { + const accountString = ( + x.name + ' ' + x.type + ' ' + x.costCentre + (x.isActive ? ' active' : ' deactive') + ).toLowerCase(); + return accountString.indexOf(c) !== -1; + } + ); + }, Object.assign([], data)); + } + + private getPagedData(data: Account[]) { + const startIndex = this.paginator.pageIndex * this.paginator.pageSize; + return data.splice(startIndex, this.paginator.pageSize); + } + + private getSortedData(data: Account[]) { + if (!this.sort.active || this.sort.direction === '') { + return data; + } + + return data.sort((a, b) => { + const isAsc = this.sort.direction === 'asc'; + switch (this.sort.active) { + case 'name': + return compare(a.name, b.name, isAsc); + case 'id': + return compare(+a.id, +b.id, isAsc); + default: + return 0; + } + }); + } +} + +/** Simple sort comparator for example ID/Name columns (for client-side sorting). */ +function compare(a, b, isAsc) { + return (a < b ? -1 : 1) * (isAsc ? 1 : -1); +} diff --git a/overlord/src/app/account/account-list/account-list.component.css b/overlord/src/app/account/account-list/account-list.component.css new file mode 100644 index 00000000..e69de29b diff --git a/overlord/src/app/account/account-list/account-list.component.html b/overlord/src/app/account/account-list/account-list.component.html new file mode 100644 index 00000000..3adc688e --- /dev/null +++ b/overlord/src/app/account/account-list/account-list.component.html @@ -0,0 +1,61 @@ + + + Accounts + + add_box + Add + + + +
    +
    + + + +
    +
    + + + + + Name + {{row.name}} + + + + + Type + {{row.type}} + + + + + Is Active? + {{row.isActive}} + + + + + Is Reconcilable? + {{row.isReconcilable}} + + + + + Cost Centre + {{row.costCentre}} + + + + + + + + +
    +
    diff --git a/overlord/src/app/account/account-list/account-list.component.spec.ts b/overlord/src/app/account/account-list/account-list.component.spec.ts new file mode 100644 index 00000000..f365becd --- /dev/null +++ b/overlord/src/app/account/account-list/account-list.component.spec.ts @@ -0,0 +1,23 @@ +import {ComponentFixture, fakeAsync, TestBed} from '@angular/core/testing'; + +import {AccountListComponent} from './account-list.component'; + +describe('AccountListComponent', () => { + let component: AccountListComponent; + let fixture: ComponentFixture; + + beforeEach(fakeAsync(() => { + TestBed.configureTestingModule({ + declarations: [AccountListComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(AccountListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should compile', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/account/account-list/account-list.component.ts b/overlord/src/app/account/account-list/account-list.component.ts new file mode 100644 index 00000000..f6dcb675 --- /dev/null +++ b/overlord/src/app/account/account-list/account-list.component.ts @@ -0,0 +1,60 @@ +import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; +import {MatPaginator, MatSort} from '@angular/material'; +import {AccountListDataSource} from './account-list-datasource'; +import {Account} from '../account'; +import {ActivatedRoute} from '@angular/router'; +import {Observable} from 'rxjs'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {debounceTime, distinctUntilChanged, startWith} from 'rxjs/operators'; + +@Component({ + selector: 'app-account-list', + templateUrl: './account-list.component.html', + styleUrls: ['./account-list.component.css'] +}) +export class AccountListComponent implements OnInit, AfterViewInit { + @ViewChild('filterElement') filterElement: ElementRef; + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + dataSource: AccountListDataSource; + filter: Observable; + form: FormGroup; + list: Account[]; + + /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ + displayedColumns = ['name', 'type', 'isActive', 'isReconcilable', 'costCentre']; + + constructor(private route: ActivatedRoute, private fb: FormBuilder) { + this.createForm(); + this.filter = this.listenToFilterChange(); + } + + createForm() { + this.form = this.fb.group({ + filter: '' + }); + } + + listenToFilterChange() { + return this.form.get('filter').valueChanges + .pipe( + startWith(''), + debounceTime(150), + distinctUntilChanged() + ); + } + + ngOnInit() { + this.route.data + .subscribe((data: { list: Account[] }) => { + this.list = data.list; + }); + this.dataSource = new AccountListDataSource(this.paginator, this.sort, this.filter, this.list); + } + + ngAfterViewInit() { + setTimeout(() => { + this.filterElement.nativeElement.focus(); + }, 0); + } +} diff --git a/overlord/src/app/account/account-resolver.service.spec.ts b/overlord/src/app/account/account-resolver.service.spec.ts new file mode 100644 index 00000000..6bf5a838 --- /dev/null +++ b/overlord/src/app/account/account-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {AccountResolverService} from './account-resolver.service'; + +describe('AccountResolverService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [AccountDetailResolverService] + }); + }); + + it('should be created', inject([AccountDetailResolverService], (service: AccountDetailResolverService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/account/account-resolver.service.ts b/overlord/src/app/account/account-resolver.service.ts new file mode 100644 index 00000000..84af843b --- /dev/null +++ b/overlord/src/app/account/account-resolver.service.ts @@ -0,0 +1,19 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot} from '@angular/router'; +import {AccountService} from './account.service'; +import {Account} from './account'; +import {Observable} from 'rxjs/internal/Observable'; + +@Injectable({ + providedIn: 'root' +}) +export class AccountResolver implements Resolve { + + constructor(private ser: AccountService, private router: Router) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const id = route.paramMap.get('id'); + return this.ser.get(id); + } +} diff --git a/overlord/src/app/account/account-routing.module.spec.ts b/overlord/src/app/account/account-routing.module.spec.ts new file mode 100644 index 00000000..e411d935 --- /dev/null +++ b/overlord/src/app/account/account-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {AccountRoutingModule} from './account-routing.module'; + +describe('AccountRoutingModule', () => { + let accountRoutingModule: AccountRoutingModule; + + beforeEach(() => { + accountRoutingModule = new AccountRoutingModule(); + }); + + it('should create an instance', () => { + expect(accountRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/account/account-routing.module.ts b/overlord/src/app/account/account-routing.module.ts new file mode 100644 index 00000000..26a8f858 --- /dev/null +++ b/overlord/src/app/account/account-routing.module.ts @@ -0,0 +1,69 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; + +import {AccountListResolver} from './account-list-resolver.service'; +import {AccountResolver} from './account-resolver.service'; +import {AccountTypeResolver} from './account-type-resolver.service'; +import {AccountDetailComponent} from './account-detail/account-detail.component'; +import {AccountListComponent} from './account-list/account-list.component'; + +import {AuthGuard} from '../auth/auth-guard.service'; +import {CostCentreListResolver} from '../cost-centre/cost-centre-list-resolver.service'; + +const accountRoutes: Routes = [ + { + path: 'Accounts', + component: AccountListComponent, + canActivate: [AuthGuard], + data: { + permission: 'Accounts' + }, + resolve: { + list: AccountListResolver + } + }, + { + path: 'Account', + component: AccountDetailComponent, + canActivate: [AuthGuard], + data: { + permission: 'Accounts' + }, + resolve: { + item: AccountResolver, + accountTypes: AccountTypeResolver, + costCentres: CostCentreListResolver + } + }, + { + path: 'Account/:id', + component: AccountDetailComponent, + canActivate: [AuthGuard], + data: { + permission: 'Accounts' + }, + resolve: { + item: AccountResolver, + accountTypes: AccountTypeResolver, + costCentres: CostCentreListResolver + } + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(accountRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + AccountListResolver, + AccountResolver + ] +}) +export class AccountRoutingModule { +} diff --git a/overlord/src/app/account/account-type-resolver.service.spec.ts b/overlord/src/app/account/account-type-resolver.service.spec.ts new file mode 100644 index 00000000..5e12c5d7 --- /dev/null +++ b/overlord/src/app/account/account-type-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {AccountTypeResolverService} from './account-type-resolver.service'; + +describe('AccountTypeResolverService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [AccountTypeResolverService] + }); + }); + + it('should be created', inject([AccountTypeResolverService], (service: AccountTypeResolverService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/account/account-type-resolver.service.ts b/overlord/src/app/account/account-type-resolver.service.ts new file mode 100644 index 00000000..f0cdbd62 --- /dev/null +++ b/overlord/src/app/account/account-type-resolver.service.ts @@ -0,0 +1,18 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {AccountType} from './account-type'; +import {Observable} from 'rxjs/internal/Observable'; +import {AccountTypeService} from './account-type.service'; + +@Injectable({ + providedIn: 'root' +}) +export class AccountTypeResolver implements Resolve { + + constructor(private ser: AccountTypeService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + return this.ser.list(); + } +} diff --git a/overlord/src/app/account/account-type.service.spec.ts b/overlord/src/app/account/account-type.service.spec.ts new file mode 100644 index 00000000..de84c8fd --- /dev/null +++ b/overlord/src/app/account/account-type.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {AccountTypeService} from './account-type.service'; + +describe('AccountTypeService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [AccountTypeService] + }); + }); + + it('should be created', inject([AccountTypeService], (service: AccountTypeService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/account/account-type.service.ts b/overlord/src/app/account/account-type.service.ts new file mode 100644 index 00000000..d29751f0 --- /dev/null +++ b/overlord/src/app/account/account-type.service.ts @@ -0,0 +1,26 @@ +import {Injectable} from '@angular/core'; +import {Observable} from 'rxjs/internal/Observable'; +import {AccountType} from './account-type'; +import {catchError} from 'rxjs/operators'; +import {HttpClient} from '@angular/common/http'; +import {ErrorLoggerService} from '../core/error-logger.service'; + +const url = '/api/AccountTypes'; +const serviceName = 'AccountTypeService'; + +@Injectable({ + providedIn: 'root' +}) +export class AccountTypeService { + + constructor( + private http: HttpClient, private log: ErrorLoggerService) { + } + + list(): Observable { + return >this.http.get(url) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } +} diff --git a/overlord/src/app/account/account-type.ts b/overlord/src/app/account/account-type.ts new file mode 100644 index 00000000..819d3e7c --- /dev/null +++ b/overlord/src/app/account/account-type.ts @@ -0,0 +1,9 @@ +export class AccountType { + id: number; + name: string; + balanceSheet: boolean; + debit: boolean; + cashFlowClassification: string; + order: number; + showInList: boolean; +} diff --git a/overlord/src/app/account/account.module.spec.ts b/overlord/src/app/account/account.module.spec.ts new file mode 100644 index 00000000..cc5a4c01 --- /dev/null +++ b/overlord/src/app/account/account.module.spec.ts @@ -0,0 +1,13 @@ +import {AccountModule} from './account.module'; + +describe('AccountModule', () => { + let accountModule: AccountModule; + + beforeEach(() => { + accountModule = new AccountModule(); + }); + + it('should create an instance', () => { + expect(accountModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/account/account.module.ts b/overlord/src/app/account/account.module.ts new file mode 100644 index 00000000..3403229d --- /dev/null +++ b/overlord/src/app/account/account.module.ts @@ -0,0 +1,50 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; + +import {AccountListComponent} from './account-list/account-list.component'; +import {AccountDetailComponent} from './account-detail/account-detail.component'; +import {AccountRoutingModule} from './account-routing.module'; +import { + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatIconModule, + MatInputModule, + MatOptionModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {CdkTableModule} from '@angular/cdk/table'; +import {ReactiveFormsModule} from '@angular/forms'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +@NgModule({ + imports: [ + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatTableModule, + MatPaginatorModule, + MatSortModule, + MatCardModule, + MatProgressSpinnerModule, + MatInputModule, + MatButtonModule, + MatIconModule, + MatOptionModule, + MatSelectModule, + MatCheckboxModule, + ReactiveFormsModule, + AccountRoutingModule + ], + declarations: [ + AccountListComponent, + AccountDetailComponent + ] +}) +export class AccountModule { +} diff --git a/overlord/src/app/account/account.service.spec.ts b/overlord/src/app/account/account.service.spec.ts new file mode 100644 index 00000000..c92f8cc0 --- /dev/null +++ b/overlord/src/app/account/account.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {AccountService} from './account.service'; + +describe('AccountService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [AccountService] + }); + }); + + it('should be created', inject([AccountService], (service: AccountService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/account/account.service.ts b/overlord/src/app/account/account.service.ts new file mode 100644 index 00000000..0be08ad9 --- /dev/null +++ b/overlord/src/app/account/account.service.ts @@ -0,0 +1,97 @@ +import {Injectable} from '@angular/core'; +import {Observable} from 'rxjs/internal/Observable'; +import {catchError} from 'rxjs/operators'; +import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http'; +import {Account} from './account'; +import {ErrorLoggerService} from '../core/error-logger.service'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; + +const url = '/api/Account'; +const serviceName = 'AccountService'; + +@Injectable({providedIn: 'root'}) +export class AccountService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + get(id: string): Observable { + const getUrl: string = (id === null) ? url : `${url}/${id}`; + return >this.http.get(getUrl) + .pipe( + catchError(this.log.handleError(serviceName, `get id=${id}`)) + ); + } + + list(): Observable { + const options = {params: new HttpParams().set('l', '')}; + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + + paymentAutocomplete(term: string): Observable { + const options = {params: new HttpParams().set('q', term).set('t', '1')}; + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + + receiptAutocomplete(term: string): Observable { + const options = {params: new HttpParams().set('q', term).set('t', '1')}; + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + + save(account: Account): Observable { + return >this.http.post(url, account, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'save')) + ); + } + + update(account: Account): Observable { + return >this.http.put(`${url}/${account.id}`, account, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'update')) + ); + } + + saveOrUpdate(account: Account): Observable { + if (!account.id) { + return this.save(account); + } else { + return this.update(account); + } + } + + delete(id: string): Observable { + return >this.http.delete(`${url}/${id}`, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'delete')) + ); + } + + autocomplete(term: string): Observable { + const options = {params: new HttpParams().set('q', term)}; + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'autocomplete')) + ); + } + + balance(id: string, date: string): Observable { + const options = {params: new HttpParams().set('b', 'true').set('d', date)}; + return >this.http.get(`${url}/${id}`, options) + .pipe( + catchError(this.log.handleError(serviceName, 'balance')) + ); + } +} diff --git a/overlord/src/app/account/account.ts b/overlord/src/app/account/account.ts new file mode 100644 index 00000000..5352b569 --- /dev/null +++ b/overlord/src/app/account/account.ts @@ -0,0 +1,18 @@ +import {AccountType} from './account-type'; +import {CostCentre} from '../cost-centre/cost-centre'; +import {Journal} from '../journal/voucher'; + +export class Account { + id: string; + code: number; + name: string; + type: AccountType; + isActive: boolean; + isReconcilable: boolean; + isFixture: boolean; + costCentre: CostCentre; + + public constructor(init?: Partial) { + Object.assign(this, init); + } +} diff --git a/overlord/src/app/app-routing.module.spec.ts b/overlord/src/app/app-routing.module.spec.ts new file mode 100644 index 00000000..38695546 --- /dev/null +++ b/overlord/src/app/app-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {AppRoutingModule} from './app-routing.module'; + +describe('AppRoutingModule', () => { + let appRoutingModule: AppRoutingModule; + + beforeEach(() => { + appRoutingModule = new AppRoutingModule(); + }); + + it('should create an instance', () => { + expect(appRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/app-routing.module.ts b/overlord/src/app/app-routing.module.ts new file mode 100644 index 00000000..8bd37ae3 --- /dev/null +++ b/overlord/src/app/app-routing.module.ts @@ -0,0 +1,27 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {LoginComponent} from './auth/login/login.component'; +import {RouterModule, Routes} from '@angular/router'; +import {LogoutComponent} from './auth/logout/logout.component'; +import {HomeComponent} from './home/home.component'; + +const appRoutes: Routes = [ + {path: 'login', component: LoginComponent}, + {path: 'logout', component: LogoutComponent}, + {path: '', component: HomeComponent}, +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forRoot( + appRoutes, + // {enableTracing: true} // <-- debugging purposes only + {} // <-- debugging purposes only + ) + ], + exports: [RouterModule], + declarations: [] +}) +export class AppRoutingModule { +} diff --git a/overlord/src/app/app.component.css b/overlord/src/app/app.component.css new file mode 100644 index 00000000..22274544 --- /dev/null +++ b/overlord/src/app/app.component.css @@ -0,0 +1,5 @@ +@import '~@angular/material/prebuilt-themes/deeppurple-amber.css'; + +.basic-container { + padding: 30px; +} diff --git a/overlord/src/app/app.component.html b/overlord/src/app/app.component.html new file mode 100644 index 00000000..69c51fcb --- /dev/null +++ b/overlord/src/app/app.component.html @@ -0,0 +1,4 @@ + +
    + +
    diff --git a/overlord/src/app/app.component.spec.ts b/overlord/src/app/app.component.spec.ts new file mode 100644 index 00000000..0c6309cd --- /dev/null +++ b/overlord/src/app/app.component.spec.ts @@ -0,0 +1,28 @@ +import {async, TestBed} from '@angular/core/testing'; +import {AppComponent} from './app.component'; + +describe('AppComponent', () => { + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ + AppComponent + ], + }).compileComponents(); + })); + it('should create the app', async(() => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.debugElement.componentInstance; + expect(app).toBeTruthy(); + })); + it(`should have as title 'app'`, async(() => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.debugElement.componentInstance; + expect(app.title).toEqual('app'); + })); + it('should render title in a h1 tag', async(() => { + const fixture = TestBed.createComponent(AppComponent); + fixture.detectChanges(); + const compiled = fixture.debugElement.nativeElement; + expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!'); + })); +}); diff --git a/overlord/src/app/app.component.ts b/overlord/src/app/app.component.ts new file mode 100644 index 00000000..dae8f3de --- /dev/null +++ b/overlord/src/app/app.component.ts @@ -0,0 +1,10 @@ +import {Component} from '@angular/core'; + +@Component({ + selector: 'app-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.css'] +}) +export class AppComponent { + title = 'app'; +} diff --git a/overlord/src/app/app.module.ts b/overlord/src/app/app.module.ts new file mode 100644 index 00000000..e46ffe4e --- /dev/null +++ b/overlord/src/app/app.module.ts @@ -0,0 +1,142 @@ +import {BrowserModule} from '@angular/platform-browser'; +import {LOCALE_ID, NgModule} from '@angular/core'; +import enIN from '@angular/common/locales/en-IN'; + +import {AppComponent} from './app.component'; +import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; +import {LayoutModule} from '@angular/cdk/layout'; +import { + MatButtonModule, + MatCardModule, + MatDividerModule, + MatIconModule, + MatInputModule, + MatListModule, + MatMenuModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSidenavModule, + MatSnackBarModule, + MatSortModule, + MatTableModule, + MatToolbarModule +} from '@angular/material'; +import {LoginComponent} from './auth/login/login.component'; +import {AppRoutingModule} from './app-routing.module'; +import {ReactiveFormsModule} from '@angular/forms'; +import {HttpClientModule} from '@angular/common/http'; +import {AuthService} from './auth/auth.service'; +import {LogoutComponent} from './auth/logout/logout.component'; +import {CostCentreModule} from './cost-centre/cost-centre.module'; +import {AccountModule} from './account/account.module'; +import {CoreModule} from './core/core.module'; +import {SharedModule} from './shared/shared.module'; +import {HomeComponent} from './home/home.component'; +import {ProductGroupModule} from './product-group/product-group.module'; +import {ProductModule} from './product/product.module'; +import {ClientModule} from './client/client.module'; +import {BalanceSheetModule} from './balance-sheet/balance-sheet.module'; +import {registerLocaleData} from '@angular/common'; +import {ClosingStockModule} from './closing-stock/closing-stock.module'; +import {TrialBalanceModule} from './trial-balance/trial-balance.module'; +import {UnpostedModule} from './unposted/unposted.module'; +import {CashFlowModule} from './cash-flow/cash-flow.module'; +import {UserModule} from './user/user.module'; +import {GroupModule} from './group/group.module'; +import {LedgerModule} from './ledger/ledger.module'; +import {JournalModule} from './journal/journal.module'; +import {PaymentModule} from './payment/payment.module'; +import {ReceiptModule} from './receipt/receipt.module'; +import {PurchaseModule} from './purchase/purchase.module'; +import {PurchaseReturnModule} from './purchase-return/purchase-return.module'; +import {IssueModule} from './issue/issue.module'; +import {DaybookModule} from './daybook/daybook.module'; +import {NetTransactionsModule} from './net-transactions/net-transactions.module'; +import {ProfitLossModule} from './profit-loss/profit-loss.module'; +import {ProductLedgerModule} from './product-ledger/product-ledger.module'; +import {PurchaseEntriesModule} from './purchase-entries/purchase-entries.module'; +import {PurchasesModule} from './purchases/purchases.module'; +import {StockMovementModule} from './stock-movement/stock-movement.module'; +import {IncentiveModule} from './incentive/incentive.module'; +import {EmployeeModule} from './employee/employee.module'; +import {EmployeeBenefitsModule} from './employee-benefits/employee-benefits.module'; +import {EmployeeFunctionsModule} from './employee-functions/employee-functions.module'; +import {SettingsModule} from './settings/settings.module'; +import {AttendanceModule} from './attendance/attendance.module'; +import {EmployeeAttendanceModule} from './employee-attendance/employee-attendance.module'; +import {RawMaterialCostModule} from './raw-material-cost/raw-material-cost.module'; + +registerLocaleData(enIN); + + +@NgModule({ + declarations: [ + AppComponent, + LoginComponent, + LogoutComponent, + HomeComponent + ], + imports: [ + BrowserModule, + BrowserAnimationsModule, + HttpClientModule, + LayoutModule, + MatButtonModule, + MatCardModule, + MatDividerModule, + MatIconModule, + MatInputModule, + MatSidenavModule, + MatToolbarModule, + MatListModule, + MatMenuModule, + MatProgressSpinnerModule, + MatSnackBarModule, + MatTableModule, + MatPaginatorModule, + MatSortModule, + ReactiveFormsModule, + SharedModule, + CoreModule, + AccountModule, + AttendanceModule, + BalanceSheetModule, + CashFlowModule, + ClientModule, + ClosingStockModule, + CostCentreModule, + DaybookModule, + EmployeeModule, + EmployeeAttendanceModule, + EmployeeBenefitsModule, + EmployeeFunctionsModule, + GroupModule, + IncentiveModule, + IssueModule, + JournalModule, + LedgerModule, + NetTransactionsModule, + PaymentModule, + ProductModule, + ProductGroupModule, + ProductLedgerModule, + ProfitLossModule, + PurchaseModule, + PurchaseEntriesModule, + PurchaseReturnModule, + PurchasesModule, + RawMaterialCostModule, + ReceiptModule, + SettingsModule, + StockMovementModule, + TrialBalanceModule, + UnpostedModule, + UserModule, + AppRoutingModule + ], + providers: [{provide: LOCALE_ID, useValue: 'en-IN'}, + AuthService], + bootstrap: [AppComponent] +}) +export class AppModule { +} diff --git a/overlord/src/app/attendance/attendance-datasource.ts b/overlord/src/app/attendance/attendance-datasource.ts new file mode 100644 index 00000000..1828b7bf --- /dev/null +++ b/overlord/src/app/attendance/attendance-datasource.ts @@ -0,0 +1,18 @@ +import {DataSource} from '@angular/cdk/collections'; +import {Observable} from 'rxjs'; +import {AttendanceItem} from './attendance'; + + +export class AttendanceDataSource extends DataSource { + + constructor(private data: Observable) { + super(); + } + + connect(): Observable { + return this.data; + } + + disconnect() { + } +} diff --git a/overlord/src/app/attendance/attendance-resolver.service.spec.ts b/overlord/src/app/attendance/attendance-resolver.service.spec.ts new file mode 100644 index 00000000..f12040e6 --- /dev/null +++ b/overlord/src/app/attendance/attendance-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {AttendanceResolver} from './attendance-resolver.service'; + +describe('AttendanceResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [AttendanceResolver] + }); + }); + + it('should be created', inject([AttendanceResolver], (service: AttendanceResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/attendance/attendance-resolver.service.ts b/overlord/src/app/attendance/attendance-resolver.service.ts new file mode 100644 index 00000000..20a97444 --- /dev/null +++ b/overlord/src/app/attendance/attendance-resolver.service.ts @@ -0,0 +1,19 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {AttendanceService} from './attendance.service'; +import {Attendance} from './attendance'; + +@Injectable({ + providedIn: 'root' +}) +export class AttendanceResolver implements Resolve { + + constructor(private ser: AttendanceService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const date = route.paramMap.get('date'); + return this.ser.get(date); + } +} diff --git a/overlord/src/app/attendance/attendance-routing.module.spec.ts b/overlord/src/app/attendance/attendance-routing.module.spec.ts new file mode 100644 index 00000000..4f3bf830 --- /dev/null +++ b/overlord/src/app/attendance/attendance-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {AttendanceRoutingModule} from './attendance-routing.module'; + +describe('AttendanceRoutingModule', () => { + let attendanceRoutingModule: AttendanceRoutingModule; + + beforeEach(() => { + attendanceRoutingModule = new AttendanceRoutingModule(); + }); + + it('should create an instance', () => { + expect(attendanceRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/attendance/attendance-routing.module.ts b/overlord/src/app/attendance/attendance-routing.module.ts new file mode 100644 index 00000000..3bae6dba --- /dev/null +++ b/overlord/src/app/attendance/attendance-routing.module.ts @@ -0,0 +1,52 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {AttendanceResolver} from './attendance-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {AttendanceComponent} from './attendance.component'; +import {AttendanceTypeResolver} from './attendance-type-resolver.service'; + +const attendanceRoutes: Routes = [ + { + path: 'Attendance', + component: AttendanceComponent, + canActivate: [AuthGuard], + data: { + permission: 'Attendance' + }, + resolve: { + info: AttendanceResolver, + attendanceTypes: AttendanceTypeResolver + }, + runGuardsAndResolvers: 'always' + }, + { + path: 'Attendance/:date', + component: AttendanceComponent, + canActivate: [AuthGuard], + data: { + permission: 'Attendance' + }, + resolve: { + info: AttendanceResolver, + attendanceTypes: AttendanceTypeResolver + }, + runGuardsAndResolvers: 'always' + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(attendanceRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + AttendanceResolver + ] +}) +export class AttendanceRoutingModule { +} diff --git a/overlord/src/app/attendance/attendance-type-resolver.service.ts b/overlord/src/app/attendance/attendance-type-resolver.service.ts new file mode 100644 index 00000000..cec39bb3 --- /dev/null +++ b/overlord/src/app/attendance/attendance-type-resolver.service.ts @@ -0,0 +1,18 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {AttendanceType} from './attendance-type'; +import {AttendanceTypeService} from './attendance-type.service'; + +@Injectable({ + providedIn: 'root' +}) +export class AttendanceTypeResolver implements Resolve { + + constructor(private ser: AttendanceTypeService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + return this.ser.list(); + } +} diff --git a/overlord/src/app/attendance/attendance-type.service.ts b/overlord/src/app/attendance/attendance-type.service.ts new file mode 100644 index 00000000..8e85ac6b --- /dev/null +++ b/overlord/src/app/attendance/attendance-type.service.ts @@ -0,0 +1,23 @@ +import {Injectable} from '@angular/core'; +import {Observable} from 'rxjs/internal/Observable'; +import {catchError} from 'rxjs/operators'; +import {HttpClient} from '@angular/common/http'; +import {ErrorLoggerService} from '../core/error-logger.service'; +import {AttendanceType} from './attendance-type'; + +const url = '/api/AttendanceTypes'; +const serviceName = 'AttendanceTypeService'; + +@Injectable({providedIn: 'root'}) +export class AttendanceTypeService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + list(): Observable { + return >this.http.get(url) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } +} diff --git a/overlord/src/app/attendance/attendance-type.ts b/overlord/src/app/attendance/attendance-type.ts new file mode 100644 index 00000000..6c2407ba --- /dev/null +++ b/overlord/src/app/attendance/attendance-type.ts @@ -0,0 +1,9 @@ +export class AttendanceType { + id: number; + name: string; + value: number; + + public constructor(init?: Partial) { + Object.assign(this, init); + } +} diff --git a/overlord/src/app/attendance/attendance.component.css b/overlord/src/app/attendance/attendance.component.css new file mode 100644 index 00000000..e2ce58cb --- /dev/null +++ b/overlord/src/app/attendance/attendance.component.css @@ -0,0 +1,53 @@ +.right { + display: flex; + justify-content: flex-end; +} + +.center { + display: flex; + justify-content: center; +} + +.present { + background-color: #228B22; +} + +.off-day { + background-color: #87CEFA; +} + +.on-leave { + background-color: #CD5C5C; +} + +.absent { + background-color: #CD0000; +} + +.half-day { + background-color: #98FB98; +} + +.double-duty { + background-color: #006400; +} + +.paid-leave-availed { + background-color: #EEEE00; +} + +.casual-leave-availed { + background-color: #800080; +} + +.compensatory-off { + background-color: #F5DEB3; +} + +.half-day-pl { + background-color: #FFF68F; +} + +.half-day-cl { + background-color: #FF00FF; +} diff --git a/overlord/src/app/attendance/attendance.component.html b/overlord/src/app/attendance/attendance.component.html new file mode 100644 index 00000000..546b65ba --- /dev/null +++ b/overlord/src/app/attendance/attendance.component.html @@ -0,0 +1,71 @@ + + + Attendance + + +
    +
    + + + + + + +
    + + + + + Code + {{row.code}} + + + + + Name + {{row.name}} + + + + + Designation + {{row.designation}} + + + + + Department + {{row.department}} + + + + + Status + + + + {{ at.name }} + + + + + + + + Prints + + {{row.prints}} + new_releases + + + + + + +
    +
    + + + +
    diff --git a/overlord/src/app/attendance/attendance.component.spec.ts b/overlord/src/app/attendance/attendance.component.spec.ts new file mode 100644 index 00000000..27a4dbb4 --- /dev/null +++ b/overlord/src/app/attendance/attendance.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {AttendanceComponent} from './attendance.component'; + +describe('AttendanceComponent', () => { + let component: AttendanceComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [AttendanceComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AttendanceComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/attendance/attendance.component.ts b/overlord/src/app/attendance/attendance.component.ts new file mode 100644 index 00000000..c5c65690 --- /dev/null +++ b/overlord/src/app/attendance/attendance.component.ts @@ -0,0 +1,99 @@ +import {Component, OnInit} from '@angular/core'; +import {FormArray, FormBuilder, FormGroup} from '@angular/forms'; +import {MatDialog} from '@angular/material'; +import {ActivatedRoute, Router} from '@angular/router'; +import {BehaviorSubject} from 'rxjs'; +import {AttendanceDataSource} from './attendance-datasource'; +import * as moment from 'moment'; +import {AuthService} from '../auth/auth.service'; +import {ToasterService} from '../core/toaster.service'; +import {AttendanceService} from './attendance.service'; +import {AttendanceType} from './attendance-type'; +import {Attendance, AttendanceItem} from './attendance'; + +@Component({ + selector: 'app-attendance', + templateUrl: './attendance.component.html', + styleUrls: ['./attendance.component.css'] +}) +export class AttendanceComponent implements OnInit { + public attendanceObservable = new BehaviorSubject([]); + dataSource: AttendanceDataSource; + form: FormGroup; + + info: Attendance; + attendanceTypes: AttendanceType[]; + + displayedColumns = ['code', 'name', 'designation', 'department', 'status', 'prints']; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder, + private dialog: MatDialog, + private toaster: ToasterService, + private auth: AuthService, + private ser: AttendanceService + ) { + this.createForm(); + } + + createForm() { + this.form = this.fb.group({ + date: '', + attendances: this.fb.array([]) + }); + } + + ngOnInit() { + this.route.data + .subscribe((data: { info: Attendance, attendanceTypes: AttendanceType[] }) => { + this.info = data.info; + this.attendanceTypes = data.attendanceTypes; + this.form.get('date').setValue(moment(this.info.date, 'DD-MMM-YYYY').toDate()); + this.form.setControl('attendances', this.fb.array( + this.info.body.map( + x => this.fb.group({ + attendanceType: x.attendanceType.id + }) + ) + )); + this.dataSource = new AttendanceDataSource(this.attendanceObservable); + this.attendanceObservable.next(this.info.body); + }); + } + + getClass(index: number) { + const array = this.form.get('attendances') as FormArray; + const id = array.controls[index].value.attendanceType; + const name: string = this.attendanceTypes.filter(x => x.id === id)[0].name; + return name.toLowerCase().replace(/(\s+\+\s+)|(\s+)/g, '-'); + } + + show() { + const date = moment(this.form.value.date).format('DD-MMM-YYYY'); + this.router.navigate(['/Attendance', date]); + } + + save() { + this.ser.save(this.getAttendance()) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + getAttendance(): Attendance { + const formModel = this.form.value; + this.info.date = moment(formModel.date).format('DD-MMM-YYYY'); + const array = this.form.get('attendances') as FormArray; + this.info.body.forEach((item, index) => { + item.attendanceType.id = array.controls[index].value.attendanceType; + }); + return this.info; + } +} diff --git a/overlord/src/app/attendance/attendance.module.spec.ts b/overlord/src/app/attendance/attendance.module.spec.ts new file mode 100644 index 00000000..b281c796 --- /dev/null +++ b/overlord/src/app/attendance/attendance.module.spec.ts @@ -0,0 +1,13 @@ +import {AttendanceModule} from './attendance.module'; + +describe('AttendanceModule', () => { + let attendanceModule: AttendanceModule; + + beforeEach(() => { + attendanceModule = new AttendanceModule(); + }); + + it('should create an instance', () => { + expect(attendanceModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/attendance/attendance.module.ts b/overlord/src/app/attendance/attendance.module.ts new file mode 100644 index 00000000..4fb26101 --- /dev/null +++ b/overlord/src/app/attendance/attendance.module.ts @@ -0,0 +1,79 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {ReactiveFormsModule} from '@angular/forms'; +import {CdkTableModule} from '@angular/cdk/table'; +import {AttendanceRoutingModule} from './attendance-routing.module'; +import {AttendanceComponent} from './attendance.component'; +import {MomentDateAdapter} from '@angular/material-moment-adapter'; +import {A11yModule} from '@angular/cdk/a11y'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + AttendanceRoutingModule + ], + declarations: [ + AttendanceComponent + ], + providers: [ + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, + ] +}) +export class AttendanceModule { +} diff --git a/overlord/src/app/attendance/attendance.service.spec.ts b/overlord/src/app/attendance/attendance.service.spec.ts new file mode 100644 index 00000000..d2d06d6c --- /dev/null +++ b/overlord/src/app/attendance/attendance.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {VoucherService} from './attendance.service'; + +describe('AttendanceService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [VoucherService] + }); + }); + + it('should be created', inject([VoucherService], (service: VoucherService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/attendance/attendance.service.ts b/overlord/src/app/attendance/attendance.service.ts new file mode 100644 index 00000000..108332ac --- /dev/null +++ b/overlord/src/app/attendance/attendance.service.ts @@ -0,0 +1,35 @@ +import {Injectable} from '@angular/core'; +import {Observable} from 'rxjs/internal/Observable'; +import {catchError} from 'rxjs/operators'; +import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http'; +import {Attendance} from './attendance'; +import {ErrorLoggerService} from '../core/error-logger.service'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; + +const url = '/api/Attendance'; +const serviceName = 'AttendanceService'; + +@Injectable({providedIn: 'root'}) +export class AttendanceService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + get(date: string): Observable { + const getUrl: string = (date === null) ? url : `${url}/${date}`; + return >this.http.get(getUrl) + .pipe( + catchError(this.log.handleError(serviceName, `get date=${date}`)) + ); + } + + save(attendance: Attendance): Observable { + return >this.http.post(`${url}/${attendance.date}`, attendance, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'save')) + ); + } +} diff --git a/overlord/src/app/attendance/attendance.ts b/overlord/src/app/attendance/attendance.ts new file mode 100644 index 00000000..9b71ac45 --- /dev/null +++ b/overlord/src/app/attendance/attendance.ts @@ -0,0 +1,26 @@ +import {AttendanceType} from './attendance-type'; + +export class Attendance { + date: string; + body: AttendanceItem[]; + + public constructor(init?: Partial) { + Object.assign(this, init); + } +} + +export class AttendanceItem { + id: string; + code: number; + name: string; + designation: string; + department: string; + attendanceType: AttendanceType; + prints: string; + hours: string; + worked: string; + + public constructor(init?: Partial) { + Object.assign(this, init); + } +} diff --git a/overlord/src/app/auth/auth-guard.service.spec.ts b/overlord/src/app/auth/auth-guard.service.spec.ts new file mode 100644 index 00000000..3f5f9192 --- /dev/null +++ b/overlord/src/app/auth/auth-guard.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {AuthGuardService} from './auth-guard.service'; + +describe('AuthGuardService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [AuthGuardService] + }); + }); + + it('should be created', inject([AuthGuardService], (service: AuthGuardService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/auth/auth-guard.service.ts b/overlord/src/app/auth/auth-guard.service.ts new file mode 100644 index 00000000..85c748b6 --- /dev/null +++ b/overlord/src/app/auth/auth-guard.service.ts @@ -0,0 +1,41 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot} from '@angular/router'; +import {AuthService} from './auth.service'; +import {Observable} from 'rxjs/internal/Observable'; +import {map} from 'rxjs/operators'; +import {ToasterService} from '../core/toaster.service'; +import {User} from '../user/user'; + +@Injectable({ + providedIn: 'root' +}) +export class AuthGuard implements CanActivate { + + constructor(private auth: AuthService, private router: Router, private toaster: ToasterService) { + } + + static checkUser(permission: string, user: User, router: Router, state: RouterStateSnapshot, toaster: ToasterService): boolean { + if (!user.isAuthenticated) { + router.navigate(['login'], {queryParams: {returnUrl: state.url}}); + toaster.show('Danger', 'User is not authenticated'); + return false; + } + const hasPermission = permission === undefined || user.perms.indexOf(permission) !== -1; + if (!hasPermission) { + toaster.show('Danger', 'You do not have the permission to access this area.'); + } + return hasPermission; + } + + canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | boolean { + if (this.auth.user === undefined) { + return this.auth.userObservable + .pipe( + map((value: User) => AuthGuard.checkUser( + route.data['permission'], value, this.router, state, this.toaster + )) + ); + } + return AuthGuard.checkUser(route.data['permission'], this.auth.user, this.router, state, this.toaster); + } +} diff --git a/overlord/src/app/auth/auth.service.spec.ts b/overlord/src/app/auth/auth.service.spec.ts new file mode 100644 index 00000000..35d06612 --- /dev/null +++ b/overlord/src/app/auth/auth.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {AuthService} from './auth.service'; + +describe('AuthService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [AuthService] + }); + }); + + it('should be created', inject([AuthService], (service: AuthService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/auth/auth.service.ts b/overlord/src/app/auth/auth.service.ts new file mode 100644 index 00000000..f08085c2 --- /dev/null +++ b/overlord/src/app/auth/auth.service.ts @@ -0,0 +1,72 @@ +import {Injectable} from '@angular/core'; +import {HttpClient, HttpHeaders} from '@angular/common/http'; +import {Observable} from 'rxjs/internal/Observable'; +import {catchError, tap} from 'rxjs/operators'; +import {Subject} from 'rxjs/internal/Subject'; +import {ErrorLoggerService} from '../core/error-logger.service'; +import {User} from '../user/user'; + + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; + +const loginUrl = '/api/login'; +const logoutUrl = '/api/logout'; +const checkUrl = '/api/Auth'; + +@Injectable({ + providedIn: 'root' +}) +export class AuthService { + public userObservable = new Subject(); + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + this.check().subscribe(); + } + + private _user: User; + + get user() { + return this._user; + } + + set user(user: User) { + this._user = user; + this.userObservable.next(user); + } + + login(name: string, password: string, otp?: string, clientName?: string): Observable { + const data = {name: name, password: password}; + if (otp) { + data['otp'] = otp; + } + + if (clientName) { + data['clientName'] = clientName; + } + + return this.http.post(loginUrl, data, httpOptions) + .pipe( + tap((user: User) => this.user = user), + catchError(this.log.handleError('AuthService', 'login')) + ); + } + + logout(): Observable { + return this.http.post(logoutUrl, {}, httpOptions) + .pipe( + tap((user: User) => this.user = user), + catchError(this.log.handleError('AuthService', 'logout')) + ); + } + + check(): Observable { + return this.http.get(checkUrl, httpOptions) + .pipe( + tap((user: User) => this.user = user), + catchError(this.log.handleError('AuthService', 'check')) + ); + } + +} diff --git a/overlord/src/app/auth/login/login.component.css b/overlord/src/app/auth/login/login.component.css new file mode 100644 index 00000000..cfd4505c --- /dev/null +++ b/overlord/src/app/auth/login/login.component.css @@ -0,0 +1,8 @@ +.example-container { + display: flex; + flex-direction: column; +} + +.example-container > * { + width: 100%; +} diff --git a/overlord/src/app/auth/login/login.component.html b/overlord/src/app/auth/login/login.component.html new file mode 100644 index 00000000..9ab26e44 --- /dev/null +++ b/overlord/src/app/auth/login/login.component.html @@ -0,0 +1,40 @@ + + + Login + + +
    +
    + + Username + + +
    +
    + + Password + + {{hide ? 'visibility' : 'visibility_off'}} + +
    + +

    Client ID: {{clientID}}

    +
    + + Otp + + +
    +
    + + Client Name + + +
    +
    +
    + + + +
    diff --git a/overlord/src/app/auth/login/login.component.spec.ts b/overlord/src/app/auth/login/login.component.spec.ts new file mode 100644 index 00000000..28a57041 --- /dev/null +++ b/overlord/src/app/auth/login/login.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {LoginComponent} from './login.component'; + +describe('LoginComponent', () => { + let component: LoginComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [LoginComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LoginComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/auth/login/login.component.ts b/overlord/src/app/auth/login/login.component.ts new file mode 100644 index 00000000..a941f706 --- /dev/null +++ b/overlord/src/app/auth/login/login.component.ts @@ -0,0 +1,69 @@ +import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; +import {AuthService} from '../auth.service'; +import {ActivatedRoute, Router} from '@angular/router'; +import {ToasterService} from '../../core/toaster.service'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {CookieService} from '../../shared/cookie.service'; + +@Component({ + selector: 'app-login', + templateUrl: './login.component.html', + styleUrls: ['./login.component.css'] +}) +export class LoginComponent implements OnInit, AfterViewInit { + @ViewChild('nameElement') nameElement: ElementRef; + form: FormGroup; + hide: boolean; + showOtp: boolean; + clientID: string; + private returnUrl: string; + + constructor(private route: ActivatedRoute, + private auth: AuthService, + private router: Router, + private toaster: ToasterService, + private cs: CookieService, + private fb: FormBuilder + ) { + this.hide = true; + this.showOtp = false; + this.createForm(); + } + + createForm() { + this.form = this.fb.group({ + username: '', + password: '', + otp: '', + clientName: '' + }); + } + + ngOnInit() { + this.returnUrl = this.route.snapshot.queryParams['returnUrl'] || '/'; + } + + ngAfterViewInit() { + setTimeout(() => { + this.nameElement.nativeElement.focus(); + }, 0); + } + + login(): void { + const formModel = this.form.value; + const username = formModel.username; + const password = formModel.password; + this.auth.login(username, password).subscribe( + (result) => { + this.router.navigateByUrl(this.returnUrl); + }, + (error) => { + if (error.status === 403 && ['Unknown Client', 'OTP not supplied', 'OTP is wrong'].indexOf(error.error) !== -1) { + this.showOtp = true; + this.clientID = this.cs.getCookie('ClientID'); + } + this.toaster.show('Danger', error.error); + } + ); + } +} diff --git a/overlord/src/app/auth/logout/logout.component.spec.ts b/overlord/src/app/auth/logout/logout.component.spec.ts new file mode 100644 index 00000000..6b7c320e --- /dev/null +++ b/overlord/src/app/auth/logout/logout.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {LogoutComponent} from './logout.component'; + +describe('LogoutComponent', () => { + let component: LogoutComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [LogoutComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LogoutComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/auth/logout/logout.component.ts b/overlord/src/app/auth/logout/logout.component.ts new file mode 100644 index 00000000..7be331b5 --- /dev/null +++ b/overlord/src/app/auth/logout/logout.component.ts @@ -0,0 +1,25 @@ +import {Component, OnInit} from '@angular/core'; +import {Router} from '@angular/router'; +import {AuthService} from '../auth.service'; +import {ToasterService} from '../../core/toaster.service'; + +@Component({ + selector: 'app-logout', + template: '' +}) +export class LogoutComponent implements OnInit { + + constructor(private auth: AuthService, private router: Router, private toaster: ToasterService) { + } + + ngOnInit() { + this.auth.logout().subscribe( + (result) => { + this.toaster.show('Success', 'Logged Out'); + this.router.navigateByUrl('/'); + }, + (error) => this.toaster.show('Danger', error.error) + ); + } + +} diff --git a/overlord/src/app/balance-sheet/balance-sheet-datasource.ts b/overlord/src/app/balance-sheet/balance-sheet-datasource.ts new file mode 100644 index 00000000..8e33965f --- /dev/null +++ b/overlord/src/app/balance-sheet/balance-sheet-datasource.ts @@ -0,0 +1,58 @@ +import {DataSource} from '@angular/cdk/collections'; +import {MatPaginator, MatSort} from '@angular/material'; +import {map} from 'rxjs/operators'; +import {merge, Observable, of as observableOf} from 'rxjs'; + + +export class BalanceSheetDataSource extends DataSource { + + constructor(private paginator: MatPaginator, private sort: MatSort, public data: any[]) { + super(); + } + + connect(): Observable { + const dataMutations = [ + observableOf(this.data), + this.paginator.page, + this.sort.sortChange + ]; + + // Set the paginators length + this.paginator.length = this.data.length; + + return merge(...dataMutations).pipe(map(() => { + return this.getPagedData(this.getSortedData([...this.data])); + })); + } + + disconnect() { + } + + private getPagedData(data: any[]) { + const startIndex = this.paginator.pageIndex * this.paginator.pageSize; + return data.splice(startIndex, this.paginator.pageSize); + } + + private getSortedData(data: any[]) { + if (!this.sort.active || this.sort.direction === '') { + return data; + } + + return data.sort((a, b) => { + const isAsc = this.sort.direction === 'asc'; + switch (this.sort.active) { + case 'name': + return compare(a.name, b.name, isAsc); + case 'id': + return compare(+a.id, +b.id, isAsc); + default: + return 0; + } + }); + } +} + +/** Simple sort comparator for example ID/Name columns (for client-side sorting). */ +function compare(a, b, isAsc) { + return (a < b ? -1 : 1) * (isAsc ? 1 : -1); +} diff --git a/overlord/src/app/balance-sheet/balance-sheet-resolver.service.spec.ts b/overlord/src/app/balance-sheet/balance-sheet-resolver.service.spec.ts new file mode 100644 index 00000000..6ec7601d --- /dev/null +++ b/overlord/src/app/balance-sheet/balance-sheet-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {BalanceSheetResolver} from './balance-sheet-resolver.service'; + +describe('BalanceSheetResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [BalanceSheetResolver] + }); + }); + + it('should be created', inject([BalanceSheetResolver], (service: BalanceSheetResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/balance-sheet/balance-sheet-resolver.service.ts b/overlord/src/app/balance-sheet/balance-sheet-resolver.service.ts new file mode 100644 index 00000000..b54d8fec --- /dev/null +++ b/overlord/src/app/balance-sheet/balance-sheet-resolver.service.ts @@ -0,0 +1,19 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {BalanceSheet} from './balance-sheet'; +import {BalanceSheetService} from './balance-sheet.service'; + +@Injectable({ + providedIn: 'root' +}) +export class BalanceSheetResolver implements Resolve { + + constructor(private ser: BalanceSheetService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const date = route.paramMap.get('date'); + return this.ser.list(date); + } +} diff --git a/overlord/src/app/balance-sheet/balance-sheet-routing.module.spec.ts b/overlord/src/app/balance-sheet/balance-sheet-routing.module.spec.ts new file mode 100644 index 00000000..9847694b --- /dev/null +++ b/overlord/src/app/balance-sheet/balance-sheet-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {BalanceSheetRoutingModule} from './balance-sheet-routing.module'; + +describe('BalanceSheetRoutingModule', () => { + let balanceSheetRoutingModule: BalanceSheetRoutingModule; + + beforeEach(() => { + balanceSheetRoutingModule = new BalanceSheetRoutingModule(); + }); + + it('should create an instance', () => { + expect(balanceSheetRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/balance-sheet/balance-sheet-routing.module.ts b/overlord/src/app/balance-sheet/balance-sheet-routing.module.ts new file mode 100644 index 00000000..ad4da6bb --- /dev/null +++ b/overlord/src/app/balance-sheet/balance-sheet-routing.module.ts @@ -0,0 +1,47 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {BalanceSheetResolver} from './balance-sheet-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {BalanceSheetComponent} from './balance-sheet.component'; + +const balanceSheetRoutes: Routes = [ + { + path: 'BalanceSheet', + component: BalanceSheetComponent, + canActivate: [AuthGuard], + data: { + permission: 'Balance Sheet' + }, + resolve: { + info: BalanceSheetResolver + } + }, + { + path: 'BalanceSheet/:date', + component: BalanceSheetComponent, + canActivate: [AuthGuard], + data: { + permission: 'Balance Sheet' + }, + resolve: { + info: BalanceSheetResolver + } + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(balanceSheetRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + BalanceSheetResolver + ] +}) +export class BalanceSheetRoutingModule { +} diff --git a/overlord/src/app/balance-sheet/balance-sheet.component.css b/overlord/src/app/balance-sheet/balance-sheet.component.css new file mode 100644 index 00000000..a9626b3c --- /dev/null +++ b/overlord/src/app/balance-sheet/balance-sheet.component.css @@ -0,0 +1,4 @@ +.right { + display: flex; + justify-content: flex-end; +} diff --git a/overlord/src/app/balance-sheet/balance-sheet.component.html b/overlord/src/app/balance-sheet/balance-sheet.component.html new file mode 100644 index 00000000..afb8eb07 --- /dev/null +++ b/overlord/src/app/balance-sheet/balance-sheet.component.html @@ -0,0 +1,63 @@ + + + Balance Sheet + + +
    +
    + + + + + + +
    +
    + + + + + Group + {{row.group}} + {{info.footer.group}} + + + + + Name + {{row.name}} + {{info.footer.name}} + + + + + Amount + {{row.subAmount | currency:'INR' | clear}} + {{info.footer.subAmount | currency:'INR' | clear}} + + + + + + Total + {{row.amount | currency:'INR' | clear}} + {{info.footer.amount | currency:'INR' | clear}} + + + + + + + + + + + +
    +
    diff --git a/overlord/src/app/balance-sheet/balance-sheet.component.spec.ts b/overlord/src/app/balance-sheet/balance-sheet.component.spec.ts new file mode 100644 index 00000000..4da21658 --- /dev/null +++ b/overlord/src/app/balance-sheet/balance-sheet.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {BalanceSheetComponent} from './balance-sheet.component'; + +describe('BalanceSheetComponent', () => { + let component: BalanceSheetComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [BalanceSheetComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(BalanceSheetComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/balance-sheet/balance-sheet.component.ts b/overlord/src/app/balance-sheet/balance-sheet.component.ts new file mode 100644 index 00000000..b5382466 --- /dev/null +++ b/overlord/src/app/balance-sheet/balance-sheet.component.ts @@ -0,0 +1,56 @@ +import {Component, OnInit, ViewChild} from '@angular/core'; +import {MatPaginator, MatSort} from '@angular/material'; +import {BalanceSheetDataSource} from './balance-sheet-datasource'; +import {BalanceSheet} from './balance-sheet'; +import {ActivatedRoute, Router} from '@angular/router'; +import * as moment from 'moment'; +import {FormBuilder, FormGroup} from '@angular/forms'; + +@Component({ + selector: 'app-balance-sheet', + templateUrl: './balance-sheet.component.html', + styleUrls: ['./balance-sheet.component.css'] +}) +export class BalanceSheetComponent implements OnInit { + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + dataSource: BalanceSheetDataSource; + form: FormGroup; + info: BalanceSheet; + /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ + displayedColumns = ['group', 'name', 'subAmount', 'total']; + + constructor(private route: ActivatedRoute, private router: Router, private fb: FormBuilder) { + this.createForm(); + } + + createForm() { + this.form = this.fb.group({ + date: '' + }); + } + + ngOnInit() { + this.route.data + .subscribe((data: { info: BalanceSheet }) => { + this.info = data.info; + this.form.setValue({ + date: moment(this.info.date, 'DD-MMM-YYYY').toDate() + }); + }); + this.dataSource = new BalanceSheetDataSource(this.paginator, this.sort, this.info.body); + } + + show() { + const info = this.getInfo(); + this.router.navigate(['BalanceSheet' + info.date]); + } + + getInfo(): BalanceSheet { + const formModel = this.form.value; + + return { + date: moment(formModel.date).format('DD-MMM-YYYY') + }; + } +} diff --git a/overlord/src/app/balance-sheet/balance-sheet.module.spec.ts b/overlord/src/app/balance-sheet/balance-sheet.module.spec.ts new file mode 100644 index 00000000..ce2f597f --- /dev/null +++ b/overlord/src/app/balance-sheet/balance-sheet.module.spec.ts @@ -0,0 +1,13 @@ +import {BalanceSheetModule} from './balance-sheet.module'; + +describe('BalanceSheetModule', () => { + let balanceSheetModule: BalanceSheetModule; + + beforeEach(() => { + balanceSheetModule = new BalanceSheetModule(); + }); + + it('should create an instance', () => { + expect(balanceSheetModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/balance-sheet/balance-sheet.module.ts b/overlord/src/app/balance-sheet/balance-sheet.module.ts new file mode 100644 index 00000000..5a9f167c --- /dev/null +++ b/overlord/src/app/balance-sheet/balance-sheet.module.ts @@ -0,0 +1,69 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {CdkTableModule} from '@angular/cdk/table'; +import {BalanceSheetRoutingModule} from './balance-sheet-routing.module'; +import {BalanceSheetComponent} from './balance-sheet.component'; +import {MomentDateAdapter} from '@angular/material-moment-adapter'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; +import {ReactiveFormsModule} from '@angular/forms'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + BalanceSheetRoutingModule + ], + declarations: [ + BalanceSheetComponent + ], + providers: [ + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, + ] +}) +export class BalanceSheetModule { +} diff --git a/overlord/src/app/balance-sheet/balance-sheet.service.spec.ts b/overlord/src/app/balance-sheet/balance-sheet.service.spec.ts new file mode 100644 index 00000000..c03a07d2 --- /dev/null +++ b/overlord/src/app/balance-sheet/balance-sheet.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {BalanceSheetService} from './balance-sheet.service'; + +describe('BalanceSheetService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [BalanceSheetService] + }); + }); + + it('should be created', inject([BalanceSheetService], (service: BalanceSheetService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/balance-sheet/balance-sheet.service.ts b/overlord/src/app/balance-sheet/balance-sheet.service.ts new file mode 100644 index 00000000..9804bac6 --- /dev/null +++ b/overlord/src/app/balance-sheet/balance-sheet.service.ts @@ -0,0 +1,31 @@ +import {Injectable} from '@angular/core'; +import {catchError} from 'rxjs/operators'; +import {Observable} from 'rxjs/internal/Observable'; +import {HttpClient, HttpHeaders} from '@angular/common/http'; +import {BalanceSheet} from './balance-sheet'; +import {ErrorLoggerService} from '../core/error-logger.service'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; + +const url = '/api/BalanceSheet'; +const serviceName = 'AccountService'; + +@Injectable({ + providedIn: 'root' +}) +export class BalanceSheetService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + list(date: string): Observable { + const listUrl = (date === null) ? url : `${url}/${date}`; + return >this.http.get(listUrl) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + +} diff --git a/overlord/src/app/balance-sheet/balance-sheet.ts b/overlord/src/app/balance-sheet/balance-sheet.ts new file mode 100644 index 00000000..8235c971 --- /dev/null +++ b/overlord/src/app/balance-sheet/balance-sheet.ts @@ -0,0 +1,5 @@ +export class BalanceSheet { + date: string; + body?: any[]; + footer?: any[]; +} diff --git a/overlord/src/app/cash-flow/cash-flow-datasource.ts b/overlord/src/app/cash-flow/cash-flow-datasource.ts new file mode 100644 index 00000000..1dbb536b --- /dev/null +++ b/overlord/src/app/cash-flow/cash-flow-datasource.ts @@ -0,0 +1,18 @@ +import {DataSource} from '@angular/cdk/collections'; +import {Observable, of as observableOf} from 'rxjs'; +import {CashFlowItem} from './cash-flow'; + + +export class CashFlowDataSource extends DataSource { + + constructor(private data: CashFlowItem[]) { + super(); + } + + connect(): Observable { + return observableOf(this.data); + } + + disconnect() { + } +} diff --git a/overlord/src/app/cash-flow/cash-flow-resolver.service.spec.ts b/overlord/src/app/cash-flow/cash-flow-resolver.service.spec.ts new file mode 100644 index 00000000..03d04aec --- /dev/null +++ b/overlord/src/app/cash-flow/cash-flow-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {CashFlowResolver} from './cash-flow-resolver.service'; + +describe('CashFlowResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [CashFlowResolver] + }); + }); + + it('should be created', inject([CashFlowResolver], (service: CashFlowResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/cash-flow/cash-flow-resolver.service.ts b/overlord/src/app/cash-flow/cash-flow-resolver.service.ts new file mode 100644 index 00000000..5621e18e --- /dev/null +++ b/overlord/src/app/cash-flow/cash-flow-resolver.service.ts @@ -0,0 +1,21 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {CashFlow} from './cash-flow'; +import {CashFlowService} from './cash-flow.service'; + +@Injectable({ + providedIn: 'root' +}) +export class CashFlowResolver implements Resolve { + + constructor(private ser: CashFlowService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const id = route.paramMap.get('id'); + const startDate = route.queryParamMap.get('startDate') || null; + const finishDate = route.queryParamMap.get('finishDate') || null; + return this.ser.list(id, startDate, finishDate); + } +} diff --git a/overlord/src/app/cash-flow/cash-flow-routing.module.spec.ts b/overlord/src/app/cash-flow/cash-flow-routing.module.spec.ts new file mode 100644 index 00000000..27ab2db7 --- /dev/null +++ b/overlord/src/app/cash-flow/cash-flow-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {CashFlowRoutingModule} from './cash-flow-routing.module'; + +describe('CashFlowRoutingModule', () => { + let cashFlowRoutingModule: CashFlowRoutingModule; + + beforeEach(() => { + cashFlowRoutingModule = new CashFlowRoutingModule(); + }); + + it('should create an instance', () => { + expect(cashFlowRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/cash-flow/cash-flow-routing.module.ts b/overlord/src/app/cash-flow/cash-flow-routing.module.ts new file mode 100644 index 00000000..f507e0af --- /dev/null +++ b/overlord/src/app/cash-flow/cash-flow-routing.module.ts @@ -0,0 +1,49 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {CashFlowResolver} from './cash-flow-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {CashFlowComponent} from './cash-flow.component'; + +const cashFlowRoutes: Routes = [ + { + path: 'CashFlow', + component: CashFlowComponent, + canActivate: [AuthGuard], + data: { + permission: 'Cash Flow' + }, + resolve: { + info: CashFlowResolver + }, + runGuardsAndResolvers: 'always' + }, + { + path: 'CashFlow/:id', + component: CashFlowComponent, + canActivate: [AuthGuard], + data: { + permission: 'Cash Flow' + }, + resolve: { + info: CashFlowResolver + }, + runGuardsAndResolvers: 'always' + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(cashFlowRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + CashFlowResolver + ] +}) +export class CashFlowRoutingModule { +} diff --git a/overlord/src/app/cash-flow/cash-flow.component.css b/overlord/src/app/cash-flow/cash-flow.component.css new file mode 100644 index 00000000..a9626b3c --- /dev/null +++ b/overlord/src/app/cash-flow/cash-flow.component.css @@ -0,0 +1,4 @@ +.right { + display: flex; + justify-content: flex-end; +} diff --git a/overlord/src/app/cash-flow/cash-flow.component.html b/overlord/src/app/cash-flow/cash-flow.component.html new file mode 100644 index 00000000..6858fb83 --- /dev/null +++ b/overlord/src/app/cash-flow/cash-flow.component.html @@ -0,0 +1,42 @@ + + + Cash Flow + + +
    +
    + + + + + + + + + + + +
    +
    + + + + + Name + {{row.name}} + + + + + Amount + {{row.amount | currency:'INR' | clear}} + + + + + +
    +
    diff --git a/overlord/src/app/cash-flow/cash-flow.component.spec.ts b/overlord/src/app/cash-flow/cash-flow.component.spec.ts new file mode 100644 index 00000000..8b13f9ed --- /dev/null +++ b/overlord/src/app/cash-flow/cash-flow.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {CashFlowComponent} from './cash-flow.component'; + +describe('CashFlowComponent', () => { + let component: CashFlowComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [CashFlowComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CashFlowComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/cash-flow/cash-flow.component.ts b/overlord/src/app/cash-flow/cash-flow.component.ts new file mode 100644 index 00000000..1811b790 --- /dev/null +++ b/overlord/src/app/cash-flow/cash-flow.component.ts @@ -0,0 +1,62 @@ +import {Component, OnInit} from '@angular/core'; +import {CashFlowDataSource} from './cash-flow-datasource'; +import {CashFlow} from './cash-flow'; +import {ActivatedRoute, Router} from '@angular/router'; +import * as moment from 'moment'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {Ledger} from '../ledger/ledger'; + +@Component({ + selector: 'app-cash-flow', + templateUrl: './cash-flow.component.html', + styleUrls: ['./cash-flow.component.css'] +}) +export class CashFlowComponent implements OnInit { + dataSource: CashFlowDataSource; + form: FormGroup; + info: CashFlow; + /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ + displayedColumns = ['name', 'amount']; + + constructor(private route: ActivatedRoute, private router: Router, private fb: FormBuilder) { + this.createForm(); + } + + createForm() { + this.form = this.fb.group({ + startDate: '', + finishDate: '' + }); + } + + ngOnInit() { + this.route.data + .subscribe((data: { info: CashFlow }) => { + this.info = data.info; + this.form.setValue({ + startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(), + finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate() + }); + this.dataSource = new CashFlowDataSource(CashFlow.Data(this.info)); + }); + } + + show() { + const info = this.getInfo(); + this.router.navigate(['CashFlow'], { + queryParams: { + startDate: info.startDate, + finishDate: info.finishDate + } + }); + } + + getInfo(): CashFlow { + const formModel = this.form.value; + + return { + startDate: moment(formModel.startDate).format('DD-MMM-YYYY'), + finishDate: moment(formModel.finishDate).format('DD-MMM-YYYY') + }; + } +} diff --git a/overlord/src/app/cash-flow/cash-flow.module.spec.ts b/overlord/src/app/cash-flow/cash-flow.module.spec.ts new file mode 100644 index 00000000..a3d0a612 --- /dev/null +++ b/overlord/src/app/cash-flow/cash-flow.module.spec.ts @@ -0,0 +1,13 @@ +import {CashFlowModule} from './cash-flow.module'; + +describe('CashFlowModule', () => { + let cashFlowModule: CashFlowModule; + + beforeEach(() => { + cashFlowModule = new CashFlowModule(); + }); + + it('should create an instance', () => { + expect(cashFlowModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/cash-flow/cash-flow.module.ts b/overlord/src/app/cash-flow/cash-flow.module.ts new file mode 100644 index 00000000..d2a29779 --- /dev/null +++ b/overlord/src/app/cash-flow/cash-flow.module.ts @@ -0,0 +1,69 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {CdkTableModule} from '@angular/cdk/table'; +import {CashFlowRoutingModule} from './cash-flow-routing.module'; +import {CashFlowComponent} from './cash-flow.component'; +import {MomentDateAdapter} from '@angular/material-moment-adapter'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; +import {ReactiveFormsModule} from '@angular/forms'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + CashFlowRoutingModule + ], + declarations: [ + CashFlowComponent + ], + providers: [ + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, + ] +}) +export class CashFlowModule { +} diff --git a/overlord/src/app/cash-flow/cash-flow.service.spec.ts b/overlord/src/app/cash-flow/cash-flow.service.spec.ts new file mode 100644 index 00000000..e8d4be2b --- /dev/null +++ b/overlord/src/app/cash-flow/cash-flow.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {CashFlowService} from './cash-flow.service'; + +describe('CashFlowService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [CashFlowService] + }); + }); + + it('should be created', inject([CashFlowService], (service: CashFlowService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/cash-flow/cash-flow.service.ts b/overlord/src/app/cash-flow/cash-flow.service.ts new file mode 100644 index 00000000..5727da06 --- /dev/null +++ b/overlord/src/app/cash-flow/cash-flow.service.ts @@ -0,0 +1,38 @@ +import {Injectable} from '@angular/core'; +import {catchError} from 'rxjs/operators'; +import {Observable} from 'rxjs/internal/Observable'; +import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http'; +import {CashFlow} from './cash-flow'; +import {ErrorLoggerService} from '../core/error-logger.service'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; + +const url = '/api/CashFlow'; +const serviceName = 'AccountService'; + +@Injectable({ + providedIn: 'root' +}) +export class CashFlowService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + list(id: string, startDate: string, finishDate: string): Observable { + const listUrl = (id === null) ? url : `${url}/${id}`; + const options = {params: new HttpParams()}; + if (startDate !== null) { + options.params = options.params.set('s', startDate); + } + if (finishDate !== null) { + options.params = options.params.set('f', finishDate); + } + return >this.http.get(listUrl, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + +} diff --git a/overlord/src/app/cash-flow/cash-flow.ts b/overlord/src/app/cash-flow/cash-flow.ts new file mode 100644 index 00000000..dc5bc422 --- /dev/null +++ b/overlord/src/app/cash-flow/cash-flow.ts @@ -0,0 +1,36 @@ +export class CashFlowItem { + name: string; + url: string; + amount: number; + + constructor(name: string) { + this.name = name; + } +} + +export class CashFlow { + startDate: string; + finishDate: string; + body?: { operating: CashFlowItem[], investing: CashFlowItem[], financing: CashFlowItem[], details: CashFlowItem[] }; + footer?: CashFlowItem[]; + + static Data(value): CashFlowItem[] { + const d: CashFlowItem[] = []; + if (value.body.operating && value.body.operating.length) { + d.push(new CashFlowItem('Cash flows from Operating activities')); + d.push(...value.body.operating); + } + if (value.body.investing && value.body.investing.length) { + d.push(new CashFlowItem('Cash flows from Investing activities')); + d.push(...value.body.investing); + } + if (value.body.financing && value.body.financing.length) { + d.push(new CashFlowItem('Cash flows from Financing activities')); + d.push(...value.body.financing); + } + if (value.body.details && value.body.details.length) { + d.push(...value.body.details); + } + return d; + } +} diff --git a/overlord/src/app/client/client-detail/client-detail.component.css b/overlord/src/app/client/client-detail/client-detail.component.css new file mode 100644 index 00000000..82c7afd6 --- /dev/null +++ b/overlord/src/app/client/client-detail/client-detail.component.css @@ -0,0 +1,3 @@ +.example-card { + max-width: 400px; +} diff --git a/overlord/src/app/client/client-detail/client-detail.component.html b/overlord/src/app/client/client-detail/client-detail.component.html new file mode 100644 index 00000000..a783cd43 --- /dev/null +++ b/overlord/src/app/client/client-detail/client-detail.component.html @@ -0,0 +1,40 @@ +
    + + + Client + + +
    +
    + + Code + + +
    +
    + + Name + + +
    +
    + Is Enabled? +
    +
    + + OTP + + +
    +
    +
    + + + + +
    +
    diff --git a/overlord/src/app/client/client-detail/client-detail.component.spec.ts b/overlord/src/app/client/client-detail/client-detail.component.spec.ts new file mode 100644 index 00000000..0c15d4c7 --- /dev/null +++ b/overlord/src/app/client/client-detail/client-detail.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {ClientDetailComponent} from './client-detail.component'; + +describe('ClientDetailComponent', () => { + let component: ClientDetailComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ClientDetailComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ClientDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/client/client-detail/client-detail.component.ts b/overlord/src/app/client/client-detail/client-detail.component.ts new file mode 100644 index 00000000..2863171d --- /dev/null +++ b/overlord/src/app/client/client-detail/client-detail.component.ts @@ -0,0 +1,110 @@ +import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; + +import {ClientService} from '../client.service'; +import {Client} from '../client'; +import {ActivatedRoute, Router} from '@angular/router'; +import {ToasterService} from '../../core/toaster.service'; +import {ConfirmDialogComponent} from '../../shared/confirm-dialog/confirm-dialog.component'; +import {MatDialog} from '@angular/material'; +import {FormBuilder, FormGroup} from '@angular/forms'; + +@Component({ + selector: 'app-client-detail', + templateUrl: './client-detail.component.html', + styleUrls: ['./client-detail.component.css'] +}) +export class ClientDetailComponent implements OnInit, AfterViewInit { + @ViewChild('nameElement') nameElement: ElementRef; + form: FormGroup; + item: Client; + + constructor( + private route: ActivatedRoute, + private router: Router, + private dialog: MatDialog, + private fb: FormBuilder, + private toaster: ToasterService, + private ser: ClientService + ) { + this.createForm(); + } + + createForm() { + this.form = this.fb.group({ + code: {value: '', disabled: true}, + name: '', + enabled: false, + otp: '' + }); + } + + ngOnInit() { + this.route.data + .subscribe((data: { item: Client }) => { + this.showItem(data.item); + }); + } + + showItem(item: Client) { + this.item = item; + this.form.setValue({ + code: this.item.code || '(Auto)', + name: this.item.name, + enabled: this.item.enabled, + otp: this.item.otp + }); + } + + ngAfterViewInit() { + setTimeout(() => { + this.nameElement.nativeElement.focus(); + }, 0); + } + + save() { + this.ser.update(this.getItem()) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigateByUrl('/Clients'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + delete() { + this.ser.delete(this.item.id) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigateByUrl('/Clients'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + confirmDelete(): void { + const dialogRef = this.dialog.open(ConfirmDialogComponent, { + width: '250px', + data: {title: 'Delete Client?', content: 'Are you sure? This cannot be undone.'} + }); + + dialogRef.afterClosed().subscribe((result: boolean) => { + if (result) { + this.delete(); + } + }); + } + + getItem(): Client { + const formModel = this.form.value; + this.item.name = formModel.name; + this.item.enabled = formModel.enabled; + this.item.otp = formModel.otp; + return this.item; + } +} diff --git a/overlord/src/app/client/client-list-resolver.service.spec.ts b/overlord/src/app/client/client-list-resolver.service.spec.ts new file mode 100644 index 00000000..acb1452e --- /dev/null +++ b/overlord/src/app/client/client-list-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {ClientListResolverService} from './client-list-resolver.service'; + +describe('ClientListResolverService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ClientListResolverService] + }); + }); + + it('should be created', inject([ClientListResolverService], (service: ClientListResolverService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/client/client-list-resolver.service.ts b/overlord/src/app/client/client-list-resolver.service.ts new file mode 100644 index 00000000..15d35332 --- /dev/null +++ b/overlord/src/app/client/client-list-resolver.service.ts @@ -0,0 +1,18 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot} from '@angular/router'; +import {Client} from './client'; +import {Observable} from 'rxjs/internal/Observable'; +import {ClientService} from './client.service'; + +@Injectable({ + providedIn: 'root' +}) +export class ClientListResolver implements Resolve { + + constructor(private ser: ClientService, private router: Router) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + return this.ser.list(); + } +} diff --git a/overlord/src/app/client/client-list/client-list-datasource.ts b/overlord/src/app/client/client-list/client-list-datasource.ts new file mode 100644 index 00000000..91566dc4 --- /dev/null +++ b/overlord/src/app/client/client-list/client-list-datasource.ts @@ -0,0 +1,58 @@ +import {DataSource} from '@angular/cdk/collections'; +import {MatPaginator, MatSort} from '@angular/material'; +import {map} from 'rxjs/operators'; +import {merge, Observable, of as observableOf} from 'rxjs'; +import {Client} from '../client'; + +export class ClientListDataSource extends DataSource { + + constructor(private paginator: MatPaginator, private sort: MatSort, public data: Client[]) { + super(); + } + + connect(): Observable { + const dataMutations = [ + observableOf(this.data), + this.paginator.page, + this.sort.sortChange + ]; + + // Set the paginators length + this.paginator.length = this.data.length; + + return merge(...dataMutations).pipe(map(() => { + return this.getPagedData(this.getSortedData([...this.data])); + })); + } + + disconnect() { + } + + private getPagedData(data: Client[]) { + const startIndex = this.paginator.pageIndex * this.paginator.pageSize; + return data.splice(startIndex, this.paginator.pageSize); + } + + private getSortedData(data: Client[]) { + if (!this.sort.active || this.sort.direction === '') { + return data; + } + + return data.sort((a, b) => { + const isAsc = this.sort.direction === 'asc'; + switch (this.sort.active) { + case 'name': + return compare(a.name, b.name, isAsc); + case 'id': + return compare(+a.id, +b.id, isAsc); + default: + return 0; + } + }); + } +} + +/** Simple sort comparator for example ID/Name columns (for client-side sorting). */ +function compare(a, b, isAsc) { + return (a < b ? -1 : 1) * (isAsc ? 1 : -1); +} diff --git a/overlord/src/app/client/client-list/client-list.component.css b/overlord/src/app/client/client-list/client-list.component.css new file mode 100644 index 00000000..e69de29b diff --git a/overlord/src/app/client/client-list/client-list.component.html b/overlord/src/app/client/client-list/client-list.component.html new file mode 100644 index 00000000..c611a130 --- /dev/null +++ b/overlord/src/app/client/client-list/client-list.component.html @@ -0,0 +1,55 @@ + + + Clients + + + + + + + Name + {{row.code}} + + + + + Name + {{row.name}} + + + + + Is Enabled? + {{row.enabled}} + + + + + otp + {{row.otp}} + + + + + Created + {{row.created | localTime}} + + + + + Last Login + {{row.lastLogin | localTime}} + + + + + + + + + + diff --git a/overlord/src/app/client/client-list/client-list.component.spec.ts b/overlord/src/app/client/client-list/client-list.component.spec.ts new file mode 100644 index 00000000..7fc745f0 --- /dev/null +++ b/overlord/src/app/client/client-list/client-list.component.spec.ts @@ -0,0 +1,23 @@ +import {ComponentFixture, fakeAsync, TestBed} from '@angular/core/testing'; + +import {ClientListComponent} from './client-list.component'; + +describe('ClientListComponent', () => { + let component: ClientListComponent; + let fixture: ComponentFixture; + + beforeEach(fakeAsync(() => { + TestBed.configureTestingModule({ + declarations: [ClientListComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ClientListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should compile', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/client/client-list/client-list.component.ts b/overlord/src/app/client/client-list/client-list.component.ts new file mode 100644 index 00000000..4cf39a39 --- /dev/null +++ b/overlord/src/app/client/client-list/client-list.component.ts @@ -0,0 +1,30 @@ +import {Component, OnInit, ViewChild} from '@angular/core'; +import {MatPaginator, MatSort} from '@angular/material'; +import {ClientListDataSource} from './client-list-datasource'; +import {Client} from '../client'; +import {ActivatedRoute} from '@angular/router'; + +@Component({ + selector: 'app-client-list', + templateUrl: './client-list.component.html', + styleUrls: ['./client-list.component.css'] +}) +export class ClientListComponent implements OnInit { + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + dataSource: ClientListDataSource; + list: Client[]; + /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ + displayedColumns = ['code', 'name', 'enabled', 'otp', 'created', 'lastLogin']; + + constructor(private route: ActivatedRoute) { + } + + ngOnInit() { + this.route.data + .subscribe((data: { list: Client[] }) => { + this.list = data.list; + }); + this.dataSource = new ClientListDataSource(this.paginator, this.sort, this.list); + } +} diff --git a/overlord/src/app/client/client-resolver.service.spec.ts b/overlord/src/app/client/client-resolver.service.spec.ts new file mode 100644 index 00000000..a04e914f --- /dev/null +++ b/overlord/src/app/client/client-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {ClientResolverService} from './client-resolver.service'; + +describe('ClientResolverService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ClientDetailResolverService] + }); + }); + + it('should be created', inject([ClientDetailResolverService], (service: ClientDetailResolverService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/client/client-resolver.service.ts b/overlord/src/app/client/client-resolver.service.ts new file mode 100644 index 00000000..41d858d0 --- /dev/null +++ b/overlord/src/app/client/client-resolver.service.ts @@ -0,0 +1,19 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot} from '@angular/router'; +import {ClientService} from './client.service'; +import {Client} from './client'; +import {Observable} from 'rxjs/internal/Observable'; + +@Injectable({ + providedIn: 'root' +}) +export class ClientResolver implements Resolve { + + constructor(private ser: ClientService, private router: Router) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const id = route.paramMap.get('id'); + return this.ser.get(id); + } +} diff --git a/overlord/src/app/client/client-routing.module.spec.ts b/overlord/src/app/client/client-routing.module.spec.ts new file mode 100644 index 00000000..f4468f18 --- /dev/null +++ b/overlord/src/app/client/client-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {ClientRoutingModule} from './client-routing.module'; + +describe('ClientRoutingModule', () => { + let clientRoutingModule: ClientRoutingModule; + + beforeEach(() => { + clientRoutingModule = new ClientRoutingModule(); + }); + + it('should create an instance', () => { + expect(clientRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/client/client-routing.module.ts b/overlord/src/app/client/client-routing.module.ts new file mode 100644 index 00000000..250210bc --- /dev/null +++ b/overlord/src/app/client/client-routing.module.ts @@ -0,0 +1,50 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {ClientListResolver} from './client-list-resolver.service'; +import {ClientResolver} from './client-resolver.service'; +import {ClientListComponent} from './client-list/client-list.component'; +import {ClientDetailComponent} from './client-detail/client-detail.component'; +import {AuthGuard} from '../auth/auth-guard.service'; + +const clientRoutes: Routes = [ + { + path: 'Clients', + component: ClientListComponent, + canActivate: [AuthGuard], + data: { + permission: 'Cost Centres' + }, + resolve: { + list: ClientListResolver + } + }, + { + path: 'Client/:id', + component: ClientDetailComponent, + canActivate: [AuthGuard], + data: { + permission: 'Cost Centres' + }, + resolve: { + item: ClientResolver + } + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(clientRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + ClientListResolver, + ClientResolver + ] +}) +export class ClientRoutingModule { +} diff --git a/overlord/src/app/client/client.module.spec.ts b/overlord/src/app/client/client.module.spec.ts new file mode 100644 index 00000000..cc27ec01 --- /dev/null +++ b/overlord/src/app/client/client.module.spec.ts @@ -0,0 +1,13 @@ +import {ClientModule} from './client.module'; + +describe('ClientModule', () => { + let clientModule: ClientModule; + + beforeEach(() => { + clientModule = new ClientModule(); + }); + + it('should create an instance', () => { + expect(clientModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/client/client.module.ts b/overlord/src/app/client/client.module.ts new file mode 100644 index 00000000..780a259f --- /dev/null +++ b/overlord/src/app/client/client.module.ts @@ -0,0 +1,48 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; + +import {ClientListComponent} from './client-list/client-list.component'; +import {ClientDetailComponent} from './client-detail/client-detail.component'; +import {ClientRoutingModule} from './client-routing.module'; +import { + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatIconModule, + MatInputModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {CdkTableModule} from '@angular/cdk/table'; +import {SharedModule} from '../shared/shared.module'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; +import {ReactiveFormsModule} from '@angular/forms'; + +@NgModule({ + imports: [ + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatIconModule, + MatInputModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + ClientRoutingModule + ], + declarations: [ + ClientListComponent, + ClientDetailComponent + ] +}) +export class ClientModule { +} diff --git a/overlord/src/app/client/client.service.spec.ts b/overlord/src/app/client/client.service.spec.ts new file mode 100644 index 00000000..c1aa5acd --- /dev/null +++ b/overlord/src/app/client/client.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {ClientService} from './client.service'; + +describe('ClientService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ClientService] + }); + }); + + it('should be created', inject([ClientService], (service: ClientService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/client/client.service.ts b/overlord/src/app/client/client.service.ts new file mode 100644 index 00000000..868d0462 --- /dev/null +++ b/overlord/src/app/client/client.service.ts @@ -0,0 +1,50 @@ +import {Injectable} from '@angular/core'; +import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http'; +import {ErrorLoggerService} from '../core/error-logger.service'; +import {catchError} from 'rxjs/operators'; +import {Observable} from 'rxjs/internal/Observable'; +import {Client} from './client'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; +const url = '/api/Client'; +const serviceName = 'ClientService'; + +@Injectable({ + providedIn: 'root' +}) +export class ClientService { + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + get(id: string): Observable { + const getUrl: string = (id === null) ? url : `${url}/${id}`; + return >this.http.get(getUrl) + .pipe( + catchError(this.log.handleError(serviceName, `get id=${id}`)) + ); + } + + list(): Observable { + const options = {params: new HttpParams().set('l', '')}; + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + + update(client: Client): Observable { + return >this.http.put(`${url}/${client.id}`, client, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'update')) + ); + } + + delete(id: string): Observable { + return >this.http.delete(`${url}/${id}`, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'delete')) + ); + } +} diff --git a/overlord/src/app/client/client.ts b/overlord/src/app/client/client.ts new file mode 100644 index 00000000..4b2c6352 --- /dev/null +++ b/overlord/src/app/client/client.ts @@ -0,0 +1,9 @@ +export class Client { + id: string; + name: string; + code: number; + enabled: boolean; + otp: number; + creationDate: string; + lastLogin: string; +} diff --git a/overlord/src/app/closing-stock/closing-stock-datasource.ts b/overlord/src/app/closing-stock/closing-stock-datasource.ts new file mode 100644 index 00000000..605f4d53 --- /dev/null +++ b/overlord/src/app/closing-stock/closing-stock-datasource.ts @@ -0,0 +1,63 @@ +import {DataSource} from '@angular/cdk/collections'; +import {MatPaginator, MatSort} from '@angular/material'; +import {map} from 'rxjs/operators'; +import {merge, Observable, of as observableOf} from 'rxjs'; +import {ClosingStockItem} from './closing-stock'; + + +export class ClosingStockDataSource extends DataSource { + + constructor(private paginator: MatPaginator, private sort: MatSort, public data: ClosingStockItem[]) { + super(); + } + + connect(): Observable { + const dataMutations = [ + observableOf(this.data), + this.paginator.page, + this.sort.sortChange + ]; + + // Set the paginators length + this.paginator.length = this.data.length; + + return merge(...dataMutations).pipe(map(() => { + return this.getPagedData(this.getSortedData([...this.data])); + })); + } + + disconnect() { + } + + private getPagedData(data: ClosingStockItem[]) { + const startIndex = this.paginator.pageIndex * this.paginator.pageSize; + return data.splice(startIndex, this.paginator.pageSize); + } + + private getSortedData(data: ClosingStockItem[]) { + if (!this.sort.active || this.sort.direction === '') { + return data; + } + + return data.sort((a, b) => { + const isAsc = this.sort.direction === 'asc'; + switch (this.sort.active) { + case 'product': + return compare(a.product, b.product, isAsc); + case 'group': + return compare(a.group, b.group, isAsc); + case 'quantity': + return compare(+a.quantity, +b.quantity, isAsc); + case 'amount': + return compare(+a.amount, +b.amount, isAsc); + default: + return 0; + } + }); + } +} + +/** Simple sort comparator for example ID/Name columns (for client-side sorting). */ +function compare(a, b, isAsc) { + return (a < b ? -1 : 1) * (isAsc ? 1 : -1); +} diff --git a/overlord/src/app/closing-stock/closing-stock-resolver.service.spec.ts b/overlord/src/app/closing-stock/closing-stock-resolver.service.spec.ts new file mode 100644 index 00000000..43317c11 --- /dev/null +++ b/overlord/src/app/closing-stock/closing-stock-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {ClosingStockResolver} from './closing-stock-resolver.service'; + +describe('ClosingStockResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ClosingStockResolver] + }); + }); + + it('should be created', inject([ClosingStockResolver], (service: ClosingStockResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/closing-stock/closing-stock-resolver.service.ts b/overlord/src/app/closing-stock/closing-stock-resolver.service.ts new file mode 100644 index 00000000..7fdc921e --- /dev/null +++ b/overlord/src/app/closing-stock/closing-stock-resolver.service.ts @@ -0,0 +1,19 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {ClosingStock} from './closing-stock'; +import {ClosingStockService} from './closing-stock.service'; + +@Injectable({ + providedIn: 'root' +}) +export class ClosingStockResolver implements Resolve { + + constructor(private ser: ClosingStockService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const date = route.paramMap.get('date'); + return this.ser.list(date); + } +} diff --git a/overlord/src/app/closing-stock/closing-stock-routing.module.spec.ts b/overlord/src/app/closing-stock/closing-stock-routing.module.spec.ts new file mode 100644 index 00000000..89d2a9f6 --- /dev/null +++ b/overlord/src/app/closing-stock/closing-stock-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {ClosingStockRoutingModule} from './closing-stock-routing.module'; + +describe('ClosingStockRoutingModule', () => { + let closingStockRoutingModule: ClosingStockRoutingModule; + + beforeEach(() => { + closingStockRoutingModule = new ClosingStockRoutingModule(); + }); + + it('should create an instance', () => { + expect(closingStockRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/closing-stock/closing-stock-routing.module.ts b/overlord/src/app/closing-stock/closing-stock-routing.module.ts new file mode 100644 index 00000000..8180aad4 --- /dev/null +++ b/overlord/src/app/closing-stock/closing-stock-routing.module.ts @@ -0,0 +1,47 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {ClosingStockResolver} from './closing-stock-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {ClosingStockComponent} from './closing-stock.component'; + +const closingStockRoutes: Routes = [ + { + path: 'ClosingStock', + component: ClosingStockComponent, + canActivate: [AuthGuard], + data: { + permission: 'Closing Stock' + }, + resolve: { + info: ClosingStockResolver + } + }, + { + path: 'ClosingStock/:date', + component: ClosingStockComponent, + canActivate: [AuthGuard], + data: { + permission: 'Closing Stock' + }, + resolve: { + info: ClosingStockResolver + } + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(closingStockRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + ClosingStockResolver + ] +}) +export class ClosingStockRoutingModule { +} diff --git a/overlord/src/app/closing-stock/closing-stock.component.css b/overlord/src/app/closing-stock/closing-stock.component.css new file mode 100644 index 00000000..a9626b3c --- /dev/null +++ b/overlord/src/app/closing-stock/closing-stock.component.css @@ -0,0 +1,4 @@ +.right { + display: flex; + justify-content: flex-end; +} diff --git a/overlord/src/app/closing-stock/closing-stock.component.html b/overlord/src/app/closing-stock/closing-stock.component.html new file mode 100644 index 00000000..6c510a63 --- /dev/null +++ b/overlord/src/app/closing-stock/closing-stock.component.html @@ -0,0 +1,58 @@ + + + Closing Stock + + + +
    +
    + + + + + + +
    +
    + + + + + Product + {{row.product}} + + + + + Group + {{row.group}} + + + + + Quantity + {{row.quantity | number:'0.2-2'}} + + + + + Amount + {{row.amount | currency:'INR'}} + + + + + + + + +
    +
    diff --git a/overlord/src/app/closing-stock/closing-stock.component.spec.ts b/overlord/src/app/closing-stock/closing-stock.component.spec.ts new file mode 100644 index 00000000..145d55d3 --- /dev/null +++ b/overlord/src/app/closing-stock/closing-stock.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {ClosingStockComponent} from './closing-stock.component'; + +describe('ClosingStockComponent', () => { + let component: ClosingStockComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ClosingStockComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ClosingStockComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/closing-stock/closing-stock.component.ts b/overlord/src/app/closing-stock/closing-stock.component.ts new file mode 100644 index 00000000..c4653a1a --- /dev/null +++ b/overlord/src/app/closing-stock/closing-stock.component.ts @@ -0,0 +1,70 @@ +import {Component, OnInit, ViewChild} from '@angular/core'; +import {MatPaginator, MatSort} from '@angular/material'; +import {ClosingStockDataSource} from './closing-stock-datasource'; +import {ClosingStock} from './closing-stock'; +import {ActivatedRoute, Router} from '@angular/router'; +import * as moment from 'moment'; +import {FormBuilder, FormGroup} from '@angular/forms'; + +@Component({ + selector: 'app-closing-stock', + templateUrl: './closing-stock.component.html', + styleUrls: ['./closing-stock.component.css'] +}) +export class ClosingStockComponent implements OnInit { + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + dataSource: ClosingStockDataSource; + form: FormGroup; + info: ClosingStock; + /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ + displayedColumns = ['product', 'group', 'quantity', 'amount']; + + constructor(private route: ActivatedRoute, private router: Router, private fb: FormBuilder) { + this.createForm(); + } + + createForm() { + this.form = this.fb.group({ + date: '' + }); + } + + ngOnInit() { + this.route.data + .subscribe((data: { info: ClosingStock }) => { + this.info = data.info; + this.form.setValue({ + date: moment(this.info.date, 'DD-MMM-YYYY').toDate() + }); + }); + this.dataSource = new ClosingStockDataSource(this.paginator, this.sort, this.info.body); + } + + show() { + const info = this.getInfo(); + this.router.navigate(['ClosingStock', info.date]); + } + + getInfo(): ClosingStock { + const formModel = this.form.value; + + return { + date: moment(formModel.date).format('DD-MMM-YYYY') + }; + } + exportCsv() { + const data: string[] = ['Product, Group, Quantity, Amount']; + data.push( + ...this.dataSource.data.map(x => '' + x.product + ', ' + x.group + ', ' + x.quantity + ', ' + x.amount) + ); + + const csvData = new Blob([data.join('\n')], {type: 'text/csv;charset=utf-8;'}); + const link = document.createElement('a'); + link.href = window.URL.createObjectURL(csvData); + link.setAttribute('download', 'closing-stock.csv'); + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + } +} diff --git a/overlord/src/app/closing-stock/closing-stock.module.spec.ts b/overlord/src/app/closing-stock/closing-stock.module.spec.ts new file mode 100644 index 00000000..875aa815 --- /dev/null +++ b/overlord/src/app/closing-stock/closing-stock.module.spec.ts @@ -0,0 +1,13 @@ +import {ClosingStockModule} from './closing-stock.module'; + +describe('ClosingStockModule', () => { + let closingStockModule: ClosingStockModule; + + beforeEach(() => { + closingStockModule = new ClosingStockModule(); + }); + + it('should create an instance', () => { + expect(closingStockModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/closing-stock/closing-stock.module.ts b/overlord/src/app/closing-stock/closing-stock.module.ts new file mode 100644 index 00000000..0194b79e --- /dev/null +++ b/overlord/src/app/closing-stock/closing-stock.module.ts @@ -0,0 +1,71 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {CdkTableModule} from '@angular/cdk/table'; +import {ClosingStockRoutingModule} from './closing-stock-routing.module'; +import {ClosingStockComponent} from './closing-stock.component'; +import {MomentDateAdapter} from '@angular/material-moment-adapter'; +import {A11yModule} from '@angular/cdk/a11y'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; +import {ReactiveFormsModule} from '@angular/forms'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + ClosingStockRoutingModule + ], + declarations: [ + ClosingStockComponent + ], + providers: [ + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, + ] +}) +export class ClosingStockModule { +} diff --git a/overlord/src/app/closing-stock/closing-stock.service.spec.ts b/overlord/src/app/closing-stock/closing-stock.service.spec.ts new file mode 100644 index 00000000..d247fbff --- /dev/null +++ b/overlord/src/app/closing-stock/closing-stock.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {ClosingStockService} from './closing-stock.service'; + +describe('ClosingStockService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ClosingStockService] + }); + }); + + it('should be created', inject([ClosingStockService], (service: ClosingStockService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/closing-stock/closing-stock.service.ts b/overlord/src/app/closing-stock/closing-stock.service.ts new file mode 100644 index 00000000..deb12ea0 --- /dev/null +++ b/overlord/src/app/closing-stock/closing-stock.service.ts @@ -0,0 +1,31 @@ +import {Injectable} from '@angular/core'; +import {catchError} from 'rxjs/operators'; +import {Observable} from 'rxjs/internal/Observable'; +import {HttpClient, HttpHeaders} from '@angular/common/http'; +import {ClosingStock} from './closing-stock'; +import {ErrorLoggerService} from '../core/error-logger.service'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; + +const url = '/api/ClosingStock'; +const serviceName = 'AccountService'; + +@Injectable({ + providedIn: 'root' +}) +export class ClosingStockService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + list(date: string): Observable { + const listUrl = (date === null) ? url : `${url}/${date}`; + return >this.http.get(listUrl) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + +} diff --git a/overlord/src/app/closing-stock/closing-stock.ts b/overlord/src/app/closing-stock/closing-stock.ts new file mode 100644 index 00000000..73ffbac5 --- /dev/null +++ b/overlord/src/app/closing-stock/closing-stock.ts @@ -0,0 +1,11 @@ +export class ClosingStockItem { + product: string; + group: string; + quantity: number; + amount: number; +} + +export class ClosingStock { + date: string; + body?: ClosingStockItem[]; +} diff --git a/overlord/src/app/core/core.module.spec.ts b/overlord/src/app/core/core.module.spec.ts new file mode 100644 index 00000000..31bbdb87 --- /dev/null +++ b/overlord/src/app/core/core.module.spec.ts @@ -0,0 +1,13 @@ +import {CoreModule} from './core.module'; + +describe('CoreModule', () => { + let coreModule: CoreModule; + + beforeEach(() => { + coreModule = new CoreModule(); + }); + + it('should create an instance', () => { + expect(coreModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/core/core.module.ts b/overlord/src/app/core/core.module.ts new file mode 100644 index 00000000..63c318a7 --- /dev/null +++ b/overlord/src/app/core/core.module.ts @@ -0,0 +1,24 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {NavBarComponent} from './nav-bar/nav-bar.component'; +import {MatButtonModule, MatIconModule, MatMenuModule, MatToolbarModule} from '@angular/material'; +import {RouterModule} from '@angular/router'; + +@NgModule({ + imports: [ + CommonModule, + MatButtonModule, + MatIconModule, + MatMenuModule, + MatToolbarModule, + RouterModule + ], + declarations: [ + NavBarComponent + ], + exports: [ + NavBarComponent + ] +}) +export class CoreModule { +} diff --git a/overlord/src/app/core/error-logger.service.spec.ts b/overlord/src/app/core/error-logger.service.spec.ts new file mode 100644 index 00000000..7ec6c6c7 --- /dev/null +++ b/overlord/src/app/core/error-logger.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {ErrorLoggerService} from './error-logger.service'; + +describe('ErrorLoggerService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ErrorLoggerService] + }); + }); + + it('should be created', inject([ErrorLoggerService], (service: ErrorLoggerService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/core/error-logger.service.ts b/overlord/src/app/core/error-logger.service.ts new file mode 100644 index 00000000..c49cf7ed --- /dev/null +++ b/overlord/src/app/core/error-logger.service.ts @@ -0,0 +1,36 @@ +import {Injectable} from '@angular/core'; +import {Observable} from 'rxjs/internal/Observable'; + +@Injectable({ + providedIn: 'root' +}) +export class ErrorLoggerService { + constructor() { + } + + /** + * Handle Http operation that failed. + * Let the app continue. + * @param operation - name of the operation that failed + * @param result - optional value to return as the observable result + */ + public handleError(serviceName = 'error-logger', operation = 'operation', result?: T) { + return (error: any): Observable => { + + // TODO: send the error to remote logging infrastructure + console.error(error); // log to console instead + + // TODO: better job of transforming error for user consumption + this.log(serviceName, `${operation} failed: ${error.message}`); + + // // Let the app keep running by returning an empty result. + // return of(result as T); + return Observable.create(subscriber => subscriber.error(error)); + }; + } + + public log(serviceName = 'error-logger', message: string) { + console.log(serviceName + 'Service: ' + message); + } + +} diff --git a/overlord/src/app/core/nav-bar/nav-bar.component.css b/overlord/src/app/core/nav-bar/nav-bar.component.css new file mode 100644 index 00000000..db4b52b0 --- /dev/null +++ b/overlord/src/app/core/nav-bar/nav-bar.component.css @@ -0,0 +1,14 @@ +.sidenav-container { + height: 100%; +} + +.sidenav { + width: 200px; + box-shadow: 3px 0 6px rgba(0, 0, 0, .24); +} + +.fill-remaining-space { + /* This fills the remaining space, by using flexbox. + Every toolbar row uses a flexbox row layout. */ + flex: 1 1 auto; +} diff --git a/overlord/src/app/core/nav-bar/nav-bar.component.html b/overlord/src/app/core/nav-bar/nav-bar.component.html new file mode 100644 index 00000000..4ae26a9d --- /dev/null +++ b/overlord/src/app/core/nav-bar/nav-bar.component.html @@ -0,0 +1,89 @@ + + + HnG / TGB + + Journal + Purchase + Purchase Return + Payment + Receipt + Issue + + + + + Display Ledger + Ledger Reconcilliation + Cash Flow + Day Book + Trial Balance + Profit and Loss + Balance Sheet + Net Transactions + UnPosted Entries + + + + + Product Ledger + Raw Material Cost + Purchase Entries + Purchases + Closing Stock + Stock Movement + + + + + Employees + Attendance + Employee Attendance + Employee Functions + Employee Benefits (Esi / Pf) + Incentive + + + + + Accounts + Cost Centres + Products + Product Groups + + + + + + + Logout {{nameObject | async}} + Change Password + Users + Groups + Clients + Settings + + + + account_box + Login + diff --git a/overlord/src/app/core/nav-bar/nav-bar.component.spec.ts b/overlord/src/app/core/nav-bar/nav-bar.component.spec.ts new file mode 100644 index 00000000..6c917a3a --- /dev/null +++ b/overlord/src/app/core/nav-bar/nav-bar.component.spec.ts @@ -0,0 +1,23 @@ +import {ComponentFixture, fakeAsync, TestBed} from '@angular/core/testing'; + +import {NavBarComponent} from './nav-bar.component'; + +describe('NavBarComponent', () => { + let component: NavBarComponent; + let fixture: ComponentFixture; + + beforeEach(fakeAsync(() => { + TestBed.configureTestingModule({ + declarations: [NavBarComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(NavBarComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should compile', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/core/nav-bar/nav-bar.component.ts b/overlord/src/app/core/nav-bar/nav-bar.component.ts new file mode 100644 index 00000000..042aa9ea --- /dev/null +++ b/overlord/src/app/core/nav-bar/nav-bar.component.ts @@ -0,0 +1,28 @@ +import {Component, OnInit} from '@angular/core'; +import {BreakpointObserver, Breakpoints, BreakpointState} from '@angular/cdk/layout'; +import {Observable} from 'rxjs'; +import {AuthService} from '../../auth/auth.service'; +import {Subject} from 'rxjs/internal/Subject'; + +@Component({ + selector: 'app-nav-bar', + templateUrl: './nav-bar.component.html', + styleUrls: ['./nav-bar.component.css'] +}) +export class NavBarComponent implements OnInit { + isHandset: Observable = this.breakpointObserver.observe(Breakpoints.Handset); + public nameObject = new Subject(); + + constructor(private breakpointObserver: BreakpointObserver, private auth: AuthService) { + } + + ngOnInit() { + this.auth.userObservable.subscribe((user) => { + if (user.isAuthenticated) { + this.nameObject.next(user.name); + } else { + this.nameObject.next(null); + } + }); + } +} diff --git a/overlord/src/app/core/toaster.service.spec.ts b/overlord/src/app/core/toaster.service.spec.ts new file mode 100644 index 00000000..857d80c8 --- /dev/null +++ b/overlord/src/app/core/toaster.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {ToasterService} from './toaster.service'; + +describe('ToasterService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ToasterService] + }); + }); + + it('should be created', inject([ToasterService], (service: ToasterService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/core/toaster.service.ts b/overlord/src/app/core/toaster.service.ts new file mode 100644 index 00000000..638a2be6 --- /dev/null +++ b/overlord/src/app/core/toaster.service.ts @@ -0,0 +1,17 @@ +import {Injectable} from '@angular/core'; +import {MatSnackBar} from '@angular/material'; + +@Injectable({ + providedIn: 'root' +}) +export class ToasterService { + + constructor(private snackBar: MatSnackBar) { + } + + show(type: string, msg: string) { + this.snackBar.open(msg, type, { + duration: 3000, + }); + } +} diff --git a/overlord/src/app/cost-centre/cost-centre-detail/cost-centre-detail.component.css b/overlord/src/app/cost-centre/cost-centre-detail/cost-centre-detail.component.css new file mode 100644 index 00000000..82c7afd6 --- /dev/null +++ b/overlord/src/app/cost-centre/cost-centre-detail/cost-centre-detail.component.css @@ -0,0 +1,3 @@ +.example-card { + max-width: 400px; +} diff --git a/overlord/src/app/cost-centre/cost-centre-detail/cost-centre-detail.component.html b/overlord/src/app/cost-centre/cost-centre-detail/cost-centre-detail.component.html new file mode 100644 index 00000000..699a49e3 --- /dev/null +++ b/overlord/src/app/cost-centre/cost-centre-detail/cost-centre-detail.component.html @@ -0,0 +1,21 @@ +
    + + + Cost Center + + +
    +
    + + Name + + +
    +
    +
    + + + +
    +
    diff --git a/overlord/src/app/cost-centre/cost-centre-detail/cost-centre-detail.component.spec.ts b/overlord/src/app/cost-centre/cost-centre-detail/cost-centre-detail.component.spec.ts new file mode 100644 index 00000000..ac1c084d --- /dev/null +++ b/overlord/src/app/cost-centre/cost-centre-detail/cost-centre-detail.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {CostCentreDetailComponent} from './cost-centre-detail.component'; + +describe('CostCentreDetailComponent', () => { + let component: CostCentreDetailComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [CostCentreDetailComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CostCentreDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/cost-centre/cost-centre-detail/cost-centre-detail.component.ts b/overlord/src/app/cost-centre/cost-centre-detail/cost-centre-detail.component.ts new file mode 100644 index 00000000..07a69689 --- /dev/null +++ b/overlord/src/app/cost-centre/cost-centre-detail/cost-centre-detail.component.ts @@ -0,0 +1,73 @@ +import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; + +import {CostCentreService} from '../cost-centre.service'; +import {CostCentre} from '../cost-centre'; +import {ActivatedRoute, Router} from '@angular/router'; +import {ToasterService} from '../../core/toaster.service'; +import {FormBuilder, FormGroup} from '@angular/forms'; + +@Component({ + selector: 'app-cost-centre-detail', + templateUrl: './cost-centre-detail.component.html', + styleUrls: ['./cost-centre-detail.component.css'] +}) +export class CostCentreDetailComponent implements OnInit, AfterViewInit { + @ViewChild('nameElement') nameElement: ElementRef; + form: FormGroup; + item: CostCentre; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder, + private toaster: ToasterService, + private ser: CostCentreService + ) { + this.createForm(); + } + + createForm() { + this.form = this.fb.group({ + name: '' + }); + } + + ngOnInit() { + this.route.data + .subscribe((data: { item: CostCentre }) => { + this.showItem(data.item); + }); + } + + showItem(item: CostCentre) { + this.item = item; + this.form.setValue({ + name: this.item.name, + }); + } + + ngAfterViewInit() { + setTimeout(() => { + this.nameElement.nativeElement.focus(); + }, 0); + } + + save() { + this.ser.saveOrUpdate(this.getItem()) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigateByUrl('/CostCentres'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + getItem(): CostCentre { + const formModel = this.form.value; + this.item.name = formModel.name; + return this.item; + } +} diff --git a/overlord/src/app/cost-centre/cost-centre-list-resolver.service.spec.ts b/overlord/src/app/cost-centre/cost-centre-list-resolver.service.spec.ts new file mode 100644 index 00000000..c7159b1c --- /dev/null +++ b/overlord/src/app/cost-centre/cost-centre-list-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {CostCentreListResolverService} from './cost-centre-list-resolver.service'; + +describe('CostCentreListResolverService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [CostCentreListResolverService] + }); + }); + + it('should be created', inject([CostCentreListResolverService], (service: CostCentreListResolverService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/cost-centre/cost-centre-list-resolver.service.ts b/overlord/src/app/cost-centre/cost-centre-list-resolver.service.ts new file mode 100644 index 00000000..7fc92d0e --- /dev/null +++ b/overlord/src/app/cost-centre/cost-centre-list-resolver.service.ts @@ -0,0 +1,18 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot} from '@angular/router'; +import {CostCentre} from './cost-centre'; +import {Observable} from 'rxjs/internal/Observable'; +import {CostCentreService} from './cost-centre.service'; + +@Injectable({ + providedIn: 'root' +}) +export class CostCentreListResolver implements Resolve { + + constructor(private ser: CostCentreService, private router: Router) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + return this.ser.list(); + } +} diff --git a/overlord/src/app/cost-centre/cost-centre-list/cost-centre-list-datasource.ts b/overlord/src/app/cost-centre/cost-centre-list/cost-centre-list-datasource.ts new file mode 100644 index 00000000..fe1e6e41 --- /dev/null +++ b/overlord/src/app/cost-centre/cost-centre-list/cost-centre-list-datasource.ts @@ -0,0 +1,58 @@ +import {DataSource} from '@angular/cdk/collections'; +import {MatPaginator, MatSort} from '@angular/material'; +import {map} from 'rxjs/operators'; +import {merge, Observable, of as observableOf} from 'rxjs'; +import {CostCentre} from '../cost-centre'; + +export class CostCentreListDataSource extends DataSource { + + constructor(private paginator: MatPaginator, private sort: MatSort, public data: CostCentre[]) { + super(); + } + + connect(): Observable { + const dataMutations = [ + observableOf(this.data), + this.paginator.page, + this.sort.sortChange + ]; + + // Set the paginators length + this.paginator.length = this.data.length; + + return merge(...dataMutations).pipe(map(() => { + return this.getPagedData(this.getSortedData([...this.data])); + })); + } + + disconnect() { + } + + private getPagedData(data: CostCentre[]) { + const startIndex = this.paginator.pageIndex * this.paginator.pageSize; + return data.splice(startIndex, this.paginator.pageSize); + } + + private getSortedData(data: CostCentre[]) { + if (!this.sort.active || this.sort.direction === '') { + return data; + } + + return data.sort((a, b) => { + const isAsc = this.sort.direction === 'asc'; + switch (this.sort.active) { + case 'name': + return compare(a.name, b.name, isAsc); + case 'id': + return compare(+a.id, +b.id, isAsc); + default: + return 0; + } + }); + } +} + +/** Simple sort comparator for example ID/Name columns (for client-side sorting). */ +function compare(a, b, isAsc) { + return (a < b ? -1 : 1) * (isAsc ? 1 : -1); +} diff --git a/overlord/src/app/cost-centre/cost-centre-list/cost-centre-list.component.css b/overlord/src/app/cost-centre/cost-centre-list/cost-centre-list.component.css new file mode 100644 index 00000000..e69de29b diff --git a/overlord/src/app/cost-centre/cost-centre-list/cost-centre-list.component.html b/overlord/src/app/cost-centre/cost-centre-list/cost-centre-list.component.html new file mode 100644 index 00000000..2889ecd6 --- /dev/null +++ b/overlord/src/app/cost-centre/cost-centre-list/cost-centre-list.component.html @@ -0,0 +1,35 @@ + + + Cost Centers + + add_box + Add + + + + + + + + Name + {{row.name}} + + + + + Is Fixture? + {{row.isFixture}} + + + + + + + + + + diff --git a/overlord/src/app/cost-centre/cost-centre-list/cost-centre-list.component.spec.ts b/overlord/src/app/cost-centre/cost-centre-list/cost-centre-list.component.spec.ts new file mode 100644 index 00000000..1daf1178 --- /dev/null +++ b/overlord/src/app/cost-centre/cost-centre-list/cost-centre-list.component.spec.ts @@ -0,0 +1,23 @@ +import {ComponentFixture, fakeAsync, TestBed} from '@angular/core/testing'; + +import {CostCentreListComponent} from './cost-centre-list.component'; + +describe('CostCentreListComponent', () => { + let component: CostCentreListComponent; + let fixture: ComponentFixture; + + beforeEach(fakeAsync(() => { + TestBed.configureTestingModule({ + declarations: [CostCentreListComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(CostCentreListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should compile', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/cost-centre/cost-centre-list/cost-centre-list.component.ts b/overlord/src/app/cost-centre/cost-centre-list/cost-centre-list.component.ts new file mode 100644 index 00000000..6f1f5409 --- /dev/null +++ b/overlord/src/app/cost-centre/cost-centre-list/cost-centre-list.component.ts @@ -0,0 +1,30 @@ +import {Component, OnInit, ViewChild} from '@angular/core'; +import {MatPaginator, MatSort} from '@angular/material'; +import {CostCentreListDataSource} from './cost-centre-list-datasource'; +import {CostCentre} from '../cost-centre'; +import {ActivatedRoute} from '@angular/router'; + +@Component({ + selector: 'app-cost-centre-list', + templateUrl: './cost-centre-list.component.html', + styleUrls: ['./cost-centre-list.component.css'] +}) +export class CostCentreListComponent implements OnInit { + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + dataSource: CostCentreListDataSource; + list: CostCentre[]; + /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ + displayedColumns = ['name', 'isFixture']; + + constructor(private route: ActivatedRoute) { + } + + ngOnInit() { + this.route.data + .subscribe((data: { list: CostCentre[] }) => { + this.list = data.list; + }); + this.dataSource = new CostCentreListDataSource(this.paginator, this.sort, this.list); + } +} diff --git a/overlord/src/app/cost-centre/cost-centre-resolver.service.spec.ts b/overlord/src/app/cost-centre/cost-centre-resolver.service.spec.ts new file mode 100644 index 00000000..c4a1e17a --- /dev/null +++ b/overlord/src/app/cost-centre/cost-centre-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {CostCentreResolverService} from './cost-centre-resolver.service'; + +describe('CostCentreResolverService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [CostCentreDetailResolverService] + }); + }); + + it('should be created', inject([CostCentreDetailResolverService], (service: CostCentreDetailResolverService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/cost-centre/cost-centre-resolver.service.ts b/overlord/src/app/cost-centre/cost-centre-resolver.service.ts new file mode 100644 index 00000000..41a33cbc --- /dev/null +++ b/overlord/src/app/cost-centre/cost-centre-resolver.service.ts @@ -0,0 +1,19 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot} from '@angular/router'; +import {CostCentreService} from './cost-centre.service'; +import {CostCentre} from './cost-centre'; +import {Observable} from 'rxjs/internal/Observable'; + +@Injectable({ + providedIn: 'root' +}) +export class CostCentreResolver implements Resolve { + + constructor(private ser: CostCentreService, private router: Router) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const id = route.paramMap.get('id'); + return this.ser.get(id); + } +} diff --git a/overlord/src/app/cost-centre/cost-centre-routing.module.spec.ts b/overlord/src/app/cost-centre/cost-centre-routing.module.spec.ts new file mode 100644 index 00000000..9ac525fe --- /dev/null +++ b/overlord/src/app/cost-centre/cost-centre-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {CostCentreRoutingModule} from './cost-centre-routing.module'; + +describe('CostCentreRoutingModule', () => { + let costCentreRoutingModule: CostCentreRoutingModule; + + beforeEach(() => { + costCentreRoutingModule = new CostCentreRoutingModule(); + }); + + it('should create an instance', () => { + expect(costCentreRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/cost-centre/cost-centre-routing.module.ts b/overlord/src/app/cost-centre/cost-centre-routing.module.ts new file mode 100644 index 00000000..b11bd467 --- /dev/null +++ b/overlord/src/app/cost-centre/cost-centre-routing.module.ts @@ -0,0 +1,61 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {CostCentreListResolver} from './cost-centre-list-resolver.service'; +import {CostCentreResolver} from './cost-centre-resolver.service'; +import {CostCentreListComponent} from './cost-centre-list/cost-centre-list.component'; +import {CostCentreDetailComponent} from './cost-centre-detail/cost-centre-detail.component'; +import {AuthGuard} from '../auth/auth-guard.service'; + +const costCentreRoutes: Routes = [ + { + path: 'CostCentres', + component: CostCentreListComponent, + canActivate: [AuthGuard], + data: { + permission: 'Cost Centres' + }, + resolve: { + list: CostCentreListResolver + } + }, + { + path: 'CostCentre', + component: CostCentreDetailComponent, + canActivate: [AuthGuard], + data: { + permission: 'Cost Centres' + }, + resolve: { + item: CostCentreResolver + } + }, + { + path: 'CostCentre/:id', + component: CostCentreDetailComponent, + canActivate: [AuthGuard], + data: { + permission: 'Cost Centres' + }, + resolve: { + item: CostCentreResolver + } + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(costCentreRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + CostCentreListResolver, + CostCentreResolver + ] +}) +export class CostCentreRoutingModule { +} diff --git a/overlord/src/app/cost-centre/cost-centre.module.spec.ts b/overlord/src/app/cost-centre/cost-centre.module.spec.ts new file mode 100644 index 00000000..606e0013 --- /dev/null +++ b/overlord/src/app/cost-centre/cost-centre.module.spec.ts @@ -0,0 +1,13 @@ +import {CostCentreModule} from './cost-centre.module'; + +describe('CostCentreModule', () => { + let costCentreModule: CostCentreModule; + + beforeEach(() => { + costCentreModule = new CostCentreModule(); + }); + + it('should create an instance', () => { + expect(costCentreModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/cost-centre/cost-centre.module.ts b/overlord/src/app/cost-centre/cost-centre.module.ts new file mode 100644 index 00000000..25091f4f --- /dev/null +++ b/overlord/src/app/cost-centre/cost-centre.module.ts @@ -0,0 +1,44 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; + +import {CostCentreListComponent} from './cost-centre-list/cost-centre-list.component'; +import {CostCentreDetailComponent} from './cost-centre-detail/cost-centre-detail.component'; +import {CostCentreRoutingModule} from './cost-centre-routing.module'; +import { + MatButtonModule, + MatCardModule, + MatIconModule, + MatInputModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {CdkTableModule} from '@angular/cdk/table'; +import {ReactiveFormsModule} from '@angular/forms'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +@NgModule({ + imports: [ + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatButtonModule, + MatCardModule, + MatIconModule, + MatInputModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + CostCentreRoutingModule + ], + declarations: [ + CostCentreListComponent, + CostCentreDetailComponent + ] +}) +export class CostCentreModule { +} diff --git a/overlord/src/app/cost-centre/cost-centre.service.spec.ts b/overlord/src/app/cost-centre/cost-centre.service.spec.ts new file mode 100644 index 00000000..8e9a283b --- /dev/null +++ b/overlord/src/app/cost-centre/cost-centre.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {CostCentreService} from './cost-centre.service'; + +describe('CostCentreService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [CostCentreService] + }); + }); + + it('should be created', inject([CostCentreService], (service: CostCentreService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/cost-centre/cost-centre.service.ts b/overlord/src/app/cost-centre/cost-centre.service.ts new file mode 100644 index 00000000..d88a4c5a --- /dev/null +++ b/overlord/src/app/cost-centre/cost-centre.service.ts @@ -0,0 +1,65 @@ +import {Injectable} from '@angular/core'; +import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http'; +import {ErrorLoggerService} from '../core/error-logger.service'; +import {catchError} from 'rxjs/operators'; +import {Observable} from 'rxjs/internal/Observable'; +import {CostCentre} from './cost-centre'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; +const url = '/api/CostCentre'; +const serviceName = 'CostCentreService'; + +@Injectable({ + providedIn: 'root' +}) +export class CostCentreService { + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + get(id: string): Observable { + const getUrl: string = (id === null) ? url : `${url}/${id}`; + return >this.http.get(getUrl) + .pipe( + catchError(this.log.handleError(serviceName, `get id=${id}`)) + ); + } + + list(): Observable { + const options = {params: new HttpParams().set('l', '')}; + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + + save(costCentre: CostCentre): Observable { + return >this.http.post(url, costCentre, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'save')) + ); + } + + update(costCentre: CostCentre): Observable { + return >this.http.put(`${url}/${costCentre.id}`, costCentre, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'update')) + ); + } + + saveOrUpdate(costCentre: CostCentre): Observable { + if (!costCentre.id) { + return this.save(costCentre); + } else { + return this.update(costCentre); + } + } + + delete(id: string): Observable { + return >this.http.delete(`${url}/${id}`, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'delete')) + ); + } +} diff --git a/overlord/src/app/cost-centre/cost-centre.ts b/overlord/src/app/cost-centre/cost-centre.ts new file mode 100644 index 00000000..2c5f97b5 --- /dev/null +++ b/overlord/src/app/cost-centre/cost-centre.ts @@ -0,0 +1,5 @@ +export class CostCentre { + id: string; + name: string; + isFixture: boolean; +} diff --git a/overlord/src/app/daybook/daybook-datasource.ts b/overlord/src/app/daybook/daybook-datasource.ts new file mode 100644 index 00000000..798567a5 --- /dev/null +++ b/overlord/src/app/daybook/daybook-datasource.ts @@ -0,0 +1,61 @@ +import {DataSource} from '@angular/cdk/collections'; +import {MatPaginator, MatSort} from '@angular/material'; +import {map} from 'rxjs/operators'; +import {merge, Observable, of as observableOf} from 'rxjs'; +import {DaybookItem} from './daybook'; + + +export class DaybookDataSource extends DataSource { + + constructor(private paginator: MatPaginator, private sort: MatSort, public data: DaybookItem[]) { + super(); + } + + connect(): Observable { + const dataMutations = [ + observableOf(this.data), + this.paginator.page, + this.sort.sortChange + ]; + + // Set the paginators length + this.paginator.length = this.data.length; + + return merge(...dataMutations).pipe(map(() => { + return this.getPagedData(this.getSortedData([...this.data])); + })); + } + + disconnect() { + } + + private getPagedData(data: DaybookItem[]) { + const startIndex = this.paginator.pageIndex * this.paginator.pageSize; + return data.splice(startIndex, this.paginator.pageSize); + } + + private getSortedData(data: DaybookItem[]) { + if (!this.sort.active || this.sort.direction === '') { + return data; + } + + return data.sort((a, b) => { + const isAsc = this.sort.direction === 'asc'; + switch (this.sort.active) { + case 'date': + return compare(a.date, b.date, isAsc); + case 'debitAmount': + return compare(+a.debitAmount, +b.debitAmount, isAsc); + case 'creditAmount': + return compare(+a.creditAmount, +b.creditAmount, isAsc); + default: + return 0; + } + }); + } +} + +/** Simple sort comparator for example ID/Name columns (for client-side sorting). */ +function compare(a, b, isAsc) { + return (a < b ? -1 : 1) * (isAsc ? 1 : -1); +} diff --git a/overlord/src/app/daybook/daybook-resolver.service.spec.ts b/overlord/src/app/daybook/daybook-resolver.service.spec.ts new file mode 100644 index 00000000..e85b1837 --- /dev/null +++ b/overlord/src/app/daybook/daybook-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {DaybookResolver} from './daybook-resolver.service'; + +describe('DaybookResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [DaybookResolver] + }); + }); + + it('should be created', inject([DaybookResolver], (service: DaybookResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/daybook/daybook-resolver.service.ts b/overlord/src/app/daybook/daybook-resolver.service.ts new file mode 100644 index 00000000..1e2f9daa --- /dev/null +++ b/overlord/src/app/daybook/daybook-resolver.service.ts @@ -0,0 +1,20 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {Daybook} from './daybook'; +import {DaybookService} from './daybook.service'; + +@Injectable({ + providedIn: 'root' +}) +export class DaybookResolver implements Resolve { + + constructor(private ser: DaybookService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const startDate = route.queryParamMap.get('startDate') || null; + const finishDate = route.queryParamMap.get('finishDate') || null; + return this.ser.list(startDate, finishDate); + } +} diff --git a/overlord/src/app/daybook/daybook-routing.module.spec.ts b/overlord/src/app/daybook/daybook-routing.module.spec.ts new file mode 100644 index 00000000..902fda0d --- /dev/null +++ b/overlord/src/app/daybook/daybook-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {DaybookRoutingModule} from './daybook-routing.module'; + +describe('DaybookRoutingModule', () => { + let daybookRoutingModule: DaybookRoutingModule; + + beforeEach(() => { + daybookRoutingModule = new DaybookRoutingModule(); + }); + + it('should create an instance', () => { + expect(daybookRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/daybook/daybook-routing.module.ts b/overlord/src/app/daybook/daybook-routing.module.ts new file mode 100644 index 00000000..1e1f6a0d --- /dev/null +++ b/overlord/src/app/daybook/daybook-routing.module.ts @@ -0,0 +1,37 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {DaybookResolver} from './daybook-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {DaybookComponent} from './daybook.component'; + +const daybookRoutes: Routes = [ + { + path: 'Daybook', + component: DaybookComponent, + canActivate: [AuthGuard], + data: { + permission: 'Daybook' + }, + resolve: { + info: DaybookResolver + }, + runGuardsAndResolvers: 'always' + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(daybookRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + DaybookResolver + ] +}) +export class DaybookRoutingModule { +} diff --git a/overlord/src/app/daybook/daybook.component.css b/overlord/src/app/daybook/daybook.component.css new file mode 100644 index 00000000..ef3a3239 --- /dev/null +++ b/overlord/src/app/daybook/daybook.component.css @@ -0,0 +1,12 @@ +.right { + display: flex; + justify-content: flex-end; +} + +.selected{ + background: #fff3cd +} + +.unposted{ + background: #f8d7da +} diff --git a/overlord/src/app/daybook/daybook.component.html b/overlord/src/app/daybook/daybook.component.html new file mode 100644 index 00000000..c289c708 --- /dev/null +++ b/overlord/src/app/daybook/daybook.component.html @@ -0,0 +1,80 @@ + + + Daybook + + +
    +
    + + + + + + + + + + + +
    +
    + + + + + Date + {{row.date}} + + + + + Type + {{row.type}} + + + + + Narration + {{row.narration}} + + + + + Debit Accounts + {{row.debitText}} + + + + + Amount + {{row.debitAmount | currency:'INR'}} + + + + + Credit Accounts + {{row.creditText}} + + + + + Amount + {{row.creditAmount | currency:'INR'}} + + + + + + + + +
    +
    diff --git a/overlord/src/app/daybook/daybook.component.spec.ts b/overlord/src/app/daybook/daybook.component.spec.ts new file mode 100644 index 00000000..1fcbf084 --- /dev/null +++ b/overlord/src/app/daybook/daybook.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {DaybookComponent} from './daybook.component'; + +describe('DaybookComponent', () => { + let component: DaybookComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [DaybookComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DaybookComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/daybook/daybook.component.ts b/overlord/src/app/daybook/daybook.component.ts new file mode 100644 index 00000000..6374929e --- /dev/null +++ b/overlord/src/app/daybook/daybook.component.ts @@ -0,0 +1,87 @@ +import {Component, OnInit, ViewChild} from '@angular/core'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MatPaginator, MatSort} from '@angular/material'; +import {ActivatedRoute, Router} from '@angular/router'; +import * as moment from 'moment'; +import {DaybookDataSource} from './daybook-datasource'; +import {Daybook} from './daybook'; +import {Account} from '../account/account'; +import {DaybookService} from './daybook.service'; + +@Component({ + selector: 'app-daybook', + templateUrl: './daybook.component.html', + styleUrls: ['./daybook.component.css'] +}) +export class DaybookComponent implements OnInit { + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + dataSource: DaybookDataSource; + form: FormGroup; + info: Daybook; + selectedRowId: string; + /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ + displayedColumns = ['date', 'type', 'narration', 'debitText', 'debitAmount', 'creditText', 'creditAmount']; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder, + private ser: DaybookService + ) { + this.createForm(); + } + + ngOnInit() { + this.route.data + .subscribe((data: { info: Daybook }) => { + this.info = data.info; + this.form.setValue({ + startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(), + finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate() + }); + this.dataSource = new DaybookDataSource(this.paginator, this.sort, this.info.body); + }); + } + + selectRow(id: string): void { + this.selectedRowId = id; + } + + getRowClass(id: string, posted: boolean): string { + if (this.selectedRowId === id) { + return 'selected'; + } else if (!posted) { + return 'unposted'; + } else { + return ''; + } + } + + show() { + const l = this.prepareSubmit(); + this.router.navigate(['Daybook'], { + queryParams: { + startDate: l.startDate, + finishDate: l.finishDate + } + }); + } + + createForm() { + this.form = this.fb.group({ + startDate: '', + finishDate: '', + }); + } + + prepareSubmit(): Daybook { + const formModel = this.form.value; + + return { + startDate: moment(formModel.startDate).format('DD-MMM-YYYY'), + finishDate: moment(formModel.finishDate).format('DD-MMM-YYYY'), + body: [] + }; + } +} diff --git a/overlord/src/app/daybook/daybook.module.spec.ts b/overlord/src/app/daybook/daybook.module.spec.ts new file mode 100644 index 00000000..7b232411 --- /dev/null +++ b/overlord/src/app/daybook/daybook.module.spec.ts @@ -0,0 +1,13 @@ +import {DaybookModule} from './daybook.module'; + +describe('DaybookModule', () => { + let daybookModule: DaybookModule; + + beforeEach(() => { + daybookModule = new DaybookModule(); + }); + + it('should create an instance', () => { + expect(daybookModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/daybook/daybook.module.ts b/overlord/src/app/daybook/daybook.module.ts new file mode 100644 index 00000000..1c63cd2c --- /dev/null +++ b/overlord/src/app/daybook/daybook.module.ts @@ -0,0 +1,75 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {ReactiveFormsModule} from '@angular/forms'; +import {CdkTableModule} from '@angular/cdk/table'; +import {DaybookRoutingModule} from './daybook-routing.module'; +import {DaybookComponent} from './daybook.component'; +import {MomentDateAdapter} from '@angular/material-moment-adapter'; +import {A11yModule} from '@angular/cdk/a11y'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + DaybookRoutingModule + ], + declarations: [ + DaybookComponent + ], + providers: [ + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, + ] +}) +export class DaybookModule { +} diff --git a/overlord/src/app/daybook/daybook.service.spec.ts b/overlord/src/app/daybook/daybook.service.spec.ts new file mode 100644 index 00000000..05c8fa6c --- /dev/null +++ b/overlord/src/app/daybook/daybook.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {DaybookService} from './daybook.service'; + +describe('DaybookService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [DaybookService] + }); + }); + + it('should be created', inject([DaybookService], (service: DaybookService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/daybook/daybook.service.ts b/overlord/src/app/daybook/daybook.service.ts new file mode 100644 index 00000000..4db235ed --- /dev/null +++ b/overlord/src/app/daybook/daybook.service.ts @@ -0,0 +1,37 @@ +import {Injectable} from '@angular/core'; +import {catchError} from 'rxjs/operators'; +import {Observable} from 'rxjs/internal/Observable'; +import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http'; +import {Daybook} from './daybook'; +import {ErrorLoggerService} from '../core/error-logger.service'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; + +const url = '/api/Daybook'; +const serviceName = 'DaybookService'; + +@Injectable({ + providedIn: 'root' +}) +export class DaybookService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + list(startDate: string, finishDate): Observable { + const options = {params: new HttpParams()}; + if (startDate !== null) { + options.params = options.params.set('s', startDate); + } + if (finishDate !== null) { + options.params = options.params.set('f', finishDate); + } + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + +} diff --git a/overlord/src/app/daybook/daybook.ts b/overlord/src/app/daybook/daybook.ts new file mode 100644 index 00000000..0d203817 --- /dev/null +++ b/overlord/src/app/daybook/daybook.ts @@ -0,0 +1,18 @@ + +export class DaybookItem { + date: string; + type: string; + narration: string; + debitText: string; + debitAmount: number; + creditText: string; + creditAmount: number; + posted: boolean; + url: string; +} + +export class Daybook { + startDate: string; + finishDate: string; + body: DaybookItem[]; +} diff --git a/overlord/src/app/employee-attendance/employee-attendance-datasource.ts b/overlord/src/app/employee-attendance/employee-attendance-datasource.ts new file mode 100644 index 00000000..addd5ccb --- /dev/null +++ b/overlord/src/app/employee-attendance/employee-attendance-datasource.ts @@ -0,0 +1,18 @@ +import {DataSource} from '@angular/cdk/collections'; +import {Observable} from 'rxjs'; +import {EmployeeAttendanceItem} from './employee-attendance'; + + +export class EmployeeAttendanceDataSource extends DataSource { + + constructor(private data: Observable) { + super(); + } + + connect(): Observable { + return this.data; + } + + disconnect() { + } +} diff --git a/overlord/src/app/employee-attendance/employee-attendance-resolver.service.ts b/overlord/src/app/employee-attendance/employee-attendance-resolver.service.ts new file mode 100644 index 00000000..23e752c4 --- /dev/null +++ b/overlord/src/app/employee-attendance/employee-attendance-resolver.service.ts @@ -0,0 +1,21 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {EmployeeAttendanceService} from './employee-attendance.service'; +import {EmployeeAttendance} from './employee-attendance'; + +@Injectable({ + providedIn: 'root' +}) +export class EmployeeAttendanceResolver implements Resolve { + + constructor(private ser: EmployeeAttendanceService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const id = route.paramMap.get('id'); + const startDate = route.queryParamMap.get('startDate') || null; + const finishDate = route.queryParamMap.get('finishDate') || null; + return this.ser.get(id, startDate, finishDate); + } +} diff --git a/overlord/src/app/employee-attendance/employee-attendance-routing.module.ts b/overlord/src/app/employee-attendance/employee-attendance-routing.module.ts new file mode 100644 index 00000000..8bc4a822 --- /dev/null +++ b/overlord/src/app/employee-attendance/employee-attendance-routing.module.ts @@ -0,0 +1,52 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {EmployeeAttendanceResolver} from './employee-attendance-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {EmployeeAttendanceComponent} from './employee-attendance.component'; +import {AttendanceTypeResolver} from '../attendance/attendance-type-resolver.service'; + +const employeeEmployeeAttendanceRoutes: Routes = [ + { + path: 'EmployeeAttendance', + component: EmployeeAttendanceComponent, + canActivate: [AuthGuard], + data: { + permission: 'Attendance' + }, + resolve: { + info: EmployeeAttendanceResolver, + attendanceTypes: AttendanceTypeResolver + }, + runGuardsAndResolvers: 'always' + }, + { + path: 'EmployeeAttendance/:id', + component: EmployeeAttendanceComponent, + canActivate: [AuthGuard], + data: { + permission: 'Attendance' + }, + resolve: { + info: EmployeeAttendanceResolver, + attendanceTypes: AttendanceTypeResolver + }, + runGuardsAndResolvers: 'always' + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(employeeEmployeeAttendanceRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + EmployeeAttendanceResolver + ] +}) +export class EmployeeAttendanceRoutingModule { +} diff --git a/overlord/src/app/employee-attendance/employee-attendance.component.css b/overlord/src/app/employee-attendance/employee-attendance.component.css new file mode 100644 index 00000000..e2ce58cb --- /dev/null +++ b/overlord/src/app/employee-attendance/employee-attendance.component.css @@ -0,0 +1,53 @@ +.right { + display: flex; + justify-content: flex-end; +} + +.center { + display: flex; + justify-content: center; +} + +.present { + background-color: #228B22; +} + +.off-day { + background-color: #87CEFA; +} + +.on-leave { + background-color: #CD5C5C; +} + +.absent { + background-color: #CD0000; +} + +.half-day { + background-color: #98FB98; +} + +.double-duty { + background-color: #006400; +} + +.paid-leave-availed { + background-color: #EEEE00; +} + +.casual-leave-availed { + background-color: #800080; +} + +.compensatory-off { + background-color: #F5DEB3; +} + +.half-day-pl { + background-color: #FFF68F; +} + +.half-day-cl { + background-color: #FF00FF; +} diff --git a/overlord/src/app/employee-attendance/employee-attendance.component.html b/overlord/src/app/employee-attendance/employee-attendance.component.html new file mode 100644 index 00000000..d8a4e28d --- /dev/null +++ b/overlord/src/app/employee-attendance/employee-attendance.component.html @@ -0,0 +1,71 @@ + + + Employee Attendance + + +
    +
    + + + + + + + + + + +
    +
    + + + + {{employee.name}} + + + +
    + + + + + Date + {{row.date}} + + + + + Status + + + + {{ at.name }} + + + + + + + + Prints + + {{row.prints}} + new_releases + + + + + + +
    +
    + + + +
    diff --git a/overlord/src/app/employee-attendance/employee-attendance.component.ts b/overlord/src/app/employee-attendance/employee-attendance.component.ts new file mode 100644 index 00000000..9a846164 --- /dev/null +++ b/overlord/src/app/employee-attendance/employee-attendance.component.ts @@ -0,0 +1,146 @@ +import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; +import {FormArray, FormBuilder, FormGroup} from '@angular/forms'; +import {MatAutocompleteSelectedEvent, MatDialog} from '@angular/material'; +import {ActivatedRoute, Router} from '@angular/router'; +import {BehaviorSubject, Observable, of as observableOf} from 'rxjs'; +import {EmployeeAttendanceDataSource} from './employee-attendance-datasource'; +import * as moment from 'moment'; +import {AuthService} from '../auth/auth.service'; +import {ToasterService} from '../core/toaster.service'; +import {EmployeeAttendanceService} from './employee-attendance.service'; +import {EmployeeAttendance, EmployeeAttendanceItem} from './employee-attendance'; +import {EmployeeService} from '../employee/employee.service'; +import {Employee} from '../employee/employee'; +import {debounceTime, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators'; +import {AttendanceType} from '../attendance/attendance-type'; + +@Component({ + selector: 'app-employee-attendance', + templateUrl: './employee-attendance.component.html', + styleUrls: ['./employee-attendance.component.css'] +}) +export class EmployeeAttendanceComponent implements OnInit, AfterViewInit { + @ViewChild('employeeElement') employeeElement: ElementRef; + public employeeAttendanceObservable = new BehaviorSubject([]); + dataSource: EmployeeAttendanceDataSource; + form: FormGroup; + + info: EmployeeAttendance; + attendanceTypes: AttendanceType[]; + + displayedColumns = ['date', 'status', 'prints']; + + employees: Observable; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder, + private dialog: MatDialog, + private toaster: ToasterService, + private auth: AuthService, + private ser: EmployeeAttendanceService, + private employeeSer: EmployeeService + ) { + this.createForm(); + this.listenToEmployeeValueChanges(); + } + + ngOnInit() { + this.route.data + .subscribe((data: { info: EmployeeAttendance, attendanceTypes: AttendanceType[] }) => { + this.info = data.info; + this.attendanceTypes = data.attendanceTypes; + this.form.get('startDate').setValue(moment(this.info.startDate, 'DD-MMM-YYYY').toDate()); + this.form.get('finishDate').setValue(moment(this.info.finishDate, 'DD-MMM-YYYY').toDate()); + this.form.get('employee').setValue(this.info.employee); + this.form.setControl('attendances', this.fb.array( + this.info.body.map( + x => this.fb.group({ + attendanceType: x.attendanceType.id + }) + ) + )); + this.dataSource = new EmployeeAttendanceDataSource(this.employeeAttendanceObservable); + this.employeeAttendanceObservable.next(this.info.body); + }); + } + + ngAfterViewInit() { + setTimeout(() => { + this.employeeElement.nativeElement.focus(); + }, 0); + } + + createForm() { + this.form = this.fb.group({ + startDate: '', + finishDate: '', + employee: '', + attendances: this.fb.array([]) + }); + } + + listenToEmployeeValueChanges() { + this.employees = this.form.get('employee').valueChanges + .pipe( + startWith(null), + map(x => (x !== null && x.length >= 1) ? x : null), + debounceTime(150), + distinctUntilChanged(), + switchMap(x => (x === null) ? observableOf([]) : this.employeeSer.autocomplete(x)) + ); + + } + + displayFn(employee?: Employee): string | undefined { + return employee ? employee.name : undefined; + } + + selected(event: MatAutocompleteSelectedEvent): void { + this.info.employee = event.option.value; + } + + getClass(index: number) { + const array = this.form.get('attendances') as FormArray; + const id = array.controls[index].value.attendanceType; + const name: string = this.attendanceTypes.filter(x => x.id === id)[0].name; + return name.toLowerCase().replace(/(\s+\+\s+)|(\s+)/g, '-'); + } + + show() { + const formValue = this.form.value; + this.info.startDate = moment(formValue.startDate).format('DD-MMM-YYYY'); + this.info.finishDate = moment(formValue.finishDate).format('DD-MMM-YYYY'); + this.router.navigate(['EmployeeAttendance', this.info.employee.id], { + queryParams: { + startDate: this.info.startDate, + finishDate: this.info.finishDate + } + }); + + } + + save() { + this.ser.save(this.getEmployeeAttendance()) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + getEmployeeAttendance(): EmployeeAttendance { + const formValue = this.form.value; + this.info.startDate = moment(formValue.startDate).format('DD-MMM-YYYY'); + this.info.finishDate = moment(formValue.finishDate).format('DD-MMM-YYYY'); + const array = this.form.get('attendances') as FormArray; + this.info.body.forEach((item, index) => { + item.attendanceType.id = array.controls[index].value.attendanceType; + }); + return this.info; + } +} diff --git a/overlord/src/app/employee-attendance/employee-attendance.module.ts b/overlord/src/app/employee-attendance/employee-attendance.module.ts new file mode 100644 index 00000000..a9436451 --- /dev/null +++ b/overlord/src/app/employee-attendance/employee-attendance.module.ts @@ -0,0 +1,79 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {ReactiveFormsModule} from '@angular/forms'; +import {CdkTableModule} from '@angular/cdk/table'; +import {EmployeeAttendanceRoutingModule} from './employee-attendance-routing.module'; +import {EmployeeAttendanceComponent} from './employee-attendance.component'; +import {MomentDateAdapter} from '@angular/material-moment-adapter'; +import {A11yModule} from '@angular/cdk/a11y'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + EmployeeAttendanceRoutingModule + ], + declarations: [ + EmployeeAttendanceComponent + ], + providers: [ + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, + ] +}) +export class EmployeeAttendanceModule { +} diff --git a/overlord/src/app/employee-attendance/employee-attendance.service.ts b/overlord/src/app/employee-attendance/employee-attendance.service.ts new file mode 100644 index 00000000..7486ae55 --- /dev/null +++ b/overlord/src/app/employee-attendance/employee-attendance.service.ts @@ -0,0 +1,43 @@ +import {Injectable} from '@angular/core'; +import {Observable} from 'rxjs/internal/Observable'; +import {catchError} from 'rxjs/operators'; +import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http'; +import {EmployeeAttendance} from './employee-attendance'; +import {ErrorLoggerService} from '../core/error-logger.service'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; + +const url = '/api/EmployeeAttendance'; +const serviceName = 'AttendanceService'; + +@Injectable({providedIn: 'root'}) +export class EmployeeAttendanceService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + get(id: string, startDate: string, finishDate: string): Observable { + const getUrl: string = (id === null) ? url : `${url}/${id}`; + const options = {params: new HttpParams()}; + if (startDate !== null) { + options.params = options.params.set('s', startDate); + } + if (finishDate !== null) { + options.params = options.params.set('f', finishDate); + } + return >this.http.get(getUrl, options) + .pipe( + catchError(this.log.handleError(serviceName, `get id=${id}`)) + ); + } + + save(employeeAttendance: EmployeeAttendance): Observable { + const id = employeeAttendance.employee.id; + return >this.http.post(`${url}/${id}`, employeeAttendance, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'save')) + ); + } +} diff --git a/overlord/src/app/employee-attendance/employee-attendance.ts b/overlord/src/app/employee-attendance/employee-attendance.ts new file mode 100644 index 00000000..ea1e5ba1 --- /dev/null +++ b/overlord/src/app/employee-attendance/employee-attendance.ts @@ -0,0 +1,25 @@ +import {Employee} from '../employee/employee'; +import {AttendanceType} from '../attendance/attendance-type'; + +export class EmployeeAttendance { + startDate: string; + finishDate: string; + employee: Employee; + body: EmployeeAttendanceItem[]; + + public constructor(init?: Partial) { + Object.assign(this, init); + } +} + +export class EmployeeAttendanceItem { + date: string; + attendanceType: AttendanceType; + prints: string; + hours: string; + worked: string; + + public constructor(init?: Partial) { + Object.assign(this, init); + } +} diff --git a/overlord/src/app/employee-benefits/employee-benefits-datasource.ts b/overlord/src/app/employee-benefits/employee-benefits-datasource.ts new file mode 100644 index 00000000..700c2d57 --- /dev/null +++ b/overlord/src/app/employee-benefits/employee-benefits-datasource.ts @@ -0,0 +1,18 @@ +import {DataSource} from '@angular/cdk/collections'; +import {Observable} from 'rxjs'; +import {EmployeeBenefit} from '../journal/voucher'; + + +export class EmployeeBenefitsDataSource extends DataSource { + + constructor(private data: Observable) { + super(); + } + + connect(): Observable { + return this.data; + } + + disconnect() { + } +} diff --git a/overlord/src/app/employee-benefits/employee-benefits-resolver.service.ts b/overlord/src/app/employee-benefits/employee-benefits-resolver.service.ts new file mode 100644 index 00000000..9344498a --- /dev/null +++ b/overlord/src/app/employee-benefits/employee-benefits-resolver.service.ts @@ -0,0 +1,24 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {Voucher} from '../journal/voucher'; +import {VoucherService} from '../journal/voucher.service'; +import {tap} from 'rxjs/operators'; + +@Injectable({ + providedIn: 'root' +}) +export class EmployeeBenefitsResolver implements Resolve { + + constructor(private ser: VoucherService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const id = route.paramMap.get('id'); + if (id === null) { + return this.ser.getOfType('Salary Deduction'); + } else { + return this.ser.get(id); + } + } +} diff --git a/overlord/src/app/employee-benefits/employee-benefits-routing.module.ts b/overlord/src/app/employee-benefits/employee-benefits-routing.module.ts new file mode 100644 index 00000000..9fc16036 --- /dev/null +++ b/overlord/src/app/employee-benefits/employee-benefits-routing.module.ts @@ -0,0 +1,49 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {EmployeeBenefitsResolver} from './employee-benefits-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {EmployeeBenefitsComponent} from './employee-benefits.component'; + +const employeeBenefitsRoutes: Routes = [ + { + path: 'EmployeeBenefits', + component: EmployeeBenefitsComponent, + canActivate: [AuthGuard], + data: { + permission: 'Salary Deduction' + }, + resolve: { + voucher: EmployeeBenefitsResolver + }, + runGuardsAndResolvers: 'always' + }, + { + path: 'EmployeeBenefits/:id', + component: EmployeeBenefitsComponent, + canActivate: [AuthGuard], + data: { + permission: 'Salary Deduction' + }, + resolve: { + voucher: EmployeeBenefitsResolver + }, + runGuardsAndResolvers: 'always' + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(employeeBenefitsRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + EmployeeBenefitsResolver + ] +}) +export class EmployeeBenefitsRoutingModule { +} diff --git a/overlord/src/app/employee-benefits/employee-benefits.component.css b/overlord/src/app/employee-benefits/employee-benefits.component.css new file mode 100644 index 00000000..a592a823 --- /dev/null +++ b/overlord/src/app/employee-benefits/employee-benefits.component.css @@ -0,0 +1,32 @@ +.right { + display: flex; + justify-content: flex-end; +} + +.selected { + background: #fff3cd +} + +.unposted { + background: #f8d7da +} + +.center { + display: flex; + justify-content: center; +} + +.img-container { + position: relative; +} + +.img-container .overlay { + display: none; +} + +.img-container:hover > .overlay { + display: inline-block; + position: absolute; + left: 60px; + top: 0; +} diff --git a/overlord/src/app/employee-benefits/employee-benefits.component.html b/overlord/src/app/employee-benefits/employee-benefits.component.html new file mode 100644 index 00000000..8f19ad52 --- /dev/null +++ b/overlord/src/app/employee-benefits/employee-benefits.component.html @@ -0,0 +1,124 @@ + + + Employee Benefits + + +
    +
    + + + + + +
    +
    + + + + {{employee.name}} + + + + Gross Salary + + + + Days Worked + + + + +
    + + + + + Name + {{row.journal.account.name}} + + + + + Designation + {{row.journal.account.designation}} + + + + + Department + {{row.journal.account.costCentre.name}} + + + + + GrossSalary + {{row.grossSalary | currency:'INR'}} + + + + + DaysWorked + {{row.daysWorked | number:'1.2-2'}} + + + + + Esi EE + {{row.esiEmployee | currency:'INR'}} + + + + + Pf EE + {{row.pfEmployee | currency:'INR'}} + + + + + Esi ER + {{row.esiEmployer | currency:'INR'}} + + + + + Pf ER + {{row.pfEmployer | currency:'INR'}} + + + + + Action + + + + + + + + + +
    +
    + + + + + + + Created on {{voucher.creationDate | localTime}} and + Last Edited on {{voucher.lastEditDate | localTime}} + by {{voucher.user.name}}. {{(voucher.poster) ? 'Posted by ' + voucher.poster : ''}} + +
    diff --git a/overlord/src/app/employee-benefits/employee-benefits.component.ts b/overlord/src/app/employee-benefits/employee-benefits.component.ts new file mode 100644 index 00000000..9f1b552e --- /dev/null +++ b/overlord/src/app/employee-benefits/employee-benefits.component.ts @@ -0,0 +1,236 @@ +import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MatAutocompleteSelectedEvent, MatDialog} from '@angular/material'; +import {ActivatedRoute, Router} from '@angular/router'; +import {BehaviorSubject, Observable, of as observableOf} from 'rxjs'; +import {EmployeeBenefitsDataSource} from './employee-benefits-datasource'; +import {VoucherService} from '../journal/voucher.service'; +import {EmployeeBenefit, Journal, Voucher} from '../journal/voucher'; +import * as moment from 'moment'; +import {AuthService} from '../auth/auth.service'; +import {ConfirmDialogComponent} from '../shared/confirm-dialog/confirm-dialog.component'; +import {ToasterService} from '../core/toaster.service'; +import {debounceTime, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators'; +import {Employee} from '../employee/employee'; +import {EmployeeService} from '../employee/employee.service'; +import {Account} from '../account/account'; + +@Component({ + selector: 'app-employee-benefits', + templateUrl: './employee-benefits.component.html', + styleUrls: ['./employee-benefits.component.css'] +}) +export class EmployeeBenefitsComponent implements OnInit, AfterViewInit { + @ViewChild('employeeElement') employeeElement: ElementRef; + public benefitsObservable = new BehaviorSubject([]); + dataSource: EmployeeBenefitsDataSource; + form: FormGroup; + voucher: Voucher; + employee: Employee; + accBal: any; + + displayedColumns = [ + 'name', 'designation', 'department', 'grossSalary', 'daysWorked', 'esiEmployee', 'pfEmployee', 'esiEmployer', 'pfEmployer' + ]; + + employees: Observable; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder, + private dialog: MatDialog, + private toaster: ToasterService, + private auth: AuthService, + private ser: VoucherService, + private employeeSer: EmployeeService + ) { + this.createForm(); + this.setupEmployeeAutocomplete(); + } + + ngOnInit() { + this.route.data + .subscribe((data: { voucher: Voucher }) => { + this.voucher = data.voucher; + this.form.setValue({ + date: moment(this.voucher.date, 'DD-MMM-YYYY').toDate(), + addRow: { + employee: '1', + grossSalary: '', + daysWorked: '' + } + }); + this.dataSource = new EmployeeBenefitsDataSource(this.benefitsObservable); + this.benefitsObservable.next(this.voucher.employeeBenefits); + }); + } + + ngAfterViewInit() { + setTimeout(() => { + this.employeeElement.nativeElement.focus(); + }, 0); + } + + createForm() { + this.form = this.fb.group({ + date: '', + addRow: this.fb.group({ + employee: '', + grossSalary: '', + daysWorked: '' + }), + }); + } + + setupEmployeeAutocomplete(): void { + const control = this.form.get('addRow').get('employee'); + this.employees = control.valueChanges + .pipe( + startWith(null), + map(x => (x !== null && x.length >= 1) ? x : null), + debounceTime(150), + distinctUntilChanged(), + switchMap(x => (x === null) ? observableOf([]) : this.employeeSer.autocomplete(x)) + ); + + } + + displayEmployeeName(employee?: Employee): string | undefined { + return employee ? employee.name : undefined; + } + + employeeSelected(event: MatAutocompleteSelectedEvent): void { + this.employee = event.option.value; + } + + addRow() { + const oldFiltered = this.voucher.employeeBenefits.filter((x) => x.journal.account.id === this.employee.id); + if (oldFiltered.length) { + this.toaster.show('Danger', 'Employee has already been added'); + return; + } + + const formValue = this.form.get('addRow').value; + const grossSalary = +formValue.grossSalary; + const daysWorked = +formValue.daysWorked; + const date = this.form.get('date').value; + const daysInMonth = moment(date).daysInMonth(); + const esi = this.getEsi(grossSalary, daysWorked, daysInMonth); + const pf = this.getPf(grossSalary, daysWorked, daysInMonth); + + this.voucher.employeeBenefits.push({ + journal: new Journal({account: new Account(this.employee)}), + grossSalary: grossSalary, + daysWorked: daysWorked, + esiEmployee: esi.ee, + pfEmployee: pf.ee, + esiEmployer: esi.er, + pfEmployer: pf.er + }); + this.benefitsObservable.next(this.voucher.employeeBenefits); + this.resetAddRow(); + } + + resetAddRow() { + this.form.get('addRow').reset({ + employee: '', + grossSalary: null, + daysWorked: null + }); + this.employee = null; + setTimeout(() => { + this.employeeElement.nativeElement.focus(); + }, 0); + } + + deleteRow(row: EmployeeBenefit) { + this.voucher.employeeBenefits.splice(this.voucher.employeeBenefits.indexOf(row), 1); + this.benefitsObservable.next(this.voucher.employeeBenefits); + } + + getEsi(grossSalary, daysWorked, daysInMonth) { + const limit = 15000, + employeeRate = 0.0175, + employerRate = 0.0475, + employee = (grossSalary > limit) ? 0 : Math.ceil(employeeRate * grossSalary * daysWorked / daysInMonth), + employer = (grossSalary > limit) ? 0 : Math.ceil(employerRate * grossSalary * daysWorked / daysInMonth); + return {ee: employee, er: employer, both: employee + employer}; + } + + getPf(grossSalary, daysWorked, daysInMonth) { + const limit = 15000, + employeeRate = 0.12, + employerRate = 0.12 + 0.011 + 0.005 + 0.0001, + employee = (grossSalary > limit) ? 0 : Math.ceil(employeeRate * grossSalary * daysWorked / daysInMonth), + employer = (grossSalary > limit) ? 0 : Math.ceil(employerRate * grossSalary * daysWorked / daysInMonth); + return {ee: employee, er: employer, both: employee + employer}; + } + + canSave() { + if (!this.voucher.id) { + return true; + } else if (this.voucher.posted && this.auth.user.perms.indexOf('Edit Posted Vouchers') !== -1) { + return true; + } else { + return this.voucher.user.id === this.auth.user.id || this.auth.user.perms.indexOf('Edit Other User\'s Vouchers') !== -1; + } + } + + post() { + this.ser.post(this.voucher.id) + .subscribe( + (result) => { + this.toaster.show('Success', 'Voucher Posted'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + save() { + this.ser.save(this.getVoucher()) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigate(['/EmployeeBenefits', result.id]); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + getVoucher(): Voucher { + const formModel = this.form.value; + this.voucher.date = moment(formModel.date).format('DD-MMM-YYYY'); + return this.voucher; + } + + delete() { + this.ser.delete(this.voucher.id) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigate(['/EmployeeBenefits'], {replaceUrl: true}); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + confirmDelete(): void { + const dialogRef = this.dialog.open(ConfirmDialogComponent, { + width: '250px', + data: {title: 'Delete Voucher?', content: 'Are you sure? This cannot be undone.'} + }); + + dialogRef.afterClosed().subscribe((result: boolean) => { + if (result) { + this.delete(); + } + }); + } +} diff --git a/overlord/src/app/employee-benefits/employee-benefits.module.ts b/overlord/src/app/employee-benefits/employee-benefits.module.ts new file mode 100644 index 00000000..dcb8960c --- /dev/null +++ b/overlord/src/app/employee-benefits/employee-benefits.module.ts @@ -0,0 +1,71 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {ReactiveFormsModule} from '@angular/forms'; +import {CdkTableModule} from '@angular/cdk/table'; +import {A11yModule} from '@angular/cdk/a11y'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; +import {SharedModule} from '../shared/shared.module'; +import {EmployeeBenefitsRoutingModule} from './employee-benefits-routing.module'; +import {EmployeeBenefitsComponent} from './employee-benefits.component'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + EmployeeBenefitsRoutingModule + ], + declarations: [ + EmployeeBenefitsComponent + ] +}) +export class EmployeeBenefitsModule { +} diff --git a/overlord/src/app/employee-functions/employee-functions-routing.module.ts b/overlord/src/app/employee-functions/employee-functions-routing.module.ts new file mode 100644 index 00000000..2a2bc341 --- /dev/null +++ b/overlord/src/app/employee-functions/employee-functions-routing.module.ts @@ -0,0 +1,30 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {EmployeeFunctionsComponent} from './employee-functions.component'; + +const employeeFunctionsRoutes: Routes = [ + { + path: 'EmployeeFunctions', + component: EmployeeFunctionsComponent, + canActivate: [AuthGuard], + data: { + permission: 'Salary Deduction' + }, + runGuardsAndResolvers: 'always' + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(employeeFunctionsRoutes) + + ], + exports: [ + RouterModule + ] +}) +export class EmployeeFunctionsRoutingModule { +} diff --git a/overlord/src/app/employee-functions/employee-functions.component.css b/overlord/src/app/employee-functions/employee-functions.component.css new file mode 100644 index 00000000..a592a823 --- /dev/null +++ b/overlord/src/app/employee-functions/employee-functions.component.css @@ -0,0 +1,32 @@ +.right { + display: flex; + justify-content: flex-end; +} + +.selected { + background: #fff3cd +} + +.unposted { + background: #f8d7da +} + +.center { + display: flex; + justify-content: center; +} + +.img-container { + position: relative; +} + +.img-container .overlay { + display: none; +} + +.img-container:hover > .overlay { + display: inline-block; + position: absolute; + left: 60px; + top: 0; +} diff --git a/overlord/src/app/employee-functions/employee-functions.component.html b/overlord/src/app/employee-functions/employee-functions.component.html new file mode 100644 index 00000000..cf4af60c --- /dev/null +++ b/overlord/src/app/employee-functions/employee-functions.component.html @@ -0,0 +1,58 @@ + + + + +
    +
    + + + + + + + +
    +
    +
    +
    +
    + + + +
    + + + + + + + + + + + + Download Attendance +
    +
    +
    +
    + + + +
    + + + +
    +
    +
    +
    +
    diff --git a/overlord/src/app/employee-functions/employee-functions.component.ts b/overlord/src/app/employee-functions/employee-functions.component.ts new file mode 100644 index 00000000..700a7106 --- /dev/null +++ b/overlord/src/app/employee-functions/employee-functions.component.ts @@ -0,0 +1,115 @@ +import {Component, OnInit} from '@angular/core'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MatDatepicker, MatDialog} from '@angular/material'; +import {ActivatedRoute, Router} from '@angular/router'; +import * as moment from 'moment'; +import {Moment} from 'moment'; +import {AuthService} from '../auth/auth.service'; +import {ToasterService} from '../core/toaster.service'; +import {EmployeeService} from '../employee/employee.service'; +import {EmployeeFunctionsService} from './employee-functions.service'; + +@Component({ + selector: 'app-employee-functions', + templateUrl: './employee-functions.component.html', + styleUrls: ['./employee-functions.component.css'] +}) +export class EmployeeFunctionsComponent implements OnInit { + creditSalaryForm: FormGroup; + attendanceRecordForm: FormGroup; + fingerprintForm: FormGroup; + fingerprintFile: File; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder, + private dialog: MatDialog, + private toaster: ToasterService, + private auth: AuthService, + private ser: EmployeeFunctionsService, + private employeeSer: EmployeeService + ) { + this.createForm(); + } + + ngOnInit() { + } + + createForm() { + const startDate = moment().date(1); + const finishDate = moment().date(startDate.daysInMonth()); + this.creditSalaryForm = this.fb.group({ + date: finishDate + }); + this.attendanceRecordForm = this.fb.group({ + startDate: startDate, + finishDate: finishDate + }); + this.fingerprintForm = this.fb.group({}); + } + + chosenYearHandler(normalizedYear: Moment) { + const dateControl = this.creditSalaryForm.get('date'); + const ctrlValue = dateControl.value; + ctrlValue.year(normalizedYear.year()); + ctrlValue.date(ctrlValue.daysInMonth()); + dateControl.setValue(ctrlValue); + } + + chosenMonthHandler(normlizedMonth: Moment, datepicker: MatDatepicker) { + const dateControl = this.creditSalaryForm.get('date'); + const ctrlValue = dateControl.value; + ctrlValue.month(normlizedMonth.month()); + ctrlValue.date(ctrlValue.daysInMonth()); + dateControl.setValue(ctrlValue); + datepicker.close(); + } + + creditSalary() { + const date = moment(this.creditSalaryForm.get('date').value).format('DD-MMM-YYYY'); + if (!date) { + this.toaster.show('Danger', 'Please choose a valid date.'); + return; + } + this.ser.creditSalary(date) + .subscribe( + (result) => { + this.toaster.show('Success', 'Salaries Credited'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + attendanceRecordUrl() { + const startDate = moment(this.attendanceRecordForm.get('startDate').value).format('DD-MMM-YYYY'); + const finishDate = moment(this.attendanceRecordForm.get('finishDate').value).format('DD-MMM-YYYY'); + if (!startDate || !finishDate) { + // this.toaster.show('Danger', 'Please choose a start and finish date.'); + return; + } + return '/AttendanceReport?StartDate=' + startDate + '&FinishDate=' + finishDate; + } + + detectFiles(event) { + this.fingerprintFile = event.target.files[0]; + } + + uploadFingerprints() { + if (!this.fingerprintFile) { + this.toaster.show('Danger', 'Please choose a file first!'); + return; + } + this.ser.uploadFingerprints(this.fingerprintFile) + .subscribe( + (result) => { + this.toaster.show('Success', 'Fingerprints uploaded'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } +} diff --git a/overlord/src/app/employee-functions/employee-functions.module.ts b/overlord/src/app/employee-functions/employee-functions.module.ts new file mode 100644 index 00000000..56d0ef14 --- /dev/null +++ b/overlord/src/app/employee-functions/employee-functions.module.ts @@ -0,0 +1,61 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule, + MatTabsModule +} from '@angular/material'; +import {ReactiveFormsModule} from '@angular/forms'; +import {CdkTableModule} from '@angular/cdk/table'; +import {A11yModule} from '@angular/cdk/a11y'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; +import {SharedModule} from '../shared/shared.module'; +import {EmployeeFunctionsComponent} from './employee-functions.component'; +import {EmployeeFunctionsRoutingModule} from './employee-functions-routing.module'; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule, + MatTabsModule, + ReactiveFormsModule, + SharedModule, + EmployeeFunctionsRoutingModule + ], + declarations: [ + EmployeeFunctionsComponent + ] +}) +export class EmployeeFunctionsModule { +} diff --git a/overlord/src/app/employee-functions/employee-functions.service.ts b/overlord/src/app/employee-functions/employee-functions.service.ts new file mode 100644 index 00000000..a056eba1 --- /dev/null +++ b/overlord/src/app/employee-functions/employee-functions.service.ts @@ -0,0 +1,37 @@ +import {Injectable} from '@angular/core'; +import {Observable} from 'rxjs/internal/Observable'; +import {catchError} from 'rxjs/operators'; +import {HttpClient, HttpHeaders} from '@angular/common/http'; +import {ErrorLoggerService} from '../core/error-logger.service'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; + +const serviceName = 'EmployeeFunctionsService'; + +@Injectable({providedIn: 'root'}) +export class EmployeeFunctionsService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + creditSalary(month: string): Observable { + const url = '/api/CreditSalary'; + return >this.http.post(url, {month: month}) + .pipe( + catchError(this.log.handleError(serviceName, `creditSalary`)) + ); + } + + uploadFingerprints(fingerprintFile: File): Observable { + const url = '/api/Fingerprint'; + const fd = new FormData(); + fd.append('uploadedFile', fingerprintFile); + return >this.http.post(url, fd) + .pipe( + catchError(this.log.handleError(serviceName, `uploadFingerprints`)) + ); + } + +} diff --git a/overlord/src/app/employee/employee-detail/employee-detail.component.css b/overlord/src/app/employee/employee-detail/employee-detail.component.css new file mode 100644 index 00000000..e69de29b diff --git a/overlord/src/app/employee/employee-detail/employee-detail.component.html b/overlord/src/app/employee/employee-detail/employee-detail.component.html new file mode 100644 index 00000000..e79b4f4c --- /dev/null +++ b/overlord/src/app/employee/employee-detail/employee-detail.component.html @@ -0,0 +1,68 @@ + + + Employee + + +
    +
    + + Code + + +
    +
    + + Name + + +
    +
    + + Designation + + +
    +
    + + Salary + + +
    +
    + + Points + + +
    +
    + Is Active? +
    +
    + + Cost Centre + + + {{ cs.name }} + + + +
    + + + + + + + + + + +
    +
    + + + + +
    diff --git a/overlord/src/app/employee/employee-detail/employee-detail.component.spec.ts b/overlord/src/app/employee/employee-detail/employee-detail.component.spec.ts new file mode 100644 index 00000000..5943452c --- /dev/null +++ b/overlord/src/app/employee/employee-detail/employee-detail.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {EmployeeDetailComponent} from './employee-detail.component'; + +describe('EmployeeDetailComponent', () => { + let component: EmployeeDetailComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [EmployeeDetailComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EmployeeDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/employee/employee-detail/employee-detail.component.ts b/overlord/src/app/employee/employee-detail/employee-detail.component.ts new file mode 100644 index 00000000..f3d172b1 --- /dev/null +++ b/overlord/src/app/employee/employee-detail/employee-detail.component.ts @@ -0,0 +1,136 @@ +import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MatDialog} from '@angular/material'; +import {ActivatedRoute, Router} from '@angular/router'; + +import * as moment from 'moment'; + +import {ToasterService} from '../../core/toaster.service'; +import {EmployeeService} from '../employee.service'; +import {Employee} from '../employee'; +import {CostCentre} from '../../cost-centre/cost-centre'; +import {ConfirmDialogComponent} from '../../shared/confirm-dialog/confirm-dialog.component'; + +@Component({ + selector: 'app-employee-detail', + templateUrl: './employee-detail.component.html', + styleUrls: ['./employee-detail.component.css'] +}) +export class EmployeeDetailComponent implements OnInit, AfterViewInit { + @ViewChild('nameElement') nameElement: ElementRef; + form: FormGroup; + costCentres: CostCentre[]; + item: Employee; + + constructor( + private route: ActivatedRoute, + private router: Router, + private dialog: MatDialog, + private fb: FormBuilder, + private toaster: ToasterService, + private ser: EmployeeService + ) { + this.createForm(); + this.listenToIsActiveChanges(); + } + + createForm() { + this.form = this.fb.group({ + code: {value: '', disabled: true}, + name: '', + designation: '', + salary: '', + points: '', + isActive: '', + costCentre: '', + joiningDate: '', + leavingDate: '' + }); + } + + ngOnInit() { + this.route.data + .subscribe((data: { item: Employee, costCentres: CostCentre[] }) => { + this.costCentres = data.costCentres; + this.showItem(data.item); + }); + } + + showItem(item: Employee) { + this.item = item; + this.form.setValue({ + code: this.item.code || '(Auto)', + name: this.item.name || '', + designation: this.item.designation || '', + salary: this.item.salary || '', + points: this.item.points || '', + isActive: this.item.isActive || true, + costCentre: this.item.costCentre.id, + joiningDate: moment(this.item.joiningDate, 'DD-MMM-YYYY').toDate(), + leavingDate: this.item.isActive ? null : moment(this.item.leavingDate, 'DD-MMM-YYYY').toDate() + }); + } + + ngAfterViewInit() { + setTimeout(() => { + this.nameElement.nativeElement.focus(); + }, 0); + } + + listenToIsActiveChanges(): void { + this.form.get('isActive').valueChanges + .subscribe(x => this.item.isActive = x); + } + + save() { + this.ser.saveOrUpdate(this.getItem()) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigateByUrl('/Employees'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + delete() { + this.ser.delete(this.item.id) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigateByUrl('/Employees'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + confirmDelete(): void { + const dialogRef = this.dialog.open(ConfirmDialogComponent, { + width: '250px', + data: {title: 'Delete Employee?', content: 'Are you sure? This cannot be undone.'} + }); + + dialogRef.afterClosed().subscribe((result: boolean) => { + if (result) { + this.delete(); + } + }); + } + + getItem(): Employee { + const formModel = this.form.value; + this.item.name = formModel.name; + this.item.designation = formModel.designation; + this.item.salary = formModel.salary; + this.item.points = formModel.points; + this.item.isActive = formModel.isActive; + this.item.costCentre.id = formModel.costCentre; + this.item.joiningDate = moment(formModel.joiningDate).format('DD-MMM-YYYY'); + this.item.leavingDate = (this.item.isActive) ? null : moment(formModel.leavingDate).format('DD-MMM-YYYY'); + return this.item; + } +} diff --git a/overlord/src/app/employee/employee-list-resolver.service.spec.ts b/overlord/src/app/employee/employee-list-resolver.service.spec.ts new file mode 100644 index 00000000..f2791d44 --- /dev/null +++ b/overlord/src/app/employee/employee-list-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {EmployeeListResolverService} from './employee-list-resolver.service'; + +describe('EmployeeListResolverService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [EmployeeListResolverService] + }); + }); + + it('should be created', inject([EmployeeListResolverService], (service: EmployeeListResolverService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/employee/employee-list-resolver.service.ts b/overlord/src/app/employee/employee-list-resolver.service.ts new file mode 100644 index 00000000..a6a79829 --- /dev/null +++ b/overlord/src/app/employee/employee-list-resolver.service.ts @@ -0,0 +1,18 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Employee} from './employee'; +import {Observable} from 'rxjs/internal/Observable'; +import {EmployeeService} from './employee.service'; + +@Injectable({ + providedIn: 'root' +}) +export class EmployeeListResolver implements Resolve { + + constructor(private ser: EmployeeService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + return this.ser.list(); + } +} diff --git a/overlord/src/app/employee/employee-list/employee-list-datasource.ts b/overlord/src/app/employee/employee-list/employee-list-datasource.ts new file mode 100644 index 00000000..139b8dd5 --- /dev/null +++ b/overlord/src/app/employee/employee-list/employee-list-datasource.ts @@ -0,0 +1,91 @@ +import {DataSource} from '@angular/cdk/collections'; +import {MatPaginator, MatSort} from '@angular/material'; +import {map, tap} from 'rxjs/operators'; +import {merge, Observable, of as observableOf} from 'rxjs'; +import {Employee} from '../employee'; + + +export class EmployeeListDataSource extends DataSource { + private dataObservable: Observable; + private filterValue: string; + + constructor(private paginator: MatPaginator, private sort: MatSort, private filter: Observable, public data: Employee[]) { + super(); + this.filter = filter.pipe( + tap(x => this.filterValue = x) + ); + } + + connect(): Observable { + this.dataObservable = observableOf(this.data); + const dataMutations = [ + this.dataObservable, + this.filter, + this.paginator.page, + this.sort.sortChange + ]; + + return merge(...dataMutations).pipe( + map((x: any) => { + return this.getPagedData(this.getSortedData(this.getFilteredData([...this.data]))); + }), + tap((x: Employee[]) => this.paginator.length = x.length) + ); + } + + disconnect() { + } + + private getFilteredData(data: Employee[]): Employee[] { + const filter = (this.filterValue === undefined) ? '' : this.filterValue; + return filter.split(' ').reduce((p: Employee[], c: string) => { + return p.filter(x => { + const employeeString = ( + x.code + ' ' + x.name + ' ' + x.designation + ' ' + x.costCentre + (x.isActive ? ' active' : ' deactive') + ).toLowerCase(); + return employeeString.indexOf(c) !== -1; + } + ); + }, Object.assign([], data)); + } + + private getPagedData(data: Employee[]) { + const startIndex = this.paginator.pageIndex * this.paginator.pageSize; + return data.splice(startIndex, this.paginator.pageSize); + } + + private getSortedData(data: Employee[]) { + if (!this.sort.active || this.sort.direction === '') { + return data; + } + + return data.sort((a, b) => { + const isAsc = this.sort.direction === 'asc'; + switch (this.sort.active) { + case 'code': + return compare(+a.code, +b.code, isAsc); + case 'name': + return compare(a.name, b.name, isAsc); + case 'designation': + return compare(a.designation, b.designation, isAsc); + case 'salary': + return compare(a.salary, b.salary, isAsc); + case 'points': + return compare(a.points, b.points, isAsc); + case 'department': + return compare(a.costCentre, b.costCentre, isAsc); + case 'joiningDate': + return compare(a.joiningDate, b.joiningDate, isAsc); + case 'leavingDate': + return compare(a.leavingDate, b.leavingDate, isAsc); + default: + return 0; + } + }); + } +} + +/** Simple sort comparator for example ID/Name columns (for client-side sorting). */ +function compare(a, b, isAsc) { + return (a < b ? -1 : 1) * (isAsc ? 1 : -1); +} diff --git a/overlord/src/app/employee/employee-list/employee-list.component.css b/overlord/src/app/employee/employee-list/employee-list.component.css new file mode 100644 index 00000000..e69de29b diff --git a/overlord/src/app/employee/employee-list/employee-list.component.html b/overlord/src/app/employee/employee-list/employee-list.component.html new file mode 100644 index 00000000..346e50fa --- /dev/null +++ b/overlord/src/app/employee/employee-list/employee-list.component.html @@ -0,0 +1,79 @@ + + + Employees + + add_box + Add + + + +
    +
    + + + +
    +
    + + + + + Code + {{row.code}} + + + + + Name + {{row.name}} + + + + + Designation + {{row.designation}} + + + + + Salary + {{row.salary | currency:'INR'}} + + + + + Points + {{row.points | number:'1.2-2'}} + + + + + Department + {{row.costCentre}} + + + + + Joining On + {{row.joiningDate}} + + + + + Left On + {{row.leavingDate}} + + + + + + + + +
    +
    diff --git a/overlord/src/app/employee/employee-list/employee-list.component.spec.ts b/overlord/src/app/employee/employee-list/employee-list.component.spec.ts new file mode 100644 index 00000000..ac80d421 --- /dev/null +++ b/overlord/src/app/employee/employee-list/employee-list.component.spec.ts @@ -0,0 +1,23 @@ +import {ComponentFixture, fakeAsync, TestBed} from '@angular/core/testing'; + +import {EmployeeListComponent} from './employee-list.component'; + +describe('EmployeeListComponent', () => { + let component: EmployeeListComponent; + let fixture: ComponentFixture; + + beforeEach(fakeAsync(() => { + TestBed.configureTestingModule({ + declarations: [EmployeeListComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(EmployeeListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should compile', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/employee/employee-list/employee-list.component.ts b/overlord/src/app/employee/employee-list/employee-list.component.ts new file mode 100644 index 00000000..8fa729b4 --- /dev/null +++ b/overlord/src/app/employee/employee-list/employee-list.component.ts @@ -0,0 +1,60 @@ +import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; +import {MatPaginator, MatSort} from '@angular/material'; +import {EmployeeListDataSource} from './employee-list-datasource'; +import {Employee} from '../employee'; +import {ActivatedRoute} from '@angular/router'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {Observable} from 'rxjs'; +import {debounceTime, distinctUntilChanged, startWith} from 'rxjs/operators'; + +@Component({ + selector: 'app-employee-list', + templateUrl: './employee-list.component.html', + styleUrls: ['./employee-list.component.css'] +}) +export class EmployeeListComponent implements OnInit, AfterViewInit { + @ViewChild('filterElement') filterElement: ElementRef; + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + dataSource: EmployeeListDataSource; + filter: Observable; + form: FormGroup; + list: Employee[]; + + /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ + displayedColumns = ['code', 'name', 'designation', 'salary', 'points', 'department', 'joiningDate', 'leavingDate']; + + constructor(private route: ActivatedRoute, private fb: FormBuilder) { + this.createForm(); + this.filter = this.listenToFilterChange(); + } + + createForm() { + this.form = this.fb.group({ + filter: '' + }); + } + + listenToFilterChange() { + return this.form.get('filter').valueChanges + .pipe( + startWith(''), + debounceTime(150), + distinctUntilChanged() + ); + } + + ngOnInit() { + this.route.data + .subscribe((data: { list: Employee[] }) => { + this.list = data.list; + }); + this.dataSource = new EmployeeListDataSource(this.paginator, this.sort, this.filter, this.list); + } + + ngAfterViewInit() { + setTimeout(() => { + this.filterElement.nativeElement.focus(); + }, 0); + } +} diff --git a/overlord/src/app/employee/employee-resolver.service.spec.ts b/overlord/src/app/employee/employee-resolver.service.spec.ts new file mode 100644 index 00000000..f5fb0eba --- /dev/null +++ b/overlord/src/app/employee/employee-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {EmployeeResolverService} from './employee-resolver.service'; + +describe('EmployeeResolverService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [EmployeeDetailResolverService] + }); + }); + + it('should be created', inject([EmployeeDetailResolverService], (service: EmployeeDetailResolverService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/employee/employee-resolver.service.ts b/overlord/src/app/employee/employee-resolver.service.ts new file mode 100644 index 00000000..e1478415 --- /dev/null +++ b/overlord/src/app/employee/employee-resolver.service.ts @@ -0,0 +1,19 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot} from '@angular/router'; +import {EmployeeService} from './employee.service'; +import {Employee} from './employee'; +import {Observable} from 'rxjs/internal/Observable'; + +@Injectable({ + providedIn: 'root' +}) +export class EmployeeResolver implements Resolve { + + constructor(private ser: EmployeeService, private router: Router) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const id = route.paramMap.get('id'); + return this.ser.get(id); + } +} diff --git a/overlord/src/app/employee/employee-routing.module.spec.ts b/overlord/src/app/employee/employee-routing.module.spec.ts new file mode 100644 index 00000000..c1cd7966 --- /dev/null +++ b/overlord/src/app/employee/employee-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {EmployeeRoutingModule} from './employee-routing.module'; + +describe('EmployeeRoutingModule', () => { + let employeeRoutingModule: EmployeeRoutingModule; + + beforeEach(() => { + employeeRoutingModule = new EmployeeRoutingModule(); + }); + + it('should create an instance', () => { + expect(employeeRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/employee/employee-routing.module.ts b/overlord/src/app/employee/employee-routing.module.ts new file mode 100644 index 00000000..a3f65551 --- /dev/null +++ b/overlord/src/app/employee/employee-routing.module.ts @@ -0,0 +1,66 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; + +import {EmployeeListResolver} from './employee-list-resolver.service'; +import {EmployeeResolver} from './employee-resolver.service'; +import {EmployeeDetailComponent} from './employee-detail/employee-detail.component'; +import {EmployeeListComponent} from './employee-list/employee-list.component'; + +import {AuthGuard} from '../auth/auth-guard.service'; +import {CostCentreListResolver} from '../cost-centre/cost-centre-list-resolver.service'; + +const employeeRoutes: Routes = [ + { + path: 'Employees', + component: EmployeeListComponent, + canActivate: [AuthGuard], + data: { + permission: 'Employees' + }, + resolve: { + list: EmployeeListResolver + } + }, + { + path: 'Employee', + component: EmployeeDetailComponent, + canActivate: [AuthGuard], + data: { + permission: 'Employees' + }, + resolve: { + item: EmployeeResolver, + costCentres: CostCentreListResolver + } + }, + { + path: 'Employee/:id', + component: EmployeeDetailComponent, + canActivate: [AuthGuard], + data: { + permission: 'Employees' + }, + resolve: { + item: EmployeeResolver, + costCentres: CostCentreListResolver + } + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(employeeRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + EmployeeListResolver, + EmployeeResolver + ] +}) +export class EmployeeRoutingModule { +} diff --git a/overlord/src/app/employee/employee.module.spec.ts b/overlord/src/app/employee/employee.module.spec.ts new file mode 100644 index 00000000..c009d0a4 --- /dev/null +++ b/overlord/src/app/employee/employee.module.spec.ts @@ -0,0 +1,13 @@ +import {EmployeeModule} from './employee.module'; + +describe('EmployeeModule', () => { + let employeeModule: EmployeeModule; + + beforeEach(() => { + employeeModule = new EmployeeModule(); + }); + + it('should create an instance', () => { + expect(employeeModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/employee/employee.module.ts b/overlord/src/app/employee/employee.module.ts new file mode 100644 index 00000000..0c33bff6 --- /dev/null +++ b/overlord/src/app/employee/employee.module.ts @@ -0,0 +1,54 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; + +import {EmployeeListComponent} from './employee-list/employee-list.component'; +import {EmployeeDetailComponent} from './employee-detail/employee-detail.component'; +import {EmployeeRoutingModule} from './employee-routing.module'; +import { + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatIconModule, + MatInputModule, + MatOptionModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {CdkTableModule} from '@angular/cdk/table'; +import {ReactiveFormsModule} from '@angular/forms'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +@NgModule({ + imports: [ + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatTableModule, + MatPaginatorModule, + MatSortModule, + MatCardModule, + MatDatepickerModule, + MatDialogModule, + MatProgressSpinnerModule, + MatInputModule, + MatButtonModule, + MatIconModule, + MatOptionModule, + MatSelectModule, + MatCheckboxModule, + ReactiveFormsModule, + EmployeeRoutingModule + ], + declarations: [ + EmployeeListComponent, + EmployeeDetailComponent + ] +}) +export class EmployeeModule { +} diff --git a/overlord/src/app/employee/employee.service.spec.ts b/overlord/src/app/employee/employee.service.spec.ts new file mode 100644 index 00000000..29ef1d8b --- /dev/null +++ b/overlord/src/app/employee/employee.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {EmployeeService} from './employee.service'; + +describe('EmployeeService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [EmployeeService] + }); + }); + + it('should be created', inject([EmployeeService], (service: EmployeeService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/employee/employee.service.ts b/overlord/src/app/employee/employee.service.ts new file mode 100644 index 00000000..95210976 --- /dev/null +++ b/overlord/src/app/employee/employee.service.ts @@ -0,0 +1,73 @@ +import {Injectable} from '@angular/core'; +import {Observable} from 'rxjs/internal/Observable'; +import {catchError} from 'rxjs/operators'; +import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http'; +import {Employee} from './employee'; +import {ErrorLoggerService} from '../core/error-logger.service'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; + +const url = '/api/Employee'; +const serviceName = 'EmployeeService'; + +@Injectable({providedIn: 'root'}) +export class EmployeeService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + get(id: string): Observable { + const getUrl: string = (id === null) ? url : `${url}/${id}`; + return >this.http.get(getUrl) + .pipe( + catchError(this.log.handleError(serviceName, `get id=${id}`)) + ); + } + + list(): Observable { + const options = {params: new HttpParams().set('l', '')}; + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + + save(employee: Employee): Observable { + return >this.http.post(url, employee, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'save')) + ); + } + + update(employee: Employee): Observable { + return >this.http.put(`${url}/${employee.id}`, employee, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'update')) + ); + } + + saveOrUpdate(employee: Employee): Observable { + if (!employee.id) { + return this.save(employee); + } else { + return this.update(employee); + } + } + + delete(id: string): Observable { + return >this.http.delete(`${url}/${id}`, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'delete')) + ); + } + + autocomplete(term: string): Observable { + const options = {params: new HttpParams().set('q', term)}; + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'autocomplete')) + ); + } +} diff --git a/overlord/src/app/employee/employee.ts b/overlord/src/app/employee/employee.ts new file mode 100644 index 00000000..5998c6ce --- /dev/null +++ b/overlord/src/app/employee/employee.ts @@ -0,0 +1,15 @@ +import {CostCentre} from '../cost-centre/cost-centre'; + +export class Employee { + id: string; + code: number; + name: string; + isActive: boolean; + designation: string; + salary: number; + points: number; + joiningDate: string; + leavingDate?: string; + costCentre: CostCentre; + +} diff --git a/overlord/src/app/group/group-detail/group-detail.component.css b/overlord/src/app/group/group-detail/group-detail.component.css new file mode 100644 index 00000000..82c7afd6 --- /dev/null +++ b/overlord/src/app/group/group-detail/group-detail.component.css @@ -0,0 +1,3 @@ +.example-card { + max-width: 400px; +} diff --git a/overlord/src/app/group/group-detail/group-detail.component.html b/overlord/src/app/group/group-detail/group-detail.component.html new file mode 100644 index 00000000..5ebd575b --- /dev/null +++ b/overlord/src/app/group/group-detail/group-detail.component.html @@ -0,0 +1,30 @@ +
    + + + Group + + +
    +
    + + Name + + +
    + +
    +
    + {{p.name}} +
    +
    +
    +
    + + + + +
    +
    diff --git a/overlord/src/app/group/group-detail/group-detail.component.spec.ts b/overlord/src/app/group/group-detail/group-detail.component.spec.ts new file mode 100644 index 00000000..94956fb7 --- /dev/null +++ b/overlord/src/app/group/group-detail/group-detail.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {GroupDetailComponent} from './group-detail.component'; + +describe('GroupDetailComponent', () => { + let component: GroupDetailComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [GroupDetailComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(GroupDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/group/group-detail/group-detail.component.ts b/overlord/src/app/group/group-detail/group-detail.component.ts new file mode 100644 index 00000000..d0d5b69a --- /dev/null +++ b/overlord/src/app/group/group-detail/group-detail.component.ts @@ -0,0 +1,108 @@ +import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; +import {ActivatedRoute, Router} from '@angular/router'; + +import {GroupService} from '../group.service'; +import {Group} from '../group'; +import {ToasterService} from '../../core/toaster.service'; +import {ConfirmDialogComponent} from '../../shared/confirm-dialog/confirm-dialog.component'; +import {MatDialog} from '@angular/material'; +import {FormArray, FormBuilder, FormGroup} from '@angular/forms'; + +@Component({ + selector: 'app-group-detail', + templateUrl: './group-detail.component.html', + styleUrls: ['./group-detail.component.css'] +}) +export class GroupDetailComponent implements OnInit, AfterViewInit { + @ViewChild('nameElement') nameElement: ElementRef; + form: FormGroup; + item: Group; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder, + private toaster: ToasterService, + private dialog: MatDialog, + private ser: GroupService + ) { + this.createForm(); + } + + createForm() { + this.form = this.fb.group({ + name: '', + permissions: this.fb.array([]) + }); + } + + ngOnInit() { + this.route.data + .subscribe((data: { item: Group }) => { + this.item = data.item; + this.form.get('name').setValue(this.item.name); + this.form.setControl('permissions', this.fb.array( + this.item.permissions.map( + x => this.fb.group({ + permission: x.enabled + }) + ) + )); + }); + } + + ngAfterViewInit() { + setTimeout(() => { + this.nameElement.nativeElement.focus(); + }, 0); + } + + save() { + this.ser.saveOrUpdate(this.getItem()) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigateByUrl('/Groups'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + delete() { + this.ser.delete(this.item.id) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigateByUrl('/Groups'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + confirmDelete(): void { + const dialogRef = this.dialog.open(ConfirmDialogComponent, { + width: '250px', + data: {title: 'Delete Group?', content: 'Are you sure? This cannot be undone.'} + }); + + dialogRef.afterClosed().subscribe((result: boolean) => { + if (result) { + this.delete(); + } + }); + } + + getItem(): Group { + const formModel = this.form.value; + this.item.name = formModel.name; + const array = this.form.get('permissions') as FormArray; + this.item.permissions.forEach((item, index) => { + item.enabled = array.controls[index].value.permission; + }); + return this.item; + } +} diff --git a/overlord/src/app/group/group-list-resolver.service.spec.ts b/overlord/src/app/group/group-list-resolver.service.spec.ts new file mode 100644 index 00000000..7e39a3ee --- /dev/null +++ b/overlord/src/app/group/group-list-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {ClientListResolverService} from './group-list-resolver.service'; + +describe('ClientListResolverService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ClientListResolverService] + }); + }); + + it('should be created', inject([ClientListResolverService], (service: ClientListResolverService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/group/group-list-resolver.service.ts b/overlord/src/app/group/group-list-resolver.service.ts new file mode 100644 index 00000000..1edbfa25 --- /dev/null +++ b/overlord/src/app/group/group-list-resolver.service.ts @@ -0,0 +1,18 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot} from '@angular/router'; +import {Group} from './group'; +import {Observable} from 'rxjs/internal/Observable'; +import {GroupService} from './group.service'; + +@Injectable({ + providedIn: 'root' +}) +export class GroupListResolver implements Resolve { + + constructor(private ser: GroupService, private router: Router) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + return this.ser.list(); + } +} diff --git a/overlord/src/app/group/group-list/group-list-datasource.ts b/overlord/src/app/group/group-list/group-list-datasource.ts new file mode 100644 index 00000000..77b42fda --- /dev/null +++ b/overlord/src/app/group/group-list/group-list-datasource.ts @@ -0,0 +1,58 @@ +import {DataSource} from '@angular/cdk/collections'; +import {MatPaginator, MatSort} from '@angular/material'; +import {map} from 'rxjs/operators'; +import {merge, Observable, of as observableOf} from 'rxjs'; +import {Group} from '../group'; + +export class GroupListDataSource extends DataSource { + + constructor(private paginator: MatPaginator, private sort: MatSort, public data: Group[]) { + super(); + } + + connect(): Observable { + const dataMutations = [ + observableOf(this.data), + this.paginator.page, + this.sort.sortChange + ]; + + // Set the paginators length + this.paginator.length = this.data.length; + + return merge(...dataMutations).pipe(map(() => { + return this.getPagedData(this.getSortedData([...this.data])); + })); + } + + disconnect() { + } + + private getPagedData(data: Group[]) { + const startIndex = this.paginator.pageIndex * this.paginator.pageSize; + return data.splice(startIndex, this.paginator.pageSize); + } + + private getSortedData(data: Group[]) { + if (!this.sort.active || this.sort.direction === '') { + return data; + } + + return data.sort((a, b) => { + const isAsc = this.sort.direction === 'asc'; + switch (this.sort.active) { + case 'name': + return compare(a.name, b.name, isAsc); + case 'id': + return compare(+a.id, +b.id, isAsc); + default: + return 0; + } + }); + } +} + +/** Simple sort comparator for example ID/Name columns (for user-side sorting). */ +function compare(a, b, isAsc) { + return (a < b ? -1 : 1) * (isAsc ? 1 : -1); +} diff --git a/overlord/src/app/group/group-list/group-list.component.css b/overlord/src/app/group/group-list/group-list.component.css new file mode 100644 index 00000000..e69de29b diff --git a/overlord/src/app/group/group-list/group-list.component.html b/overlord/src/app/group/group-list/group-list.component.html new file mode 100644 index 00000000..ed2453b8 --- /dev/null +++ b/overlord/src/app/group/group-list/group-list.component.html @@ -0,0 +1,35 @@ + + + Groups + + + + + + + Name + {{row.name}} + + + + + Permissions + +
      +
    • {{permission}}
    • +
    +
    +
    + + + +
    + + + +
    +
    diff --git a/overlord/src/app/group/group-list/group-list.component.spec.ts b/overlord/src/app/group/group-list/group-list.component.spec.ts new file mode 100644 index 00000000..560a01a0 --- /dev/null +++ b/overlord/src/app/group/group-list/group-list.component.spec.ts @@ -0,0 +1,23 @@ +import {ComponentFixture, fakeAsync, TestBed} from '@angular/core/testing'; + +import {GroupListComponent} from './group-list.component'; + +describe('GroupListComponent', () => { + let component: GroupListComponent; + let fixture: ComponentFixture; + + beforeEach(fakeAsync(() => { + TestBed.configureTestingModule({ + declarations: [GroupListComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(GroupListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should compile', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/group/group-list/group-list.component.ts b/overlord/src/app/group/group-list/group-list.component.ts new file mode 100644 index 00000000..53418e42 --- /dev/null +++ b/overlord/src/app/group/group-list/group-list.component.ts @@ -0,0 +1,30 @@ +import {Component, OnInit, ViewChild} from '@angular/core'; +import {MatPaginator, MatSort} from '@angular/material'; +import {GroupListDataSource} from './group-list-datasource'; +import {Group} from '../group'; +import {ActivatedRoute} from '@angular/router'; + +@Component({ + selector: 'app-group-list', + templateUrl: './group-list.component.html', + styleUrls: ['./group-list.component.css'] +}) +export class GroupListComponent implements OnInit { + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + dataSource: GroupListDataSource; + list: Group[]; + /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ + displayedColumns = ['name', 'permissions']; + + constructor(private route: ActivatedRoute) { + } + + ngOnInit() { + this.route.data + .subscribe((data: { list: Group[] }) => { + this.list = data.list; + }); + this.dataSource = new GroupListDataSource(this.paginator, this.sort, this.list); + } +} diff --git a/overlord/src/app/group/group-resolver.service.spec.ts b/overlord/src/app/group/group-resolver.service.spec.ts new file mode 100644 index 00000000..0032bdcd --- /dev/null +++ b/overlord/src/app/group/group-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {GroupResolverService} from './group-resolver.service'; + +describe('GroupResolverService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [GroupDetailResolverService] + }); + }); + + it('should be created', inject([GroupDetailResolverService], (service: GroupDetailResolverService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/group/group-resolver.service.ts b/overlord/src/app/group/group-resolver.service.ts new file mode 100644 index 00000000..f9f5e963 --- /dev/null +++ b/overlord/src/app/group/group-resolver.service.ts @@ -0,0 +1,19 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot} from '@angular/router'; +import {Group} from './group'; +import {Observable} from 'rxjs/internal/Observable'; +import {GroupService} from './group.service'; + +@Injectable({ + providedIn: 'root' +}) +export class GroupResolver implements Resolve { + + constructor(private ser: GroupService, private router: Router) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const id = route.paramMap.get('id'); + return this.ser.get(id); + } +} diff --git a/overlord/src/app/group/group-routing.module.spec.ts b/overlord/src/app/group/group-routing.module.spec.ts new file mode 100644 index 00000000..55cbcc26 --- /dev/null +++ b/overlord/src/app/group/group-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {UserRoutingModule} from './group-routing.module'; + +describe('UserRoutingModule', () => { + let groupRoutingModule: UserRoutingModule; + + beforeEach(() => { + groupRoutingModule = new UserRoutingModule(); + }); + + it('should create an instance', () => { + expect(groupRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/group/group-routing.module.ts b/overlord/src/app/group/group-routing.module.ts new file mode 100644 index 00000000..f9e5497a --- /dev/null +++ b/overlord/src/app/group/group-routing.module.ts @@ -0,0 +1,61 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {GroupListResolver} from './group-list-resolver.service'; +import {GroupResolver} from './group-resolver.service'; +import {GroupListComponent} from './group-list/group-list.component'; +import {GroupDetailComponent} from './group-detail/group-detail.component'; +import {AuthGuard} from '../auth/auth-guard.service'; + +const groupRoutes: Routes = [ + { + path: 'Groups', + component: GroupListComponent, + canActivate: [AuthGuard], + data: { + permission: 'Users' + }, + resolve: { + list: GroupListResolver + } + }, + { + path: 'Group', + component: GroupDetailComponent, + canActivate: [AuthGuard], + data: { + permission: 'Users' + }, + resolve: { + item: GroupResolver, + } + }, + { + path: 'Group/:id', + component: GroupDetailComponent, + canActivate: [AuthGuard], + data: { + permission: 'Users' + }, + resolve: { + item: GroupResolver + } + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(groupRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + GroupListResolver, + GroupResolver + ] +}) +export class GroupRoutingModule { +} diff --git a/overlord/src/app/group/group.module.spec.ts b/overlord/src/app/group/group.module.spec.ts new file mode 100644 index 00000000..6b893121 --- /dev/null +++ b/overlord/src/app/group/group.module.spec.ts @@ -0,0 +1,13 @@ +import {GroupModule} from './group.module'; + +describe('GroupModule', () => { + let groupModule: GroupModule; + + beforeEach(() => { + groupModule = new GroupModule(); + }); + + it('should create an instance', () => { + expect(groupModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/group/group.module.ts b/overlord/src/app/group/group.module.ts new file mode 100644 index 00000000..390ca572 --- /dev/null +++ b/overlord/src/app/group/group.module.ts @@ -0,0 +1,50 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; + +import {GroupListComponent} from './group-list/group-list.component'; +import {GroupDetailComponent} from './group-detail/group-detail.component'; +import {GroupRoutingModule} from './group-routing.module'; +import { + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDividerModule, + MatIconModule, + MatInputModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {CdkTableModule} from '@angular/cdk/table'; +import {ReactiveFormsModule} from '@angular/forms'; +import {SharedModule} from '../shared/shared.module'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +@NgModule({ + imports: [ + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDividerModule, + MatIconModule, + MatInputModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + GroupRoutingModule + ], + declarations: [ + GroupListComponent, + GroupDetailComponent + ] +}) +export class GroupModule { +} diff --git a/overlord/src/app/group/group.service.spec.ts b/overlord/src/app/group/group.service.spec.ts new file mode 100644 index 00000000..b4507afe --- /dev/null +++ b/overlord/src/app/group/group.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {GroupService} from './group.service'; + +describe('GroupService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [GroupService] + }); + }); + + it('should be created', inject([GroupService], (service: GroupService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/group/group.service.ts b/overlord/src/app/group/group.service.ts new file mode 100644 index 00000000..9e4629a7 --- /dev/null +++ b/overlord/src/app/group/group.service.ts @@ -0,0 +1,73 @@ +import {Injectable} from '@angular/core'; +import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http'; +import {ErrorLoggerService} from '../core/error-logger.service'; +import {catchError} from 'rxjs/operators'; +import {Observable} from 'rxjs/internal/Observable'; +import {Group} from './group'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; +const url = '/api/Group'; +const serviceName = 'GroupService'; + +@Injectable({ + providedIn: 'root' +}) +export class GroupService { + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + get(id: string): Observable { + const getUrl: string = (id === null) ? url : `${url}/${id}`; + return >this.http.get(getUrl) + .pipe( + catchError(this.log.handleError(serviceName, `get id=${id}`)) + ); + } + + list(): Observable { + const options = {params: new HttpParams().set('l', '')}; + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + + listOfNames(): Observable { + const options = {params: new HttpParams().set('n', '')}; + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + + save(group: Group): Observable { + return >this.http.post(url, group, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'save')) + ); + } + + update(group: Group): Observable { + return >this.http.put(`${url}/${group.id}`, group, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'update')) + ); + } + + saveOrUpdate(group: Group): Observable { + if (!group.id) { + return this.save(group); + } else { + return this.update(group); + } + } + + delete(id: string): Observable { + return >this.http.delete(`${url}/${id}`, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'delete')) + ); + } +} diff --git a/overlord/src/app/group/group.ts b/overlord/src/app/group/group.ts new file mode 100644 index 00000000..8d99f118 --- /dev/null +++ b/overlord/src/app/group/group.ts @@ -0,0 +1,11 @@ +export class Group { + id: string; + name: string; + permissions: Permission[]; +} + +export class Permission { + id: string; + name: string; + enabled: boolean; +} diff --git a/overlord/src/app/home/home.component.css b/overlord/src/app/home/home.component.css new file mode 100644 index 00000000..e69de29b diff --git a/overlord/src/app/home/home.component.html b/overlord/src/app/home/home.component.html new file mode 100644 index 00000000..a009ebd9 --- /dev/null +++ b/overlord/src/app/home/home.component.html @@ -0,0 +1,3 @@ +

    + Accounting Software Redone! +

    diff --git a/overlord/src/app/home/home.component.spec.ts b/overlord/src/app/home/home.component.spec.ts new file mode 100644 index 00000000..482c23cf --- /dev/null +++ b/overlord/src/app/home/home.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {HomeComponent} from './home.component'; + +describe('HomeComponent', () => { + let component: HomeComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [HomeComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(HomeComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/home/home.component.ts b/overlord/src/app/home/home.component.ts new file mode 100644 index 00000000..cadfde79 --- /dev/null +++ b/overlord/src/app/home/home.component.ts @@ -0,0 +1,16 @@ +import {Component, OnInit} from '@angular/core'; + +@Component({ + selector: 'app-home', + templateUrl: './home.component.html', + styleUrls: ['./home.component.css'] +}) +export class HomeComponent implements OnInit { + + constructor() { + } + + ngOnInit() { + } + +} diff --git a/overlord/src/app/incentive/incentive-datasource.ts b/overlord/src/app/incentive/incentive-datasource.ts new file mode 100644 index 00000000..c8e4b896 --- /dev/null +++ b/overlord/src/app/incentive/incentive-datasource.ts @@ -0,0 +1,18 @@ +import {DataSource} from '@angular/cdk/collections'; +import {Observable} from 'rxjs'; +import {Incentive} from '../journal/voucher'; + + +export class IncentiveDataSource extends DataSource { + + constructor(private data: Observable) { + super(); + } + + connect(): Observable { + return this.data; + } + + disconnect() { + } +} diff --git a/overlord/src/app/incentive/incentive-resolver.service.spec.ts b/overlord/src/app/incentive/incentive-resolver.service.spec.ts new file mode 100644 index 00000000..30d81940 --- /dev/null +++ b/overlord/src/app/incentive/incentive-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {IncentiveResolver} from './incentive-resolver.service'; + +describe('IncentiveResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [IncentiveResolver] + }); + }); + + it('should be created', inject([IncentiveResolver], (service: IncentiveResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/incentive/incentive-resolver.service.ts b/overlord/src/app/incentive/incentive-resolver.service.ts new file mode 100644 index 00000000..40a3bfcb --- /dev/null +++ b/overlord/src/app/incentive/incentive-resolver.service.ts @@ -0,0 +1,24 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {Voucher} from '../journal/voucher'; +import {VoucherService} from '../journal/voucher.service'; +import {tap} from 'rxjs/operators'; + +@Injectable({ + providedIn: 'root' +}) +export class IncentiveResolver implements Resolve { + + constructor(private ser: VoucherService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const id = route.paramMap.get('id'); + if (id === null) { + return this.ser.getOfType('Service Charge'); + } else { + return this.ser.get(id); + } + } +} diff --git a/overlord/src/app/incentive/incentive-routing.module.spec.ts b/overlord/src/app/incentive/incentive-routing.module.spec.ts new file mode 100644 index 00000000..c26fb236 --- /dev/null +++ b/overlord/src/app/incentive/incentive-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {IncentiveRoutingModule} from './incentive-routing.module'; + +describe('IncentiveRoutingModule', () => { + let incentiveRoutingModule: IncentiveRoutingModule; + + beforeEach(() => { + incentiveRoutingModule = new IncentiveRoutingModule(); + }); + + it('should create an instance', () => { + expect(incentiveRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/incentive/incentive-routing.module.ts b/overlord/src/app/incentive/incentive-routing.module.ts new file mode 100644 index 00000000..940eac68 --- /dev/null +++ b/overlord/src/app/incentive/incentive-routing.module.ts @@ -0,0 +1,49 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {IncentiveResolver} from './incentive-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {IncentiveComponent} from './incentive.component'; + +const incentiveRoutes: Routes = [ + { + path: 'Incentive', + component: IncentiveComponent, + canActivate: [AuthGuard], + data: { + permission: 'Service Charge' + }, + resolve: { + voucher: IncentiveResolver + }, + runGuardsAndResolvers: 'always' + }, + { + path: 'Incentive/:id', + component: IncentiveComponent, + canActivate: [AuthGuard], + data: { + permission: 'Service Charge' + }, + resolve: { + voucher: IncentiveResolver + }, + runGuardsAndResolvers: 'always' + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(incentiveRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + IncentiveResolver + ] +}) +export class IncentiveRoutingModule { +} diff --git a/overlord/src/app/incentive/incentive.component.css b/overlord/src/app/incentive/incentive.component.css new file mode 100644 index 00000000..a592a823 --- /dev/null +++ b/overlord/src/app/incentive/incentive.component.css @@ -0,0 +1,32 @@ +.right { + display: flex; + justify-content: flex-end; +} + +.selected { + background: #fff3cd +} + +.unposted { + background: #f8d7da +} + +.center { + display: flex; + justify-content: center; +} + +.img-container { + position: relative; +} + +.img-container .overlay { + display: none; +} + +.img-container:hover > .overlay { + display: inline-block; + position: absolute; + left: 60px; + top: 0; +} diff --git a/overlord/src/app/incentive/incentive.component.html b/overlord/src/app/incentive/incentive.component.html new file mode 100644 index 00000000..c5e192fe --- /dev/null +++ b/overlord/src/app/incentive/incentive.component.html @@ -0,0 +1,90 @@ + + + Incentives + + +
    +
    + + + + + +
    +
    + Total Service Charge: {{voucher.incentive | number:'1.2-2'}} + Total Points: {{totalPoints() | number:'1.2-2'}} + Point Value: {{pointValue() | number:'1.2-2'}} +
    + + + + + Name + {{row.name}} + + + + + Designation + {{row.designation}} + + + + + Department + {{row.department}} + + + + + DaysWorked + {{row.daysWorked | number:'1.2-2'}} + + + + + Service Points + + + + + + + + + + + + Amount + {{amount(row) | currency:'INR'}} + + + + + +
    +
    + + + + + + + Created on {{voucher.creationDate | localTime}} and + Last Edited on {{voucher.lastEditDate | localTime}} + by {{voucher.user.name}}. {{(voucher.poster) ? 'Posted by ' + voucher.poster : ''}} + +
    diff --git a/overlord/src/app/incentive/incentive.component.spec.ts b/overlord/src/app/incentive/incentive.component.spec.ts new file mode 100644 index 00000000..8a25292c --- /dev/null +++ b/overlord/src/app/incentive/incentive.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {IncentiveComponent} from './incentive.component'; + +describe('IncentiveComponent', () => { + let component: IncentiveComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [IncentiveComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(IncentiveComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/incentive/incentive.component.ts b/overlord/src/app/incentive/incentive.component.ts new file mode 100644 index 00000000..4713eff0 --- /dev/null +++ b/overlord/src/app/incentive/incentive.component.ts @@ -0,0 +1,192 @@ +import {Component, OnInit} from '@angular/core'; +import {FormArray, FormBuilder, FormGroup} from '@angular/forms'; +import {MatDialog} from '@angular/material'; +import {ActivatedRoute, Router} from '@angular/router'; +import {BehaviorSubject, Observable} from 'rxjs'; +import {IncentiveDataSource} from './incentive-datasource'; +import {Account} from '../account/account'; +import {VoucherService} from '../journal/voucher.service'; +import {Incentive, Voucher} from '../journal/voucher'; +import * as moment from 'moment'; +import {AuthService} from '../auth/auth.service'; +import {ConfirmDialogComponent} from '../shared/confirm-dialog/confirm-dialog.component'; +import {ToasterService} from '../core/toaster.service'; +import {map} from 'rxjs/operators'; + +@Component({ + selector: 'app-incentive', + templateUrl: './incentive.component.html', + styleUrls: ['./incentive.component.css'] +}) +export class IncentiveComponent implements OnInit { + public incentiveObservable = new BehaviorSubject([]); + dataSource: IncentiveDataSource; + form: FormGroup; + voucher: Voucher; + account: Account; + accBal: any; + + displayedColumns = ['name', 'designation', 'department', 'daysWorked', 'points', 'amount']; + + accounts: Observable; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder, + private dialog: MatDialog, + private toaster: ToasterService, + private auth: AuthService, + private ser: VoucherService + ) { + this.createForm(); + this.listenToDateChange(); + } + + ngOnInit() { + this.route.data + .subscribe((data: { voucher: Voucher }) => { + this.voucher = data.voucher; + this.form.get('date').setValue(moment(this.voucher.date, 'DD-MMM-YYYY').toDate()); + this.form.setControl('incentives', this.fb.array( + this.voucher.incentives.map( + x => this.fb.group({ + points: x.points + }) + ) + )); + this.dataSource = new IncentiveDataSource(this.incentiveObservable); + this.incentiveObservable.next(this.voucher.incentives); + }); + } + + createForm() { + this.form = this.fb.group({ + date: '', + incentives: this.fb.array([]) + }); + } + + listenToDateChange(): void { + this.form.get('date').valueChanges.pipe( + map(x => moment(x).format('DD-MMM-YYYY')) + ).subscribe(x => { + if (x !== this.voucher.date && !this.voucher.id) { + return this.ser.getIncentive(x) + .subscribe((voucher: Voucher) => { + this.voucher = voucher; + this.form.get('date').setValue(moment(this.voucher.date, 'DD-MMM-YYYY').toDate()); + this.form.setControl('incentives', this.fb.array( + this.voucher.incentives.map( + i => this.fb.group({ + points: i.points + }) + ) + )); + this.dataSource = new IncentiveDataSource(this.incentiveObservable); + this.incentiveObservable.next(this.voucher.incentives); + }); + } + }); + } + + totalPoints() { + return this.voucher.incentives.map((item) => { + return item.daysWorked * item.points; + }).reduce((sum, item) => { + return sum + item; + }); + } + + pointValue() { + return Math.round(this.voucher.incentive * 100 / this.totalPoints()) / 100; + } + + less(row: Incentive, i: number) { + if (row.points >= 1) { + row.points -= 1; + this.form.get('incentives').get('' + i).setValue({'points': '' + row.points}); + } + } + + more(row: Incentive, i: number) { + row.points += 1; + this.form.get('incentives').get('' + i).setValue({'points': '' + row.points}); + } + + amount(row) { + return row.points * row.daysWorked * this.pointValue(); + } + + canSave() { + if (!this.voucher.id) { + return true; + } else if (this.voucher.posted && this.auth.user.perms.indexOf('Edit Posted Vouchers') !== -1) { + return true; + } else { + return this.voucher.user.id === this.auth.user.id || this.auth.user.perms.indexOf('Edit Other User\'s Vouchers') !== -1; + } + } + + post() { + this.ser.post(this.voucher.id) + .subscribe( + (result) => { + this.toaster.show('Success', 'Voucher Posted'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + save() { + this.ser.save(this.getVoucher()) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigate(['/Incentive', result.id]); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + getVoucher(): Voucher { + const formModel = this.form.value; + this.voucher.date = moment(formModel.date).format('DD-MMM-YYYY'); + const array = this.form.get('attendances') as FormArray; + this.voucher.incentives.forEach((item, index) => { + item.points = array.controls[index].value.points; + }); + this.voucher.narration = formModel.narration; + return this.voucher; + } + + delete() { + this.ser.delete(this.voucher.id) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigate(['/Incentive'], {replaceUrl: true}); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + confirmDelete(): void { + const dialogRef = this.dialog.open(ConfirmDialogComponent, { + width: '250px', + data: {title: 'Delete Voucher?', content: 'Are you sure? This cannot be undone.'} + }); + + dialogRef.afterClosed().subscribe((result: boolean) => { + if (result) { + this.delete(); + } + }); + } +} diff --git a/overlord/src/app/incentive/incentive.module.spec.ts b/overlord/src/app/incentive/incentive.module.spec.ts new file mode 100644 index 00000000..1d7311d7 --- /dev/null +++ b/overlord/src/app/incentive/incentive.module.spec.ts @@ -0,0 +1,13 @@ +import {IncentiveModule} from './incentive.module'; + +describe('IncentiveModule', () => { + let incentiveModule: IncentiveModule; + + beforeEach(() => { + incentiveModule = new IncentiveModule(); + }); + + it('should create an instance', () => { + expect(incentiveModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/incentive/incentive.module.ts b/overlord/src/app/incentive/incentive.module.ts new file mode 100644 index 00000000..df8e561a --- /dev/null +++ b/overlord/src/app/incentive/incentive.module.ts @@ -0,0 +1,79 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {ReactiveFormsModule} from '@angular/forms'; +import {CdkTableModule} from '@angular/cdk/table'; +import {IncentiveRoutingModule} from './incentive-routing.module'; +import {IncentiveComponent} from './incentive.component'; +import {MomentDateAdapter} from '@angular/material-moment-adapter'; +import {A11yModule} from '@angular/cdk/a11y'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + IncentiveRoutingModule + ], + declarations: [ + IncentiveComponent + ], + providers: [ + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, + ] +}) +export class IncentiveModule { +} diff --git a/overlord/src/app/incentive/incentive.service.spec.ts b/overlord/src/app/incentive/incentive.service.spec.ts new file mode 100644 index 00000000..d3c5a0fc --- /dev/null +++ b/overlord/src/app/incentive/incentive.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {VoucherService} from './incentive.service'; + +describe('IncentiveService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [VoucherService] + }); + }); + + it('should be created', inject([VoucherService], (service: VoucherService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/issue/issue-datasource.ts b/overlord/src/app/issue/issue-datasource.ts new file mode 100644 index 00000000..7e88d8b7 --- /dev/null +++ b/overlord/src/app/issue/issue-datasource.ts @@ -0,0 +1,18 @@ +import {DataSource} from '@angular/cdk/collections'; +import {Observable} from 'rxjs'; +import {Inventory, Journal} from '../journal/voucher'; + + +export class IssueDataSource extends DataSource { + + constructor(private data: Observable) { + super(); + } + + connect(): Observable { + return this.data; + } + + disconnect() { + } +} diff --git a/overlord/src/app/issue/issue-dialog.component.css b/overlord/src/app/issue/issue-dialog.component.css new file mode 100644 index 00000000..e69de29b diff --git a/overlord/src/app/issue/issue-dialog.component.html b/overlord/src/app/issue/issue-dialog.component.html new file mode 100644 index 00000000..de176416 --- /dev/null +++ b/overlord/src/app/issue/issue-dialog.component.html @@ -0,0 +1,25 @@ +

    Edit Issue Entry

    +
    +
    +
    + + + + {{batch.name}} + + + + Quantity + + +
    +
    +
    +
    + + +
    + diff --git a/overlord/src/app/issue/issue-dialog.component.spec.ts b/overlord/src/app/issue/issue-dialog.component.spec.ts new file mode 100644 index 00000000..8340c52d --- /dev/null +++ b/overlord/src/app/issue/issue-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { IssueDialogComponent } from './issue-dialog.component'; + +describe('IssueDialogComponent', () => { + let component: IssueDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ IssueDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(IssueDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/issue/issue-dialog.component.ts b/overlord/src/app/issue/issue-dialog.component.ts new file mode 100644 index 00000000..04d3436e --- /dev/null +++ b/overlord/src/app/issue/issue-dialog.component.ts @@ -0,0 +1,74 @@ +import {Component, Inject, OnInit} from '@angular/core'; +import {MAT_DIALOG_DATA, MatAutocompleteSelectedEvent, MatDialogRef} from '@angular/material'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {debounceTime, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators'; +import {Observable, of as observableOf} from 'rxjs'; +import {Batch} from '../journal/voucher'; +import {BatchService} from '../purchase-return/batch.service'; + +@Component({ + selector: 'app-issue-dialog', + templateUrl: './issue-dialog.component.html', + styleUrls: ['./issue-dialog.component.css'] +}) +export class IssueDialogComponent implements OnInit { + batches: Observable; + form: FormGroup; + batch: Batch; + + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any, + private fb: FormBuilder, + private batchSer: BatchService) { + this.createForm(); + this.listenToBatchAutocompleteChange(); + } + + ngOnInit() { + this.form.setValue({ + batch: this.data.inventory.batch, + quantity: this.data.inventory.quantity + }); + this.batch = this.data.inventory.batch; + } + + createForm() { + this.form = this.fb.group({ + batch: '', + quantity: '' + }); + } + + listenToBatchAutocompleteChange(): void { + const control = this.form.get('batch'); + this.batches = control.valueChanges + .pipe( + startWith(null), + map(x => (x !== null && x.length >= 1) ? x : null), + debounceTime(150), + distinctUntilChanged(), + switchMap(x => (x === null) ? observableOf([]) : this.batchSer.autocomplete(this.data.date, x))); + } + + displayBatchName(batch?: Batch): string | undefined { + return batch ? batch.name : undefined; + } + + batchSelected(event: MatAutocompleteSelectedEvent): void { + this.batch = event.option.value; + } + + accept(): void { + const formValue = this.form.value; + const quantity = +(formValue.quantity); + this.data.inventory.batch = this.batch; + this.data.inventory.product = this.batch.product; + this.data.inventory.quantity = quantity; + this.data.inventory.rate = this.batch.rate; + this.data.inventory.tax = this.batch.tax; + this.data.inventory.discount = this.batch.discount; + this.data.inventory.amount = quantity * this.batch.rate * (1 + this.batch.tax) * (1 - this.batch.discount); + this.dialogRef.close(this.data.inventory); + } +} diff --git a/overlord/src/app/issue/issue-grid-datasource.ts b/overlord/src/app/issue/issue-grid-datasource.ts new file mode 100644 index 00000000..6dcdd333 --- /dev/null +++ b/overlord/src/app/issue/issue-grid-datasource.ts @@ -0,0 +1,17 @@ +import {DataSource} from '@angular/cdk/collections'; +import {Observable} from 'rxjs'; + + +export class IssueGridDataSource extends DataSource { + + constructor(private data: Observable) { + super(); + } + + connect(): Observable { + return this.data; + } + + disconnect() { + } +} diff --git a/overlord/src/app/issue/issue-grid.service.spec.ts b/overlord/src/app/issue/issue-grid.service.spec.ts new file mode 100644 index 00000000..ba07d3bd --- /dev/null +++ b/overlord/src/app/issue/issue-grid.service.spec.ts @@ -0,0 +1,15 @@ +import { TestBed, inject } from '@angular/core/testing'; + +import { IssueGridService } from './issue-grid.service'; + +describe('IssueGridService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [IssueGridService] + }); + }); + + it('should be created', inject([IssueGridService], (service: IssueGridService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/issue/issue-grid.service.ts b/overlord/src/app/issue/issue-grid.service.ts new file mode 100644 index 00000000..6e2d3c43 --- /dev/null +++ b/overlord/src/app/issue/issue-grid.service.ts @@ -0,0 +1,24 @@ +import {Injectable} from '@angular/core'; +import {HttpClient, HttpParams} from '@angular/common/http'; +import {ErrorLoggerService} from '../core/error-logger.service'; +import {catchError} from 'rxjs/operators'; +import {Observable} from 'rxjs/internal/Observable'; + +const url = '/api/IssueGrid'; +const serviceName = 'BatchService'; + +@Injectable({ + providedIn: 'root' +}) +export class IssueGridService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + issueGrid(date: string): Observable { + return >this.http.get(`${url}/${date}`) + .pipe( + catchError(this.log.handleError(serviceName, 'autocomplete')) + ); + } +} diff --git a/overlord/src/app/issue/issue-resolver.service.spec.ts b/overlord/src/app/issue/issue-resolver.service.spec.ts new file mode 100644 index 00000000..43443e0a --- /dev/null +++ b/overlord/src/app/issue/issue-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {IssueResolver} from './issue-resolver.service'; + +describe('IssueResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [IssueResolver] + }); + }); + + it('should be created', inject([IssueResolver], (service: IssueResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/issue/issue-resolver.service.ts b/overlord/src/app/issue/issue-resolver.service.ts new file mode 100644 index 00000000..a9699da0 --- /dev/null +++ b/overlord/src/app/issue/issue-resolver.service.ts @@ -0,0 +1,23 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {Voucher} from '../journal/voucher'; +import {VoucherService} from '../journal/voucher.service'; + +@Injectable({ + providedIn: 'root' +}) +export class IssueResolver implements Resolve { + + constructor(private ser: VoucherService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const id = route.paramMap.get('id'); + if (id === null) { + return this.ser.getOfType('Issue'); + } else { + return this.ser.get(id); + } + } +} diff --git a/overlord/src/app/issue/issue-routing.module.spec.ts b/overlord/src/app/issue/issue-routing.module.spec.ts new file mode 100644 index 00000000..a05aa786 --- /dev/null +++ b/overlord/src/app/issue/issue-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {IssueRoutingModule} from './issue-routing.module'; + +describe('IssueRoutingModule', () => { + let issueRoutingModule: IssueRoutingModule; + + beforeEach(() => { + issueRoutingModule = new IssueRoutingModule(); + }); + + it('should create an instance', () => { + expect(issueRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/issue/issue-routing.module.ts b/overlord/src/app/issue/issue-routing.module.ts new file mode 100644 index 00000000..8faef6a2 --- /dev/null +++ b/overlord/src/app/issue/issue-routing.module.ts @@ -0,0 +1,52 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {IssueResolver} from './issue-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {IssueComponent} from './issue.component'; +import {CostCentreListResolver} from '../cost-centre/cost-centre-list-resolver.service'; + +const issueRoutes: Routes = [ + { + path: 'Issue', + component: IssueComponent, + canActivate: [AuthGuard], + data: { + permission: 'Issue' + }, + resolve: { + voucher: IssueResolver, + costCentres: CostCentreListResolver + }, + runGuardsAndResolvers: 'always' + }, + { + path: 'Issue/:id', + component: IssueComponent, + canActivate: [AuthGuard], + data: { + permission: 'Issue' + }, + resolve: { + voucher: IssueResolver, + costCentres: CostCentreListResolver + }, + runGuardsAndResolvers: 'always' + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(issueRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + IssueResolver + ] +}) +export class IssueRoutingModule { +} diff --git a/overlord/src/app/issue/issue.component.css b/overlord/src/app/issue/issue.component.css new file mode 100644 index 00000000..a592a823 --- /dev/null +++ b/overlord/src/app/issue/issue.component.css @@ -0,0 +1,32 @@ +.right { + display: flex; + justify-content: flex-end; +} + +.selected { + background: #fff3cd +} + +.unposted { + background: #f8d7da +} + +.center { + display: flex; + justify-content: center; +} + +.img-container { + position: relative; +} + +.img-container .overlay { + display: none; +} + +.img-container:hover > .overlay { + display: inline-block; + position: absolute; + left: 60px; + top: 0; +} diff --git a/overlord/src/app/issue/issue.component.html b/overlord/src/app/issue/issue.component.html new file mode 100644 index 00000000..3e1e80c0 --- /dev/null +++ b/overlord/src/app/issue/issue.component.html @@ -0,0 +1,159 @@ + + + Issue + + +
    +
    + + + + + + + + + {{ costCentre.name }} + + + + + + + {{ costCentre.name }} + + + + + Amount + ₹ + + +
    + +
    + + + + {{batch.name}} + + + + Quantity + + + + +
    + + + + + Product + {{row.product.name}} + + + + + Batch + {{row.batch.name}} + + + + + Quantity + {{row.quantity | number:'1.2-2'}} + + + + + Rate + {{row.rate | currency:'INR'}} + + + + + Amount + {{row.amount | currency:'INR'}} + + + + + Action + + + + + + + + + + + Narration + + +
    +
    + + + + + + + Created on {{voucher.creationDate | localTime}} and + Last Edited on {{voucher.lastEditDate | localTime}} + by {{voucher.user.name}}. {{(voucher.poster) ? 'Posted by ' + voucher.poster : ''}} + + Other issues for the day + + + + + + Source + {{row.source}} + + + + + Destination + {{row.destination}} + + + + + Amount + {{row.amount | currency:'INR'}} + + + + + Load + + + + + + + + + +
    diff --git a/overlord/src/app/issue/issue.component.spec.ts b/overlord/src/app/issue/issue.component.spec.ts new file mode 100644 index 00000000..f597f040 --- /dev/null +++ b/overlord/src/app/issue/issue.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {IssueComponent} from './issue.component'; + +describe('IssueComponent', () => { + let component: IssueComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [IssueComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(IssueComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/issue/issue.component.ts b/overlord/src/app/issue/issue.component.ts new file mode 100644 index 00000000..8075c51c --- /dev/null +++ b/overlord/src/app/issue/issue.component.ts @@ -0,0 +1,302 @@ +import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MatAutocompleteSelectedEvent, MatDialog} from '@angular/material'; +import {ActivatedRoute, Router} from '@angular/router'; +import {BehaviorSubject, Observable, of as observableOf} from 'rxjs'; +import {debounceTime, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators'; +import {IssueDataSource} from './issue-datasource'; +import {VoucherService} from '../journal/voucher.service'; +import {Batch, Inventory, Journal, Voucher} from '../journal/voucher'; +import * as moment from 'moment'; +import {AuthService} from '../auth/auth.service'; +import {ConfirmDialogComponent} from '../shared/confirm-dialog/confirm-dialog.component'; +import {ToasterService} from '../core/toaster.service'; +import {IssueDialogComponent} from './issue-dialog.component'; +import {BatchService} from '../purchase-return/batch.service'; +import {IssueGridService} from './issue-grid.service'; +import {CostCentre} from '../cost-centre/cost-centre'; +import {IssueGridDataSource} from './issue-grid-datasource'; + +@Component({ + selector: 'app-issue', + templateUrl: './issue.component.html', + styleUrls: ['./issue.component.css'] +}) +export class IssueComponent implements OnInit, AfterViewInit { + @ViewChild('batchElement') batchElement: ElementRef; + public inventoryObservable = new BehaviorSubject([]); + public gridObservable = new BehaviorSubject([]); + dataSource: IssueDataSource; + gridDataSource: IssueGridDataSource; + form: FormGroup; + sourceJournal: Journal; + destinationJournal: Journal; + voucher: Voucher; + costCentres: CostCentre[]; + batch: Batch; + + displayedColumns = ['product', 'batch', 'quantity', 'rate', 'amount', 'action']; + gridColumns = ['source', 'destination', 'gridAmount', 'load']; + + batches: Observable; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder, + private dialog: MatDialog, + private toaster: ToasterService, + private auth: AuthService, + private ser: VoucherService, + private batchSer: BatchService, + private issueGridSer: IssueGridService + ) { + this.createForm(); + this.listenToBatchAutocompleteChange(); + this.listenToDateChange(); + } + + ngOnInit() { + this.gridDataSource = new IssueGridDataSource(this.gridObservable); + this.route.data + .subscribe((data: { voucher: Voucher, costCentres: CostCentre[] }) => { + this.costCentres = data.costCentres; + this.loadVoucher(data.voucher); + }); + } + + ngAfterViewInit() { + this.focusBatch(); + } + + loadVoucher(voucher: Voucher) { + this.voucher = voucher; + this.sourceJournal = this.voucher.journals.filter(x => x.debit === -1)[0]; + this.destinationJournal = this.voucher.journals.filter(x => x.debit === 1)[0]; + this.form.setValue({ + date: moment(this.voucher.date, 'DD-MMM-YYYY').toDate(), + sourceCostCentre: this.sourceJournal.costCentre.id, + destinationCostCentre: this.destinationJournal.costCentre.id, + amount: this.sourceJournal.amount, + addRow: { + batch: '', + quantity: '' + }, + narration: this.voucher.narration + }); + this.dataSource = new IssueDataSource(this.inventoryObservable); + this.updateView(); + } + + focusBatch() { + setTimeout(() => { + this.batchElement.nativeElement.focus(); + }, 0); + } + + addRow() { + const formValue = this.form.get('addRow').value; + const quantity = +(formValue.quantity); + const isConsumption = this.voucher.journals + .filter( + x => x.debit === -1 + )[0].costCentre.id === '7b845f95-dfef-fa4a-897c-f0baf15284a3'; + if (this.batch === null || quantity <= 0) { + return; + } + const oldFiltered = this.voucher.inventories.filter((x) => x.product.id === this.batch.product.id); + const old = oldFiltered.length ? oldFiltered[0] : null; + if (oldFiltered.length) { + if (old.batch.id !== this.batch.id) { + this.toaster.show('Danger', 'Product with a different batch already added'); + return; + } + if (isConsumption && old.quantity + quantity > this.batch.quantityRemaining) { + this.toaster.show('Danger', 'Quantity issued cannot be more than quantity available'); + return; + } + old.quantity += quantity; + } else { + if (isConsumption && quantity > this.batch.quantityRemaining) { + this.toaster.show('Danger', 'Quantity issued cannot be more than quantity available'); + return; + } + this.voucher.inventories.push({ + id: null, + quantity: quantity, + rate: this.batch.rate, + tax: this.batch.tax, + discount: this.batch.discount, + amount: quantity * this.batch.rate * (1 + this.batch.tax) * (1 - this.batch.discount), + product: this.batch.product, + batch: this.batch + }); + } + this.resetAddRow(); + this.updateView(); + } + + resetAddRow() { + this.form.get('addRow').reset({ + batch: null, + quantity: '' + }); + this.batch = null; + setTimeout(() => { + this.batchElement.nativeElement.focus(); + }, 0); + } + + updateView() { + this.inventoryObservable.next(this.voucher.inventories); + const amount = Math.abs(this.voucher.inventories.map((x) => x.amount).reduce((p, c) => p + c, 0)); + this.sourceJournal.amount = amount; + this.destinationJournal.amount = amount; + this.form.get('amount').setValue(amount); + } + + editRow(row: Inventory) { + const dialogRef = this.dialog.open(IssueDialogComponent, { + width: '750px', + data: {inventory: Object.assign({}, row), date: moment(this.form.value.date).format('DD-MMM-YYYY')} + }); + + dialogRef.afterClosed().subscribe((result: boolean | Inventory) => { + if (!result) { + return; + } + const j = result as Inventory; + if (j.product.id !== row.product.id && this.voucher.inventories.filter((x) => x.product.id === j.product.id).length) { + return; + } + Object.assign(row, j); + this.updateView(); + }); + } + + deleteRow(row: Inventory) { + this.voucher.inventories.splice(this.voucher.inventories.indexOf(row), 1); + this.updateView(); + } + + createForm() { + this.form = this.fb.group({ + date: '', + sourceCostCentre: '', + destinationCostCentre: '', + amount: {value: '', disabled: true}, + addRow: this.fb.group({ + batch: '', + quantity: '' + }), + narration: '' + }); + } + + canSave() { + if (!this.voucher.id) { + return true; + } else if (this.voucher.posted && this.auth.user.perms.indexOf('Edit Posted Vouchers') !== -1) { + return true; + } else { + return this.voucher.user.id === this.auth.user.id || this.auth.user.perms.indexOf('Edit Other User\'s Vouchers') !== -1; + } + } + + save() { + this.ser.save(this.getVoucher()) + .subscribe( + (result) => { + this.loadVoucher(result); + this.toaster.show('Success', ''); + this.router.navigate(['/Issue', result.id]); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + newVoucher() { + this.router.navigate(['/Issue']); + } + + getVoucher(): Voucher { + const formModel = this.form.value; + this.voucher.date = moment(formModel.date).format('DD-MMM-YYYY'); + this.sourceJournal.costCentre.id = formModel.sourceCostCentre; + this.destinationJournal.costCentre.id = formModel.destinationCostCentre; + this.voucher.narration = formModel.narration; + return this.voucher; + } + + delete() { + this.ser.delete(this.voucher.id) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigate(['/Issue'], {replaceUrl: true}); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + confirmDelete(): void { + const dialogRef = this.dialog.open(ConfirmDialogComponent, { + width: '250px', + data: {title: 'Delete Voucher?', content: 'Are you sure? This cannot be undone.'} + }); + + dialogRef.afterClosed().subscribe((result: boolean) => { + if (result) { + this.delete(); + } + }); + } + + listenToBatchAutocompleteChange(): void { + const control = this.form.get('addRow').get('batch'); + this.batches = control.valueChanges + .pipe( + startWith(null), + map(x => (x !== null && x.length >= 1) ? x : null), + debounceTime(150), + distinctUntilChanged(), + switchMap( + x => (x === null) ? observableOf([]) : this.batchSer.autocomplete( + moment(this.form.value.date).format('DD-MMM-YYYY'), x + ) + ) + ); + } + + listenToDateChange(): void { + this.form.get('date').valueChanges + .pipe( + map(x => moment(x).format('DD-MMM-YYYY')) + ) + .subscribe(x => this.showGrid(x)); + } + + showGrid(date: string) { + this.issueGridSer.issueGrid(date) + .subscribe( + x => this.gridObservable.next(x) + ); + } + + displayBatchName(batch?: Batch): string | undefined { + return batch ? batch.name : undefined; + } + + batchSelected(event: MatAutocompleteSelectedEvent): void { + this.batch = event.option.value; + } + + goToVoucher(id: string) { + this.router.navigate(['/Issue', id]); + } + +} diff --git a/overlord/src/app/issue/issue.module.spec.ts b/overlord/src/app/issue/issue.module.spec.ts new file mode 100644 index 00000000..e6d2f7db --- /dev/null +++ b/overlord/src/app/issue/issue.module.spec.ts @@ -0,0 +1,13 @@ +import {IssueModule} from './issue.module'; + +describe('IssueModule', () => { + let issueModule: IssueModule; + + beforeEach(() => { + issueModule = new IssueModule(); + }); + + it('should create an instance', () => { + expect(issueModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/issue/issue.module.ts b/overlord/src/app/issue/issue.module.ts new file mode 100644 index 00000000..88405556 --- /dev/null +++ b/overlord/src/app/issue/issue.module.ts @@ -0,0 +1,84 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {ReactiveFormsModule} from '@angular/forms'; +import {CdkTableModule} from '@angular/cdk/table'; +import {IssueRoutingModule} from './issue-routing.module'; +import {IssueComponent} from './issue.component'; +import {MomentDateAdapter} from '@angular/material-moment-adapter'; +import {A11yModule} from '@angular/cdk/a11y'; +import {IssueDialogComponent} from './issue-dialog.component'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + IssueRoutingModule + ], + declarations: [ + IssueComponent, + IssueDialogComponent + ], + providers: [ + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, + ], + entryComponents: [ + IssueDialogComponent + ] +}) +export class IssueModule { +} diff --git a/overlord/src/app/issue/issue.service.spec.ts b/overlord/src/app/issue/issue.service.spec.ts new file mode 100644 index 00000000..2f54878e --- /dev/null +++ b/overlord/src/app/issue/issue.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {VoucherService} from './issue.service'; + +describe('IssueService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [VoucherService] + }); + }); + + it('should be created', inject([VoucherService], (service: VoucherService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/journal/journal-datasource.ts b/overlord/src/app/journal/journal-datasource.ts new file mode 100644 index 00000000..2ccc5dab --- /dev/null +++ b/overlord/src/app/journal/journal-datasource.ts @@ -0,0 +1,18 @@ +import {DataSource} from '@angular/cdk/collections'; +import {Observable} from 'rxjs'; +import {Journal} from './voucher'; + + +export class JournalDataSource extends DataSource { + + constructor(private data: Observable) { + super(); + } + + connect(): Observable { + return this.data; + } + + disconnect() { + } +} diff --git a/overlord/src/app/journal/journal-dialog.component.css b/overlord/src/app/journal/journal-dialog.component.css new file mode 100644 index 00000000..e69de29b diff --git a/overlord/src/app/journal/journal-dialog.component.html b/overlord/src/app/journal/journal-dialog.component.html new file mode 100644 index 00000000..2ff790a4 --- /dev/null +++ b/overlord/src/app/journal/journal-dialog.component.html @@ -0,0 +1,36 @@ +

    Edit Journal Entry

    +
    +
    +
    + + + Dr + Cr + + + + + + Balance as on Date: {{accBal.date | currency:'INR' | accounting}} / + Final balance: {{accBal.total | currency:'INR' | accounting}} + + + + {{account.name}} + + + Amount + ₹ + + +
    +
    +
    +
    + + +
    + diff --git a/overlord/src/app/journal/journal-dialog.component.spec.ts b/overlord/src/app/journal/journal-dialog.component.spec.ts new file mode 100644 index 00000000..ea34bb48 --- /dev/null +++ b/overlord/src/app/journal/journal-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { JournalDialogComponent } from './journal-dialog.component'; + +describe('JournalDialogComponent', () => { + let component: JournalDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ JournalDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(JournalDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/journal/journal-dialog.component.ts b/overlord/src/app/journal/journal-dialog.component.ts new file mode 100644 index 00000000..6caa9f10 --- /dev/null +++ b/overlord/src/app/journal/journal-dialog.component.ts @@ -0,0 +1,80 @@ +import {Component, Inject, OnInit} from '@angular/core'; +import {MAT_DIALOG_DATA, MatAutocompleteSelectedEvent, MatDialogRef} from '@angular/material'; +import {debounceTime, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators'; +import {Account} from '../account/account'; +import {AccountService} from '../account/account.service'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {Observable, of as observableOf} from 'rxjs'; + +@Component({ + selector: 'app-journal-dialog', + templateUrl: './journal-dialog.component.html', + styleUrls: ['./journal-dialog.component.css'] +}) +export class JournalDialogComponent implements OnInit { + accounts: Observable; + form: FormGroup; + account: Account; + accBal: any; + + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any, + private fb: FormBuilder, + private accountSer: AccountService) { + this.createForm(); + this.setupAccountAutocomplete(); + } + + ngOnInit() { + this.form.setValue({ + debit: '' + this.data.journal.debit, + account: this.data.journal.account, + amount: this.data.journal.amount + }); + this.account = this.data.journal.account; + } + + createForm() { + this.form = this.fb.group({ + debit: '1', + account: '', + amount: '' + }); + this.accBal = null; + } + + setupAccountAutocomplete(): void { + const control = this.form.get('account'); + this.accounts = control.valueChanges + .pipe( + startWith(null), + map(x => (x !== null && x.length >= 1) ? x : null), + debounceTime(150), + distinctUntilChanged(), + switchMap(x => (x === null) ? observableOf([]) : this.accountSer.autocomplete(x)) + ); + + } + + displayAccount(account?: Account): string | undefined { + return account ? account.name : undefined; + } + + accountSelected(event: MatAutocompleteSelectedEvent): void { + this.account = event.option.value; + this.accountSer.balance(this.account.id, this.data.date).subscribe((v) => { + this.accBal = v; + }); + } + + accept(): void { + const formValue = this.form.value; + const debit = +formValue.debit; + const amount = +formValue.amount; + this.data.journal.debit = debit; + this.data.journal.account = this.account; + this.data.journal.amount = amount; + this.dialogRef.close(this.data.journal); + } +} diff --git a/overlord/src/app/journal/journal-resolver.service.spec.ts b/overlord/src/app/journal/journal-resolver.service.spec.ts new file mode 100644 index 00000000..c2b1cd86 --- /dev/null +++ b/overlord/src/app/journal/journal-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {JournalResolver} from './journal-resolver.service'; + +describe('JournalResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [JournalResolver] + }); + }); + + it('should be created', inject([JournalResolver], (service: JournalResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/journal/journal-resolver.service.ts b/overlord/src/app/journal/journal-resolver.service.ts new file mode 100644 index 00000000..0119e7a6 --- /dev/null +++ b/overlord/src/app/journal/journal-resolver.service.ts @@ -0,0 +1,23 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {Voucher} from './voucher'; +import {VoucherService} from './voucher.service'; + +@Injectable({ + providedIn: 'root' +}) +export class JournalResolver implements Resolve { + + constructor(private ser: VoucherService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const id = route.paramMap.get('id'); + if (id === null) { + return this.ser.getOfType('Journal'); + } else { + return this.ser.get(id); + } + } +} diff --git a/overlord/src/app/journal/journal-routing.module.spec.ts b/overlord/src/app/journal/journal-routing.module.spec.ts new file mode 100644 index 00000000..0269aced --- /dev/null +++ b/overlord/src/app/journal/journal-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {JournalRoutingModule} from './journal-routing.module'; + +describe('JournalRoutingModule', () => { + let journalRoutingModule: JournalRoutingModule; + + beforeEach(() => { + journalRoutingModule = new JournalRoutingModule(); + }); + + it('should create an instance', () => { + expect(journalRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/journal/journal-routing.module.ts b/overlord/src/app/journal/journal-routing.module.ts new file mode 100644 index 00000000..cdb96968 --- /dev/null +++ b/overlord/src/app/journal/journal-routing.module.ts @@ -0,0 +1,49 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {JournalResolver} from './journal-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {JournalComponent} from './journal.component'; + +const journalRoutes: Routes = [ + { + path: 'Journal', + component: JournalComponent, + canActivate: [AuthGuard], + data: { + permission: 'Journal' + }, + resolve: { + voucher: JournalResolver + }, + runGuardsAndResolvers: 'always' + }, + { + path: 'Journal/:id', + component: JournalComponent, + canActivate: [AuthGuard], + data: { + permission: 'Journal' + }, + resolve: { + voucher: JournalResolver + }, + runGuardsAndResolvers: 'always' + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(journalRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + JournalResolver + ] +}) +export class JournalRoutingModule { +} diff --git a/overlord/src/app/journal/journal.component.css b/overlord/src/app/journal/journal.component.css new file mode 100644 index 00000000..a592a823 --- /dev/null +++ b/overlord/src/app/journal/journal.component.css @@ -0,0 +1,32 @@ +.right { + display: flex; + justify-content: flex-end; +} + +.selected { + background: #fff3cd +} + +.unposted { + background: #f8d7da +} + +.center { + display: flex; + justify-content: center; +} + +.img-container { + position: relative; +} + +.img-container .overlay { + display: none; +} + +.img-container:hover > .overlay { + display: inline-block; + position: absolute; + left: 60px; + top: 0; +} diff --git a/overlord/src/app/journal/journal.component.html b/overlord/src/app/journal/journal.component.html new file mode 100644 index 00000000..31149824 --- /dev/null +++ b/overlord/src/app/journal/journal.component.html @@ -0,0 +1,111 @@ + + + Journal + + +
    +
    + + + + + +
    +
    + + + Dr + Cr + + + + + + Balance as on Date: {{accBal.date | currency:'INR' | accounting}} / + Final balance: {{accBal.total | currency:'INR' | accounting}} + + + + {{account.name}} + + + Amount + ₹ + + + + +
    + + + + + Debit + {{(row.debit === 1)?'Dr':'Cr'}} + + + + + Account + {{row.account.name}} + + + + + Amount + {{row.amount | currency:'INR'}} + + + + + Action + + + + + + + + + + + Narration + + +
    +
    + + +
    +
    + +
    +
    + + + + + + + Created on {{voucher.creationDate | localTime}} and + Last Edited on {{voucher.lastEditDate | localTime}} + by {{voucher.user.name}}. {{(voucher.poster) ? 'Posted by ' + voucher.poster : ''}} + +
    diff --git a/overlord/src/app/journal/journal.component.spec.ts b/overlord/src/app/journal/journal.component.spec.ts new file mode 100644 index 00000000..a7a90658 --- /dev/null +++ b/overlord/src/app/journal/journal.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {JournalComponent} from './journal.component'; + +describe('JournalComponent', () => { + let component: JournalComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [JournalComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(JournalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/journal/journal.component.ts b/overlord/src/app/journal/journal.component.ts new file mode 100644 index 00000000..8188523f --- /dev/null +++ b/overlord/src/app/journal/journal.component.ts @@ -0,0 +1,320 @@ +import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MatAutocompleteSelectedEvent, MatDialog} from '@angular/material'; +import {ActivatedRoute, Router} from '@angular/router'; +import {BehaviorSubject, fromEvent, Observable, of as observableOf, zip} from 'rxjs'; +import {JournalDataSource} from './journal-datasource'; +import {Account} from '../account/account'; +import {VoucherService} from './voucher.service'; +import {AccountService} from '../account/account.service'; +import {DbFile, Journal, Voucher} from './voucher'; +import * as moment from 'moment'; +import {AuthService} from '../auth/auth.service'; +import {ConfirmDialogComponent} from '../shared/confirm-dialog/confirm-dialog.component'; +import {ToasterService} from '../core/toaster.service'; +import {debounceTime, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators'; +import {JournalDialogComponent} from './journal-dialog.component'; +import {ImageDialogComponent} from '../shared/image-dialog/image-dialog.component'; + +@Component({ + selector: 'app-journal', + templateUrl: './journal.component.html', + styleUrls: ['./journal.component.css'] +}) +export class JournalComponent implements OnInit, AfterViewInit { + @ViewChild('accountElement') accountElement: ElementRef; + public journalObservable = new BehaviorSubject([]); + dataSource: JournalDataSource; + form: FormGroup; + voucher: Voucher; + account: Account; + accBal: any; + + displayedColumns = ['debit', 'account', 'amount', 'action']; + + accounts: Observable; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder, + private dialog: MatDialog, + private toaster: ToasterService, + private auth: AuthService, + private ser: VoucherService, + private accountSer: AccountService + ) { + this.createForm(); + this.setupAccountAutocomplete(); + } + + ngOnInit() { + this.route.data + .subscribe((data: { voucher: Voucher }) => { + this.loadVoucher(data.voucher); + }); + } + + ngAfterViewInit() { + this.focusAccount(); + } + + loadVoucher(voucher) { + this.voucher = voucher; + this.form.setValue({ + date: moment(this.voucher.date, 'DD-MMM-YYYY').toDate(), + addRow: { + debit: '1', + account: '', + amount: 0 + }, + narration: this.voucher.narration + }); + this.dataSource = new JournalDataSource(this.journalObservable); + this.journalObservable.next(this.voucher.journals); + } + + focusAccount() { + setTimeout(() => { + this.accountElement.nativeElement.focus(); + }, 0); + } + + addRow() { + const formValue = this.form.get('addRow').value; + const amount = +formValue.amount; + const debit = +formValue.debit; + if (this.account === null || amount === 0) { + return; + } + const oldFiltered = this.voucher.journals.filter((x) => x.account.id === this.account.id); + const old = oldFiltered.length ? oldFiltered[0] : null; + if (old) { + const a = (old.debit * old.amount) + (debit * amount); + old.debit = (a < 0) ? -1 : 1; + old.amount = Math.abs(a); + } else { + this.voucher.journals.push({ + id: null, + debit: debit, + amount: amount, + account: this.account, + costCentre: null + }); + } + this.journalObservable.next(this.voucher.journals); + this.resetAddRow(); + } + + resetAddRow() { + const amount = Math.abs(this.voucher.journals.map((x) => x.debit * x.amount).reduce((p, c) => p + c)); + const debit = this.form.get('addRow').value.debit; + this.form.get('addRow').reset({ + debit: debit, + account: null, + amount: amount + }); + this.account = null; + this.accBal = null; + setTimeout(() => { + this.accountElement.nativeElement.focus(); + }, 0); + } + + editRow(row: Journal) { + const dialogRef = this.dialog.open(JournalDialogComponent, { + width: '750px', + data: {journal: Object.assign({}, row), date: moment(this.form.get('date').value).format('DD-MMM-YYYY')} + }); + + dialogRef.afterClosed().subscribe((result: boolean | Journal) => { + if (!result) { + return; + } + const j = result as Journal; + if (j.account.id !== row.account.id && this.voucher.journals.filter((x) => x.account.id === j.account.id).length) { + return; + } + Object.assign(row, j); + this.journalObservable.next(this.voucher.journals); + const amount = Math.abs(this.voucher.journals.map((x) => x.debit * x.amount).reduce((p, c) => p + c, 0)); + this.form.get('addRow').patchValue({ + amount: amount + }); + }); + } + + deleteRow(row: Journal) { + this.voucher.journals.splice(this.voucher.journals.indexOf(row), 1); + this.journalObservable.next(this.voucher.journals); + const amount = Math.abs(this.voucher.journals.map((x) => x.debit * x.amount).reduce((p, c) => p + c, 0)); + this.form.get('addRow').patchValue({ + amount: amount + }); + } + + createForm() { + this.form = this.fb.group({ + date: '', + addRow: this.fb.group({ + debit: '1', + account: '', + amount: '' + }), + narration: '' + }); + this.accBal = null; + } + + canSave() { + if (!this.voucher.id) { + return true; + } else if (this.voucher.posted && this.auth.user.perms.indexOf('Edit Posted Vouchers') !== -1) { + return true; + } else { + return this.voucher.user.id === this.auth.user.id || this.auth.user.perms.indexOf('Edit Other User\'s Vouchers') !== -1; + } + } + + post() { + this.ser.post(this.voucher.id) + .subscribe( + (result) => { + this.loadVoucher(result); + this.toaster.show('Success', 'Voucher Posted'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + save() { + this.ser.save(this.getVoucher()) + .subscribe( + (result) => { + this.loadVoucher(result); + this.toaster.show('Success', ''); + this.router.navigate(['/Journal', result.id]); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + getVoucher(): Voucher { + const formModel = this.form.value; + this.voucher.date = moment(formModel.date).format('DD-MMM-YYYY'); + this.voucher.narration = formModel.narration; + return this.voucher; + } + + delete() { + this.ser.delete(this.voucher.id) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigate(['/Journal'], {replaceUrl: true}); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + confirmDelete(): void { + const dialogRef = this.dialog.open(ConfirmDialogComponent, { + width: '250px', + data: {title: 'Delete Voucher?', content: 'Are you sure? This cannot be undone.'} + }); + + dialogRef.afterClosed().subscribe((result: boolean) => { + if (result) { + this.delete(); + } + }); + } + + setupAccountAutocomplete(): void { + const control = this.form.get('addRow').get('account'); + this.accounts = control.valueChanges + .pipe( + startWith(null), + map(x => (x !== null && x.length >= 1) ? x : null), + debounceTime(150), + distinctUntilChanged(), + switchMap(x => (x === null) ? observableOf([]) : this.accountSer.autocomplete(x)) + ); + + } + + displayAccount(account?: Account): string | undefined { + return account ? account.name : undefined; + } + + accountSelected(event: MatAutocompleteSelectedEvent): void { + this.account = event.option.value; + const date = moment(this.form.get('date').value).format('DD-MMM-YYYY'); + this.accountSer.balance(this.account.id, date).subscribe((v) => { + this.accBal = v; + }); + } + + zoomImage(file: DbFile) { + this.dialog.open(ImageDialogComponent, { + width: '750px', + data: file.resized + }); + } + + deleteImage(file: DbFile) { + const index = this.voucher.files.indexOf(file); + this.voucher.files.splice(index, 1); + } + + detectFiles(event) { + const files = event.target.files; + if (files) { + for (const file of files) { + const reader = new FileReader(); + reader.onload = (e: any) => { + zip(observableOf(e.target.result), + this.resizeImage(e.target.result, 100, 150), + this.resizeImage(e.target.result, 825, 1170) + ).subscribe( + val => this.voucher.files.push({id: null, thumbnail: val[1], resized: val[2]}) + ); + }; + reader.readAsDataURL(file); + } + } + } + + resizeImage(image, MAX_WIDTH, MAX_HEIGHT) { + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d'); + const img = new Image(); + const ex = fromEvent(img, 'load').pipe( + map((e) => { + let width = img.naturalWidth, + height = img.naturalHeight; + const ratio = Math.min(1, MAX_WIDTH / width, MAX_HEIGHT / height); + + if (ratio === 1) { + return image; + } + + width *= ratio; + height *= ratio; + + canvas.width = width; + canvas.height = height; + ctx.drawImage(img, 0, 0, width, height); + return canvas.toDataURL('image/jpeg', 0.95); + }) + ); + img.src = image; + return ex; + } +} diff --git a/overlord/src/app/journal/journal.module.spec.ts b/overlord/src/app/journal/journal.module.spec.ts new file mode 100644 index 00000000..2aea2304 --- /dev/null +++ b/overlord/src/app/journal/journal.module.spec.ts @@ -0,0 +1,13 @@ +import {JournalModule} from './journal.module'; + +describe('JournalModule', () => { + let journalModule: JournalModule; + + beforeEach(() => { + journalModule = new JournalModule(); + }); + + it('should create an instance', () => { + expect(journalModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/journal/journal.module.ts b/overlord/src/app/journal/journal.module.ts new file mode 100644 index 00000000..abd85c50 --- /dev/null +++ b/overlord/src/app/journal/journal.module.ts @@ -0,0 +1,84 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {ReactiveFormsModule} from '@angular/forms'; +import {CdkTableModule} from '@angular/cdk/table'; +import {JournalRoutingModule} from './journal-routing.module'; +import {JournalComponent} from './journal.component'; +import {MomentDateAdapter} from '@angular/material-moment-adapter'; +import {A11yModule} from '@angular/cdk/a11y'; +import {JournalDialogComponent} from './journal-dialog.component'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + JournalRoutingModule + ], + declarations: [ + JournalComponent, + JournalDialogComponent + ], + providers: [ + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, + ], + entryComponents: [ + JournalDialogComponent + ] +}) +export class JournalModule { +} diff --git a/overlord/src/app/journal/journal.service.spec.ts b/overlord/src/app/journal/journal.service.spec.ts new file mode 100644 index 00000000..c5f2f91d --- /dev/null +++ b/overlord/src/app/journal/journal.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {VoucherService} from './journal.service'; + +describe('JournalService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [VoucherService] + }); + }); + + it('should be created', inject([VoucherService], (service: VoucherService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/journal/voucher.service.ts b/overlord/src/app/journal/voucher.service.ts new file mode 100644 index 00000000..6d2f01bf --- /dev/null +++ b/overlord/src/app/journal/voucher.service.ts @@ -0,0 +1,97 @@ +import {Injectable} from '@angular/core'; +import {catchError} from 'rxjs/operators'; +import {Observable} from 'rxjs/internal/Observable'; +import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http'; +import {ErrorLoggerService} from '../core/error-logger.service'; +import {Voucher} from './voucher'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; + +const url = '/api/Voucher'; +const serviceName = 'JournalService'; + +@Injectable({ + providedIn: 'root' +}) +export class VoucherService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + get(id: string): Observable { + const options = {params: new HttpParams()}; + return >this.http.get(`${url}/${id}`, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + + getOfType(type: string, account?: string): Observable { + const options = {params: new HttpParams().set('t', type)}; + if (account !== undefined && account !== null) { + options.params = options.params.set('a', account); + } + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + + getIncentive(date: string): Observable { + const options = {params: new HttpParams().set('t', 'Service Charge').set('d', date)}; + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + + post(id: string): Observable { + const options = {params: new HttpParams().set('p', '')}; + return >this.http.post(`${url}/${id}`, {}, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + + delete(id: string): Observable { + return >this.http.delete(`${url}/${id}`, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'delete')) + ); + } + + save(voucher: Voucher): Observable { + const options = { + params: new HttpParams().set('t', voucher.type) + }; + const fd = new FormData(); + voucher.files.filter(x => !x.id).forEach((file, index) => { + fd.append('f' + index, this.dataURLtoBlob(file.resized)); + fd.append('t' + index, this.dataURLtoBlob(file.thumbnail)); + }); + voucher.files = voucher.files.filter(x => x.id); + fd.append('model', JSON.stringify(voucher)); + const saveUrl: string = (voucher.id === undefined || voucher.id === null) ? url : `${url}/${voucher.id}`; + return >this.http.post(saveUrl, fd, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + + dataURLtoBlob(dataURL) { + const re = /^data:([\w/\-\.]+);\w+,(.*)$/; + const m = dataURL.match(re); + const mimeString = m[1]; + const byteString = atob(m[2]); + const ab = new ArrayBuffer(byteString.length); + const dw = new DataView(ab); + let i; + + for (i = 0; i < byteString.length; i++) { + dw.setUint8(i, byteString.charCodeAt(i)); + } + return new Blob([ab], {type: mimeString}); + } +} diff --git a/overlord/src/app/journal/voucher.ts b/overlord/src/app/journal/voucher.ts new file mode 100644 index 00000000..87af682e --- /dev/null +++ b/overlord/src/app/journal/voucher.ts @@ -0,0 +1,82 @@ +import {Account} from '../account/account'; +import {User} from '../user/user'; +import {CostCentre} from '../cost-centre/cost-centre'; +import {Product} from '../product/product'; + +export class Voucher { + id: string; + date: string; + type: string; + posted: boolean; + narration: string; + incentive?: number; + journals: Journal[]; + inventories: Inventory[]; + employeeBenefits: EmployeeBenefit[]; + incentives: Incentive[]; + files: DbFile[]; + creationDate: string; + lastEditDate: string; + user: User; + poster: string; + reconcileDate: string; +} + +export class Journal { + id: string; + debit: number; + amount: number; + account: Account; + costCentre: CostCentre; + + public constructor(init?: Partial) { + Object.assign(this, init); + } +} + +export class EmployeeBenefit { + grossSalary: number; + daysWorked: number; + esiEmployee: number; + pfEmployee: number; + esiEmployer: number; + pfEmployer: number; + journal: Journal; // Should be employee as we need designation +} + +export class Incentive { + id: string; + name: string; + designation: string; + department: string; + daysWorked: number; + points: number; + +} + +export class Inventory { + id: string; + quantity: number; + rate: number; + tax: number; + discount: number; + amount: number; + product: Product; + batch: Batch; +} + +export class Batch { + id: string; + name: string; + quantityRemaining: number; + tax: number; + discount: number; + rate: number; + product: Product; +} + +export class DbFile { + id: string; + resized: string; + thumbnail: string; +} diff --git a/overlord/src/app/ledger/ledger-datasource.ts b/overlord/src/app/ledger/ledger-datasource.ts new file mode 100644 index 00000000..ba730b24 --- /dev/null +++ b/overlord/src/app/ledger/ledger-datasource.ts @@ -0,0 +1,61 @@ +import {DataSource} from '@angular/cdk/collections'; +import {MatPaginator, MatSort} from '@angular/material'; +import {map} from 'rxjs/operators'; +import {merge, Observable, of as observableOf} from 'rxjs'; +import {LedgerItem} from './ledger'; + + +export class LedgerDataSource extends DataSource { + + constructor(private paginator: MatPaginator, private sort: MatSort, public data: LedgerItem[]) { + super(); + } + + connect(): Observable { + const dataMutations = [ + observableOf(this.data), + this.paginator.page, + this.sort.sortChange + ]; + + // Set the paginators length + this.paginator.length = this.data.length; + + return merge(...dataMutations).pipe(map(() => { + return this.getPagedData(this.getSortedData([...this.data])); + })); + } + + disconnect() { + } + + private getPagedData(data: LedgerItem[]) { + const startIndex = this.paginator.pageIndex * this.paginator.pageSize; + return data.splice(startIndex, this.paginator.pageSize); + } + + private getSortedData(data: LedgerItem[]) { + if (!this.sort.active || this.sort.direction === '') { + return data; + } + + return data.sort((a, b) => { + const isAsc = this.sort.direction === 'asc'; + switch (this.sort.active) { + case 'date': + return compare(a.date, b.date, isAsc); + case 'debit': + return compare(+a.debit, +b.debit, isAsc); + case 'credit': + return compare(+a.credit, +b.credit, isAsc); + default: + return 0; + } + }); + } +} + +/** Simple sort comparator for example ID/Name columns (for client-side sorting). */ +function compare(a, b, isAsc) { + return (a < b ? -1 : 1) * (isAsc ? 1 : -1); +} diff --git a/overlord/src/app/ledger/ledger-resolver.service.spec.ts b/overlord/src/app/ledger/ledger-resolver.service.spec.ts new file mode 100644 index 00000000..6626351e --- /dev/null +++ b/overlord/src/app/ledger/ledger-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {LedgerResolver} from './ledger-resolver.service'; + +describe('LedgerResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [LedgerResolver] + }); + }); + + it('should be created', inject([LedgerResolver], (service: LedgerResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/ledger/ledger-resolver.service.ts b/overlord/src/app/ledger/ledger-resolver.service.ts new file mode 100644 index 00000000..8b834ea4 --- /dev/null +++ b/overlord/src/app/ledger/ledger-resolver.service.ts @@ -0,0 +1,21 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {Ledger} from './ledger'; +import {LedgerService} from './ledger.service'; + +@Injectable({ + providedIn: 'root' +}) +export class LedgerResolver implements Resolve { + + constructor(private ser: LedgerService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const id = route.paramMap.get('id'); + const startDate = route.queryParamMap.get('startDate') || null; + const finishDate = route.queryParamMap.get('finishDate') || null; + return this.ser.list(id, startDate, finishDate); + } +} diff --git a/overlord/src/app/ledger/ledger-routing.module.spec.ts b/overlord/src/app/ledger/ledger-routing.module.spec.ts new file mode 100644 index 00000000..eb383042 --- /dev/null +++ b/overlord/src/app/ledger/ledger-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {LedgerRoutingModule} from './ledger-routing.module'; + +describe('LedgerRoutingModule', () => { + let ledgerRoutingModule: LedgerRoutingModule; + + beforeEach(() => { + ledgerRoutingModule = new LedgerRoutingModule(); + }); + + it('should create an instance', () => { + expect(ledgerRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/ledger/ledger-routing.module.ts b/overlord/src/app/ledger/ledger-routing.module.ts new file mode 100644 index 00000000..2724ce4e --- /dev/null +++ b/overlord/src/app/ledger/ledger-routing.module.ts @@ -0,0 +1,49 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {LedgerResolver} from './ledger-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {LedgerComponent} from './ledger.component'; + +const ledgerRoutes: Routes = [ + { + path: 'Ledger', + component: LedgerComponent, + canActivate: [AuthGuard], + data: { + permission: 'Ledger' + }, + resolve: { + info: LedgerResolver + }, + runGuardsAndResolvers: 'always' + }, + { + path: 'Ledger/:id', + component: LedgerComponent, + canActivate: [AuthGuard], + data: { + permission: 'Ledger' + }, + resolve: { + info: LedgerResolver + }, + runGuardsAndResolvers: 'always' + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(ledgerRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + LedgerResolver + ] +}) +export class LedgerRoutingModule { +} diff --git a/overlord/src/app/ledger/ledger.component.css b/overlord/src/app/ledger/ledger.component.css new file mode 100644 index 00000000..ef3a3239 --- /dev/null +++ b/overlord/src/app/ledger/ledger.component.css @@ -0,0 +1,12 @@ +.right { + display: flex; + justify-content: flex-end; +} + +.selected{ + background: #fff3cd +} + +.unposted{ + background: #f8d7da +} diff --git a/overlord/src/app/ledger/ledger.component.html b/overlord/src/app/ledger/ledger.component.html new file mode 100644 index 00000000..03caee7c --- /dev/null +++ b/overlord/src/app/ledger/ledger.component.html @@ -0,0 +1,102 @@ + + + Ledger + + + +
    +
    + + + + + + + + + + +
    +
    + + + + {{account.name}} + + + +
    +
    + + + + + Date + {{row.date}} + + + + + + Particulars + {{row.name}} + Closing Balance + + + + + Type + {{row.type}} + Closing Balance + + + + + Narration + {{row.narration}} + + + + + + Debit + {{row.debit | currency:'INR' | clear}} + {{debit | currency:'INR'}} + + + + + Credit + {{row.credit | currency:'INR' | clear}} + {{credit | currency:'INR'}} + + + + + Running + {{row.running | currency:'INR' | accounting}} + {{running | currency:'INR' | accounting}} + + + + + + + + + +
    +
    diff --git a/overlord/src/app/ledger/ledger.component.spec.ts b/overlord/src/app/ledger/ledger.component.spec.ts new file mode 100644 index 00000000..7f65d9e7 --- /dev/null +++ b/overlord/src/app/ledger/ledger.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {LedgerComponent} from './ledger.component'; + +describe('LedgerComponent', () => { + let component: LedgerComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [LedgerComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LedgerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/ledger/ledger.component.ts b/overlord/src/app/ledger/ledger.component.ts new file mode 100644 index 00000000..d25060b0 --- /dev/null +++ b/overlord/src/app/ledger/ledger.component.ts @@ -0,0 +1,157 @@ +import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MatAutocompleteSelectedEvent, MatPaginator, MatSort} from '@angular/material'; +import {ActivatedRoute, Router} from '@angular/router'; +import {Observable, of as observableOf} from 'rxjs'; +import {debounceTime, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators'; +import * as moment from 'moment'; +import {LedgerDataSource} from './ledger-datasource'; +import {Ledger} from './ledger'; +import {Account} from '../account/account'; +import {LedgerService} from './ledger.service'; +import {AccountService} from '../account/account.service'; + +@Component({ + selector: 'app-ledger', + templateUrl: './ledger.component.html', + styleUrls: ['./ledger.component.css'] +}) +export class LedgerComponent implements OnInit, AfterViewInit { + @ViewChild('accountElement') accountElement: ElementRef; + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + dataSource: LedgerDataSource; + form: FormGroup; + info: Ledger; + selectedRowId: string; + debit: number; + credit: number; + running: number; + /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ + displayedColumns = ['date', 'particulars', 'type', 'narration', 'debit', 'credit', 'running']; + + accounts: Observable; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder, + private ser: LedgerService, + private accountSer: AccountService + ) { + this.createForm(); + + this.accounts = this.form.get('account').valueChanges + .pipe( + startWith(null), + map(x => (x !== null && x.length >= 1) ? x : null), + debounceTime(150), + distinctUntilChanged(), + switchMap(x => (x === null) ? observableOf([]) : this.accountSer.autocomplete(x)) + ); + } + + ngOnInit() { + this.route.data + .subscribe((data: { info: Ledger }) => { + this.info = data.info; + this.calculateTotals(); + this.form.setValue({ + account: this.info.account, + startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(), + finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate() + }); + this.dataSource = new LedgerDataSource(this.paginator, this.sort, this.info.body); + }); + } + + ngAfterViewInit() { + setTimeout(() => { + this.accountElement.nativeElement.focus(); + }, 0); + } + + displayFn(account?: Account): string | undefined { + return account ? account.name : undefined; + } + + calculateTotals() { + this.debit = 0; + this.credit = 0; + this.running = 0; + this.info.body.forEach((item) => { + if (item.type !== 'Opening Balance') { + this.debit += item.debit; + this.credit += item.credit; + if (item.posted) { + this.running += item.debit - item.credit; + } + } else { + this.running += item.debit - item.credit; + } + item.running = this.running; + }); + } + + selected(event: MatAutocompleteSelectedEvent): void { + this.info.account = event.option.value; + } + + selectRow(id: string): void { + this.selectedRowId = id; + } + + getRowClass(id: string, posted: boolean): string { + if (this.selectedRowId === id) { + return 'selected'; + } else if (!posted) { + return 'unposted'; + } else { + return ''; + } + } + + show() { + const info = this.getInfo(); + this.router.navigate(['Ledger', info.account.id], { + queryParams: { + startDate: info.startDate, + finishDate: info.finishDate + } + }); + } + + createForm() { + this.form = this.fb.group({ + startDate: '', + finishDate: '', + account: '' + }); + } + + getInfo(): Ledger { + const formModel = this.form.value; + + return { + account: formModel.account, + startDate: moment(formModel.startDate).format('DD-MMM-YYYY'), + finishDate: moment(formModel.finishDate).format('DD-MMM-YYYY') + }; + } + + exportCsv() { + const data: string[] = ['Date , Name , Type , Narration , Debit , Credit , Running , Posted']; + data.push( + ...this.dataSource.data.map(x => x.date + ', ' + x.name + ', ' + x.type + ', ' + + x.narration + ', ' + x.debit + ', ' + x.credit + ', ' + x.running + ', ' + x.posted) + ); + + const csvData = new Blob([data.join('\n')], {type: 'text/csv;charset=utf-8;'}); + const link = document.createElement('a'); + link.href = window.URL.createObjectURL(csvData); + link.setAttribute('download', 'ledger.csv'); + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + } +} diff --git a/overlord/src/app/ledger/ledger.module.spec.ts b/overlord/src/app/ledger/ledger.module.spec.ts new file mode 100644 index 00000000..6af7db7d --- /dev/null +++ b/overlord/src/app/ledger/ledger.module.spec.ts @@ -0,0 +1,13 @@ +import {LedgerModule} from './ledger.module'; + +describe('LedgerModule', () => { + let ledgerModule: LedgerModule; + + beforeEach(() => { + ledgerModule = new LedgerModule(); + }); + + it('should create an instance', () => { + expect(ledgerModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/ledger/ledger.module.ts b/overlord/src/app/ledger/ledger.module.ts new file mode 100644 index 00000000..12a2ac75 --- /dev/null +++ b/overlord/src/app/ledger/ledger.module.ts @@ -0,0 +1,75 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {ReactiveFormsModule} from '@angular/forms'; +import {CdkTableModule} from '@angular/cdk/table'; +import {LedgerRoutingModule} from './ledger-routing.module'; +import {LedgerComponent} from './ledger.component'; +import {MomentDateAdapter} from '@angular/material-moment-adapter'; +import {A11yModule} from '@angular/cdk/a11y'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + LedgerRoutingModule + ], + declarations: [ + LedgerComponent + ], + providers: [ + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, + ] +}) +export class LedgerModule { +} diff --git a/overlord/src/app/ledger/ledger.service.spec.ts b/overlord/src/app/ledger/ledger.service.spec.ts new file mode 100644 index 00000000..1ab499ee --- /dev/null +++ b/overlord/src/app/ledger/ledger.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {LedgerService} from './ledger.service'; + +describe('LedgerService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [LedgerService] + }); + }); + + it('should be created', inject([LedgerService], (service: LedgerService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/ledger/ledger.service.ts b/overlord/src/app/ledger/ledger.service.ts new file mode 100644 index 00000000..1338de62 --- /dev/null +++ b/overlord/src/app/ledger/ledger.service.ts @@ -0,0 +1,38 @@ +import {Injectable} from '@angular/core'; +import {catchError} from 'rxjs/operators'; +import {Observable} from 'rxjs/internal/Observable'; +import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http'; +import {Ledger} from './ledger'; +import {ErrorLoggerService} from '../core/error-logger.service'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; + +const url = '/api/Ledger'; +const serviceName = 'LedgerService'; + +@Injectable({ + providedIn: 'root' +}) +export class LedgerService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + list(date: string, startDate: string, finishDate): Observable { + const listUrl = (date === null) ? url : `${url}/${date}`; + const options = {params: new HttpParams()}; + if (startDate !== null) { + options.params = options.params.set('s', startDate); + } + if (finishDate !== null) { + options.params = options.params.set('f', finishDate); + } + return >this.http.get(listUrl, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + +} diff --git a/overlord/src/app/ledger/ledger.ts b/overlord/src/app/ledger/ledger.ts new file mode 100644 index 00000000..7878c1d8 --- /dev/null +++ b/overlord/src/app/ledger/ledger.ts @@ -0,0 +1,21 @@ +import {Account} from '../account/account'; + +export class LedgerItem { + date: string; + id: string; + name: string; + type: string; + narration: string; + debit: number; + credit: number; + running: number; + posted: boolean; + url: string; +} + +export class Ledger { + startDate: string; + finishDate: string; + account: Account; + body?: LedgerItem[]; +} diff --git a/overlord/src/app/net-transactions/net-transactions-datasource.ts b/overlord/src/app/net-transactions/net-transactions-datasource.ts new file mode 100644 index 00000000..74a119dc --- /dev/null +++ b/overlord/src/app/net-transactions/net-transactions-datasource.ts @@ -0,0 +1,63 @@ +import {DataSource} from '@angular/cdk/collections'; +import {MatPaginator, MatSort} from '@angular/material'; +import {map} from 'rxjs/operators'; +import {merge, Observable, of as observableOf} from 'rxjs'; +import {NetTransactionsItem} from './net-transactions'; + + +export class NetTransactionsDataSource extends DataSource { + + constructor(private paginator: MatPaginator, private sort: MatSort, public data: NetTransactionsItem[]) { + super(); + } + + connect(): Observable { + const dataMutations = [ + observableOf(this.data), + this.paginator.page, + this.sort.sortChange + ]; + + // Set the paginators length + this.paginator.length = this.data.length; + + return merge(...dataMutations).pipe(map(() => { + return this.getPagedData(this.getSortedData([...this.data])); + })); + } + + disconnect() { + } + + private getPagedData(data: NetTransactionsItem[]) { + const startIndex = this.paginator.pageIndex * this.paginator.pageSize; + return data.splice(startIndex, this.paginator.pageSize); + } + + private getSortedData(data: NetTransactionsItem[]) { + if (!this.sort.active || this.sort.direction === '') { + return data; + } + + return data.sort((a, b) => { + const isAsc = this.sort.direction === 'asc'; + switch (this.sort.active) { + case 'name': + return compare(a.name, b.name, isAsc); + case 'type': + return compare(a.type, b.type, isAsc); + case 'debit': + return compare(+a.debit, +b.debit, isAsc); + case 'credit': + return compare(+a.credit, +b.credit, isAsc); + default: + return 0; + } + }); + } +} + +/** Simple sort comparator for example ID/Name columns (for client-side sorting). */ +function compare(a, b, isAsc) { + return (a < b ? -1 : 1) * (isAsc ? 1 : -1); +} diff --git a/overlord/src/app/net-transactions/net-transactions-resolver.service.spec.ts b/overlord/src/app/net-transactions/net-transactions-resolver.service.spec.ts new file mode 100644 index 00000000..587312ae --- /dev/null +++ b/overlord/src/app/net-transactions/net-transactions-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {NetTransactionsResolver} from './net-transactions-resolver.service'; + +describe('NetTransactionsResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [NetTransactionsResolver] + }); + }); + + it('should be created', inject([NetTransactionsResolver], (service: NetTransactionsResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/net-transactions/net-transactions-resolver.service.ts b/overlord/src/app/net-transactions/net-transactions-resolver.service.ts new file mode 100644 index 00000000..89f15d29 --- /dev/null +++ b/overlord/src/app/net-transactions/net-transactions-resolver.service.ts @@ -0,0 +1,20 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {NetTransactions} from './net-transactions'; +import {NetTransactionsService} from './net-transactions.service'; + +@Injectable({ + providedIn: 'root' +}) +export class NetTransactionsResolver implements Resolve { + + constructor(private ser: NetTransactionsService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const startDate = route.queryParamMap.get('startDate') || null; + const finishDate = route.queryParamMap.get('finishDate') || null; + return this.ser.list(startDate, finishDate); + } +} diff --git a/overlord/src/app/net-transactions/net-transactions-routing.module.spec.ts b/overlord/src/app/net-transactions/net-transactions-routing.module.spec.ts new file mode 100644 index 00000000..fad23722 --- /dev/null +++ b/overlord/src/app/net-transactions/net-transactions-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {NetTransactionsRoutingModule} from './net-transactions-routing.module'; + +describe('NetTransactionsRoutingModule', () => { + let netTransactionsRoutingModule: NetTransactionsRoutingModule; + + beforeEach(() => { + netTransactionsRoutingModule = new NetTransactionsRoutingModule(); + }); + + it('should create an instance', () => { + expect(netTransactionsRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/net-transactions/net-transactions-routing.module.ts b/overlord/src/app/net-transactions/net-transactions-routing.module.ts new file mode 100644 index 00000000..bf8f2737 --- /dev/null +++ b/overlord/src/app/net-transactions/net-transactions-routing.module.ts @@ -0,0 +1,37 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {NetTransactionsResolver} from './net-transactions-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {NetTransactionsComponent} from './net-transactions.component'; + +const netTransactionsRoutes: Routes = [ + { + path: 'NetTransactions', + component: NetTransactionsComponent, + canActivate: [AuthGuard], + data: { + permission: 'Net Transactions' + }, + resolve: { + info: NetTransactionsResolver + }, + runGuardsAndResolvers: 'always' + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(netTransactionsRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + NetTransactionsResolver + ] +}) +export class NetTransactionsRoutingModule { +} diff --git a/overlord/src/app/net-transactions/net-transactions.component.css b/overlord/src/app/net-transactions/net-transactions.component.css new file mode 100644 index 00000000..ef3a3239 --- /dev/null +++ b/overlord/src/app/net-transactions/net-transactions.component.css @@ -0,0 +1,12 @@ +.right { + display: flex; + justify-content: flex-end; +} + +.selected{ + background: #fff3cd +} + +.unposted{ + background: #f8d7da +} diff --git a/overlord/src/app/net-transactions/net-transactions.component.html b/overlord/src/app/net-transactions/net-transactions.component.html new file mode 100644 index 00000000..50f26c40 --- /dev/null +++ b/overlord/src/app/net-transactions/net-transactions.component.html @@ -0,0 +1,61 @@ + + + Net Transactions + + +
    +
    + + + + + + + + + + + +
    +
    + + + + + Type + {{row.type}} + + + + + Name + {{row.name}} + + + + + Debit + {{row.debit | currency:'INR' | accounting}} + + + + + Credit + {{row.credit | currency:'INR' | accounting}} + + + + + + + + +
    +
    diff --git a/overlord/src/app/net-transactions/net-transactions.component.spec.ts b/overlord/src/app/net-transactions/net-transactions.component.spec.ts new file mode 100644 index 00000000..5de523eb --- /dev/null +++ b/overlord/src/app/net-transactions/net-transactions.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {NetTransactionsComponent} from './net-transactions.component'; + +describe('NetTransactionsComponent', () => { + let component: NetTransactionsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [NetTransactionsComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(NetTransactionsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/net-transactions/net-transactions.component.ts b/overlord/src/app/net-transactions/net-transactions.component.ts new file mode 100644 index 00000000..32069f32 --- /dev/null +++ b/overlord/src/app/net-transactions/net-transactions.component.ts @@ -0,0 +1,71 @@ +import {Component, OnInit, ViewChild} from '@angular/core'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MatPaginator, MatSort} from '@angular/material'; +import {ActivatedRoute, Router} from '@angular/router'; +import * as moment from 'moment'; +import {NetTransactionsDataSource} from './net-transactions-datasource'; +import {NetTransactions} from './net-transactions'; +import {NetTransactionsService} from './net-transactions.service'; + +@Component({ + selector: 'app-net-transactions', + templateUrl: './net-transactions.component.html', + styleUrls: ['./net-transactions.component.css'] +}) +export class NetTransactionsComponent implements OnInit { + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + dataSource: NetTransactionsDataSource; + form: FormGroup; + info: NetTransactions; + selectedRowId: string; + /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ + displayedColumns = ['type', 'name', 'debit', 'credit']; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder + ) { + this.createForm(); + } + + ngOnInit() { + this.route.data + .subscribe((data: { info: NetTransactions }) => { + this.info = data.info; + this.form.setValue({ + startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(), + finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate() + }); + this.dataSource = new NetTransactionsDataSource(this.paginator, this.sort, this.info.body); + }); + } + + show() { + const l = this.prepareSubmit(); + this.router.navigate(['NetTransactions'], { + queryParams: { + startDate: l.startDate, + finishDate: l.finishDate + } + }); + } + + createForm() { + this.form = this.fb.group({ + startDate: '', + finishDate: '', + }); + } + + prepareSubmit(): NetTransactions { + const formModel = this.form.value; + + return { + startDate: moment(formModel.startDate).format('DD-MMM-YYYY'), + finishDate: moment(formModel.finishDate).format('DD-MMM-YYYY'), + body: [] + }; + } +} diff --git a/overlord/src/app/net-transactions/net-transactions.module.spec.ts b/overlord/src/app/net-transactions/net-transactions.module.spec.ts new file mode 100644 index 00000000..896bd376 --- /dev/null +++ b/overlord/src/app/net-transactions/net-transactions.module.spec.ts @@ -0,0 +1,13 @@ +import {NetTransactionsModule} from './net-transactions.module'; + +describe('NetTransactionsModule', () => { + let netTransactionsModule: NetTransactionsModule; + + beforeEach(() => { + netTransactionsModule = new NetTransactionsModule(); + }); + + it('should create an instance', () => { + expect(netTransactionsModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/net-transactions/net-transactions.module.ts b/overlord/src/app/net-transactions/net-transactions.module.ts new file mode 100644 index 00000000..54a4e9d4 --- /dev/null +++ b/overlord/src/app/net-transactions/net-transactions.module.ts @@ -0,0 +1,75 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {ReactiveFormsModule} from '@angular/forms'; +import {CdkTableModule} from '@angular/cdk/table'; +import {NetTransactionsRoutingModule} from './net-transactions-routing.module'; +import {NetTransactionsComponent} from './net-transactions.component'; +import {MomentDateAdapter} from '@angular/material-moment-adapter'; +import {A11yModule} from '@angular/cdk/a11y'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + NetTransactionsRoutingModule + ], + declarations: [ + NetTransactionsComponent + ], + providers: [ + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, + ] +}) +export class NetTransactionsModule { +} diff --git a/overlord/src/app/net-transactions/net-transactions.service.spec.ts b/overlord/src/app/net-transactions/net-transactions.service.spec.ts new file mode 100644 index 00000000..463ff1b9 --- /dev/null +++ b/overlord/src/app/net-transactions/net-transactions.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {NetTransactionsService} from './net-transactions.service'; + +describe('NetTransactionsService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [NetTransactionsService] + }); + }); + + it('should be created', inject([NetTransactionsService], (service: NetTransactionsService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/net-transactions/net-transactions.service.ts b/overlord/src/app/net-transactions/net-transactions.service.ts new file mode 100644 index 00000000..50983144 --- /dev/null +++ b/overlord/src/app/net-transactions/net-transactions.service.ts @@ -0,0 +1,37 @@ +import {Injectable} from '@angular/core'; +import {catchError} from 'rxjs/operators'; +import {Observable} from 'rxjs/internal/Observable'; +import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http'; +import {NetTransactions} from './net-transactions'; +import {ErrorLoggerService} from '../core/error-logger.service'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; + +const url = '/api/NetTransactions'; +const serviceName = 'NetTransactionsService'; + +@Injectable({ + providedIn: 'root' +}) +export class NetTransactionsService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + list(startDate: string, finishDate): Observable { + const options = {params: new HttpParams()}; + if (startDate !== null) { + options.params = options.params.set('s', startDate); + } + if (finishDate !== null) { + options.params = options.params.set('f', finishDate); + } + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + +} diff --git a/overlord/src/app/net-transactions/net-transactions.ts b/overlord/src/app/net-transactions/net-transactions.ts new file mode 100644 index 00000000..eeb402a8 --- /dev/null +++ b/overlord/src/app/net-transactions/net-transactions.ts @@ -0,0 +1,13 @@ + +export class NetTransactionsItem { + type: string; + name: string; + debit: number; + credit: string; +} + +export class NetTransactions { + startDate: string; + finishDate: string; + body: NetTransactionsItem[]; +} diff --git a/overlord/src/app/payment/payment-accounts-resolver.service.spec.ts b/overlord/src/app/payment/payment-accounts-resolver.service.spec.ts new file mode 100644 index 00000000..fdcb9781 --- /dev/null +++ b/overlord/src/app/payment/payment-accounts-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {PaymentAccountsResolver} from './payment-accounts-resolver.service'; + +describe('PaymentAccountsResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [PaymentAccountsResolverService] + }); + }); + + it('should be created', inject([PaymentAccountsResolver], (service: PaymentAccountsResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/payment/payment-accounts-resolver.service.ts b/overlord/src/app/payment/payment-accounts-resolver.service.ts new file mode 100644 index 00000000..b3be6154 --- /dev/null +++ b/overlord/src/app/payment/payment-accounts-resolver.service.ts @@ -0,0 +1,18 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {Account} from '../account/account'; +import {AccountService} from '../account/account.service'; + +@Injectable({ + providedIn: 'root' +}) +export class PaymentAccountsResolver implements Resolve { + + constructor(private ser: AccountService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + return this.ser.paymentAutocomplete(''); + } +} diff --git a/overlord/src/app/payment/payment-datasource.ts b/overlord/src/app/payment/payment-datasource.ts new file mode 100644 index 00000000..890c8dc9 --- /dev/null +++ b/overlord/src/app/payment/payment-datasource.ts @@ -0,0 +1,18 @@ +import {DataSource} from '@angular/cdk/collections'; +import {Observable} from 'rxjs'; +import {Journal} from '../journal/voucher'; + + +export class PaymentDataSource extends DataSource { + + constructor(private data: Observable) { + super(); + } + + connect(): Observable { + return this.data; + } + + disconnect() { + } +} diff --git a/overlord/src/app/payment/payment-dialog.component.css b/overlord/src/app/payment/payment-dialog.component.css new file mode 100644 index 00000000..e69de29b diff --git a/overlord/src/app/payment/payment-dialog.component.html b/overlord/src/app/payment/payment-dialog.component.html new file mode 100644 index 00000000..9bb4a201 --- /dev/null +++ b/overlord/src/app/payment/payment-dialog.component.html @@ -0,0 +1,31 @@ +

    Edit Payment Entry

    +
    +
    +
    + + + + Balance as on Date: {{accBal.date | currency:'INR' | accounting}} / + Final balance: {{accBal.total | currency:'INR' | accounting}} + + + + {{account.name}} + + + Amount + ₹ + + + +
    +
    +
    +
    + + +
    + diff --git a/overlord/src/app/payment/payment-dialog.component.spec.ts b/overlord/src/app/payment/payment-dialog.component.spec.ts new file mode 100644 index 00000000..7a24fc65 --- /dev/null +++ b/overlord/src/app/payment/payment-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PaymentDialogComponent } from './payment-dialog.component'; + +describe('PaymentDialogComponent', () => { + let component: PaymentDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PaymentDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PaymentDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/payment/payment-dialog.component.ts b/overlord/src/app/payment/payment-dialog.component.ts new file mode 100644 index 00000000..0078ad3e --- /dev/null +++ b/overlord/src/app/payment/payment-dialog.component.ts @@ -0,0 +1,76 @@ +import {Component, Inject, OnInit} from '@angular/core'; +import {MAT_DIALOG_DATA, MatAutocompleteSelectedEvent, MatDialogRef} from '@angular/material'; +import {debounceTime, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators'; +import {Account} from '../account/account'; +import {AccountService} from '../account/account.service'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {Observable, of as observableOf} from 'rxjs'; + +@Component({ + selector: 'app-payment-dialog', + templateUrl: './payment-dialog.component.html', + styleUrls: ['./payment-dialog.component.css'] +}) +export class PaymentDialogComponent implements OnInit { + accounts: Observable; + form: FormGroup; + account: Account; + accBal: any; + + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any, + private fb: FormBuilder, + private accountSer: AccountService) { + this.createForm(); + this.setupAccountAutocomplete(); + } + + ngOnInit() { + this.form.setValue({ + account: this.data.journal.account, + amount: this.data.journal.amount + }); + this.account = this.data.journal.account; + } + + createForm() { + this.form = this.fb.group({ + account: '', + amount: '' + }); + this.accBal = null; + } + + setupAccountAutocomplete(): void { + const control = this.form.get('account'); + this.accounts = control.valueChanges + .pipe( + startWith(null), + map(x => (x !== null && x.length >= 1) ? x : null), + debounceTime(150), + distinctUntilChanged(), + switchMap(x => (x === null) ? observableOf([]) : this.accountSer.autocomplete(x)) + ); + + } + + displayAccount(account?: Account): string | undefined { + return account ? account.name : undefined; + } + + accountSelected(event: MatAutocompleteSelectedEvent): void { + this.account = event.option.value; + this.accountSer.balance(this.account.id, this.data.date).subscribe((v) => { + this.accBal = v; + }); + } + + accept(): void { + const formValue = this.form.value; + const amount = +formValue.amount; + this.data.journal.account = this.account; + this.data.journal.amount = amount; + this.dialogRef.close(this.data.journal); + } +} diff --git a/overlord/src/app/payment/payment-resolver.service.spec.ts b/overlord/src/app/payment/payment-resolver.service.spec.ts new file mode 100644 index 00000000..99667a6d --- /dev/null +++ b/overlord/src/app/payment/payment-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {PaymentResolver} from './payment-resolver.service'; + +describe('PaymentResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [PaymentResolver] + }); + }); + + it('should be created', inject([PaymentResolver], (service: PaymentResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/payment/payment-resolver.service.ts b/overlord/src/app/payment/payment-resolver.service.ts new file mode 100644 index 00000000..24fd7e95 --- /dev/null +++ b/overlord/src/app/payment/payment-resolver.service.ts @@ -0,0 +1,26 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {Voucher} from '../journal/voucher'; +import {VoucherService} from '../journal/voucher.service'; + +@Injectable({ + providedIn: 'root' +}) +export class PaymentResolver implements Resolve { + + constructor(private ser: VoucherService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const id = route.paramMap.get('id'); + const account = route.queryParamMap.get('a') || null; + if (id !== null) { + return this.ser.get(id); + } else if (account !== null) { + return this.ser.getOfType('Payment', account); + } else { + return this.ser.getOfType('Payment'); + } + } +} diff --git a/overlord/src/app/payment/payment-routing.module.spec.ts b/overlord/src/app/payment/payment-routing.module.spec.ts new file mode 100644 index 00000000..32f82c41 --- /dev/null +++ b/overlord/src/app/payment/payment-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {PaymentRoutingModule} from './payment-routing.module'; + +describe('PaymentRoutingModule', () => { + let paymentRoutingModule: PaymentRoutingModule; + + beforeEach(() => { + paymentRoutingModule = new PaymentRoutingModule(); + }); + + it('should create an instance', () => { + expect(paymentRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/payment/payment-routing.module.ts b/overlord/src/app/payment/payment-routing.module.ts new file mode 100644 index 00000000..04e8b8d1 --- /dev/null +++ b/overlord/src/app/payment/payment-routing.module.ts @@ -0,0 +1,52 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {PaymentResolver} from './payment-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {PaymentComponent} from './payment.component'; +import {PaymentAccountsResolver} from './payment-accounts-resolver.service'; + +const paymentRoutes: Routes = [ + { + path: 'Payment', + component: PaymentComponent, + canActivate: [AuthGuard], + data: { + permission: 'Payment' + }, + resolve: { + paymentAccounts: PaymentAccountsResolver, + voucher: PaymentResolver + }, + runGuardsAndResolvers: 'paramsChange' + }, + { + path: 'Payment/:id', + component: PaymentComponent, + canActivate: [AuthGuard], + data: { + permission: 'Payment' + }, + resolve: { + paymentAccounts: PaymentAccountsResolver, + voucher: PaymentResolver + }, + runGuardsAndResolvers: 'paramsChange' + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(paymentRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + PaymentResolver + ] +}) +export class PaymentRoutingModule { +} diff --git a/overlord/src/app/payment/payment.component.css b/overlord/src/app/payment/payment.component.css new file mode 100644 index 00000000..a592a823 --- /dev/null +++ b/overlord/src/app/payment/payment.component.css @@ -0,0 +1,32 @@ +.right { + display: flex; + justify-content: flex-end; +} + +.selected { + background: #fff3cd +} + +.unposted { + background: #f8d7da +} + +.center { + display: flex; + justify-content: center; +} + +.img-container { + position: relative; +} + +.img-container .overlay { + display: none; +} + +.img-container:hover > .overlay { + display: inline-block; + position: absolute; + left: 60px; + top: 0; +} diff --git a/overlord/src/app/payment/payment.component.html b/overlord/src/app/payment/payment.component.html new file mode 100644 index 00000000..47fdb29b --- /dev/null +++ b/overlord/src/app/payment/payment.component.html @@ -0,0 +1,113 @@ + + + Payment + + +
    +
    + + + + + + + + + {{ account.name }} + + + + + Payment Amount + ₹ + + +
    + +
    + + + + Balance as on Date: {{accBal.date | currency:'INR' | accounting}} / + Final balance: {{accBal.total | currency:'INR' | accounting}} + + + + {{account.name}} + + + Amount + ₹ + + + + +
    + + + + + Account + {{row.account.name}} + + + + + Amount + {{row.amount | currency:'INR'}} + + + + + Action + + + + + + + + + + + Narration + + +
    +
    + + +
    +
    + +
    +
    + + + + + + + Created on {{voucher.creationDate | localTime}} and + Last Edited on {{voucher.lastEditDate | localTime}} + by {{voucher.user.name}}. {{(voucher.poster) ? 'Posted by ' + voucher.poster : ''}} + +
    diff --git a/overlord/src/app/payment/payment.component.spec.ts b/overlord/src/app/payment/payment.component.spec.ts new file mode 100644 index 00000000..9fd54fe4 --- /dev/null +++ b/overlord/src/app/payment/payment.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {PaymentComponent} from './payment.component'; + +describe('PaymentComponent', () => { + let component: PaymentComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [PaymentComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PaymentComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/payment/payment.component.ts b/overlord/src/app/payment/payment.component.ts new file mode 100644 index 00000000..32d0678d --- /dev/null +++ b/overlord/src/app/payment/payment.component.ts @@ -0,0 +1,334 @@ +import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MatAutocompleteSelectedEvent, MatDialog} from '@angular/material'; +import {ActivatedRoute, Router} from '@angular/router'; +import {BehaviorSubject, fromEvent, Observable, of, of as observableOf, zip} from 'rxjs'; +import {PaymentDataSource} from './payment-datasource'; +import {Account} from '../account/account'; +import {VoucherService} from '../journal/voucher.service'; +import {AccountService} from '../account/account.service'; +import {DbFile, Journal, Voucher} from '../journal/voucher'; +import * as moment from 'moment'; +import {AuthService} from '../auth/auth.service'; +import {ConfirmDialogComponent} from '../shared/confirm-dialog/confirm-dialog.component'; +import {ToasterService} from '../core/toaster.service'; +import {debounceTime, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators'; +import {PaymentDialogComponent} from './payment-dialog.component'; +import {ImageDialogComponent} from '../shared/image-dialog/image-dialog.component'; + +@Component({ + selector: 'app-payment', + templateUrl: './payment.component.html', + styleUrls: ['./payment.component.css'] +}) +export class PaymentComponent implements OnInit, AfterViewInit { + @ViewChild('accountElement') accountElement: ElementRef; + public journalObservable = new BehaviorSubject([]); + dataSource: PaymentDataSource; + form: FormGroup; + paymentAccounts: Account[]; + paymentJournal: Journal; + voucher: Voucher; + account: Account; + accBal: any; + + displayedColumns = ['account', 'amount', 'action']; + + accounts: Observable; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder, + private dialog: MatDialog, + private toaster: ToasterService, + private auth: AuthService, + private ser: VoucherService, + private accountSer: AccountService + ) { + this.createForm(); + this.listenToAccountAutocompleteChange(); + this.listenToPaymentAccountChange(); + } + + ngOnInit() { + this.route.data + .subscribe((data: { voucher: Voucher, paymentAccounts: Account[] }) => { + this.paymentAccounts = data.paymentAccounts; + this.loadVoucher(data.voucher); + }); + } + + ngAfterViewInit() { + this.focusAccount(); + } + + loadVoucher(voucher: Voucher) { + this.voucher = voucher; + this.paymentJournal = this.voucher.journals.filter(x => x.debit === -1)[0]; + this.form.setValue({ + date: moment(this.voucher.date, 'DD-MMM-YYYY').toDate(), + paymentAccount: this.paymentJournal.account.id, + paymentAmount: this.paymentJournal.amount, + addRow: { + account: '', + amount: 0 + }, + narration: this.voucher.narration + }); + this.dataSource = new PaymentDataSource(this.journalObservable); + this.updateView(); + + } + + focusAccount() { + setTimeout(() => { + this.accountElement.nativeElement.focus(); + }, 0); + } + + addRow() { + const amount = +(this.form.get('addRow').value.amount); + const debit = 1; + if (this.account === null || amount <= 0) { + return; + } + const oldFiltered = this.voucher.journals.filter((x) => x.account.id === this.account.id); + const old = oldFiltered.length ? oldFiltered[0] : null; + if (old && (old.debit === -1 || old.id === this.paymentJournal.id)) { + return; + } + if (old) { + old.amount += amount; + } else { + this.voucher.journals.push({ + id: null, + debit: debit, + amount: amount, + account: this.account, + costCentre: null + }); + } + this.resetAddRow(); + this.updateView(); + } + + resetAddRow() { + this.form.get('addRow').reset({ + account: null, + amount: null + }); + this.account = null; + this.accBal = null; + setTimeout(() => { + this.accountElement.nativeElement.focus(); + }, 0); + } + + updateView() { + const journals = this.voucher.journals.filter(x => x.debit === 1); + this.journalObservable.next(journals); + this.paymentJournal.amount = Math.abs(journals.map((x) => x.amount).reduce((p, c) => p + c, 0)); + this.form.get('paymentAmount').setValue(this.paymentJournal.amount); + } + + editRow(row: Journal) { + const dialogRef = this.dialog.open(PaymentDialogComponent, { + width: '750px', + data: {journal: Object.assign({}, row), date: moment(this.form.get('date').value).format('DD-MMM-YYYY')} + }); + + dialogRef.afterClosed().subscribe((result: boolean | Journal) => { + if (!result) { + return; + } + const j = result as Journal; + if (j.account.id !== row.account.id && this.voucher.journals.filter((x) => x.account.id === j.account.id).length) { + return; + } + Object.assign(row, j); + this.updateView(); + }); + } + + deleteRow(row: Journal) { + this.voucher.journals.splice(this.voucher.journals.indexOf(row), 1); + this.updateView(); + } + + createForm() { + this.form = this.fb.group({ + date: '', + paymentAccount: '', + paymentAmount: {value: '', disabled: true}, + addRow: this.fb.group({ + account: '', + amount: '' + }), + narration: '' + }); + this.accBal = null; + } + + canSave() { + if (!this.voucher.id) { + return true; + } else if (this.voucher.posted && this.auth.user.perms.indexOf('Edit Posted Vouchers') !== -1) { + return true; + } else { + return this.voucher.user.id === this.auth.user.id || this.auth.user.perms.indexOf('Edit Other User\'s Vouchers') !== -1; + } + } + + post() { + this.ser.post(this.voucher.id) + .subscribe( + (result) => { + this.loadVoucher(result); + this.toaster.show('Success', 'Voucher Posted'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + save() { + this.ser.save(this.getVoucher()) + .subscribe( + (result) => { + this.loadVoucher(result); + this.toaster.show('Success', ''); + this.router.navigate(['/Payment', result.id]); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + getVoucher(): Voucher { + const formModel = this.form.value; + this.voucher.date = moment(formModel.date).format('DD-MMM-YYYY'); + this.paymentJournal.account.id = formModel.paymentAccount; + this.voucher.narration = formModel.narration; + return this.voucher; + } + + delete() { + this.ser.delete(this.voucher.id) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigate(['/Payment'], {replaceUrl: true}); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + confirmDelete(): void { + const dialogRef = this.dialog.open(ConfirmDialogComponent, { + width: '250px', + data: {title: 'Delete Voucher?', content: 'Are you sure? This cannot be undone.'} + }); + + dialogRef.afterClosed().subscribe((result: boolean) => { + if (result) { + this.delete(); + } + }); + } + + listenToAccountAutocompleteChange(): void { + const control = this.form.get('addRow').get('account'); + this.accounts = control.valueChanges + .pipe( + startWith(null), + map(x => (x !== null && x.length >= 1) ? x : null), + debounceTime(150), + distinctUntilChanged(), + switchMap(x => (x === null) ? observableOf([]) : this.accountSer.autocomplete(x)) + ); + } + + listenToPaymentAccountChange(): void { + this.form.get('paymentAccount').valueChanges + .subscribe(x => this.router.navigate([], { + relativeTo: this.route, + queryParams: {a: x}, + replaceUrl: true + }) + ); + } + + displayAccount(account?: Account): string | undefined { + return account ? account.name : undefined; + } + + accountSelected(event: MatAutocompleteSelectedEvent): void { + this.account = event.option.value; + const date = moment(this.form.get('date').value).format('DD-MMM-YYYY'); + this.accountSer.balance(this.account.id, date).subscribe((v) => { + this.accBal = v; + }); + } + + zoomImage(file: DbFile) { + this.dialog.open(ImageDialogComponent, { + width: '750px', + data: file.resized + }); + } + + deleteImage(file: DbFile) { + const index = this.voucher.files.indexOf(file); + this.voucher.files.splice(index, 1); + } + + detectFiles(event) { + const files = event.target.files; + if (files) { + for (const file of files) { + const reader = new FileReader(); + reader.onload = (e: any) => { + zip(of(e.target.result), + this.resizeImage(e.target.result, 100, 150), + this.resizeImage(e.target.result, 825, 1170) + ).subscribe( + val => this.voucher.files.push({id: null, thumbnail: val[1], resized: val[2]}) + ); + }; + reader.readAsDataURL(file); + } + } + } + + resizeImage(image, MAX_WIDTH, MAX_HEIGHT) { + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d'); + const img = new Image(); + const ex = fromEvent(img, 'load').pipe( + map((e) => { + let width = img.naturalWidth, + height = img.naturalHeight; + const ratio = Math.min(1, MAX_WIDTH / width, MAX_HEIGHT / height); + + if (ratio === 1) { + return image; + } + + width *= ratio; + height *= ratio; + + canvas.width = width; + canvas.height = height; + ctx.drawImage(img, 0, 0, width, height); + return canvas.toDataURL('image/jpeg', 0.95); + }) + ); + img.src = image; + return ex; + } +} diff --git a/overlord/src/app/payment/payment.module.spec.ts b/overlord/src/app/payment/payment.module.spec.ts new file mode 100644 index 00000000..42d35ac7 --- /dev/null +++ b/overlord/src/app/payment/payment.module.spec.ts @@ -0,0 +1,13 @@ +import {PaymentModule} from './payment.module'; + +describe('PaymentModule', () => { + let paymentModule: PaymentModule; + + beforeEach(() => { + paymentModule = new PaymentModule(); + }); + + it('should create an instance', () => { + expect(paymentModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/payment/payment.module.ts b/overlord/src/app/payment/payment.module.ts new file mode 100644 index 00000000..be3182a9 --- /dev/null +++ b/overlord/src/app/payment/payment.module.ts @@ -0,0 +1,84 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {ReactiveFormsModule} from '@angular/forms'; +import {CdkTableModule} from '@angular/cdk/table'; +import {PaymentRoutingModule} from './payment-routing.module'; +import {PaymentComponent} from './payment.component'; +import {MomentDateAdapter} from '@angular/material-moment-adapter'; +import {A11yModule} from '@angular/cdk/a11y'; +import {PaymentDialogComponent} from './payment-dialog.component'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + PaymentRoutingModule + ], + declarations: [ + PaymentComponent, + PaymentDialogComponent + ], + providers: [ + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, + ], + entryComponents: [ + PaymentDialogComponent + ] +}) +export class PaymentModule { +} diff --git a/overlord/src/app/payment/payment.service.spec.ts b/overlord/src/app/payment/payment.service.spec.ts new file mode 100644 index 00000000..8b829d69 --- /dev/null +++ b/overlord/src/app/payment/payment.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {VoucherService} from './payment.service'; + +describe('PaymentService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [VoucherService] + }); + }); + + it('should be created', inject([VoucherService], (service: VoucherService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/product-group/product-group-detail/product-group-detail.component.css b/overlord/src/app/product-group/product-group-detail/product-group-detail.component.css new file mode 100644 index 00000000..82c7afd6 --- /dev/null +++ b/overlord/src/app/product-group/product-group-detail/product-group-detail.component.css @@ -0,0 +1,3 @@ +.example-card { + max-width: 400px; +} diff --git a/overlord/src/app/product-group/product-group-detail/product-group-detail.component.html b/overlord/src/app/product-group/product-group-detail/product-group-detail.component.html new file mode 100644 index 00000000..a8c0167c --- /dev/null +++ b/overlord/src/app/product-group/product-group-detail/product-group-detail.component.html @@ -0,0 +1,21 @@ +
    + + + Product Group + + +
    +
    + + Name + + +
    +
    +
    + + + +
    +
    diff --git a/overlord/src/app/product-group/product-group-detail/product-group-detail.component.spec.ts b/overlord/src/app/product-group/product-group-detail/product-group-detail.component.spec.ts new file mode 100644 index 00000000..50600159 --- /dev/null +++ b/overlord/src/app/product-group/product-group-detail/product-group-detail.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {ProductGroupDetailComponent} from './product-group-detail.component'; + +describe('ProductGroupDetailComponent', () => { + let component: ProductGroupDetailComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ProductGroupDetailComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ProductGroupDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/product-group/product-group-detail/product-group-detail.component.ts b/overlord/src/app/product-group/product-group-detail/product-group-detail.component.ts new file mode 100644 index 00000000..91c61c1f --- /dev/null +++ b/overlord/src/app/product-group/product-group-detail/product-group-detail.component.ts @@ -0,0 +1,73 @@ +import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; + +import {ProductGroupService} from '../product-group.service'; +import {ProductGroup} from '../product-group'; +import {ActivatedRoute, Router} from '@angular/router'; +import {ToasterService} from '../../core/toaster.service'; +import {FormBuilder, FormGroup} from '@angular/forms'; + +@Component({ + selector: 'app-product-group-detail', + templateUrl: './product-group-detail.component.html', + styleUrls: ['./product-group-detail.component.css'] +}) +export class ProductGroupDetailComponent implements OnInit, AfterViewInit { + @ViewChild('nameElement') nameElement: ElementRef; + form: FormGroup; + item: ProductGroup; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder, + private toaster: ToasterService, + private ser: ProductGroupService + ) { + this.createForm(); + } + + createForm() { + this.form = this.fb.group({ + name: '' + }); + } + + ngOnInit() { + this.route.data + .subscribe((data: { item: ProductGroup }) => { + this.showItem(data.item); + }); + } + + showItem(item: ProductGroup) { + this.item = item; + this.form.setValue({ + name: this.item.name, + }); + } + + ngAfterViewInit() { + setTimeout(() => { + this.nameElement.nativeElement.focus(); + }, 0); + } + + save() { + this.ser.saveOrUpdate(this.getItem()) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigateByUrl('/ProductGroups'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + getItem(): ProductGroup { + const formModel = this.form.value; + this.item.name = formModel.name; + return this.item; + } +} diff --git a/overlord/src/app/product-group/product-group-list-resolver.service.spec.ts b/overlord/src/app/product-group/product-group-list-resolver.service.spec.ts new file mode 100644 index 00000000..864d865f --- /dev/null +++ b/overlord/src/app/product-group/product-group-list-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {ProductGroupListResolverService} from './product-group-list-resolver.service'; + +describe('ProductGroupListResolverService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ProductGroupListResolverService] + }); + }); + + it('should be created', inject([ProductGroupListResolverService], (service: ProductGroupListResolverService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/product-group/product-group-list-resolver.service.ts b/overlord/src/app/product-group/product-group-list-resolver.service.ts new file mode 100644 index 00000000..ba6d4d8f --- /dev/null +++ b/overlord/src/app/product-group/product-group-list-resolver.service.ts @@ -0,0 +1,18 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot} from '@angular/router'; +import {ProductGroup} from './product-group'; +import {Observable} from 'rxjs/internal/Observable'; +import {ProductGroupService} from './product-group.service'; + +@Injectable({ + providedIn: 'root' +}) +export class ProductGroupListResolver implements Resolve { + + constructor(private ser: ProductGroupService, private router: Router) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + return this.ser.list(); + } +} diff --git a/overlord/src/app/product-group/product-group-list/product-group-list-datasource.ts b/overlord/src/app/product-group/product-group-list/product-group-list-datasource.ts new file mode 100644 index 00000000..26040fb7 --- /dev/null +++ b/overlord/src/app/product-group/product-group-list/product-group-list-datasource.ts @@ -0,0 +1,58 @@ +import {DataSource} from '@angular/cdk/collections'; +import {MatPaginator, MatSort} from '@angular/material'; +import {map} from 'rxjs/operators'; +import {merge, Observable, of as observableOf} from 'rxjs'; +import {ProductGroup} from '../product-group'; + +export class ProductGroupListDataSource extends DataSource { + + constructor(private paginator: MatPaginator, private sort: MatSort, public data: ProductGroup[]) { + super(); + } + + connect(): Observable { + const dataMutations = [ + observableOf(this.data), + this.paginator.page, + this.sort.sortChange + ]; + + // Set the paginators length + this.paginator.length = this.data.length; + + return merge(...dataMutations).pipe(map(() => { + return this.getPagedData(this.getSortedData([...this.data])); + })); + } + + disconnect() { + } + + private getPagedData(data: ProductGroup[]) { + const startIndex = this.paginator.pageIndex * this.paginator.pageSize; + return data.splice(startIndex, this.paginator.pageSize); + } + + private getSortedData(data: ProductGroup[]) { + if (!this.sort.active || this.sort.direction === '') { + return data; + } + + return data.sort((a, b) => { + const isAsc = this.sort.direction === 'asc'; + switch (this.sort.active) { + case 'name': + return compare(a.name, b.name, isAsc); + case 'id': + return compare(+a.id, +b.id, isAsc); + default: + return 0; + } + }); + } +} + +/** Simple sort comparator for example ID/Name columns (for client-side sorting). */ +function compare(a, b, isAsc) { + return (a < b ? -1 : 1) * (isAsc ? 1 : -1); +} diff --git a/overlord/src/app/product-group/product-group-list/product-group-list.component.css b/overlord/src/app/product-group/product-group-list/product-group-list.component.css new file mode 100644 index 00000000..e69de29b diff --git a/overlord/src/app/product-group/product-group-list/product-group-list.component.html b/overlord/src/app/product-group/product-group-list/product-group-list.component.html new file mode 100644 index 00000000..132edc72 --- /dev/null +++ b/overlord/src/app/product-group/product-group-list/product-group-list.component.html @@ -0,0 +1,35 @@ + + + Product Groups + + add_box + Add + + + + + + + + Name + {{row.name}} + + + + + Is Fixture? + {{row.isFixture}} + + + + + + + + + + diff --git a/overlord/src/app/product-group/product-group-list/product-group-list.component.spec.ts b/overlord/src/app/product-group/product-group-list/product-group-list.component.spec.ts new file mode 100644 index 00000000..939ebec6 --- /dev/null +++ b/overlord/src/app/product-group/product-group-list/product-group-list.component.spec.ts @@ -0,0 +1,23 @@ +import {ComponentFixture, fakeAsync, TestBed} from '@angular/core/testing'; + +import {ProductGroupListComponent} from './product-group-list.component'; + +describe('ProductGroupListComponent', () => { + let component: ProductGroupListComponent; + let fixture: ComponentFixture; + + beforeEach(fakeAsync(() => { + TestBed.configureTestingModule({ + declarations: [ProductGroupListComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ProductGroupListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should compile', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/product-group/product-group-list/product-group-list.component.ts b/overlord/src/app/product-group/product-group-list/product-group-list.component.ts new file mode 100644 index 00000000..8f747e6f --- /dev/null +++ b/overlord/src/app/product-group/product-group-list/product-group-list.component.ts @@ -0,0 +1,30 @@ +import {Component, OnInit, ViewChild} from '@angular/core'; +import {MatPaginator, MatSort} from '@angular/material'; +import {ProductGroupListDataSource} from './product-group-list-datasource'; +import {ProductGroup} from '../product-group'; +import {ActivatedRoute} from '@angular/router'; + +@Component({ + selector: 'app-product-group-list', + templateUrl: './product-group-list.component.html', + styleUrls: ['./product-group-list.component.css'] +}) +export class ProductGroupListComponent implements OnInit { + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + dataSource: ProductGroupListDataSource; + list: ProductGroup[]; + /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ + displayedColumns = ['name', 'isFixture']; + + constructor(private route: ActivatedRoute) { + } + + ngOnInit() { + this.route.data + .subscribe((data: { list: ProductGroup[] }) => { + this.list = data.list; + }); + this.dataSource = new ProductGroupListDataSource(this.paginator, this.sort, this.list); + } +} diff --git a/overlord/src/app/product-group/product-group-resolver.service.spec.ts b/overlord/src/app/product-group/product-group-resolver.service.spec.ts new file mode 100644 index 00000000..fea6971f --- /dev/null +++ b/overlord/src/app/product-group/product-group-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {ProductGroupResolverService} from './product-group-resolver.service'; + +describe('ProductGroupResolverService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ProductGroupDetailResolverService] + }); + }); + + it('should be created', inject([ProductGroupDetailResolverService], (service: ProductGroupDetailResolverService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/product-group/product-group-resolver.service.ts b/overlord/src/app/product-group/product-group-resolver.service.ts new file mode 100644 index 00000000..4776f965 --- /dev/null +++ b/overlord/src/app/product-group/product-group-resolver.service.ts @@ -0,0 +1,19 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot} from '@angular/router'; +import {ProductGroupService} from './product-group.service'; +import {ProductGroup} from './product-group'; +import {Observable} from 'rxjs/internal/Observable'; + +@Injectable({ + providedIn: 'root' +}) +export class ProductGroupResolver implements Resolve { + + constructor(private ser: ProductGroupService, private router: Router) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const id = route.paramMap.get('id'); + return this.ser.get(id); + } +} diff --git a/overlord/src/app/product-group/product-group-routing.module.spec.ts b/overlord/src/app/product-group/product-group-routing.module.spec.ts new file mode 100644 index 00000000..88d6e8f8 --- /dev/null +++ b/overlord/src/app/product-group/product-group-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {ProductGroupRoutingModule} from './product-group-routing.module'; + +describe('ProductGroupRoutingModule', () => { + let productGroupRoutingModule: ProductGroupRoutingModule; + + beforeEach(() => { + productGroupRoutingModule = new ProductGroupRoutingModule(); + }); + + it('should create an instance', () => { + expect(productGroupRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/product-group/product-group-routing.module.ts b/overlord/src/app/product-group/product-group-routing.module.ts new file mode 100644 index 00000000..5a247df5 --- /dev/null +++ b/overlord/src/app/product-group/product-group-routing.module.ts @@ -0,0 +1,61 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {ProductGroupListResolver} from './product-group-list-resolver.service'; +import {ProductGroupResolver} from './product-group-resolver.service'; +import {ProductGroupListComponent} from './product-group-list/product-group-list.component'; +import {ProductGroupDetailComponent} from './product-group-detail/product-group-detail.component'; +import {AuthGuard} from '../auth/auth-guard.service'; + +const productGroupRoutes: Routes = [ + { + path: 'ProductGroups', + component: ProductGroupListComponent, + canActivate: [AuthGuard], + data: { + permission: 'Cost Centres' + }, + resolve: { + list: ProductGroupListResolver + } + }, + { + path: 'ProductGroup', + component: ProductGroupDetailComponent, + canActivate: [AuthGuard], + data: { + permission: 'Cost Centres' + }, + resolve: { + item: ProductGroupResolver + } + }, + { + path: 'ProductGroup/:id', + component: ProductGroupDetailComponent, + canActivate: [AuthGuard], + data: { + permission: 'Cost Centres' + }, + resolve: { + item: ProductGroupResolver + } + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(productGroupRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + ProductGroupListResolver, + ProductGroupResolver + ] +}) +export class ProductGroupRoutingModule { +} diff --git a/overlord/src/app/product-group/product-group.module.spec.ts b/overlord/src/app/product-group/product-group.module.spec.ts new file mode 100644 index 00000000..40eb41da --- /dev/null +++ b/overlord/src/app/product-group/product-group.module.spec.ts @@ -0,0 +1,13 @@ +import {ProductGroupModule} from './product-group.module'; + +describe('ProductGroupModule', () => { + let productGroupModule: ProductGroupModule; + + beforeEach(() => { + productGroupModule = new ProductGroupModule(); + }); + + it('should create an instance', () => { + expect(productGroupModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/product-group/product-group.module.ts b/overlord/src/app/product-group/product-group.module.ts new file mode 100644 index 00000000..94503e7a --- /dev/null +++ b/overlord/src/app/product-group/product-group.module.ts @@ -0,0 +1,44 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; + +import {ProductGroupListComponent} from './product-group-list/product-group-list.component'; +import {ProductGroupDetailComponent} from './product-group-detail/product-group-detail.component'; +import {ProductGroupRoutingModule} from './product-group-routing.module'; +import { + MatButtonModule, + MatCardModule, + MatIconModule, + MatInputModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {CdkTableModule} from '@angular/cdk/table'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; +import {ReactiveFormsModule} from '@angular/forms'; + +@NgModule({ + imports: [ + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatTableModule, + MatPaginatorModule, + MatSortModule, + MatCardModule, + MatProgressSpinnerModule, + MatInputModule, + MatButtonModule, + MatIconModule, + ReactiveFormsModule, + ProductGroupRoutingModule + ], + declarations: [ + ProductGroupListComponent, + ProductGroupDetailComponent + ] +}) +export class ProductGroupModule { +} diff --git a/overlord/src/app/product-group/product-group.service.spec.ts b/overlord/src/app/product-group/product-group.service.spec.ts new file mode 100644 index 00000000..9f9dd7d4 --- /dev/null +++ b/overlord/src/app/product-group/product-group.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {ProductGroupService} from './product-group.service'; + +describe('ProductGroupService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ProductGroupService] + }); + }); + + it('should be created', inject([ProductGroupService], (service: ProductGroupService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/product-group/product-group.service.ts b/overlord/src/app/product-group/product-group.service.ts new file mode 100644 index 00000000..d4327ce8 --- /dev/null +++ b/overlord/src/app/product-group/product-group.service.ts @@ -0,0 +1,65 @@ +import {Injectable} from '@angular/core'; +import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http'; +import {ErrorLoggerService} from '../core/error-logger.service'; +import {catchError} from 'rxjs/operators'; +import {Observable} from 'rxjs/internal/Observable'; +import {ProductGroup} from './product-group'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; +const url = '/api/ProductGroup'; +const serviceName = 'ProductGroupService'; + +@Injectable({ + providedIn: 'root' +}) +export class ProductGroupService { + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + get(id: string): Observable { + const getUrl: string = (id === null) ? url : `${url}/${id}`; + return >this.http.get(getUrl) + .pipe( + catchError(this.log.handleError(serviceName, `get id=${id}`)) + ); + } + + list(): Observable { + const options = {params: new HttpParams().set('l', '')}; + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + + save(productGroup: ProductGroup): Observable { + return >this.http.post(url, productGroup, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'save')) + ); + } + + update(productGroup: ProductGroup): Observable { + return >this.http.put(`${url}/${productGroup.id}`, productGroup, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'update')) + ); + } + + saveOrUpdate(productGroup: ProductGroup): Observable { + if (!productGroup.id) { + return this.save(productGroup); + } else { + return this.update(productGroup); + } + } + + delete(id: string): Observable { + return >this.http.delete(`${url}/${id}`, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'delete')) + ); + } +} diff --git a/overlord/src/app/product-group/product-group.ts b/overlord/src/app/product-group/product-group.ts new file mode 100644 index 00000000..86645914 --- /dev/null +++ b/overlord/src/app/product-group/product-group.ts @@ -0,0 +1,5 @@ +export class ProductGroup { + id: string; + name: string; + isFixture: boolean; +} diff --git a/overlord/src/app/product-ledger/product-ledger-datasource.ts b/overlord/src/app/product-ledger/product-ledger-datasource.ts new file mode 100644 index 00000000..f2c9c50c --- /dev/null +++ b/overlord/src/app/product-ledger/product-ledger-datasource.ts @@ -0,0 +1,65 @@ +import {DataSource} from '@angular/cdk/collections'; +import {MatPaginator, MatSort} from '@angular/material'; +import {map} from 'rxjs/operators'; +import {merge, Observable, of as observableOf} from 'rxjs'; +import {ProductLedgerItem} from './product-ledger'; + + +export class ProductLedgerDataSource extends DataSource { + + constructor(private paginator: MatPaginator, private sort: MatSort, public data: ProductLedgerItem[]) { + super(); + } + + connect(): Observable { + const dataMutations = [ + observableOf(this.data), + this.paginator.page, + this.sort.sortChange + ]; + + // Set the paginators length + this.paginator.length = this.data.length; + + return merge(...dataMutations).pipe(map(() => { + return this.getPagedData(this.getSortedData([...this.data])); + })); + } + + disconnect() { + } + + private getPagedData(data: ProductLedgerItem[]) { + const startIndex = this.paginator.pageIndex * this.paginator.pageSize; + return data.splice(startIndex, this.paginator.pageSize); + } + + private getSortedData(data: ProductLedgerItem[]) { + if (!this.sort.active || this.sort.direction === '') { + return data; + } + + return data.sort((a, b) => { + const isAsc = this.sort.direction === 'asc'; + switch (this.sort.active) { + case 'date': + return compare(a.date, b.date, isAsc); + case 'debitQuantity': + return compare(+a.debitQuantity, +b.debitQuantity, isAsc); + case 'debitAmount': + return compare(+a.debitAmount, +b.debitAmount, isAsc); + case 'creditQuantity': + return compare(+a.creditQuantity, +b.creditQuantity, isAsc); + case 'creditAmount': + return compare(+a.creditAmount, +b.creditAmount, isAsc); + default: + return 0; + } + }); + } +} + +/** Simple sort comparator for example ID/Name columns (for client-side sorting). */ +function compare(a, b, isAsc) { + return (a < b ? -1 : 1) * (isAsc ? 1 : -1); +} diff --git a/overlord/src/app/product-ledger/product-ledger-resolver.service.spec.ts b/overlord/src/app/product-ledger/product-ledger-resolver.service.spec.ts new file mode 100644 index 00000000..83fb8142 --- /dev/null +++ b/overlord/src/app/product-ledger/product-ledger-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {ProductLedgerResolver} from './product-ledger-resolver.service'; + +describe('ProductLedgerResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ProductLedgerResolver] + }); + }); + + it('should be created', inject([ProductLedgerResolver], (service: ProductLedgerResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/product-ledger/product-ledger-resolver.service.ts b/overlord/src/app/product-ledger/product-ledger-resolver.service.ts new file mode 100644 index 00000000..5f485f8e --- /dev/null +++ b/overlord/src/app/product-ledger/product-ledger-resolver.service.ts @@ -0,0 +1,21 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {ProductLedger} from './product-ledger'; +import {ProductLedgerService} from './product-ledger.service'; + +@Injectable({ + providedIn: 'root' +}) +export class ProductLedgerResolver implements Resolve { + + constructor(private ser: ProductLedgerService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const id = route.paramMap.get('id'); + const startDate = route.queryParamMap.get('startDate') || null; + const finishDate = route.queryParamMap.get('finishDate') || null; + return this.ser.list(id, startDate, finishDate); + } +} diff --git a/overlord/src/app/product-ledger/product-ledger-routing.module.spec.ts b/overlord/src/app/product-ledger/product-ledger-routing.module.spec.ts new file mode 100644 index 00000000..54aa6ca0 --- /dev/null +++ b/overlord/src/app/product-ledger/product-ledger-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {ProductLedgerRoutingModule} from './product-ledger-routing.module'; + +describe('ProductLedgerRoutingModule', () => { + let productLedgerRoutingModule: ProductLedgerRoutingModule; + + beforeEach(() => { + productLedgerRoutingModule = new ProductLedgerRoutingModule(); + }); + + it('should create an instance', () => { + expect(productLedgerRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/product-ledger/product-ledger-routing.module.ts b/overlord/src/app/product-ledger/product-ledger-routing.module.ts new file mode 100644 index 00000000..2fcb0f79 --- /dev/null +++ b/overlord/src/app/product-ledger/product-ledger-routing.module.ts @@ -0,0 +1,49 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {ProductLedgerResolver} from './product-ledger-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {ProductLedgerComponent} from './product-ledger.component'; + +const productLedgerRoutes: Routes = [ + { + path: 'ProductLedger', + component: ProductLedgerComponent, + canActivate: [AuthGuard], + data: { + permission: 'Product Ledger' + }, + resolve: { + info: ProductLedgerResolver + }, + runGuardsAndResolvers: 'always' + }, + { + path: 'ProductLedger/:id', + component: ProductLedgerComponent, + canActivate: [AuthGuard], + data: { + permission: 'Product Ledger' + }, + resolve: { + info: ProductLedgerResolver + }, + runGuardsAndResolvers: 'always' + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(productLedgerRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + ProductLedgerResolver + ] +}) +export class ProductLedgerRoutingModule { +} diff --git a/overlord/src/app/product-ledger/product-ledger.component.css b/overlord/src/app/product-ledger/product-ledger.component.css new file mode 100644 index 00000000..ef3a3239 --- /dev/null +++ b/overlord/src/app/product-ledger/product-ledger.component.css @@ -0,0 +1,12 @@ +.right { + display: flex; + justify-content: flex-end; +} + +.selected{ + background: #fff3cd +} + +.unposted{ + background: #f8d7da +} diff --git a/overlord/src/app/product-ledger/product-ledger.component.html b/overlord/src/app/product-ledger/product-ledger.component.html new file mode 100644 index 00000000..a71afa2d --- /dev/null +++ b/overlord/src/app/product-ledger/product-ledger.component.html @@ -0,0 +1,120 @@ + + + Product Ledger + + +
    +
    + + + + + + + + + + +
    +
    + + + + {{product.name}} + + + +
    +
    + + + + + Date + {{row.date}} + + + + + + Particulars + {{row.name}} + Closing Balance + + + + + Type + {{row.type}} + Closing Balance + + + + + Narration + {{row.narration}} + + + + + + Debit Quantity + {{row.debitQuantity | number:'1.2-2'}} + {{info.debitQuantity | number:'1.2-2'}} + + + + + Amount + {{row.debitAmount | currency:'INR'}} + {{info.debitAmount | currency:'INR'}} + + + + + Credit + {{row.creditQuantity | number:'1.2-2'}} + {{info.creditQuantity | number:'1.2-2'}} + + + + + Credit + {{row.creditAmount | currency:'INR'}} + {{info.creditAmount | currency:'INR'}} + + + + + Running + {{row.runningQuantity | number:'1.2-2'}} + {{info.runningQuantity | number:'1.2-2'}} + + + + + Running + {{row.runningAmount | currency:'INR'}} + {{info.runningAmount | currency:'INR'}} + + + + + + + + + +
    +
    diff --git a/overlord/src/app/product-ledger/product-ledger.component.spec.ts b/overlord/src/app/product-ledger/product-ledger.component.spec.ts new file mode 100644 index 00000000..7def8a5e --- /dev/null +++ b/overlord/src/app/product-ledger/product-ledger.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {ProductLedgerComponent} from './product-ledger.component'; + +describe('ProductLedgerComponent', () => { + let component: ProductLedgerComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ProductLedgerComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ProductLedgerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/product-ledger/product-ledger.component.ts b/overlord/src/app/product-ledger/product-ledger.component.ts new file mode 100644 index 00000000..0656bd35 --- /dev/null +++ b/overlord/src/app/product-ledger/product-ledger.component.ts @@ -0,0 +1,150 @@ +import {Component, OnInit, ViewChild} from '@angular/core'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MatAutocompleteSelectedEvent, MatPaginator, MatSort} from '@angular/material'; +import {ActivatedRoute, Router} from '@angular/router'; +import {Observable, of as observableOf} from 'rxjs'; +import {debounceTime, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators'; +import * as moment from 'moment'; +import {ProductLedgerDataSource} from './product-ledger-datasource'; +import {ProductLedger} from './product-ledger'; +import {ProductLedgerService} from './product-ledger.service'; +import {Product} from '../product/product'; +import {ProductService} from '../product/product.service'; + +@Component({ + selector: 'app-product-ledger', + templateUrl: './product-ledger.component.html', + styleUrls: ['./product-ledger.component.css'] +}) +export class ProductLedgerComponent implements OnInit { + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + dataSource: ProductLedgerDataSource; + form: FormGroup; + info: ProductLedger; + selectedRowId: string; + debitQuantity: number; + debitAmount: number; + creditQuantity: number; + creditAmount: number; + runningQuantity: number; + runningAmount: number; + /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ + displayedColumns = [ + 'date', 'particulars', 'type', 'narration', + 'debitQuantity', 'debitAmount', + 'creditQuantity', 'creditAmount', + 'runningQuantity', 'runningAmount' + ]; + + products: Observable; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder, + private ser: ProductLedgerService, + private productSer: ProductService + ) { + this.createForm(); + + this.products = this.form.get('product').valueChanges + .pipe( + startWith(null), + map(x => (x !== null && x.length >= 1) ? x : null), + debounceTime(150), + distinctUntilChanged(), + switchMap(x => (x === null) ? observableOf([]) : this.productSer.autocomplete(x)) + ); + } + + ngOnInit() { + this.route.data + .subscribe((data: { info: ProductLedger }) => { + this.info = data.info; + this.calculateTotals(); + this.form.setValue({ + product: this.info.product, + startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(), + finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate() + }); + this.dataSource = new ProductLedgerDataSource(this.paginator, this.sort, this.info.body); + }); + } + + displayFn(product?: Product): string | undefined { + return product ? product.name : undefined; + } + + calculateTotals() { + this.debitQuantity = 0; + this.debitAmount = 0; + this.creditQuantity = 0; + this.creditAmount = 0; + this.runningQuantity = 0; + this.runningAmount = 0; + this.info.body.forEach((item) => { + if (item.type !== 'Opening Balance') { + this.debitAmount += item.debitAmount; + this.creditQuantity += item.creditQuantity; + this.creditAmount += item.creditAmount; + if (item.posted) { + this.runningQuantity += item.debitQuantity - item.creditQuantity; + this.runningAmount += item.debitAmount - item.creditAmount; + } + } else { + this.runningQuantity += item.debitQuantity - item.creditQuantity; + this.runningAmount += item.debitAmount - item.creditAmount; + } + item.runningQuantity = this.runningQuantity; + item.runningAmount = this.runningAmount; + }); + } + + selected(event: MatAutocompleteSelectedEvent): void { + this.info.product = event.option.value; + } + + selectRow(id: string): void { + this.selectedRowId = id; + } + + getRowClass(id: string, posted: boolean): string { + if (this.selectedRowId === id) { + return 'selected'; + } else if (!posted) { + return 'unposted'; + } else { + return ''; + } + } + + show() { + const l = this.prepareSubmit(); + this.router.navigate(['ProductLedger', l.product.id], { + queryParams: { + startDate: l.startDate, + finishDate: l.finishDate + } + }); + } + + createForm() { + this.form = this.fb.group({ + startDate: '', + finishDate: '', + product: '' + }); + } + + prepareSubmit(): ProductLedger { + const formModel = this.form.value; + + return { + product: formModel.product, + startDate: moment(formModel.startDate).format('DD-MMM-YYYY'), + finishDate: moment(formModel.finishDate).format('DD-MMM-YYYY'), + body: this.info.body + }; + } +} diff --git a/overlord/src/app/product-ledger/product-ledger.module.spec.ts b/overlord/src/app/product-ledger/product-ledger.module.spec.ts new file mode 100644 index 00000000..d634200e --- /dev/null +++ b/overlord/src/app/product-ledger/product-ledger.module.spec.ts @@ -0,0 +1,13 @@ +import {ProductLedgerModule} from './product-ledger.module'; + +describe('ProductLedgerModule', () => { + let productLedgerModule: ProductLedgerModule; + + beforeEach(() => { + productLedgerModule = new ProductLedgerModule(); + }); + + it('should create an instance', () => { + expect(productLedgerModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/product-ledger/product-ledger.module.ts b/overlord/src/app/product-ledger/product-ledger.module.ts new file mode 100644 index 00000000..b2952bea --- /dev/null +++ b/overlord/src/app/product-ledger/product-ledger.module.ts @@ -0,0 +1,75 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {ReactiveFormsModule} from '@angular/forms'; +import {CdkTableModule} from '@angular/cdk/table'; +import {ProductLedgerRoutingModule} from './product-ledger-routing.module'; +import {ProductLedgerComponent} from './product-ledger.component'; +import {MomentDateAdapter} from '@angular/material-moment-adapter'; +import {A11yModule} from '@angular/cdk/a11y'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + ProductLedgerRoutingModule + ], + declarations: [ + ProductLedgerComponent + ], + providers: [ + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, + ] +}) +export class ProductLedgerModule { +} diff --git a/overlord/src/app/product-ledger/product-ledger.service.spec.ts b/overlord/src/app/product-ledger/product-ledger.service.spec.ts new file mode 100644 index 00000000..1b457b56 --- /dev/null +++ b/overlord/src/app/product-ledger/product-ledger.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {ProductLedgerService} from './product-ledger.service'; + +describe('ProductLedgerService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ProductLedgerService] + }); + }); + + it('should be created', inject([ProductLedgerService], (service: ProductLedgerService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/product-ledger/product-ledger.service.ts b/overlord/src/app/product-ledger/product-ledger.service.ts new file mode 100644 index 00000000..fe428af2 --- /dev/null +++ b/overlord/src/app/product-ledger/product-ledger.service.ts @@ -0,0 +1,38 @@ +import {Injectable} from '@angular/core'; +import {catchError} from 'rxjs/operators'; +import {Observable} from 'rxjs/internal/Observable'; +import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http'; +import {ProductLedger} from './product-ledger'; +import {ErrorLoggerService} from '../core/error-logger.service'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; + +const url = '/api/ProductLedger'; +const serviceName = 'ProductLedgerService'; + +@Injectable({ + providedIn: 'root' +}) +export class ProductLedgerService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + list(date: string, startDate: string, finishDate): Observable { + const listUrl = (date === null) ? url : `${url}/${date}`; + const options = {params: new HttpParams()}; + if (startDate !== null) { + options.params = options.params.set('s', startDate); + } + if (finishDate !== null) { + options.params = options.params.set('f', finishDate); + } + return >this.http.get(listUrl, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + +} diff --git a/overlord/src/app/product-ledger/product-ledger.ts b/overlord/src/app/product-ledger/product-ledger.ts new file mode 100644 index 00000000..6f533bef --- /dev/null +++ b/overlord/src/app/product-ledger/product-ledger.ts @@ -0,0 +1,24 @@ +import {Product} from '../product/product'; + +export class ProductLedgerItem { + date: string; + id: string; + name: string; + type: string; + narration: string; + debitQuantity: number; + debitAmount: number; + creditQuantity: number; + creditAmount: number; + runningQuantity: number; + runningAmount: number; + posted: boolean; + url: string; +} + +export class ProductLedger { + startDate: string; + finishDate: string; + product: Product; + body: ProductLedgerItem[]; +} diff --git a/overlord/src/app/product/product-detail/product-detail.component.css b/overlord/src/app/product/product-detail/product-detail.component.css new file mode 100644 index 00000000..e69de29b diff --git a/overlord/src/app/product/product-detail/product-detail.component.html b/overlord/src/app/product/product-detail/product-detail.component.html new file mode 100644 index 00000000..71d1c848 --- /dev/null +++ b/overlord/src/app/product/product-detail/product-detail.component.html @@ -0,0 +1,77 @@ +
    + + + Product + + +
    +
    + + Code + + +
    +
    + + Name + + + + Units + + +
    +
    + + Fraction + + + + Fraction Units + + + + Yield + + +
    +
    + + {{item.isPurchased ? 'Purchase Price' : 'Cost Price' }} + + + + Sale Price + + +
    +
    + Is Purchased? + Is Sold? + Is Active? +
    +
    + + Product Type + + + {{ pg.name }} + + + +
    +
    +
    + + + + +
    +
    diff --git a/overlord/src/app/product/product-detail/product-detail.component.spec.ts b/overlord/src/app/product/product-detail/product-detail.component.spec.ts new file mode 100644 index 00000000..83e97a9f --- /dev/null +++ b/overlord/src/app/product/product-detail/product-detail.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {ProductDetailComponent} from './product-detail.component'; + +describe('ProductDetailComponent', () => { + let component: ProductDetailComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ProductDetailComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ProductDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/product/product-detail/product-detail.component.ts b/overlord/src/app/product/product-detail/product-detail.component.ts new file mode 100644 index 00000000..25e69162 --- /dev/null +++ b/overlord/src/app/product/product-detail/product-detail.component.ts @@ -0,0 +1,136 @@ +import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; +import {ToasterService} from '../../core/toaster.service'; +import {ActivatedRoute, Router} from '@angular/router'; +import {ProductService} from '../product.service'; +import {Product} from '../product'; +import {ProductGroup} from '../../product-group/product-group'; +import {ConfirmDialogComponent} from '../../shared/confirm-dialog/confirm-dialog.component'; +import {MatDialog} from '@angular/material'; +import {FormBuilder, FormGroup} from '@angular/forms'; + +@Component({ + selector: 'app-product-detail', + templateUrl: './product-detail.component.html', + styleUrls: ['./product-detail.component.css'] +}) +export class ProductDetailComponent implements OnInit, AfterViewInit { + @ViewChild('nameElement') nameElement: ElementRef; + form: FormGroup; + productGroups: ProductGroup[]; + item: Product; + + constructor( + private route: ActivatedRoute, + private router: Router, + private dialog: MatDialog, + private fb: FormBuilder, + private toaster: ToasterService, + private ser: ProductService + ) { + this.createForm(); + } + + createForm() { + this.form = this.fb.group({ + code: {value: '', disabled: true}, + name: '', + units: '', + fraction: '', + fractionUnits: '', + productYield: '', + price: '', + salePrice: '', + isPurchased: '', + isSold: '', + isActive: '', + productGroup: '' + }); + } + + ngOnInit() { + this.route.data + .subscribe((data: { item: Product, productGroups: ProductGroup[] }) => { + this.productGroups = data.productGroups; + this.showItem(data.item); + }); + } + + showItem(item: Product) { + this.item = item; + this.form.setValue({ + code: this.item.code || '(Auto)', + name: this.item.name, + units: this.item.units, + fraction: this.item.fraction, + fractionUnits: this.item.fractionUnits, + productYield: this.item.productYield, + price: this.item.price, + salePrice: this.item.salePrice, + isPurchased: this.item.isPurchased, + isSold: this.item.isSold, + isActive: this.item.isActive, + productGroup: this.item.productGroup.id + }); + } + + ngAfterViewInit() { + setTimeout(() => { + this.nameElement.nativeElement.focus(); + }, 0); + } + + save() { + this.ser.saveOrUpdate(this.getItem()) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigateByUrl('/Products'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + delete() { + this.ser.delete(this.item.id) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigateByUrl('/Products'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + confirmDelete(): void { + const dialogRef = this.dialog.open(ConfirmDialogComponent, { + width: '250px', + data: {title: 'Delete Product?', content: 'Are you sure? This cannot be undone.'} + }); + + dialogRef.afterClosed().subscribe((result: boolean) => { + if (result) { + this.delete(); + } + }); + } + + getItem(): Product { + const formModel = this.form.value; + this.item.name = formModel.name; + this.item.units = formModel.units; + this.item.fraction = +formModel.fraction; + this.item.fractionUnits = formModel.fractionUnits; + this.item.productYield = +formModel.productYield; + this.item.price = +formModel.price; + this.item.salePrice = +formModel.salePrice; + this.item.isPurchased = formModel.isPurchased; + this.item.isSold = formModel.isSold; + this.item.isActive = formModel.isActive; + this.item.productGroup.id = formModel.productGroup; + return this.item; + } +} diff --git a/overlord/src/app/product/product-list-resolver.service.spec.ts b/overlord/src/app/product/product-list-resolver.service.spec.ts new file mode 100644 index 00000000..41f02906 --- /dev/null +++ b/overlord/src/app/product/product-list-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {ProductListResolverService} from './product-list-resolver.service'; + +describe('ProductListResolverService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ProductListResolverService] + }); + }); + + it('should be created', inject([ProductListResolverService], (service: ProductListResolverService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/product/product-list-resolver.service.ts b/overlord/src/app/product/product-list-resolver.service.ts new file mode 100644 index 00000000..bf2df74b --- /dev/null +++ b/overlord/src/app/product/product-list-resolver.service.ts @@ -0,0 +1,18 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Product} from './product'; +import {Observable} from 'rxjs/internal/Observable'; +import {ProductService} from './product.service'; + +@Injectable({ + providedIn: 'root' +}) +export class ProductListResolver implements Resolve { + + constructor(private ser: ProductService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + return this.ser.list(); + } +} diff --git a/overlord/src/app/product/product-list/product-list-datasource.ts b/overlord/src/app/product/product-list/product-list-datasource.ts new file mode 100644 index 00000000..c0511cf7 --- /dev/null +++ b/overlord/src/app/product/product-list/product-list-datasource.ts @@ -0,0 +1,80 @@ +import {DataSource} from '@angular/cdk/collections'; +import {MatPaginator, MatSort} from '@angular/material'; +import {map, tap} from 'rxjs/operators'; +import {merge, Observable, of as observableOf} from 'rxjs'; +import {Product} from '../product'; + + +export class ProductListDataSource extends DataSource { + private dataObservable: Observable; + private filterValue: string; + + constructor(private paginator: MatPaginator, private sort: MatSort, private filter: Observable, public data: Product[]) { + super(); + this.filter = filter.pipe( + tap(x => this.filterValue = x) + ); + } + + connect(): Observable { + this.dataObservable = observableOf(this.data); + const dataMutations = [ + this.dataObservable, + this.filter, + this.paginator.page, + this.sort.sortChange + ]; + + return merge(...dataMutations).pipe( + map((x: any) => { + return this.getPagedData(this.getSortedData(this.getFilteredData([...this.data]))); + }), + tap((x: Product[]) => this.paginator.length = x.length) + ); + } + + disconnect() { + } + + private getFilteredData(data: Product[]): Product[] { + const filter = (this.filterValue === undefined) ? '' : this.filterValue; + return filter.split(' ').reduce((p: Product[], c: string) => { + return p.filter(x => { + const productString = ( + x.code + ' ' + x.name + ' ' + x.units + ' ' + x.productGroup + (x.isPurchased ? ' purchased' : ' made') + + (x.isSold ? 'sold' : 'used') + (x.isActive ? 'active' : 'deactive') + ).toLowerCase(); + return productString.indexOf(c) !== -1; + } + ); + }, Object.assign([], data)); + } + + private getPagedData(data: Product[]) { + const startIndex = this.paginator.pageIndex * this.paginator.pageSize; + return data.splice(startIndex, this.paginator.pageSize); + } + + private getSortedData(data: Product[]) { + if (!this.sort.active || this.sort.direction === '') { + return data; + } + + return data.sort((a, b) => { + const isAsc = this.sort.direction === 'asc'; + switch (this.sort.active) { + case 'name': + return compare(a.name, b.name, isAsc); + case 'id': + return compare(+a.id, +b.id, isAsc); + default: + return 0; + } + }); + } +} + +/** Simple sort comparator for example ID/Name columns (for client-side sorting). */ +function compare(a, b, isAsc) { + return (a < b ? -1 : 1) * (isAsc ? 1 : -1); +} diff --git a/overlord/src/app/product/product-list/product-list.component.css b/overlord/src/app/product/product-list/product-list.component.css new file mode 100644 index 00000000..e69de29b diff --git a/overlord/src/app/product/product-list/product-list.component.html b/overlord/src/app/product/product-list/product-list.component.html new file mode 100644 index 00000000..3a3b3fa9 --- /dev/null +++ b/overlord/src/app/product/product-list/product-list.component.html @@ -0,0 +1,83 @@ + + + Products + + add_box + Add + + + +
    +
    + + + +
    +
    + + + + + Name + {{row.name}} ({{showExtended ? + row.fraction + ' ' + row.fractionUnits + ' = 1 ':''}}{{row.units}}) + + + + + Cost Price + {{row.costPrice | currency:'INR'}} + + + + + Yield + {{row.productYield | percent:'1.2-2'}} + + + + + Product Group + {{row.productGroup}} + + + + + Details + +
    +
    + + {{ row.isPurchased ? "shopping_cart" : "remove_shopping_cart" }} + + {{ row.isPurchased ? "Purchased" : "Made" }} +
    +
    + + {{ row.isSold ? "restaurant_menu" : "import_contacts" }} + + {{ row.isSold ? "Sold" : "Used" }} +
    +
    + + {{ row.isActive ? "visibility" : "visibility_off" }} + + {{ row.isActive ? "Active" : "Deactivated" }} +
    +
    +
    +
    + + + +
    + + + +
    +
    diff --git a/overlord/src/app/product/product-list/product-list.component.spec.ts b/overlord/src/app/product/product-list/product-list.component.spec.ts new file mode 100644 index 00000000..06504afa --- /dev/null +++ b/overlord/src/app/product/product-list/product-list.component.spec.ts @@ -0,0 +1,23 @@ +import {ComponentFixture, fakeAsync, TestBed} from '@angular/core/testing'; + +import {ProductListComponent} from './product-list.component'; + +describe('ProductListComponent', () => { + let component: ProductListComponent; + let fixture: ComponentFixture; + + beforeEach(fakeAsync(() => { + TestBed.configureTestingModule({ + declarations: [ProductListComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(ProductListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should compile', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/product/product-list/product-list.component.ts b/overlord/src/app/product/product-list/product-list.component.ts new file mode 100644 index 00000000..f2931aa6 --- /dev/null +++ b/overlord/src/app/product/product-list/product-list.component.ts @@ -0,0 +1,76 @@ +import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; +import {MatPaginator, MatSort} from '@angular/material'; +import {ProductListDataSource} from './product-list-datasource'; +import {Product} from '../product'; +import {ActivatedRoute} from '@angular/router'; +import {debounceTime, distinctUntilChanged, startWith} from 'rxjs/operators'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {Observable} from 'rxjs'; + +@Component({ + selector: 'app-product-list', + templateUrl: './product-list.component.html', + styleUrls: ['./product-list.component.css'] +}) +export class ProductListComponent implements OnInit, AfterViewInit { + @ViewChild('filterElement') filterElement: ElementRef; + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + dataSource: ProductListDataSource; + filter: Observable; + form: FormGroup; + list: Product[]; + /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ + displayedColumns: string[]; + + constructor(private route: ActivatedRoute, private fb: FormBuilder) { + this.showExtended = false; + this.createForm(); + this.filter = this.listenToFilterChange(); + } + + createForm() { + this.form = this.fb.group({ + filter: '' + }); + } + + listenToFilterChange() { + return this.form.get('filter').valueChanges + .pipe( + startWith(''), + debounceTime(150), + distinctUntilChanged() + ); + } + + ngOnInit() { + this.route.data + .subscribe((data: { list: Product[] }) => { + this.list = data.list; + }); + this.dataSource = new ProductListDataSource(this.paginator, this.sort, this.filter, this.list); + } + + ngAfterViewInit() { + setTimeout(() => { + this.filterElement.nativeElement.focus(); + }, 0); + } + + private _showExtended: boolean; + + get showExtended(): boolean { + return this._showExtended; + } + + set showExtended(value: boolean) { + this._showExtended = value; + if (value) { + this.displayedColumns = ['name', 'costPrice', 'productYield', 'productGroup', 'info']; + } else { + this.displayedColumns = ['name', 'costPrice', 'productGroup', 'info']; + } + } + +} diff --git a/overlord/src/app/product/product-resolver.service.spec.ts b/overlord/src/app/product/product-resolver.service.spec.ts new file mode 100644 index 00000000..d58b20d2 --- /dev/null +++ b/overlord/src/app/product/product-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {ProductResolverService} from './product-resolver.service'; + +describe('ProductResolverService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ProductDetailResolverService] + }); + }); + + it('should be created', inject([ProductDetailResolverService], (service: ProductDetailResolverService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/product/product-resolver.service.ts b/overlord/src/app/product/product-resolver.service.ts new file mode 100644 index 00000000..2805b668 --- /dev/null +++ b/overlord/src/app/product/product-resolver.service.ts @@ -0,0 +1,19 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot} from '@angular/router'; +import {ProductService} from './product.service'; +import {Product} from './product'; +import {Observable} from 'rxjs/internal/Observable'; + +@Injectable({ + providedIn: 'root' +}) +export class ProductResolver implements Resolve { + + constructor(private ser: ProductService, private router: Router) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const id = route.paramMap.get('id'); + return this.ser.get(id); + } +} diff --git a/overlord/src/app/product/product-routing.module.spec.ts b/overlord/src/app/product/product-routing.module.spec.ts new file mode 100644 index 00000000..3f054cf5 --- /dev/null +++ b/overlord/src/app/product/product-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {ProductRoutingModule} from './product-routing.module'; + +describe('ProductRoutingModule', () => { + let productRoutingModule: ProductRoutingModule; + + beforeEach(() => { + productRoutingModule = new ProductRoutingModule(); + }); + + it('should create an instance', () => { + expect(productRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/product/product-routing.module.ts b/overlord/src/app/product/product-routing.module.ts new file mode 100644 index 00000000..ce7c4c24 --- /dev/null +++ b/overlord/src/app/product/product-routing.module.ts @@ -0,0 +1,67 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; + +import {ProductListResolver} from './product-list-resolver.service'; +import {ProductResolver} from './product-resolver.service'; +import {ProductDetailComponent} from './product-detail/product-detail.component'; +import {ProductListComponent} from './product-list/product-list.component'; + +import {AuthGuard} from '../auth/auth-guard.service'; +import {ProductGroupListResolver} from '../product-group/product-group-list-resolver.service'; +import {AccountListResolver} from '../account/account-list-resolver.service'; + +const productRoutes: Routes = [ + { + path: 'Products', + component: ProductListComponent, + canActivate: [AuthGuard], + data: { + permission: 'Products' + }, + resolve: { + list: ProductListResolver + } + }, + { + path: 'Product', + component: ProductDetailComponent, + canActivate: [AuthGuard], + data: { + permission: 'Products' + }, + resolve: { + item: ProductResolver, + productGroups: ProductGroupListResolver + } + }, + { + path: 'Product/:id', + component: ProductDetailComponent, + canActivate: [AuthGuard], + data: { + permission: 'Products' + }, + resolve: { + item: ProductResolver, + productGroups: ProductGroupListResolver + } + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(productRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + ProductListResolver, + ProductResolver + ] +}) +export class ProductRoutingModule { +} diff --git a/overlord/src/app/product/product.module.spec.ts b/overlord/src/app/product/product.module.spec.ts new file mode 100644 index 00000000..0ec58f1b --- /dev/null +++ b/overlord/src/app/product/product.module.spec.ts @@ -0,0 +1,13 @@ +import {ProductModule} from './product.module'; + +describe('ProductModule', () => { + let productModule: ProductModule; + + beforeEach(() => { + productModule = new ProductModule(); + }); + + it('should create an instance', () => { + expect(productModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/product/product.module.ts b/overlord/src/app/product/product.module.ts new file mode 100644 index 00000000..9a7396f9 --- /dev/null +++ b/overlord/src/app/product/product.module.ts @@ -0,0 +1,50 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; + +import {ProductListComponent} from './product-list/product-list.component'; +import {ProductDetailComponent} from './product-detail/product-detail.component'; +import {ProductRoutingModule} from './product-routing.module'; +import { + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatIconModule, + MatInputModule, + MatOptionModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {CdkTableModule} from '@angular/cdk/table'; +import {ReactiveFormsModule} from '@angular/forms'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +@NgModule({ + imports: [ + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatTableModule, + MatPaginatorModule, + MatSortModule, + MatCardModule, + MatProgressSpinnerModule, + MatInputModule, + MatButtonModule, + MatIconModule, + MatOptionModule, + MatSelectModule, + MatCheckboxModule, + ReactiveFormsModule, + ProductRoutingModule + ], + declarations: [ + ProductListComponent, + ProductDetailComponent + ] +}) +export class ProductModule { +} diff --git a/overlord/src/app/product/product.service.spec.ts b/overlord/src/app/product/product.service.spec.ts new file mode 100644 index 00000000..9a947235 --- /dev/null +++ b/overlord/src/app/product/product.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {ProductService} from './product.service'; + +describe('ProductService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ProductService] + }); + }); + + it('should be created', inject([ProductService], (service: ProductService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/product/product.service.ts b/overlord/src/app/product/product.service.ts new file mode 100644 index 00000000..b346d075 --- /dev/null +++ b/overlord/src/app/product/product.service.ts @@ -0,0 +1,81 @@ +import {Injectable} from '@angular/core'; +import {Observable} from 'rxjs/internal/Observable'; +import {catchError} from 'rxjs/operators'; +import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http'; +import {Product} from './product'; +import {ErrorLoggerService} from '../core/error-logger.service'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; + +const url = '/api/Product'; +const serviceName = 'ProductService'; + +@Injectable({providedIn: 'root'}) +export class ProductService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + get(id: string): Observable { + const getUrl: string = (id === null) ? url : `${url}/${id}`; + return >this.http.get(getUrl) + .pipe( + catchError(this.log.handleError(serviceName, `get id=${id}`)) + ); + } + + list(): Observable { + const options = {params: new HttpParams().set('l', '')}; + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'getList')) + ); + } + + save(product: Product): Observable { + return >this.http.post(url, product, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'save')) + ); + } + + update(product: Product): Observable { + return >this.http.put(`${url}/${product.id}`, product, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'update')) + ); + } + + saveOrUpdate(product: Product): Observable { + if (!product.id) { + return this.save(product); + } else { + return this.update(product); + } + } + + delete(id: string): Observable { + return >this.http.delete(`${url}/${id}`, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'delete')) + ); + } + + autocomplete(term: string): Observable { + const options = {params: new HttpParams().set('t', term)}; + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'autocomplete')) + ); + } + + balance(id: string, date: string): Observable { + const options = {params: new HttpParams().set('b', 'true').set('d', date)}; + return >this.http.get(`${url}/${id}`, options) + .pipe( + catchError(this.log.handleError(serviceName, 'balance')) + ); + } +} diff --git a/overlord/src/app/product/product.ts b/overlord/src/app/product/product.ts new file mode 100644 index 00000000..fb00e5d8 --- /dev/null +++ b/overlord/src/app/product/product.ts @@ -0,0 +1,20 @@ +import {Account} from '../account/account'; +import {ProductGroup} from '../product-group/product-group'; + +export class Product { + id: string; + code: number; + name: string; + units: string; + fraction: number; + fractionUnits: string; + productYield: number; + price: number; + salePrice: number; + isActive: boolean; + isFixture: boolean; + isPurchased: boolean; + isSold: boolean; + productGroup: ProductGroup; + account: Account; +} diff --git a/overlord/src/app/profit-loss/profit-loss-datasource.ts b/overlord/src/app/profit-loss/profit-loss-datasource.ts new file mode 100644 index 00000000..05ce61f3 --- /dev/null +++ b/overlord/src/app/profit-loss/profit-loss-datasource.ts @@ -0,0 +1,63 @@ +import {DataSource} from '@angular/cdk/collections'; +import {MatPaginator, MatSort} from '@angular/material'; +import {map} from 'rxjs/operators'; +import {merge, Observable, of as observableOf} from 'rxjs'; +import {ProfitLossItem} from './profit-loss'; + + +export class ProfitLossDataSource extends DataSource { + + constructor(private paginator: MatPaginator, private sort: MatSort, public data: ProfitLossItem[]) { + super(); + } + + connect(): Observable { + const dataMutations = [ + observableOf(this.data), + this.paginator.page, + this.sort.sortChange + ]; + + // Set the paginators length + this.paginator.length = this.data.length; + + return merge(...dataMutations).pipe(map(() => { + return this.getPagedData(this.getSortedData([...this.data])); + })); + } + + disconnect() { + } + + private getPagedData(data: ProfitLossItem[]) { + const startIndex = this.paginator.pageIndex * this.paginator.pageSize; + return data.splice(startIndex, this.paginator.pageSize); + } + + private getSortedData(data: ProfitLossItem[]) { + if (!this.sort.active || this.sort.direction === '') { + return data; + } + + return data.sort((a, b) => { + const isAsc = this.sort.direction === 'asc'; + switch (this.sort.active) { + case 'group': + return compare(a.group, b.group, isAsc); + case 'name': + return compare(a.name, b.name, isAsc); + case 'amount': + return compare(+a.amount, +b.amount, isAsc); + case 'total': + return compare(+a.total, +b.total, isAsc); + default: + return 0; + } + }); + } +} + +/** Simple sort comparator for example ID/Name columns (for client-side sorting). */ +function compare(a, b, isAsc) { + return (a < b ? -1 : 1) * (isAsc ? 1 : -1); +} diff --git a/overlord/src/app/profit-loss/profit-loss-resolver.service.spec.ts b/overlord/src/app/profit-loss/profit-loss-resolver.service.spec.ts new file mode 100644 index 00000000..70878b0f --- /dev/null +++ b/overlord/src/app/profit-loss/profit-loss-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {ProfitLossResolver} from './profit-loss-resolver.service'; + +describe('ProfitLossResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ProfitLossResolver] + }); + }); + + it('should be created', inject([ProfitLossResolver], (service: ProfitLossResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/profit-loss/profit-loss-resolver.service.ts b/overlord/src/app/profit-loss/profit-loss-resolver.service.ts new file mode 100644 index 00000000..69c4b716 --- /dev/null +++ b/overlord/src/app/profit-loss/profit-loss-resolver.service.ts @@ -0,0 +1,20 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {ProfitLoss} from './profit-loss'; +import {ProfitLossService} from './profit-loss.service'; + +@Injectable({ + providedIn: 'root' +}) +export class ProfitLossResolver implements Resolve { + + constructor(private ser: ProfitLossService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const startDate = route.queryParamMap.get('startDate') || null; + const finishDate = route.queryParamMap.get('finishDate') || null; + return this.ser.list(startDate, finishDate); + } +} diff --git a/overlord/src/app/profit-loss/profit-loss-routing.module.spec.ts b/overlord/src/app/profit-loss/profit-loss-routing.module.spec.ts new file mode 100644 index 00000000..2b62f119 --- /dev/null +++ b/overlord/src/app/profit-loss/profit-loss-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {ProfitLossRoutingModule} from './profit-loss-routing.module'; + +describe('ProfitLossRoutingModule', () => { + let profitLossRoutingModule: ProfitLossRoutingModule; + + beforeEach(() => { + profitLossRoutingModule = new ProfitLossRoutingModule(); + }); + + it('should create an instance', () => { + expect(profitLossRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/profit-loss/profit-loss-routing.module.ts b/overlord/src/app/profit-loss/profit-loss-routing.module.ts new file mode 100644 index 00000000..fcaa6454 --- /dev/null +++ b/overlord/src/app/profit-loss/profit-loss-routing.module.ts @@ -0,0 +1,37 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {ProfitLossResolver} from './profit-loss-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {ProfitLossComponent} from './profit-loss.component'; + +const profitLossRoutes: Routes = [ + { + path: 'ProfitLoss', + component: ProfitLossComponent, + canActivate: [AuthGuard], + data: { + permission: 'Profit & Loss' + }, + resolve: { + info: ProfitLossResolver + }, + runGuardsAndResolvers: 'always' + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(profitLossRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + ProfitLossResolver + ] +}) +export class ProfitLossRoutingModule { +} diff --git a/overlord/src/app/profit-loss/profit-loss.component.css b/overlord/src/app/profit-loss/profit-loss.component.css new file mode 100644 index 00000000..ef3a3239 --- /dev/null +++ b/overlord/src/app/profit-loss/profit-loss.component.css @@ -0,0 +1,12 @@ +.right { + display: flex; + justify-content: flex-end; +} + +.selected{ + background: #fff3cd +} + +.unposted{ + background: #f8d7da +} diff --git a/overlord/src/app/profit-loss/profit-loss.component.html b/overlord/src/app/profit-loss/profit-loss.component.html new file mode 100644 index 00000000..8c15e27f --- /dev/null +++ b/overlord/src/app/profit-loss/profit-loss.component.html @@ -0,0 +1,70 @@ + + + Profit & Loss + + +
    +
    + + + + + + + + + + + +
    +
    + + + + + Group + {{row.group}} + {{info.footer.group}} + + + + + Name + {{row.name}} + {{info.footer.name}} + + + + + Amount + {{row.amount | currency:'INR'}} + + {{info.footer.amount | currency:'INR'}} + + + + + + Total + {{row.total | currency:'INR'}} + + {{info.footer.total | currency:'INR'}} + + + + + + + + + + +
    +
    diff --git a/overlord/src/app/profit-loss/profit-loss.component.spec.ts b/overlord/src/app/profit-loss/profit-loss.component.spec.ts new file mode 100644 index 00000000..ea5af687 --- /dev/null +++ b/overlord/src/app/profit-loss/profit-loss.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {ProfitLossComponent} from './profit-loss.component'; + +describe('ProfitLossComponent', () => { + let component: ProfitLossComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ProfitLossComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ProfitLossComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/profit-loss/profit-loss.component.ts b/overlord/src/app/profit-loss/profit-loss.component.ts new file mode 100644 index 00000000..5ac98c60 --- /dev/null +++ b/overlord/src/app/profit-loss/profit-loss.component.ts @@ -0,0 +1,71 @@ +import {Component, OnInit, ViewChild} from '@angular/core'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MatPaginator, MatSort} from '@angular/material'; +import {ActivatedRoute, Router} from '@angular/router'; +import * as moment from 'moment'; +import {ProfitLossDataSource} from './profit-loss-datasource'; +import {ProfitLoss} from './profit-loss'; + +@Component({ + selector: 'app-profit-loss', + templateUrl: './profit-loss.component.html', + styleUrls: ['./profit-loss.component.css'] +}) +export class ProfitLossComponent implements OnInit { + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + dataSource: ProfitLossDataSource; + form: FormGroup; + info: ProfitLoss; + selectedRowId: string; + /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ + displayedColumns = ['group', 'name', 'amount', 'total']; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder + ) { + this.createForm(); + } + + ngOnInit() { + this.route.data + .subscribe((data: { info: ProfitLoss }) => { + this.info = data.info; + this.form.setValue({ + startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(), + finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate() + }); + this.dataSource = new ProfitLossDataSource(this.paginator, this.sort, this.info.body); + }); + } + + show() { + const l = this.prepareSubmit(); + this.router.navigate(['ProfitLoss'], { + queryParams: { + startDate: l.startDate, + finishDate: l.finishDate + } + }); + } + + createForm() { + this.form = this.fb.group({ + startDate: '', + finishDate: '', + }); + } + + prepareSubmit(): ProfitLoss { + const formModel = this.form.value; + + return { + startDate: moment(formModel.startDate).format('DD-MMM-YYYY'), + finishDate: moment(formModel.finishDate).format('DD-MMM-YYYY'), + body: [], + footer: {group: null, name: null, amount: null, total: null} + }; + } +} diff --git a/overlord/src/app/profit-loss/profit-loss.module.spec.ts b/overlord/src/app/profit-loss/profit-loss.module.spec.ts new file mode 100644 index 00000000..32072bf5 --- /dev/null +++ b/overlord/src/app/profit-loss/profit-loss.module.spec.ts @@ -0,0 +1,13 @@ +import {ProfitLossModule} from './profit-loss.module'; + +describe('ProfitLossModule', () => { + let profitLossModule: ProfitLossModule; + + beforeEach(() => { + profitLossModule = new ProfitLossModule(); + }); + + it('should create an instance', () => { + expect(profitLossModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/profit-loss/profit-loss.module.ts b/overlord/src/app/profit-loss/profit-loss.module.ts new file mode 100644 index 00000000..510b8ba7 --- /dev/null +++ b/overlord/src/app/profit-loss/profit-loss.module.ts @@ -0,0 +1,75 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {ReactiveFormsModule} from '@angular/forms'; +import {CdkTableModule} from '@angular/cdk/table'; +import {ProfitLossRoutingModule} from './profit-loss-routing.module'; +import {ProfitLossComponent} from './profit-loss.component'; +import {MomentDateAdapter} from '@angular/material-moment-adapter'; +import {A11yModule} from '@angular/cdk/a11y'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + ProfitLossRoutingModule + ], + declarations: [ + ProfitLossComponent + ], + providers: [ + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, + ] +}) +export class ProfitLossModule { +} diff --git a/overlord/src/app/profit-loss/profit-loss.service.spec.ts b/overlord/src/app/profit-loss/profit-loss.service.spec.ts new file mode 100644 index 00000000..7f400435 --- /dev/null +++ b/overlord/src/app/profit-loss/profit-loss.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {ProfitLossService} from './profit-loss.service'; + +describe('ProfitLossService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ProfitLossService] + }); + }); + + it('should be created', inject([ProfitLossService], (service: ProfitLossService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/profit-loss/profit-loss.service.ts b/overlord/src/app/profit-loss/profit-loss.service.ts new file mode 100644 index 00000000..21fe018a --- /dev/null +++ b/overlord/src/app/profit-loss/profit-loss.service.ts @@ -0,0 +1,37 @@ +import {Injectable} from '@angular/core'; +import {catchError} from 'rxjs/operators'; +import {Observable} from 'rxjs/internal/Observable'; +import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http'; +import {ProfitLoss} from './profit-loss'; +import {ErrorLoggerService} from '../core/error-logger.service'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; + +const url = '/api/ProfitLoss'; +const serviceName = 'ProfitLossService'; + +@Injectable({ + providedIn: 'root' +}) +export class ProfitLossService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + list(startDate: string, finishDate): Observable { + const options = {params: new HttpParams()}; + if (startDate !== null) { + options.params = options.params.set('s', startDate); + } + if (finishDate !== null) { + options.params = options.params.set('f', finishDate); + } + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + +} diff --git a/overlord/src/app/profit-loss/profit-loss.ts b/overlord/src/app/profit-loss/profit-loss.ts new file mode 100644 index 00000000..32e3df7e --- /dev/null +++ b/overlord/src/app/profit-loss/profit-loss.ts @@ -0,0 +1,14 @@ + +export class ProfitLossItem { + group: string; + name: string; + amount: number; + total: number; +} + +export class ProfitLoss { + startDate: string; + finishDate: string; + body: ProfitLossItem[]; + footer: ProfitLossItem; +} diff --git a/overlord/src/app/purchase-entries/purchase-entries-datasource.ts b/overlord/src/app/purchase-entries/purchase-entries-datasource.ts new file mode 100644 index 00000000..585aca18 --- /dev/null +++ b/overlord/src/app/purchase-entries/purchase-entries-datasource.ts @@ -0,0 +1,63 @@ +import {DataSource} from '@angular/cdk/collections'; +import {MatPaginator, MatSort} from '@angular/material'; +import {map} from 'rxjs/operators'; +import {merge, Observable, of as observableOf} from 'rxjs'; +import {PurchaseEntriesItem} from './purchase-entries'; + + +export class PurchaseEntriesDataSource extends DataSource { + + constructor(private paginator: MatPaginator, private sort: MatSort, public data: PurchaseEntriesItem[]) { + super(); + } + + connect(): Observable { + const dataMutations = [ + observableOf(this.data), + this.paginator.page, + this.sort.sortChange + ]; + + // Set the paginators length + this.paginator.length = this.data.length; + + return merge(...dataMutations).pipe(map(() => { + return this.getPagedData(this.getSortedData([...this.data])); + })); + } + + disconnect() { + } + + private getPagedData(data: PurchaseEntriesItem[]) { + const startIndex = this.paginator.pageIndex * this.paginator.pageSize; + return data.splice(startIndex, this.paginator.pageSize); + } + + private getSortedData(data: PurchaseEntriesItem[]) { + if (!this.sort.active || this.sort.direction === '') { + return data; + } + + return data.sort((a, b) => { + const isAsc = this.sort.direction === 'asc'; + switch (this.sort.active) { + case 'date': + return compare(a.date, b.date, isAsc); + case 'supplier': + return compare(a.supplier, b.supplier, isAsc); + case 'product': + return compare(a.product, b.product, isAsc); + case 'amount': + return compare(+a.amount, +b.amount, isAsc); + default: + return 0; + } + }); + } +} + +/** Simple sort comparator for example ID/Name columns (for client-side sorting). */ +function compare(a, b, isAsc) { + return (a < b ? -1 : 1) * (isAsc ? 1 : -1); +} diff --git a/overlord/src/app/purchase-entries/purchase-entries-resolver.service.spec.ts b/overlord/src/app/purchase-entries/purchase-entries-resolver.service.spec.ts new file mode 100644 index 00000000..8c551604 --- /dev/null +++ b/overlord/src/app/purchase-entries/purchase-entries-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {PurchaseEntriesResolver} from './purchase-entries-resolver.service'; + +describe('PurchaseEntriesResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [PurchaseEntriesResolver] + }); + }); + + it('should be created', inject([PurchaseEntriesResolver], (service: PurchaseEntriesResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/purchase-entries/purchase-entries-resolver.service.ts b/overlord/src/app/purchase-entries/purchase-entries-resolver.service.ts new file mode 100644 index 00000000..dd883319 --- /dev/null +++ b/overlord/src/app/purchase-entries/purchase-entries-resolver.service.ts @@ -0,0 +1,20 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {PurchaseEntries} from './purchase-entries'; +import {PurchaseEntriesService} from './purchase-entries.service'; + +@Injectable({ + providedIn: 'root' +}) +export class PurchaseEntriesResolver implements Resolve { + + constructor(private ser: PurchaseEntriesService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const startDate = route.queryParamMap.get('startDate') || null; + const finishDate = route.queryParamMap.get('finishDate') || null; + return this.ser.list(startDate, finishDate); + } +} diff --git a/overlord/src/app/purchase-entries/purchase-entries-routing.module.spec.ts b/overlord/src/app/purchase-entries/purchase-entries-routing.module.spec.ts new file mode 100644 index 00000000..2aba6cbb --- /dev/null +++ b/overlord/src/app/purchase-entries/purchase-entries-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {PurchaseEntriesRoutingModule} from './purchase-entries-routing.module'; + +describe('PurchaseEntriesRoutingModule', () => { + let purchaseEntriesRoutingModule: PurchaseEntriesRoutingModule; + + beforeEach(() => { + purchaseEntriesRoutingModule = new PurchaseEntriesRoutingModule(); + }); + + it('should create an instance', () => { + expect(purchaseEntriesRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/purchase-entries/purchase-entries-routing.module.ts b/overlord/src/app/purchase-entries/purchase-entries-routing.module.ts new file mode 100644 index 00000000..3fcc7feb --- /dev/null +++ b/overlord/src/app/purchase-entries/purchase-entries-routing.module.ts @@ -0,0 +1,37 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {PurchaseEntriesResolver} from './purchase-entries-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {PurchaseEntriesComponent} from './purchase-entries.component'; + +const purchaseEntriesRoutes: Routes = [ + { + path: 'PurchaseEntries', + component: PurchaseEntriesComponent, + canActivate: [AuthGuard], + data: { + permission: 'Purchase Entries' + }, + resolve: { + info: PurchaseEntriesResolver + }, + runGuardsAndResolvers: 'always' + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(purchaseEntriesRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + PurchaseEntriesResolver + ] +}) +export class PurchaseEntriesRoutingModule { +} diff --git a/overlord/src/app/purchase-entries/purchase-entries.component.css b/overlord/src/app/purchase-entries/purchase-entries.component.css new file mode 100644 index 00000000..ef3a3239 --- /dev/null +++ b/overlord/src/app/purchase-entries/purchase-entries.component.css @@ -0,0 +1,12 @@ +.right { + display: flex; + justify-content: flex-end; +} + +.selected{ + background: #fff3cd +} + +.unposted{ + background: #f8d7da +} diff --git a/overlord/src/app/purchase-entries/purchase-entries.component.html b/overlord/src/app/purchase-entries/purchase-entries.component.html new file mode 100644 index 00000000..7f3f7798 --- /dev/null +++ b/overlord/src/app/purchase-entries/purchase-entries.component.html @@ -0,0 +1,86 @@ + + + Purchase Entries + + +
    +
    + + + + + + + + + + + +
    +
    + + + + + Date + {{row.date}} + + + + + Supplier + {{row.supplier}} + + + + + Product + {{row.product}} + + + + + + Quantity + {{row.quantity | number:'1.2-2'}} + + + + + Rate + {{row.rate | currency:'INR'}} + + + + + Tax + {{row.tax | percent:'1.2-2'}} + + + + + Discount + {{row.discount | percent:'1.2-2'}} + + + + + Amount + {{row.amount | currency:'INR'}} + + + + + + + + +
    +
    diff --git a/overlord/src/app/purchase-entries/purchase-entries.component.spec.ts b/overlord/src/app/purchase-entries/purchase-entries.component.spec.ts new file mode 100644 index 00000000..e60d1a53 --- /dev/null +++ b/overlord/src/app/purchase-entries/purchase-entries.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {PurchaseEntriesComponent} from './purchase-entries.component'; + +describe('PurchaseEntriesComponent', () => { + let component: PurchaseEntriesComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [PurchaseEntriesComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PurchaseEntriesComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/purchase-entries/purchase-entries.component.ts b/overlord/src/app/purchase-entries/purchase-entries.component.ts new file mode 100644 index 00000000..88b076c4 --- /dev/null +++ b/overlord/src/app/purchase-entries/purchase-entries.component.ts @@ -0,0 +1,70 @@ +import {Component, OnInit, ViewChild} from '@angular/core'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MatPaginator, MatSort} from '@angular/material'; +import {ActivatedRoute, Router} from '@angular/router'; +import * as moment from 'moment'; +import {PurchaseEntriesDataSource} from './purchase-entries-datasource'; +import {PurchaseEntries} from './purchase-entries'; + +@Component({ + selector: 'app-purchase-entries', + templateUrl: './purchase-entries.component.html', + styleUrls: ['./purchase-entries.component.css'] +}) +export class PurchaseEntriesComponent implements OnInit { + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + dataSource: PurchaseEntriesDataSource; + form: FormGroup; + info: PurchaseEntries; + selectedRowId: string; + /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ + displayedColumns = ['date', 'supplier', 'product', 'quantity', 'rate', 'tax', 'discount', 'amount']; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder + ) { + this.createForm(); + } + + ngOnInit() { + this.route.data + .subscribe((data: { info: PurchaseEntries }) => { + this.info = data.info; + this.form.setValue({ + startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(), + finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate() + }); + this.dataSource = new PurchaseEntriesDataSource(this.paginator, this.sort, this.info.body); + }); + } + + show() { + const l = this.prepareSubmit(); + this.router.navigate(['PurchaseEntries'], { + queryParams: { + startDate: l.startDate, + finishDate: l.finishDate + } + }); + } + + createForm() { + this.form = this.fb.group({ + startDate: '', + finishDate: '', + }); + } + + prepareSubmit(): PurchaseEntries { + const formModel = this.form.value; + + return { + startDate: moment(formModel.startDate).format('DD-MMM-YYYY'), + finishDate: moment(formModel.finishDate).format('DD-MMM-YYYY'), + body: [] + }; + } +} diff --git a/overlord/src/app/purchase-entries/purchase-entries.module.spec.ts b/overlord/src/app/purchase-entries/purchase-entries.module.spec.ts new file mode 100644 index 00000000..628945e3 --- /dev/null +++ b/overlord/src/app/purchase-entries/purchase-entries.module.spec.ts @@ -0,0 +1,13 @@ +import {PurchaseEntriesModule} from './purchase-entries.module'; + +describe('PurchaseEntriesModule', () => { + let purchaseEntriesModule: PurchaseEntriesModule; + + beforeEach(() => { + purchaseEntriesModule = new PurchaseEntriesModule(); + }); + + it('should create an instance', () => { + expect(purchaseEntriesModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/purchase-entries/purchase-entries.module.ts b/overlord/src/app/purchase-entries/purchase-entries.module.ts new file mode 100644 index 00000000..e89d015c --- /dev/null +++ b/overlord/src/app/purchase-entries/purchase-entries.module.ts @@ -0,0 +1,75 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {ReactiveFormsModule} from '@angular/forms'; +import {CdkTableModule} from '@angular/cdk/table'; +import {PurchaseEntriesRoutingModule} from './purchase-entries-routing.module'; +import {PurchaseEntriesComponent} from './purchase-entries.component'; +import {MomentDateAdapter} from '@angular/material-moment-adapter'; +import {A11yModule} from '@angular/cdk/a11y'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + PurchaseEntriesRoutingModule + ], + declarations: [ + PurchaseEntriesComponent + ], + providers: [ + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, + ] +}) +export class PurchaseEntriesModule { +} diff --git a/overlord/src/app/purchase-entries/purchase-entries.service.spec.ts b/overlord/src/app/purchase-entries/purchase-entries.service.spec.ts new file mode 100644 index 00000000..3588a425 --- /dev/null +++ b/overlord/src/app/purchase-entries/purchase-entries.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {PurchaseEntriesService} from './purchase-entries.service'; + +describe('PurchaseEntriesService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [PurchaseEntriesService] + }); + }); + + it('should be created', inject([PurchaseEntriesService], (service: PurchaseEntriesService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/purchase-entries/purchase-entries.service.ts b/overlord/src/app/purchase-entries/purchase-entries.service.ts new file mode 100644 index 00000000..8ef07b23 --- /dev/null +++ b/overlord/src/app/purchase-entries/purchase-entries.service.ts @@ -0,0 +1,37 @@ +import {Injectable} from '@angular/core'; +import {catchError} from 'rxjs/operators'; +import {Observable} from 'rxjs/internal/Observable'; +import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http'; +import {PurchaseEntries} from './purchase-entries'; +import {ErrorLoggerService} from '../core/error-logger.service'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; + +const url = '/api/PurchaseEntries'; +const serviceName = 'PurchaseEntriesService'; + +@Injectable({ + providedIn: 'root' +}) +export class PurchaseEntriesService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + list(startDate: string, finishDate): Observable { + const options = {params: new HttpParams()}; + if (startDate !== null) { + options.params = options.params.set('s', startDate); + } + if (finishDate !== null) { + options.params = options.params.set('f', finishDate); + } + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + +} diff --git a/overlord/src/app/purchase-entries/purchase-entries.ts b/overlord/src/app/purchase-entries/purchase-entries.ts new file mode 100644 index 00000000..6eb2fce3 --- /dev/null +++ b/overlord/src/app/purchase-entries/purchase-entries.ts @@ -0,0 +1,17 @@ + +export class PurchaseEntriesItem { + date: string; + supplier: string; + product: string; + quantity: number; + rate: number; + tax: number; + discount: number; + amount: number; +} + +export class PurchaseEntries { + startDate: string; + finishDate: string; + body: PurchaseEntriesItem[]; +} diff --git a/overlord/src/app/purchase-return/batch.service.ts b/overlord/src/app/purchase-return/batch.service.ts new file mode 100644 index 00000000..5a28473d --- /dev/null +++ b/overlord/src/app/purchase-return/batch.service.ts @@ -0,0 +1,24 @@ +import {Injectable} from '@angular/core'; +import {Observable} from 'rxjs/internal/Observable'; +import {catchError} from 'rxjs/operators'; +import {HttpClient, HttpParams} from '@angular/common/http'; +import {Batch} from '../journal/voucher'; +import {ErrorLoggerService} from '../core/error-logger.service'; + +const url = '/api/Batch'; +const serviceName = 'BatchService'; + +@Injectable({providedIn: 'root'}) +export class BatchService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + autocomplete(date: string, term: string): Observable { + const options = {params: new HttpParams().set('t', term).set('d', date)}; + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'autocomplete')) + ); + } +} diff --git a/overlord/src/app/purchase-return/purchase-return-datasource.ts b/overlord/src/app/purchase-return/purchase-return-datasource.ts new file mode 100644 index 00000000..fc8fe27b --- /dev/null +++ b/overlord/src/app/purchase-return/purchase-return-datasource.ts @@ -0,0 +1,18 @@ +import {DataSource} from '@angular/cdk/collections'; +import {Observable} from 'rxjs'; +import {Inventory, Journal} from '../journal/voucher'; + + +export class PurchaseReturnDataSource extends DataSource { + + constructor(private data: Observable) { + super(); + } + + connect(): Observable { + return this.data; + } + + disconnect() { + } +} diff --git a/overlord/src/app/purchase-return/purchase-return-dialog.component.css b/overlord/src/app/purchase-return/purchase-return-dialog.component.css new file mode 100644 index 00000000..e69de29b diff --git a/overlord/src/app/purchase-return/purchase-return-dialog.component.html b/overlord/src/app/purchase-return/purchase-return-dialog.component.html new file mode 100644 index 00000000..4421cbf8 --- /dev/null +++ b/overlord/src/app/purchase-return/purchase-return-dialog.component.html @@ -0,0 +1,25 @@ +

    Edit PurchaseReturn Entry

    +
    +
    +
    + + + + {{batch.name}} + + + + Quantity + + +
    +
    +
    +
    + + +
    + diff --git a/overlord/src/app/purchase-return/purchase-return-dialog.component.spec.ts b/overlord/src/app/purchase-return/purchase-return-dialog.component.spec.ts new file mode 100644 index 00000000..8d6711fe --- /dev/null +++ b/overlord/src/app/purchase-return/purchase-return-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PurchaseReturnDialogComponent } from './purchase-return-dialog.component'; + +describe('PurchaseReturnDialogComponent', () => { + let component: PurchaseReturnDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PurchaseReturnDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PurchaseReturnDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/purchase-return/purchase-return-dialog.component.ts b/overlord/src/app/purchase-return/purchase-return-dialog.component.ts new file mode 100644 index 00000000..deea7ca8 --- /dev/null +++ b/overlord/src/app/purchase-return/purchase-return-dialog.component.ts @@ -0,0 +1,74 @@ +import {Component, Inject, OnInit} from '@angular/core'; +import {MAT_DIALOG_DATA, MatAutocompleteSelectedEvent, MatDialogRef} from '@angular/material'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {debounceTime, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators'; +import {Observable, of as observableOf} from 'rxjs'; +import {Batch} from '../journal/voucher'; +import {BatchService} from './batch.service'; + +@Component({ + selector: 'app-purchase-return-dialog', + templateUrl: './purchase-return-dialog.component.html', + styleUrls: ['./purchase-return-dialog.component.css'] +}) +export class PurchaseReturnDialogComponent implements OnInit { + batches: Observable; + form: FormGroup; + batch: Batch; + + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any, + private fb: FormBuilder, + private batchSer: BatchService) { + this.createForm(); + this.listenToBatchAutocompleteChange(); + } + + ngOnInit() { + this.form.setValue({ + batch: this.data.inventory.batch, + quantity: this.data.inventory.quantity + }); + this.batch = this.data.inventory.batch; + } + + createForm() { + this.form = this.fb.group({ + batch: '', + quantity: '' + }); + } + + listenToBatchAutocompleteChange(): void { + const control = this.form.get('batch'); + this.batches = control.valueChanges + .pipe( + startWith(null), + map(x => (x !== null && x.length >= 1) ? x : null), + debounceTime(150), + distinctUntilChanged(), + switchMap(x => (x === null) ? observableOf([]) : this.batchSer.autocomplete(this.data.date, x))); + } + + displayBatchName(batch?: Batch): string | undefined { + return batch ? batch.name : undefined; + } + + batchSelected(event: MatAutocompleteSelectedEvent): void { + this.batch = event.option.value; + } + + accept(): void { + const formValue = this.form.value; + const quantity = +(formValue.quantity); + this.data.inventory.batch = this.batch; + this.data.inventory.product = this.batch.product; + this.data.inventory.quantity = quantity; + this.data.inventory.rate = this.batch.rate; + this.data.inventory.tax = this.batch.tax; + this.data.inventory.discount = this.batch.discount; + this.data.inventory.amount = quantity * this.batch.rate * (1 + this.batch.tax) * (1 - this.batch.discount); + this.dialogRef.close(this.data.inventory); + } +} diff --git a/overlord/src/app/purchase-return/purchase-return-resolver.service.spec.ts b/overlord/src/app/purchase-return/purchase-return-resolver.service.spec.ts new file mode 100644 index 00000000..89a01477 --- /dev/null +++ b/overlord/src/app/purchase-return/purchase-return-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {PurchaseReturnResolver} from './purchase-return-resolver.service'; + +describe('PurchaseReturnResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [PurchaseReturnResolver] + }); + }); + + it('should be created', inject([PurchaseReturnResolver], (service: PurchaseReturnResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/purchase-return/purchase-return-resolver.service.ts b/overlord/src/app/purchase-return/purchase-return-resolver.service.ts new file mode 100644 index 00000000..dd71fa44 --- /dev/null +++ b/overlord/src/app/purchase-return/purchase-return-resolver.service.ts @@ -0,0 +1,23 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {Voucher} from '../journal/voucher'; +import {VoucherService} from '../journal/voucher.service'; + +@Injectable({ + providedIn: 'root' +}) +export class PurchaseReturnResolver implements Resolve { + + constructor(private ser: VoucherService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const id = route.paramMap.get('id'); + if (id === null) { + return this.ser.getOfType('Purchase Return'); + } else { + return this.ser.get(id); + } + } +} diff --git a/overlord/src/app/purchase-return/purchase-return-routing.module.spec.ts b/overlord/src/app/purchase-return/purchase-return-routing.module.spec.ts new file mode 100644 index 00000000..60507372 --- /dev/null +++ b/overlord/src/app/purchase-return/purchase-return-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {PurchaseReturnRoutingModule} from './purchase-return-routing.module'; + +describe('PurchaseReturnRoutingModule', () => { + let purchaseReturnRoutingModule: PurchaseReturnRoutingModule; + + beforeEach(() => { + purchaseReturnRoutingModule = new PurchaseReturnRoutingModule(); + }); + + it('should create an instance', () => { + expect(purchaseReturnRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/purchase-return/purchase-return-routing.module.ts b/overlord/src/app/purchase-return/purchase-return-routing.module.ts new file mode 100644 index 00000000..b288f4ff --- /dev/null +++ b/overlord/src/app/purchase-return/purchase-return-routing.module.ts @@ -0,0 +1,49 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {PurchaseReturnResolver} from './purchase-return-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {PurchaseReturnComponent} from './purchase-return.component'; + +const purchaseReturnRoutes: Routes = [ + { + path: 'Return', + component: PurchaseReturnComponent, + canActivate: [AuthGuard], + data: { + permission: 'Purchase Return' + }, + resolve: { + voucher: PurchaseReturnResolver + }, + runGuardsAndResolvers: 'always' + }, + { + path: 'Return/:id', + component: PurchaseReturnComponent, + canActivate: [AuthGuard], + data: { + permission: 'Purchase Return' + }, + resolve: { + voucher: PurchaseReturnResolver + }, + runGuardsAndResolvers: 'always' + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(purchaseReturnRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + PurchaseReturnResolver + ] +}) +export class PurchaseReturnRoutingModule { +} diff --git a/overlord/src/app/purchase-return/purchase-return.component.css b/overlord/src/app/purchase-return/purchase-return.component.css new file mode 100644 index 00000000..a592a823 --- /dev/null +++ b/overlord/src/app/purchase-return/purchase-return.component.css @@ -0,0 +1,32 @@ +.right { + display: flex; + justify-content: flex-end; +} + +.selected { + background: #fff3cd +} + +.unposted { + background: #f8d7da +} + +.center { + display: flex; + justify-content: center; +} + +.img-container { + position: relative; +} + +.img-container .overlay { + display: none; +} + +.img-container:hover > .overlay { + display: inline-block; + position: absolute; + left: 60px; + top: 0; +} diff --git a/overlord/src/app/purchase-return/purchase-return.component.html b/overlord/src/app/purchase-return/purchase-return.component.html new file mode 100644 index 00000000..10a725f3 --- /dev/null +++ b/overlord/src/app/purchase-return/purchase-return.component.html @@ -0,0 +1,137 @@ + + + Purchase Return + + +
    +
    + + + + + + + + + Balance as on Date: {{accBal.date | currency:'INR' | accounting}} / + Final balance: {{accBal.total | currency:'INR' | accounting}} + + + {{account.name}} + + + + Amount + ₹ + + +
    + +
    + + + + {{batch.name}} + + + + Quantity + + + + +
    + + + + + Product + {{row.product.name}} + + + + + Quantity + {{row.quantity | number:'1.2-2'}} + + + + + Rate + {{row.rate | currency:'INR'}} + + + + + Tax + {{row.tax | percent:'1.2-2'}} + + + + + Discount + {{row.discount | percent:'1.2-2'}} + + + + + Amount + {{row.amount | currency:'INR'}} + + + + + Action + + + + + + + + + + + Narration + + +
    +
    + + +
    +
    + +
    +
    + + + + + + + Created on {{voucher.creationDate | localTime}} and + Last Edited on {{voucher.lastEditDate | localTime}} + by {{voucher.user.name}}. {{(voucher.poster) ? 'Posted by ' + voucher.poster : ''}} + +
    diff --git a/overlord/src/app/purchase-return/purchase-return.component.spec.ts b/overlord/src/app/purchase-return/purchase-return.component.spec.ts new file mode 100644 index 00000000..e7348e96 --- /dev/null +++ b/overlord/src/app/purchase-return/purchase-return.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {PurchaseReturnComponent} from './purchase-return.component'; + +describe('PurchaseReturnComponent', () => { + let component: PurchaseReturnComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [PurchaseReturnComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PurchaseReturnComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/purchase-return/purchase-return.component.ts b/overlord/src/app/purchase-return/purchase-return.component.ts new file mode 100644 index 00000000..a367d467 --- /dev/null +++ b/overlord/src/app/purchase-return/purchase-return.component.ts @@ -0,0 +1,343 @@ +import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MatAutocompleteSelectedEvent, MatDialog} from '@angular/material'; +import {ActivatedRoute, Router} from '@angular/router'; +import {BehaviorSubject, fromEvent, Observable, of, of as observableOf, zip} from 'rxjs'; +import {PurchaseReturnDataSource} from './purchase-return-datasource'; +import {Account} from '../account/account'; +import {VoucherService} from '../journal/voucher.service'; +import {AccountService} from '../account/account.service'; +import {Batch, DbFile, Inventory, Journal, Voucher} from '../journal/voucher'; +import * as moment from 'moment'; +import {AuthService} from '../auth/auth.service'; +import {ConfirmDialogComponent} from '../shared/confirm-dialog/confirm-dialog.component'; +import {ToasterService} from '../core/toaster.service'; +import {debounceTime, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators'; +import {PurchaseReturnDialogComponent} from './purchase-return-dialog.component'; +import {ImageDialogComponent} from '../shared/image-dialog/image-dialog.component'; +import {BatchService} from './batch.service'; + +@Component({ + selector: 'app-purchase-return', + templateUrl: './purchase-return.component.html', + styleUrls: ['./purchase-return.component.css'] +}) +export class PurchaseReturnComponent implements OnInit, AfterViewInit { + @ViewChild('accountElement') accountElement: ElementRef; + @ViewChild('batchElement') batchElement: ElementRef; + public inventoryObservable = new BehaviorSubject([]); + dataSource: PurchaseReturnDataSource; + form: FormGroup; + purchaseReturnJournal: Journal; + voucher: Voucher; + account: Account; + batch: Batch; + accBal: any; + + displayedColumns = ['product', 'quantity', 'rate', 'tax', 'discount', 'amount', 'action']; + + accounts: Observable; + batches: Observable; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder, + private dialog: MatDialog, + private toaster: ToasterService, + private auth: AuthService, + private ser: VoucherService, + private batchSer: BatchService, + private accountSer: AccountService + ) { + this.createForm(); + this.listenToAccountAutocompleteChange(); + this.listenToBatchAutocompleteChange(); + } + + ngOnInit() { + this.route.data + .subscribe((data: { voucher: Voucher }) => { + this.loadVoucher(data.voucher); + }); + } + + ngAfterViewInit() { + this.focusAccount(); + } + + loadVoucher(voucher: Voucher) { + this.voucher = voucher; + this.purchaseReturnJournal = this.voucher.journals.filter(x => x.debit === 1)[0]; + this.form.setValue({ + date: moment(this.voucher.date, 'DD-MMM-YYYY').toDate(), + account: this.purchaseReturnJournal.account, + amount: this.purchaseReturnJournal.amount, + addRow: { + batch: '', + quantity: '' + }, + narration: this.voucher.narration + }); + this.dataSource = new PurchaseReturnDataSource(this.inventoryObservable); + this.updateView(); + } + + focusAccount() { + setTimeout(() => { + this.accountElement.nativeElement.focus(); + }, 0); + + } + + addRow() { + const formValue = this.form.get('addRow').value; + const quantity = +(formValue.quantity); + if (this.batch === null || quantity <= 0 || this.batch.quantityRemaining < quantity) { + return; + } + const oldFiltered = this.voucher.inventories.filter((x) => x.product.id === this.batch.product.id); + if (oldFiltered.length) { + this.toaster.show('Danger', 'Product already added'); + return; + } + this.voucher.inventories.push({ + id: null, + quantity: quantity, + rate: this.batch.rate, + tax: this.batch.tax, + discount: this.batch.discount, + amount: quantity * this.batch.rate * (1 + this.batch.tax) * (1 - this.batch.discount), + product: this.batch.product, + batch: this.batch + }); + this.resetAddRow(); + this.updateView(); + } + + resetAddRow() { + this.form.get('addRow').reset({ + batch: null, + quantity: '' + }); + this.batch = null; + setTimeout(() => { + this.batchElement.nativeElement.focus(); + }, 0); + } + + updateView() { + this.inventoryObservable.next(this.voucher.inventories); + this.purchaseReturnJournal.amount = Math.abs(this.voucher.inventories.map((x) => x.amount).reduce((p, c) => p + c, 0)); + this.form.get('amount').setValue(this.purchaseReturnJournal.amount); + } + + editRow(row: Inventory) { + const dialogRef = this.dialog.open(PurchaseReturnDialogComponent, { + width: '750px', + data: {inventory: Object.assign({}, row), date: moment(this.form.value.date).format('DD-MMM-YYYY')} + }); + + dialogRef.afterClosed().subscribe((result: boolean | Inventory) => { + if (!result) { + return; + } + const j = result as Inventory; + if (j.product.id !== row.product.id && this.voucher.inventories.filter((x) => x.product.id === j.product.id).length) { + return; + } + Object.assign(row, j); + this.updateView(); + }); + } + + deleteRow(row: Inventory) { + this.voucher.inventories.splice(this.voucher.inventories.indexOf(row), 1); + this.updateView(); + } + + createForm() { + this.form = this.fb.group({ + date: '', + account: '', + amount: {value: '', disabled: true}, + addRow: this.fb.group({ + batch: '', + quantity: '' + }), + narration: '' + }); + } + + canSave() { + if (!this.voucher.id) { + return true; + } else if (this.voucher.posted && this.auth.user.perms.indexOf('Edit Posted Vouchers') !== -1) { + return true; + } else { + return this.voucher.user.id === this.auth.user.id || this.auth.user.perms.indexOf('Edit Other User\'s Vouchers') !== -1; + } + } + + post() { + this.ser.post(this.voucher.id) + .subscribe( + (result) => { + this.loadVoucher(result); + this.toaster.show('Success', 'Voucher Posted'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + save() { + this.ser.save(this.getVoucher()) + .subscribe( + (result) => { + this.loadVoucher(result); + this.toaster.show('Success', ''); + this.router.navigate(['/Return', result.id]); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + getVoucher(): Voucher { + const formModel = this.form.value; + this.voucher.date = moment(formModel.date).format('DD-MMM-YYYY'); + this.purchaseReturnJournal.account = formModel.account; + this.voucher.narration = formModel.narration; + return this.voucher; + } + + delete() { + this.ser.delete(this.voucher.id) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigate(['/Return'], {replaceUrl: true}); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + confirmDelete(): void { + const dialogRef = this.dialog.open(ConfirmDialogComponent, { + width: '250px', + data: {title: 'Delete Voucher?', content: 'Are you sure? This cannot be undone.'} + }); + + dialogRef.afterClosed().subscribe((result: boolean) => { + if (result) { + this.delete(); + } + }); + } + + listenToAccountAutocompleteChange(): void { + const control = this.form.get('account'); + this.accounts = control.valueChanges + .pipe( + startWith(null), + map(x => (x !== null && x.length >= 1) ? x : null), + debounceTime(150), + distinctUntilChanged(), + switchMap(x => (x === null) ? observableOf([]) : this.accountSer.autocomplete(x)) + ); + } + + listenToBatchAutocompleteChange(): void { + const control = this.form.get('addRow').get('batch'); + this.batches = control.valueChanges + .pipe( + startWith(null), + map(x => (x !== null && x.length >= 1) ? x : null), + debounceTime(150), + distinctUntilChanged(), + switchMap( + x => (x === null) ? observableOf([]) : this.batchSer.autocomplete( + moment(this.form.value.date).format('DD-MMM-YYYY'), x + ) + ) + ); + } + + displayAccount(account?: Account): string | undefined { + return account ? account.name : undefined; + } + + accountSelected(event: MatAutocompleteSelectedEvent): void { + this.account = event.option.value; + } + + displayBatchName(batch?: Batch): string | undefined { + return batch ? batch.name : undefined; + } + + batchSelected(event: MatAutocompleteSelectedEvent): void { + this.batch = event.option.value; + } + + zoomImage(file: DbFile) { + this.dialog.open(ImageDialogComponent, { + width: '750px', + data: file.resized + }); + } + + deleteImage(file: DbFile) { + const index = this.voucher.files.indexOf(file); + this.voucher.files.splice(index, 1); + } + + detectFiles(event) { + const files = event.target.files; + if (files) { + for (const file of files) { + const reader = new FileReader(); + reader.onload = (e: any) => { + zip(of(e.target.result), + this.resizeImage(e.target.result, 100, 150), + this.resizeImage(e.target.result, 825, 1170) + ).subscribe( + val => this.voucher.files.push({id: null, thumbnail: val[1], resized: val[2]}) + ); + }; + reader.readAsDataURL(file); + } + } + } + + resizeImage(image, MAX_WIDTH, MAX_HEIGHT) { + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d'); + const img = new Image(); + const ex = fromEvent(img, 'load').pipe( + map((e) => { + let width = img.naturalWidth, + height = img.naturalHeight; + const ratio = Math.min(1, MAX_WIDTH / width, MAX_HEIGHT / height); + + if (ratio === 1) { + return image; + } + + width *= ratio; + height *= ratio; + + canvas.width = width; + canvas.height = height; + ctx.drawImage(img, 0, 0, width, height); + return canvas.toDataURL('image/jpeg', 0.95); + }) + ); + img.src = image; + return ex; + } +} diff --git a/overlord/src/app/purchase-return/purchase-return.module.spec.ts b/overlord/src/app/purchase-return/purchase-return.module.spec.ts new file mode 100644 index 00000000..e90e87e6 --- /dev/null +++ b/overlord/src/app/purchase-return/purchase-return.module.spec.ts @@ -0,0 +1,13 @@ +import {PurchaseReturnModule} from './purchase-return.module'; + +describe('PurchaseReturnModule', () => { + let purchaseReturnModule: PurchaseReturnModule; + + beforeEach(() => { + purchaseReturnModule = new PurchaseReturnModule(); + }); + + it('should create an instance', () => { + expect(purchaseReturnModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/purchase-return/purchase-return.module.ts b/overlord/src/app/purchase-return/purchase-return.module.ts new file mode 100644 index 00000000..342db9c2 --- /dev/null +++ b/overlord/src/app/purchase-return/purchase-return.module.ts @@ -0,0 +1,84 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {ReactiveFormsModule} from '@angular/forms'; +import {CdkTableModule} from '@angular/cdk/table'; +import {PurchaseReturnRoutingModule} from './purchase-return-routing.module'; +import {PurchaseReturnComponent} from './purchase-return.component'; +import {MomentDateAdapter} from '@angular/material-moment-adapter'; +import {A11yModule} from '@angular/cdk/a11y'; +import {PurchaseReturnDialogComponent} from './purchase-return-dialog.component'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + PurchaseReturnRoutingModule + ], + declarations: [ + PurchaseReturnComponent, + PurchaseReturnDialogComponent + ], + providers: [ + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, + ], + entryComponents: [ + PurchaseReturnDialogComponent + ] +}) +export class PurchaseReturnModule { +} diff --git a/overlord/src/app/purchase-return/purchase-return.service.spec.ts b/overlord/src/app/purchase-return/purchase-return.service.spec.ts new file mode 100644 index 00000000..1d24cf07 --- /dev/null +++ b/overlord/src/app/purchase-return/purchase-return.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {VoucherService} from './purchase-return.service'; + +describe('PurchaseReturnService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [VoucherService] + }); + }); + + it('should be created', inject([VoucherService], (service: VoucherService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/purchase/purchase-datasource.ts b/overlord/src/app/purchase/purchase-datasource.ts new file mode 100644 index 00000000..d6a1384b --- /dev/null +++ b/overlord/src/app/purchase/purchase-datasource.ts @@ -0,0 +1,18 @@ +import {DataSource} from '@angular/cdk/collections'; +import {Observable} from 'rxjs'; +import {Inventory, Journal} from '../journal/voucher'; + + +export class PurchaseDataSource extends DataSource { + + constructor(private data: Observable) { + super(); + } + + connect(): Observable { + return this.data; + } + + disconnect() { + } +} diff --git a/overlord/src/app/purchase/purchase-dialog.component.css b/overlord/src/app/purchase/purchase-dialog.component.css new file mode 100644 index 00000000..e69de29b diff --git a/overlord/src/app/purchase/purchase-dialog.component.html b/overlord/src/app/purchase/purchase-dialog.component.html new file mode 100644 index 00000000..73b26da5 --- /dev/null +++ b/overlord/src/app/purchase/purchase-dialog.component.html @@ -0,0 +1,37 @@ +

    Edit Purchase Entry

    +
    +
    +
    + + + + {{product.name}} + + + + Quantity + + + + Price + + + + Tax + + + + Discount + + +
    +
    +
    +
    + + +
    + diff --git a/overlord/src/app/purchase/purchase-dialog.component.spec.ts b/overlord/src/app/purchase/purchase-dialog.component.spec.ts new file mode 100644 index 00000000..56233dee --- /dev/null +++ b/overlord/src/app/purchase/purchase-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PurchaseDialogComponent } from './purchase-dialog.component'; + +describe('PurchaseDialogComponent', () => { + let component: PurchaseDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PurchaseDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PurchaseDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/purchase/purchase-dialog.component.ts b/overlord/src/app/purchase/purchase-dialog.component.ts new file mode 100644 index 00000000..f9323941 --- /dev/null +++ b/overlord/src/app/purchase/purchase-dialog.component.ts @@ -0,0 +1,84 @@ +import {Component, Inject, OnInit} from '@angular/core'; +import {MAT_DIALOG_DATA, MatAutocompleteSelectedEvent, MatDialogRef} from '@angular/material'; +import {debounceTime, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {Observable, of as observableOf} from 'rxjs'; +import {Product} from '../product/product'; +import {ProductService} from '../product/product.service'; + +@Component({ + selector: 'app-purchase-dialog', + templateUrl: './purchase-dialog.component.html', + styleUrls: ['./purchase-dialog.component.css'] +}) +export class PurchaseDialogComponent implements OnInit { + products: Observable; + form: FormGroup; + product: Product; + + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any, + private fb: FormBuilder, + private productSer: ProductService) { + this.createForm(); + this.listenToProductAutocompleteChange(); + } + + ngOnInit() { + this.form.setValue({ + product: this.data.inventory.product, + quantity: this.data.inventory.quantity, + price: this.data.inventory.rate, + tax: this.data.inventory.tax, + discount: this.data.inventory.discount + }); + this.product = this.data.inventory.product; + } + + createForm() { + this.form = this.fb.group({ + product: '', + quantity: '', + price: '', + tax: '', + discount: '' + }); + } + + listenToProductAutocompleteChange(): void { + const control = this.form.get('product'); + this.products = control.valueChanges + .pipe( + startWith(null), + map(x => (x !== null && x.length >= 1) ? x : null), + debounceTime(150), + distinctUntilChanged(), + switchMap(x => (x === null) ? observableOf([]) : this.productSer.autocomplete(x)) + ); + } + + displayProductName(product?: Product): string | undefined { + return product ? product.name : undefined; + } + + productSelected(event: MatAutocompleteSelectedEvent): void { + this.product = event.option.value; + this.form.get('price').setValue(this.product.price); + } + + accept(): void { + const formValue = this.form.value; + const quantity = +(formValue.quantity); + const price = +(formValue.price); + const tax = +(formValue.tax); + const discount = +(formValue.discount); + this.data.inventory.product = this.product; + this.data.inventory.quantity = quantity; + this.data.inventory.rate = price; + this.data.inventory.tax = tax; + this.data.inventory.discount = discount; + this.data.inventory.amount = quantity * price * (1 + tax) * (1 - discount); + this.dialogRef.close(this.data.inventory); + } +} diff --git a/overlord/src/app/purchase/purchase-resolver.service.spec.ts b/overlord/src/app/purchase/purchase-resolver.service.spec.ts new file mode 100644 index 00000000..9cacda9d --- /dev/null +++ b/overlord/src/app/purchase/purchase-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {PurchaseResolver} from './purchase-resolver.service'; + +describe('PurchaseResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [PurchaseResolver] + }); + }); + + it('should be created', inject([PurchaseResolver], (service: PurchaseResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/purchase/purchase-resolver.service.ts b/overlord/src/app/purchase/purchase-resolver.service.ts new file mode 100644 index 00000000..821d5ce5 --- /dev/null +++ b/overlord/src/app/purchase/purchase-resolver.service.ts @@ -0,0 +1,23 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {Voucher} from '../journal/voucher'; +import {VoucherService} from '../journal/voucher.service'; + +@Injectable({ + providedIn: 'root' +}) +export class PurchaseResolver implements Resolve { + + constructor(private ser: VoucherService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const id = route.paramMap.get('id'); + if (id === null) { + return this.ser.getOfType('Purchase'); + } else { + return this.ser.get(id); + } + } +} diff --git a/overlord/src/app/purchase/purchase-routing.module.spec.ts b/overlord/src/app/purchase/purchase-routing.module.spec.ts new file mode 100644 index 00000000..e94e7816 --- /dev/null +++ b/overlord/src/app/purchase/purchase-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {PurchaseRoutingModule} from './purchase-routing.module'; + +describe('PurchaseRoutingModule', () => { + let purchaseRoutingModule: PurchaseRoutingModule; + + beforeEach(() => { + purchaseRoutingModule = new PurchaseRoutingModule(); + }); + + it('should create an instance', () => { + expect(purchaseRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/purchase/purchase-routing.module.ts b/overlord/src/app/purchase/purchase-routing.module.ts new file mode 100644 index 00000000..0a78a755 --- /dev/null +++ b/overlord/src/app/purchase/purchase-routing.module.ts @@ -0,0 +1,49 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {PurchaseResolver} from './purchase-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {PurchaseComponent} from './purchase.component'; + +const purchaseRoutes: Routes = [ + { + path: 'Purchase', + component: PurchaseComponent, + canActivate: [AuthGuard], + data: { + permission: 'Purchase' + }, + resolve: { + voucher: PurchaseResolver + }, + runGuardsAndResolvers: 'always' + }, + { + path: 'Purchase/:id', + component: PurchaseComponent, + canActivate: [AuthGuard], + data: { + permission: 'Purchase' + }, + resolve: { + voucher: PurchaseResolver + }, + runGuardsAndResolvers: 'always' + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(purchaseRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + PurchaseResolver + ] +}) +export class PurchaseRoutingModule { +} diff --git a/overlord/src/app/purchase/purchase.component.css b/overlord/src/app/purchase/purchase.component.css new file mode 100644 index 00000000..a592a823 --- /dev/null +++ b/overlord/src/app/purchase/purchase.component.css @@ -0,0 +1,32 @@ +.right { + display: flex; + justify-content: flex-end; +} + +.selected { + background: #fff3cd +} + +.unposted { + background: #f8d7da +} + +.center { + display: flex; + justify-content: center; +} + +.img-container { + position: relative; +} + +.img-container .overlay { + display: none; +} + +.img-container:hover > .overlay { + display: inline-block; + position: absolute; + left: 60px; + top: 0; +} diff --git a/overlord/src/app/purchase/purchase.component.html b/overlord/src/app/purchase/purchase.component.html new file mode 100644 index 00000000..b51e78d5 --- /dev/null +++ b/overlord/src/app/purchase/purchase.component.html @@ -0,0 +1,149 @@ + + + Purchase + + +
    +
    + + + + + + + + + Balance as on Date: {{accBal.date | currency:'INR' | accounting}} / + Final balance: {{accBal.total | currency:'INR' | accounting}} + + + {{account.name}} + + + + Amount + ₹ + + +
    + +
    + + + + {{product.name}} + + + + Quantity + + + + Price + + + + Tax + + + + Discount + + + + +
    + + + + + Product + {{row.product.name}} + + + + + Quantity + {{row.quantity | number:'1.2-2'}} + + + + + Rate + {{row.rate | currency:'INR'}} + + + + + Tax + {{row.tax | percent:'1.2-2'}} + + + + + Discount + {{row.discount | percent:'1.2-2'}} + + + + + Amount + {{row.amount | currency:'INR'}} + + + + + Action + + + + + + + + + + + Narration + + +
    +
    + + +
    +
    + +
    +
    + + + + + + + Created on {{voucher.creationDate | localTime}} and + Last Edited on {{voucher.lastEditDate | localTime}} + by {{voucher.user.name}}. {{(voucher.poster) ? 'Posted by ' + voucher.poster : ''}} + +
    diff --git a/overlord/src/app/purchase/purchase.component.spec.ts b/overlord/src/app/purchase/purchase.component.spec.ts new file mode 100644 index 00000000..7fd3d909 --- /dev/null +++ b/overlord/src/app/purchase/purchase.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {PurchaseComponent} from './purchase.component'; + +describe('PurchaseComponent', () => { + let component: PurchaseComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [PurchaseComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PurchaseComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/purchase/purchase.component.ts b/overlord/src/app/purchase/purchase.component.ts new file mode 100644 index 00000000..f5329af6 --- /dev/null +++ b/overlord/src/app/purchase/purchase.component.ts @@ -0,0 +1,353 @@ +import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MatAutocompleteSelectedEvent, MatDialog} from '@angular/material'; +import {ActivatedRoute, Router} from '@angular/router'; +import {BehaviorSubject, fromEvent, Observable, of, of as observableOf, zip} from 'rxjs'; +import {PurchaseDataSource} from './purchase-datasource'; +import {Account} from '../account/account'; +import {VoucherService} from '../journal/voucher.service'; +import {AccountService} from '../account/account.service'; +import {DbFile, Inventory, Journal, Voucher} from '../journal/voucher'; +import * as moment from 'moment'; +import {AuthService} from '../auth/auth.service'; +import {ConfirmDialogComponent} from '../shared/confirm-dialog/confirm-dialog.component'; +import {ToasterService} from '../core/toaster.service'; +import {debounceTime, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators'; +import {PurchaseDialogComponent} from './purchase-dialog.component'; +import {ImageDialogComponent} from '../shared/image-dialog/image-dialog.component'; +import {ProductService} from '../product/product.service'; +import {Product} from '../product/product'; + +@Component({ + selector: 'app-purchase', + templateUrl: './purchase.component.html', + styleUrls: ['./purchase.component.css'] +}) +export class PurchaseComponent implements OnInit, AfterViewInit { + @ViewChild('accountElement') accountElement: ElementRef; + @ViewChild('productElement') productElement: ElementRef; + public inventoryObservable = new BehaviorSubject([]); + dataSource: PurchaseDataSource; + form: FormGroup; + purchaseJournal: Journal; + voucher: Voucher; + account: Account; + product: Product; + accBal: any; + + displayedColumns = ['product', 'quantity', 'rate', 'tax', 'discount', 'amount', 'action']; + + accounts: Observable; + products: Observable; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder, + private dialog: MatDialog, + private toaster: ToasterService, + private auth: AuthService, + private ser: VoucherService, + private productSer: ProductService, + private accountSer: AccountService + ) { + this.createForm(); + this.listenToAccountAutocompleteChange(); + this.listenToProductAutocompleteChange(); + } + + ngOnInit() { + this.route.data + .subscribe((data: { voucher: Voucher }) => { + this.loadVoucher(data.voucher); + }); + } + + ngAfterViewInit() { + this.focusAccount(); + } + + loadVoucher(voucher) { + this.voucher = voucher; + this.purchaseJournal = this.voucher.journals.filter(x => x.debit === -1)[0]; + this.form.setValue({ + date: moment(this.voucher.date, 'DD-MMM-YYYY').toDate(), + account: this.purchaseJournal.account, + amount: this.purchaseJournal.amount, + addRow: { + product: '', + quantity: '', + price: '', + tax: '', + discount: '' + }, + narration: this.voucher.narration + }); + this.dataSource = new PurchaseDataSource(this.inventoryObservable); + this.updateView(); + } + + focusAccount() { + setTimeout(() => { + this.accountElement.nativeElement.focus(); + }, 0); + } + + addRow() { + const formValue = this.form.get('addRow').value; + const quantity = +(formValue.quantity); + const price = +(formValue.price); + const tax = +(formValue.tax); + const discount = +(formValue.discount); + if (this.product === null || quantity <= 0 || price <= 0) { + return; + } + const oldFiltered = this.voucher.inventories.filter((x) => x.product.id === this.product.id); + if (oldFiltered.length) { + this.toaster.show('Danger', 'Product already added'); + return; + } + this.voucher.inventories.push({ + id: null, + quantity: quantity, + rate: price, + tax: tax, + discount: discount, + amount: quantity * price * (1 + tax) * (1 - discount), + product: this.product, + batch: null + }); + this.resetAddRow(); + this.updateView(); + } + + resetAddRow() { + this.form.get('addRow').reset({ + product: null, + quantity: '', + price: '', + tax: '', + discount: '' + }); + this.product = null; + setTimeout(() => { + this.productElement.nativeElement.focus(); + }, 0); + } + + updateView() { + this.inventoryObservable.next(this.voucher.inventories); + this.purchaseJournal.amount = Math.abs(this.voucher.inventories.map((x) => x.amount).reduce((p, c) => p + c, 0)); + this.form.get('amount').setValue(this.purchaseJournal.amount); + } + + editRow(row: Inventory) { + const dialogRef = this.dialog.open(PurchaseDialogComponent, { + width: '750px', + data: {inventory: Object.assign({}, row)} + }); + + dialogRef.afterClosed().subscribe((result: boolean | Inventory) => { + if (!result) { + return; + } + const j = result as Inventory; + if (j.product.id !== row.product.id && this.voucher.inventories.filter((x) => x.product.id === j.product.id).length) { + return; + } + Object.assign(row, j); + this.updateView(); + }); + } + + deleteRow(row: Inventory) { + this.voucher.inventories.splice(this.voucher.inventories.indexOf(row), 1); + this.updateView(); + } + + createForm() { + this.form = this.fb.group({ + date: '', + account: '', + amount: {value: '', disabled: true}, + addRow: this.fb.group({ + product: '', + quantity: '', + price: '', + tax: '', + discount: '' + }), + narration: '' + }); + this.accBal = null; + } + + canSave() { + if (!this.voucher.id) { + return true; + } else if (this.voucher.posted && this.auth.user.perms.indexOf('Edit Posted Vouchers') !== -1) { + return true; + } else { + return this.voucher.user.id === this.auth.user.id || this.auth.user.perms.indexOf('Edit Other User\'s Vouchers') !== -1; + } + } + + post() { + this.ser.post(this.voucher.id) + .subscribe( + (result) => { + this.loadVoucher(result); + this.toaster.show('Success', 'Voucher Posted'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + save() { + this.ser.save(this.getVoucher()) + .subscribe( + (result) => { + this.loadVoucher(result); + this.toaster.show('Success', ''); + this.router.navigate(['/Purchase', result.id]); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + getVoucher(): Voucher { + const formModel = this.form.value; + this.voucher.date = moment(formModel.date).format('DD-MMM-YYYY'); + this.purchaseJournal.account = formModel.account; + this.voucher.narration = formModel.narration; + return this.voucher; + } + + delete() { + this.ser.delete(this.voucher.id) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigate(['/Purchase'], {replaceUrl: true}); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + confirmDelete(): void { + const dialogRef = this.dialog.open(ConfirmDialogComponent, { + width: '250px', + data: {title: 'Delete Voucher?', content: 'Are you sure? This cannot be undone.'} + }); + + dialogRef.afterClosed().subscribe((result: boolean) => { + if (result) { + this.delete(); + } + }); + } + + listenToAccountAutocompleteChange(): void { + const control = this.form.get('account'); + this.accounts = control.valueChanges + .pipe( + startWith(null), + map(x => (x !== null && x.length >= 1) ? x : null), + debounceTime(150), + distinctUntilChanged(), + switchMap(x => (x === null) ? observableOf([]) : this.accountSer.autocomplete(x)) + ); + } + + listenToProductAutocompleteChange(): void { + const control = this.form.get('addRow').get('product'); + this.products = control.valueChanges + .pipe( + startWith(null), + map(x => (x !== null && x.length >= 1) ? x : null), + debounceTime(150), + distinctUntilChanged(), + switchMap(x => (x === null) ? observableOf([]) : this.productSer.autocomplete(x)) + ); + } + + displayAccount(account?: Account): string | undefined { + return account ? account.name : undefined; + } + + accountSelected(event: MatAutocompleteSelectedEvent): void { + this.account = event.option.value; + } + + displayProductName(product?: Product): string | undefined { + return product ? product.name : undefined; + } + + productSelected(event: MatAutocompleteSelectedEvent): void { + this.product = event.option.value; + this.form.get('addRow').get('price').setValue(this.product.price); + } + + zoomImage(file: DbFile) { + this.dialog.open(ImageDialogComponent, { + width: '750px', + data: file.resized + }); + } + + deleteImage(file: DbFile) { + const index = this.voucher.files.indexOf(file); + this.voucher.files.splice(index, 1); + } + + detectFiles(event) { + const files = event.target.files; + if (files) { + for (const file of files) { + const reader = new FileReader(); + reader.onload = (e: any) => { + zip(of(e.target.result), + this.resizeImage(e.target.result, 100, 150), + this.resizeImage(e.target.result, 825, 1170) + ).subscribe( + val => this.voucher.files.push({id: null, thumbnail: val[1], resized: val[2]}) + ); + }; + reader.readAsDataURL(file); + } + } + } + + resizeImage(image, MAX_WIDTH, MAX_HEIGHT) { + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d'); + const img = new Image(); + const ex = fromEvent(img, 'load').pipe( + map((e) => { + let width = img.naturalWidth, + height = img.naturalHeight; + const ratio = Math.min(1, MAX_WIDTH / width, MAX_HEIGHT / height); + + if (ratio === 1) { + return image; + } + + width *= ratio; + height *= ratio; + + canvas.width = width; + canvas.height = height; + ctx.drawImage(img, 0, 0, width, height); + return canvas.toDataURL('image/jpeg', 0.95); + }) + ); + img.src = image; + return ex; + } +} diff --git a/overlord/src/app/purchase/purchase.module.spec.ts b/overlord/src/app/purchase/purchase.module.spec.ts new file mode 100644 index 00000000..fa1362f6 --- /dev/null +++ b/overlord/src/app/purchase/purchase.module.spec.ts @@ -0,0 +1,13 @@ +import {PurchaseModule} from './purchase.module'; + +describe('PurchaseModule', () => { + let purchaseModule: PurchaseModule; + + beforeEach(() => { + purchaseModule = new PurchaseModule(); + }); + + it('should create an instance', () => { + expect(purchaseModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/purchase/purchase.module.ts b/overlord/src/app/purchase/purchase.module.ts new file mode 100644 index 00000000..002cbfc5 --- /dev/null +++ b/overlord/src/app/purchase/purchase.module.ts @@ -0,0 +1,84 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {ReactiveFormsModule} from '@angular/forms'; +import {CdkTableModule} from '@angular/cdk/table'; +import {PurchaseRoutingModule} from './purchase-routing.module'; +import {PurchaseComponent} from './purchase.component'; +import {MomentDateAdapter} from '@angular/material-moment-adapter'; +import {A11yModule} from '@angular/cdk/a11y'; +import {PurchaseDialogComponent} from './purchase-dialog.component'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + PurchaseRoutingModule + ], + declarations: [ + PurchaseComponent, + PurchaseDialogComponent + ], + providers: [ + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, + ], + entryComponents: [ + PurchaseDialogComponent + ] +}) +export class PurchaseModule { +} diff --git a/overlord/src/app/purchase/purchase.service.spec.ts b/overlord/src/app/purchase/purchase.service.spec.ts new file mode 100644 index 00000000..01751742 --- /dev/null +++ b/overlord/src/app/purchase/purchase.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {VoucherService} from './purchase.service'; + +describe('PurchaseService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [VoucherService] + }); + }); + + it('should be created', inject([VoucherService], (service: VoucherService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/purchases/purchases-datasource.ts b/overlord/src/app/purchases/purchases-datasource.ts new file mode 100644 index 00000000..4c24451d --- /dev/null +++ b/overlord/src/app/purchases/purchases-datasource.ts @@ -0,0 +1,63 @@ +import {DataSource} from '@angular/cdk/collections'; +import {MatPaginator, MatSort} from '@angular/material'; +import {map} from 'rxjs/operators'; +import {merge, Observable, of as observableOf} from 'rxjs'; +import {PurchasesItem} from './purchases'; + + +export class PurchasesDataSource extends DataSource { + + constructor(private paginator: MatPaginator, private sort: MatSort, public data: PurchasesItem[]) { + super(); + } + + connect(): Observable { + const dataMutations = [ + observableOf(this.data), + this.paginator.page, + this.sort.sortChange + ]; + + // Set the paginators length + this.paginator.length = this.data.length; + + return merge(...dataMutations).pipe(map(() => { + return this.getPagedData(this.getSortedData([...this.data])); + })); + } + + disconnect() { + } + + private getPagedData(data: PurchasesItem[]) { + const startIndex = this.paginator.pageIndex * this.paginator.pageSize; + return data.splice(startIndex, this.paginator.pageSize); + } + + private getSortedData(data: PurchasesItem[]) { + if (!this.sort.active || this.sort.direction === '') { + return data; + } + + return data.sort((a, b) => { + const isAsc = this.sort.direction === 'asc'; + switch (this.sort.active) { + case 'product': + return compare(a.name, b.name, isAsc); + case 'quantity': + return compare(+a.quantity, +b.quantity, isAsc); + case 'rate': + return compare(+a.rate, +b.rate, isAsc); + case 'amount': + return compare(+a.amount, +b.amount, isAsc); + default: + return 0; + } + }); + } +} + +/** Simple sort comparator for example ID/Name columns (for client-side sorting). */ +function compare(a, b, isAsc) { + return (a < b ? -1 : 1) * (isAsc ? 1 : -1); +} diff --git a/overlord/src/app/purchases/purchases-resolver.service.spec.ts b/overlord/src/app/purchases/purchases-resolver.service.spec.ts new file mode 100644 index 00000000..e56d10c6 --- /dev/null +++ b/overlord/src/app/purchases/purchases-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {PurchasesResolver} from './purchases-resolver.service'; + +describe('PurchasesResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [PurchasesResolver] + }); + }); + + it('should be created', inject([PurchasesResolver], (service: PurchasesResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/purchases/purchases-resolver.service.ts b/overlord/src/app/purchases/purchases-resolver.service.ts new file mode 100644 index 00000000..b4ad79e8 --- /dev/null +++ b/overlord/src/app/purchases/purchases-resolver.service.ts @@ -0,0 +1,20 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {Purchases} from './purchases'; +import {PurchasesService} from './purchases.service'; + +@Injectable({ + providedIn: 'root' +}) +export class PurchasesResolver implements Resolve { + + constructor(private ser: PurchasesService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const startDate = route.queryParamMap.get('startDate') || null; + const finishDate = route.queryParamMap.get('finishDate') || null; + return this.ser.list(startDate, finishDate); + } +} diff --git a/overlord/src/app/purchases/purchases-routing.module.spec.ts b/overlord/src/app/purchases/purchases-routing.module.spec.ts new file mode 100644 index 00000000..c8debea7 --- /dev/null +++ b/overlord/src/app/purchases/purchases-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {PurchasesRoutingModule} from './purchases-routing.module'; + +describe('PurchasesRoutingModule', () => { + let purchasesRoutingModule: PurchasesRoutingModule; + + beforeEach(() => { + purchasesRoutingModule = new PurchasesRoutingModule(); + }); + + it('should create an instance', () => { + expect(purchasesRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/purchases/purchases-routing.module.ts b/overlord/src/app/purchases/purchases-routing.module.ts new file mode 100644 index 00000000..3eb0113e --- /dev/null +++ b/overlord/src/app/purchases/purchases-routing.module.ts @@ -0,0 +1,37 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {PurchasesResolver} from './purchases-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {PurchasesComponent} from './purchases.component'; + +const purchasesRoutes: Routes = [ + { + path: 'Purchases', + component: PurchasesComponent, + canActivate: [AuthGuard], + data: { + permission: 'Purchases' + }, + resolve: { + info: PurchasesResolver + }, + runGuardsAndResolvers: 'always' + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(purchasesRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + PurchasesResolver + ] +}) +export class PurchasesRoutingModule { +} diff --git a/overlord/src/app/purchases/purchases.component.css b/overlord/src/app/purchases/purchases.component.css new file mode 100644 index 00000000..ef3a3239 --- /dev/null +++ b/overlord/src/app/purchases/purchases.component.css @@ -0,0 +1,12 @@ +.right { + display: flex; + justify-content: flex-end; +} + +.selected{ + background: #fff3cd +} + +.unposted{ + background: #f8d7da +} diff --git a/overlord/src/app/purchases/purchases.component.html b/overlord/src/app/purchases/purchases.component.html new file mode 100644 index 00000000..6c5926bd --- /dev/null +++ b/overlord/src/app/purchases/purchases.component.html @@ -0,0 +1,74 @@ + + + Purchases + + +
    +
    + + + + + + + + + + + +
    +
    + + + + + Product + {{row.name}} + + {{info.footer.name}} + + + + + + Quantity + {{row.quantity | number:'1.2-2'}} + + {{info.footer.quantity | number:'1.2-2'}} + + + + + + Rate + {{row.rate | currency:'INR'}} + + {{info.footer.rate | currency:'INR'}} + + + + + + Amount + {{row.amount | currency:'INR'}} + + {{info.footer.amount | currency:'INR'}} + + + + + + + + + + +
    +
    diff --git a/overlord/src/app/purchases/purchases.component.spec.ts b/overlord/src/app/purchases/purchases.component.spec.ts new file mode 100644 index 00000000..363209c8 --- /dev/null +++ b/overlord/src/app/purchases/purchases.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {PurchasesComponent} from './purchases.component'; + +describe('PurchasesComponent', () => { + let component: PurchasesComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [PurchasesComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PurchasesComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/purchases/purchases.component.ts b/overlord/src/app/purchases/purchases.component.ts new file mode 100644 index 00000000..f4acad37 --- /dev/null +++ b/overlord/src/app/purchases/purchases.component.ts @@ -0,0 +1,71 @@ +import {Component, OnInit, ViewChild} from '@angular/core'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MatPaginator, MatSort} from '@angular/material'; +import {ActivatedRoute, Router} from '@angular/router'; +import * as moment from 'moment'; +import {PurchasesDataSource} from './purchases-datasource'; +import {Purchases, PurchasesItem} from './purchases'; + +@Component({ + selector: 'app-purchases', + templateUrl: './purchases.component.html', + styleUrls: ['./purchases.component.css'] +}) +export class PurchasesComponent implements OnInit { + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + dataSource: PurchasesDataSource; + form: FormGroup; + info: Purchases; + selectedRowId: string; + /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ + displayedColumns = ['product', 'quantity', 'rate', 'amount']; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder + ) { + this.createForm(); + } + + ngOnInit() { + this.route.data + .subscribe((data: { info: Purchases }) => { + this.info = data.info; + this.form.setValue({ + startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(), + finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate() + }); + this.dataSource = new PurchasesDataSource(this.paginator, this.sort, this.info.body); + }); + } + + show() { + const l = this.prepareSubmit(); + this.router.navigate(['Purchases'], { + queryParams: { + startDate: l.startDate, + finishDate: l.finishDate + } + }); + } + + createForm() { + this.form = this.fb.group({ + startDate: '', + finishDate: '', + }); + } + + prepareSubmit(): Purchases { + const formModel = this.form.value; + + return { + startDate: moment(formModel.startDate).format('DD-MMM-YYYY'), + finishDate: moment(formModel.finishDate).format('DD-MMM-YYYY'), + body: [], + footer: new PurchasesItem() + }; + } +} diff --git a/overlord/src/app/purchases/purchases.module.spec.ts b/overlord/src/app/purchases/purchases.module.spec.ts new file mode 100644 index 00000000..45e37fae --- /dev/null +++ b/overlord/src/app/purchases/purchases.module.spec.ts @@ -0,0 +1,13 @@ +import {PurchasesModule} from './purchases.module'; + +describe('PurchasesModule', () => { + let purchasesModule: PurchasesModule; + + beforeEach(() => { + purchasesModule = new PurchasesModule(); + }); + + it('should create an instance', () => { + expect(purchasesModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/purchases/purchases.module.ts b/overlord/src/app/purchases/purchases.module.ts new file mode 100644 index 00000000..1250bf68 --- /dev/null +++ b/overlord/src/app/purchases/purchases.module.ts @@ -0,0 +1,75 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {ReactiveFormsModule} from '@angular/forms'; +import {CdkTableModule} from '@angular/cdk/table'; +import {PurchasesRoutingModule} from './purchases-routing.module'; +import {PurchasesComponent} from './purchases.component'; +import {MomentDateAdapter} from '@angular/material-moment-adapter'; +import {A11yModule} from '@angular/cdk/a11y'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + PurchasesRoutingModule + ], + declarations: [ + PurchasesComponent + ], + providers: [ + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, + ] +}) +export class PurchasesModule { +} diff --git a/overlord/src/app/purchases/purchases.service.spec.ts b/overlord/src/app/purchases/purchases.service.spec.ts new file mode 100644 index 00000000..b9742da9 --- /dev/null +++ b/overlord/src/app/purchases/purchases.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {PurchasesService} from './purchases.service'; + +describe('PurchasesService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [PurchasesService] + }); + }); + + it('should be created', inject([PurchasesService], (service: PurchasesService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/purchases/purchases.service.ts b/overlord/src/app/purchases/purchases.service.ts new file mode 100644 index 00000000..40efb5d8 --- /dev/null +++ b/overlord/src/app/purchases/purchases.service.ts @@ -0,0 +1,37 @@ +import {Injectable} from '@angular/core'; +import {catchError} from 'rxjs/operators'; +import {Observable} from 'rxjs/internal/Observable'; +import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http'; +import {Purchases} from './purchases'; +import {ErrorLoggerService} from '../core/error-logger.service'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; + +const url = '/api/Purchases'; +const serviceName = 'PurchasesService'; + +@Injectable({ + providedIn: 'root' +}) +export class PurchasesService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + list(startDate: string, finishDate): Observable { + const options = {params: new HttpParams()}; + if (startDate !== null) { + options.params = options.params.set('s', startDate); + } + if (finishDate !== null) { + options.params = options.params.set('f', finishDate); + } + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + +} diff --git a/overlord/src/app/purchases/purchases.ts b/overlord/src/app/purchases/purchases.ts new file mode 100644 index 00000000..447b3584 --- /dev/null +++ b/overlord/src/app/purchases/purchases.ts @@ -0,0 +1,15 @@ + +export class PurchasesItem { + name: string; + quantity: number; + rate: number; + amount: number; + url: string; +} + +export class Purchases { + startDate: string; + finishDate: string; + body: PurchasesItem[]; + footer: PurchasesItem; +} diff --git a/overlord/src/app/raw-material-cost/raw-material-cost-datasource.ts b/overlord/src/app/raw-material-cost/raw-material-cost-datasource.ts new file mode 100644 index 00000000..4e30fe49 --- /dev/null +++ b/overlord/src/app/raw-material-cost/raw-material-cost-datasource.ts @@ -0,0 +1,57 @@ +import {DataSource} from '@angular/cdk/collections'; +import {MatPaginator, MatSort} from '@angular/material'; +import {map} from 'rxjs/operators'; +import {merge, Observable, of as observableOf} from 'rxjs'; +import {RawMaterialCostItem} from './raw-material-cost'; + + +export class RawMaterialCostDataSource extends DataSource { + + constructor(private paginator: MatPaginator, private sort: MatSort, public data: RawMaterialCostItem[]) { + super(); + } + + connect(): Observable { + const dataMutations = [ + observableOf(this.data), + this.paginator.page, + this.sort.sortChange + ]; + + // Set the paginators length + this.paginator.length = this.data.length; + + return merge(...dataMutations).pipe(map(() => { + return this.getPagedData(this.getSortedData([...this.data])); + })); + } + + disconnect() { + } + + private getPagedData(data: RawMaterialCostItem[]) { + const startIndex = this.paginator.pageIndex * this.paginator.pageSize; + return data.splice(startIndex, this.paginator.pageSize); + } + + private getSortedData(data: RawMaterialCostItem[]) { + if (!this.sort.active || this.sort.direction === '') { + return data; + } + + return data.sort((a, b) => { + const isAsc = this.sort.direction === 'asc'; + switch (this.sort.active) { + case 'name': + return compare(a.name, b.name, isAsc); + default: + return 0; + } + }); + } +} + +/** Simple sort comparator for example ID/Name columns (for client-side sorting). */ +function compare(a, b, isAsc) { + return (a < b ? -1 : 1) * (isAsc ? 1 : -1); +} diff --git a/overlord/src/app/raw-material-cost/raw-material-cost-resolver.service.spec.ts b/overlord/src/app/raw-material-cost/raw-material-cost-resolver.service.spec.ts new file mode 100644 index 00000000..d3ce43da --- /dev/null +++ b/overlord/src/app/raw-material-cost/raw-material-cost-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {RawMaterialCostResolver} from './raw-material-cost-resolver.service'; + +describe('RawMaterialCostResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [RawMaterialCostResolver] + }); + }); + + it('should be created', inject([RawMaterialCostResolver], (service: RawMaterialCostResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/raw-material-cost/raw-material-cost-resolver.service.ts b/overlord/src/app/raw-material-cost/raw-material-cost-resolver.service.ts new file mode 100644 index 00000000..31445943 --- /dev/null +++ b/overlord/src/app/raw-material-cost/raw-material-cost-resolver.service.ts @@ -0,0 +1,21 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {RawMaterialCost} from './raw-material-cost'; +import {RawMaterialCostService} from './raw-material-cost.service'; + +@Injectable({ + providedIn: 'root' +}) +export class RawMaterialCostResolver implements Resolve { + + constructor(private ser: RawMaterialCostService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const id = route.paramMap.get('id') || null; + const startDate = route.queryParamMap.get('startDate') || null; + const finishDate = route.queryParamMap.get('finishDate') || null; + return this.ser.list(id, startDate, finishDate); + } +} diff --git a/overlord/src/app/raw-material-cost/raw-material-cost-routing.module.spec.ts b/overlord/src/app/raw-material-cost/raw-material-cost-routing.module.spec.ts new file mode 100644 index 00000000..4f69c744 --- /dev/null +++ b/overlord/src/app/raw-material-cost/raw-material-cost-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {RawMaterialCostRoutingModule} from './raw-material-cost-routing.module'; + +describe('RawMaterialCostRoutingModule', () => { + let rawMaterialCostRoutingModule: RawMaterialCostRoutingModule; + + beforeEach(() => { + rawMaterialCostRoutingModule = new RawMaterialCostRoutingModule(); + }); + + it('should create an instance', () => { + expect(rawMaterialCostRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/raw-material-cost/raw-material-cost-routing.module.ts b/overlord/src/app/raw-material-cost/raw-material-cost-routing.module.ts new file mode 100644 index 00000000..f2a91e8a --- /dev/null +++ b/overlord/src/app/raw-material-cost/raw-material-cost-routing.module.ts @@ -0,0 +1,49 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {RawMaterialCostResolver} from './raw-material-cost-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {RawMaterialCostComponent} from './raw-material-cost.component'; + +const rawMaterialCostRoutes: Routes = [ + { + path: 'RawMaterialCost', + component: RawMaterialCostComponent, + canActivate: [AuthGuard], + data: { + permission: 'Raw Material Cost' + }, + resolve: { + info: RawMaterialCostResolver + }, + runGuardsAndResolvers: 'always' + }, + { + path: 'RawMaterialCost/:id', + component: RawMaterialCostComponent, + canActivate: [AuthGuard], + data: { + permission: 'Raw Material Cost' + }, + resolve: { + info: RawMaterialCostResolver + }, + runGuardsAndResolvers: 'always' + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(rawMaterialCostRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + RawMaterialCostResolver + ] +}) +export class RawMaterialCostRoutingModule { +} diff --git a/overlord/src/app/raw-material-cost/raw-material-cost.component.css b/overlord/src/app/raw-material-cost/raw-material-cost.component.css new file mode 100644 index 00000000..ef3a3239 --- /dev/null +++ b/overlord/src/app/raw-material-cost/raw-material-cost.component.css @@ -0,0 +1,12 @@ +.right { + display: flex; + justify-content: flex-end; +} + +.selected{ + background: #fff3cd +} + +.unposted{ + background: #f8d7da +} diff --git a/overlord/src/app/raw-material-cost/raw-material-cost.component.html b/overlord/src/app/raw-material-cost/raw-material-cost.component.html new file mode 100644 index 00000000..2d5480f5 --- /dev/null +++ b/overlord/src/app/raw-material-cost/raw-material-cost.component.html @@ -0,0 +1,100 @@ + + + Raw Material Cost + + +
    +
    + + + + + + + + + + + +
    +
    + + + + + Name + + + {{row.name}} + + {{row.name}} + + {{info.footer.name}} + + + + + Issue + {{row.issue | currency:'INR'}} + {{info.footer.issue | currency:'INR'}} + + + + + Sale + {{row.sale | currency:'INR'}} + {{info.footer.sale | currency:'INR'}} + + + + + RMC + {{row.rmc | percent:'1.2-2'}} + {{info.footer.rmc | percent:'1.2-2'}} + + + + + Group + {{row.group}} + + + + + + Quantity Quantity + {{row.quantityQuantity | number:'1.2-2'}} + + + + + + Net + {{row.net | currency:'INR'}} + + + + + + Gross + {{row.gross | currency:'INR'}} + + + + + + + + + + + +
    +
    diff --git a/overlord/src/app/raw-material-cost/raw-material-cost.component.spec.ts b/overlord/src/app/raw-material-cost/raw-material-cost.component.spec.ts new file mode 100644 index 00000000..d448d5a9 --- /dev/null +++ b/overlord/src/app/raw-material-cost/raw-material-cost.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {RawMaterialCostComponent} from './raw-material-cost.component'; + +describe('RawMaterialCostComponent', () => { + let component: RawMaterialCostComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [RawMaterialCostComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(RawMaterialCostComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/raw-material-cost/raw-material-cost.component.ts b/overlord/src/app/raw-material-cost/raw-material-cost.component.ts new file mode 100644 index 00000000..967cd54c --- /dev/null +++ b/overlord/src/app/raw-material-cost/raw-material-cost.component.ts @@ -0,0 +1,81 @@ +import {Component, OnInit, ViewChild} from '@angular/core'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MatPaginator, MatSort} from '@angular/material'; +import {ActivatedRoute, Router} from '@angular/router'; +import {Observable} from 'rxjs'; +import * as moment from 'moment'; +import {RawMaterialCostDataSource} from './raw-material-cost-datasource'; +import {RawMaterialCost} from './raw-material-cost'; +import {Product} from '../product/product'; + +@Component({ + selector: 'app-raw-material-cost', + templateUrl: './raw-material-cost.component.html', + styleUrls: ['./raw-material-cost.component.css'] +}) +export class RawMaterialCostComponent implements OnInit { + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + dataSource: RawMaterialCostDataSource; + form: FormGroup; + info: RawMaterialCost; + debitQuantity: number; + debitAmount: number; + creditQuantity: number; + creditAmount: number; + runningQuantity: number; + runningAmount: number; + /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ + displayedColumns: string[]; + columnsNoId = ['name', 'issue', 'sale', 'rmc']; + columnsId = ['name', 'group', 'quantity', 'net', 'gross']; + + products: Observable; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder + ) { + this.createForm(); + } + + ngOnInit() { + this.route.data + .subscribe((data: { info: RawMaterialCost }) => { + this.info = data.info; + this.displayedColumns = (this.info.id) ? this.columnsId : this.columnsNoId; + this.form.setValue({ + startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(), + finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate() + }); + this.dataSource = new RawMaterialCostDataSource(this.paginator, this.sort, this.info.body); + }); + } + + show() { + const model = this.prepareSubmit(); + this.router.navigate(['RawMaterialCost'], { + queryParams: { + startDate: model.startDate, + finishDate: model.finishDate + } + }); + } + + createForm() { + this.form = this.fb.group({ + startDate: '', + finishDate: '', + }); + } + + prepareSubmit(): RawMaterialCost { + const formModel = this.form.value; + + return { + startDate: moment(formModel.startDate).format('DD-MMM-YYYY'), + finishDate: moment(formModel.finishDate).format('DD-MMM-YYYY'), + }; + } +} diff --git a/overlord/src/app/raw-material-cost/raw-material-cost.module.spec.ts b/overlord/src/app/raw-material-cost/raw-material-cost.module.spec.ts new file mode 100644 index 00000000..d4ed6591 --- /dev/null +++ b/overlord/src/app/raw-material-cost/raw-material-cost.module.spec.ts @@ -0,0 +1,13 @@ +import {RawMaterialCostModule} from './raw-material-cost.module'; + +describe('RawMaterialCostModule', () => { + let rawMaterialCostModule: RawMaterialCostModule; + + beforeEach(() => { + rawMaterialCostModule = new RawMaterialCostModule(); + }); + + it('should create an instance', () => { + expect(rawMaterialCostModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/raw-material-cost/raw-material-cost.module.ts b/overlord/src/app/raw-material-cost/raw-material-cost.module.ts new file mode 100644 index 00000000..b4913f26 --- /dev/null +++ b/overlord/src/app/raw-material-cost/raw-material-cost.module.ts @@ -0,0 +1,75 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {ReactiveFormsModule} from '@angular/forms'; +import {CdkTableModule} from '@angular/cdk/table'; +import {RawMaterialCostRoutingModule} from './raw-material-cost-routing.module'; +import {RawMaterialCostComponent} from './raw-material-cost.component'; +import {MomentDateAdapter} from '@angular/material-moment-adapter'; +import {A11yModule} from '@angular/cdk/a11y'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + RawMaterialCostRoutingModule + ], + declarations: [ + RawMaterialCostComponent + ], + providers: [ + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, + ] +}) +export class RawMaterialCostModule { +} diff --git a/overlord/src/app/raw-material-cost/raw-material-cost.service.spec.ts b/overlord/src/app/raw-material-cost/raw-material-cost.service.spec.ts new file mode 100644 index 00000000..f15e02c1 --- /dev/null +++ b/overlord/src/app/raw-material-cost/raw-material-cost.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {RawMaterialCostService} from './raw-material-cost.service'; + +describe('RawMaterialCostService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [RawMaterialCostService] + }); + }); + + it('should be created', inject([RawMaterialCostService], (service: RawMaterialCostService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/raw-material-cost/raw-material-cost.service.ts b/overlord/src/app/raw-material-cost/raw-material-cost.service.ts new file mode 100644 index 00000000..3674fe9e --- /dev/null +++ b/overlord/src/app/raw-material-cost/raw-material-cost.service.ts @@ -0,0 +1,37 @@ +import {Injectable} from '@angular/core'; +import {catchError} from 'rxjs/operators'; +import {Observable} from 'rxjs/internal/Observable'; +import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http'; +import {RawMaterialCost} from './raw-material-cost'; +import {ErrorLoggerService} from '../core/error-logger.service'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; + +const url = '/api/RawMaterialCost'; +const serviceName = 'RawMaterialCostService'; + +@Injectable({ + providedIn: 'root' +}) +export class RawMaterialCostService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + list(id: string, startDate: string, finishDate): Observable { + const listUrl = (id === null) ? url : `${url}/${id}`; + const options = {params: new HttpParams()}; + if (startDate !== null) { + options.params = options.params.set('s', startDate); + } + if (finishDate !== null) { + options.params = options.params.set('f', finishDate); + } + return >this.http.get(listUrl, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } +} diff --git a/overlord/src/app/raw-material-cost/raw-material-cost.ts b/overlord/src/app/raw-material-cost/raw-material-cost.ts new file mode 100644 index 00000000..2b925724 --- /dev/null +++ b/overlord/src/app/raw-material-cost/raw-material-cost.ts @@ -0,0 +1,20 @@ +export class RawMaterialCostItem { + name: string; + issue?: number; + sale?: number; + rmc?: number; + url?: string; + + group?: string; + quantity?: number; + net?: number; + gross?: number; +} + +export class RawMaterialCost { + id?: string; + startDate: string; + finishDate: string; + body?: RawMaterialCostItem[]; + footer?: RawMaterialCostItem; +} diff --git a/overlord/src/app/receipt/receipt-accounts-resolver.service.spec.ts b/overlord/src/app/receipt/receipt-accounts-resolver.service.spec.ts new file mode 100644 index 00000000..e7d3853d --- /dev/null +++ b/overlord/src/app/receipt/receipt-accounts-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {ReceiptAccountsResolver} from './receipt-accounts-resolver.service'; + +describe('ReceiptAccountsResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ReceiptAccountsResolverService] + }); + }); + + it('should be created', inject([ReceiptAccountsResolver], (service: ReceiptAccountsResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/receipt/receipt-accounts-resolver.service.ts b/overlord/src/app/receipt/receipt-accounts-resolver.service.ts new file mode 100644 index 00000000..9dd8063b --- /dev/null +++ b/overlord/src/app/receipt/receipt-accounts-resolver.service.ts @@ -0,0 +1,18 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {Account} from '../account/account'; +import {AccountService} from '../account/account.service'; + +@Injectable({ + providedIn: 'root' +}) +export class ReceiptAccountsResolver implements Resolve { + + constructor(private ser: AccountService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + return this.ser.receiptAutocomplete(''); + } +} diff --git a/overlord/src/app/receipt/receipt-datasource.ts b/overlord/src/app/receipt/receipt-datasource.ts new file mode 100644 index 00000000..b322e067 --- /dev/null +++ b/overlord/src/app/receipt/receipt-datasource.ts @@ -0,0 +1,18 @@ +import {DataSource} from '@angular/cdk/collections'; +import {Observable} from 'rxjs'; +import {Journal} from '../journal/voucher'; + + +export class ReceiptDataSource extends DataSource { + + constructor(private data: Observable) { + super(); + } + + connect(): Observable { + return this.data; + } + + disconnect() { + } +} diff --git a/overlord/src/app/receipt/receipt-dialog.component.css b/overlord/src/app/receipt/receipt-dialog.component.css new file mode 100644 index 00000000..e69de29b diff --git a/overlord/src/app/receipt/receipt-dialog.component.html b/overlord/src/app/receipt/receipt-dialog.component.html new file mode 100644 index 00000000..996b04ce --- /dev/null +++ b/overlord/src/app/receipt/receipt-dialog.component.html @@ -0,0 +1,30 @@ +

    Edit Receipt Entry

    +
    +
    +
    + + + + Balance as on Date: {{accBal.date | currency:'INR' | accounting}} / + Final balance: {{accBal.total | currency:'INR' | accounting}} + + + + {{account.name}} + + + Amount + ₹ + + +
    +
    +
    +
    + + +
    + diff --git a/overlord/src/app/receipt/receipt-dialog.component.spec.ts b/overlord/src/app/receipt/receipt-dialog.component.spec.ts new file mode 100644 index 00000000..66c753f9 --- /dev/null +++ b/overlord/src/app/receipt/receipt-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ReceiptDialogComponent } from './receipt-dialog.component'; + +describe('ReceiptDialogComponent', () => { + let component: ReceiptDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ReceiptDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ReceiptDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/receipt/receipt-dialog.component.ts b/overlord/src/app/receipt/receipt-dialog.component.ts new file mode 100644 index 00000000..fe2a0e37 --- /dev/null +++ b/overlord/src/app/receipt/receipt-dialog.component.ts @@ -0,0 +1,76 @@ +import {Component, Inject, OnInit} from '@angular/core'; +import {MAT_DIALOG_DATA, MatAutocompleteSelectedEvent, MatDialogRef} from '@angular/material'; +import {debounceTime, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators'; +import {Account} from '../account/account'; +import {AccountService} from '../account/account.service'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {Observable, of as observableOf} from 'rxjs'; + +@Component({ + selector: 'app-receipt-dialog', + templateUrl: './receipt-dialog.component.html', + styleUrls: ['./receipt-dialog.component.css'] +}) +export class ReceiptDialogComponent implements OnInit { + accounts: Observable; + form: FormGroup; + account: Account; + accBal: any; + + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any, + private fb: FormBuilder, + private accountSer: AccountService) { + this.createForm(); + this.setupAccountAutocomplete(); + } + + ngOnInit() { + this.form.setValue({ + account: this.data.journal.account, + amount: this.data.journal.amount + }); + this.account = this.data.journal.account; + } + + createForm() { + this.form = this.fb.group({ + account: '', + amount: '' + }); + this.accBal = null; + } + + setupAccountAutocomplete(): void { + const control = this.form.get('account'); + this.accounts = control.valueChanges + .pipe( + startWith(null), + map(x => (x !== null && x.length >= 1) ? x : null), + debounceTime(150), + distinctUntilChanged(), + switchMap(x => (x === null) ? observableOf([]) : this.accountSer.autocomplete(x)) + ); + + } + + displayAccount(account?: Account): string | undefined { + return account ? account.name : undefined; + } + + accountSelected(event: MatAutocompleteSelectedEvent): void { + this.account = event.option.value; + this.accountSer.balance(this.account.id, this.data.date).subscribe((v) => { + this.accBal = v; + }); + } + + accept(): void { + const formValue = this.form.value; + const amount = +formValue.amount; + this.data.journal.account = this.account; + this.data.journal.amount = amount; + this.dialogRef.close(this.data.journal); + } +} diff --git a/overlord/src/app/receipt/receipt-resolver.service.spec.ts b/overlord/src/app/receipt/receipt-resolver.service.spec.ts new file mode 100644 index 00000000..c3a7225d --- /dev/null +++ b/overlord/src/app/receipt/receipt-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {ReceiptResolver} from './receipt-resolver.service'; + +describe('ReceiptResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ReceiptResolver] + }); + }); + + it('should be created', inject([ReceiptResolver], (service: ReceiptResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/receipt/receipt-resolver.service.ts b/overlord/src/app/receipt/receipt-resolver.service.ts new file mode 100644 index 00000000..51db9340 --- /dev/null +++ b/overlord/src/app/receipt/receipt-resolver.service.ts @@ -0,0 +1,26 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {Voucher} from '../journal/voucher'; +import {VoucherService} from '../journal/voucher.service'; + +@Injectable({ + providedIn: 'root' +}) +export class ReceiptResolver implements Resolve { + + constructor(private ser: VoucherService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const id = route.paramMap.get('id'); + const account = route.queryParamMap.get('a') || null; + if (id !== null) { + return this.ser.get(id); + } else if (account !== null) { + return this.ser.getOfType('Receipt', account); + } else { + return this.ser.getOfType('Receipt'); + } + } +} diff --git a/overlord/src/app/receipt/receipt-routing.module.spec.ts b/overlord/src/app/receipt/receipt-routing.module.spec.ts new file mode 100644 index 00000000..6aaa585c --- /dev/null +++ b/overlord/src/app/receipt/receipt-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {ReceiptRoutingModule} from './receipt-routing.module'; + +describe('ReceiptRoutingModule', () => { + let receiptRoutingModule: ReceiptRoutingModule; + + beforeEach(() => { + receiptRoutingModule = new ReceiptRoutingModule(); + }); + + it('should create an instance', () => { + expect(receiptRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/receipt/receipt-routing.module.ts b/overlord/src/app/receipt/receipt-routing.module.ts new file mode 100644 index 00000000..1ec9dfa7 --- /dev/null +++ b/overlord/src/app/receipt/receipt-routing.module.ts @@ -0,0 +1,52 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {ReceiptResolver} from './receipt-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {ReceiptComponent} from './receipt.component'; +import {ReceiptAccountsResolver} from './receipt-accounts-resolver.service'; + +const receiptRoutes: Routes = [ + { + path: 'Receipt', + component: ReceiptComponent, + canActivate: [AuthGuard], + data: { + permission: 'Receipt' + }, + resolve: { + receiptAccounts: ReceiptAccountsResolver, + voucher: ReceiptResolver + }, + runGuardsAndResolvers: 'paramsChange' + }, + { + path: 'Receipt/:id', + component: ReceiptComponent, + canActivate: [AuthGuard], + data: { + permission: 'Receipt' + }, + resolve: { + receiptAccounts: ReceiptAccountsResolver, + voucher: ReceiptResolver + }, + runGuardsAndResolvers: 'paramsChange' + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(receiptRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + ReceiptResolver + ] +}) +export class ReceiptRoutingModule { +} diff --git a/overlord/src/app/receipt/receipt.component.css b/overlord/src/app/receipt/receipt.component.css new file mode 100644 index 00000000..a592a823 --- /dev/null +++ b/overlord/src/app/receipt/receipt.component.css @@ -0,0 +1,32 @@ +.right { + display: flex; + justify-content: flex-end; +} + +.selected { + background: #fff3cd +} + +.unposted { + background: #f8d7da +} + +.center { + display: flex; + justify-content: center; +} + +.img-container { + position: relative; +} + +.img-container .overlay { + display: none; +} + +.img-container:hover > .overlay { + display: inline-block; + position: absolute; + left: 60px; + top: 0; +} diff --git a/overlord/src/app/receipt/receipt.component.html b/overlord/src/app/receipt/receipt.component.html new file mode 100644 index 00000000..c71115e4 --- /dev/null +++ b/overlord/src/app/receipt/receipt.component.html @@ -0,0 +1,113 @@ + + + Receipt + + +
    +
    + + + + + + + + + {{ account.name }} + + + + + Receipt Amount + ₹ + + +
    + +
    + + + + Balance as on Date: {{accBal.date | currency:'INR' | accounting}} / + Final balance: {{accBal.total | currency:'INR' | accounting}} + + + + {{account.name}} + + + Amount + ₹ + + + + +
    + + + + + Account + {{row.account.name}} + + + + + Amount + {{row.amount | currency:'INR'}} + + + + + Action + + + + + + + + + + + Narration + + +
    +
    + + +
    +
    + +
    +
    + + + + + + + Created on {{voucher.creationDate | localTime}} and + Last Edited on {{voucher.lastEditDate | localTime}} + by {{voucher.user.name}}. {{(voucher.poster) ? 'Posted by ' + voucher.poster : ''}} + +
    diff --git a/overlord/src/app/receipt/receipt.component.spec.ts b/overlord/src/app/receipt/receipt.component.spec.ts new file mode 100644 index 00000000..5f1646a0 --- /dev/null +++ b/overlord/src/app/receipt/receipt.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {ReceiptComponent} from './receipt.component'; + +describe('ReceiptComponent', () => { + let component: ReceiptComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ReceiptComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ReceiptComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/receipt/receipt.component.ts b/overlord/src/app/receipt/receipt.component.ts new file mode 100644 index 00000000..5528ddc7 --- /dev/null +++ b/overlord/src/app/receipt/receipt.component.ts @@ -0,0 +1,333 @@ +import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MatAutocompleteSelectedEvent, MatDialog} from '@angular/material'; +import {ActivatedRoute, Router} from '@angular/router'; +import {BehaviorSubject, fromEvent, Observable, of, of as observableOf, zip} from 'rxjs'; +import {ReceiptDataSource} from './receipt-datasource'; +import {Account} from '../account/account'; +import {VoucherService} from '../journal/voucher.service'; +import {AccountService} from '../account/account.service'; +import {DbFile, Journal, Voucher} from '../journal/voucher'; +import * as moment from 'moment'; +import {AuthService} from '../auth/auth.service'; +import {ConfirmDialogComponent} from '../shared/confirm-dialog/confirm-dialog.component'; +import {ToasterService} from '../core/toaster.service'; +import {debounceTime, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators'; +import {ReceiptDialogComponent} from './receipt-dialog.component'; +import {ImageDialogComponent} from '../shared/image-dialog/image-dialog.component'; + +@Component({ + selector: 'app-receipt', + templateUrl: './receipt.component.html', + styleUrls: ['./receipt.component.css'] +}) +export class ReceiptComponent implements OnInit, AfterViewInit { + @ViewChild('accountElement') accountElement: ElementRef; + public journalObservable = new BehaviorSubject([]); + dataSource: ReceiptDataSource; + form: FormGroup; + receiptAccounts: Account[]; + receiptJournal: Journal; + voucher: Voucher; + account: Account; + accBal: any; + + displayedColumns = ['account', 'amount', 'action']; + + accounts: Observable; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder, + private dialog: MatDialog, + private toaster: ToasterService, + private auth: AuthService, + private ser: VoucherService, + private accountSer: AccountService + ) { + this.createForm(); + this.listenToAccountAutocompleteChange(); + this.listenToReceiptAccountChange(); + } + + ngOnInit() { + this.route.data + .subscribe((data: { voucher: Voucher, receiptAccounts: Account[] }) => { + this.receiptAccounts = data.receiptAccounts; + this.loadVoucher(data.voucher); + }); + } + + ngAfterViewInit() { + this.focusAccount(); + } + + loadVoucher(voucher: Voucher) { + this.voucher = voucher; + this.receiptJournal = this.voucher.journals.filter(x => x.debit === 1)[0]; + this.form.setValue({ + date: moment(this.voucher.date, 'DD-MMM-YYYY').toDate(), + receiptAccount: this.receiptJournal.account.id, + receiptAmount: this.receiptJournal.amount, + addRow: { + account: '', + amount: 0 + }, + narration: this.voucher.narration + }); + this.dataSource = new ReceiptDataSource(this.journalObservable); + this.updateView(); + } + + focusAccount() { + setTimeout(() => { + this.accountElement.nativeElement.focus(); + }, 0); + } + + addRow() { + const amount = +(this.form.get('addRow').value.amount); + const debit = -1; + if (this.account === null || amount <= 0) { + return; + } + const oldFiltered = this.voucher.journals.filter((x) => x.account.id === this.account.id); + const old = oldFiltered.length ? oldFiltered[0] : null; + if (old && (old.debit === 1 || old.id === this.receiptJournal.id)) { + return; + } + if (old) { + old.amount += amount; + } else { + this.voucher.journals.push({ + id: null, + debit: debit, + amount: amount, + account: this.account, + costCentre: null + }); + } + this.resetAddRow(); + this.updateView(); + } + + resetAddRow() { + this.form.get('addRow').reset({ + account: null, + amount: null + }); + this.account = null; + this.accBal = null; + setTimeout(() => { + this.accountElement.nativeElement.focus(); + }, 0); + } + + updateView() { + const journals = this.voucher.journals.filter(x => x.debit === -1); + this.journalObservable.next(journals); + this.receiptJournal.amount = Math.abs(journals.map((x) => x.amount).reduce((p, c) => p + c, 0)); + this.form.get('receiptAmount').setValue(this.receiptJournal.amount); + } + + editRow(row: Journal) { + const dialogRef = this.dialog.open(ReceiptDialogComponent, { + width: '750px', + data: {journal: Object.assign({}, row), date: moment(this.form.get('date').value).format('DD-MMM-YYYY')} + }); + + dialogRef.afterClosed().subscribe((result: boolean | Journal) => { + if (!result) { + return; + } + const j = result as Journal; + if (j.account.id !== row.account.id && this.voucher.journals.filter((x) => x.account.id === j.account.id).length) { + return; + } + Object.assign(row, j); + this.updateView(); + }); + } + + deleteRow(row: Journal) { + this.voucher.journals.splice(this.voucher.journals.indexOf(row), 1); + this.updateView(); + } + + createForm() { + this.form = this.fb.group({ + date: '', + receiptAccount: '', + receiptAmount: {value: '', disabled: true}, + addRow: this.fb.group({ + account: '', + amount: '' + }), + narration: '' + }); + this.accBal = null; + } + + canSave() { + if (!this.voucher.id) { + return true; + } else if (this.voucher.posted && this.auth.user.perms.indexOf('Edit Posted Vouchers') !== -1) { + return true; + } else { + return this.voucher.user.id === this.auth.user.id || this.auth.user.perms.indexOf('Edit Other User\'s Vouchers') !== -1; + } + } + + post() { + this.ser.post(this.voucher.id) + .subscribe( + (result) => { + this.loadVoucher(result); + this.toaster.show('Success', 'Voucher Posted'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + save() { + this.ser.save(this.getVoucher()) + .subscribe( + (result) => { + this.loadVoucher(result); + this.toaster.show('Success', ''); + this.router.navigate(['/Receipt', result.id]); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + getVoucher(): Voucher { + const formModel = this.form.value; + this.voucher.date = moment(formModel.date).format('DD-MMM-YYYY'); + this.receiptJournal.account.id = formModel.receiptAccount; + this.voucher.narration = formModel.narration; + return this.voucher; + } + + delete() { + this.ser.delete(this.voucher.id) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigate(['/Receipt'], {replaceUrl: true}); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + confirmDelete(): void { + const dialogRef = this.dialog.open(ConfirmDialogComponent, { + width: '250px', + data: {title: 'Delete Voucher?', content: 'Are you sure? This cannot be undone.'} + }); + + dialogRef.afterClosed().subscribe((result: boolean) => { + if (result) { + this.delete(); + } + }); + } + + listenToAccountAutocompleteChange(): void { + const control = this.form.get('addRow').get('account'); + this.accounts = control.valueChanges + .pipe( + startWith(null), + map(x => (x !== null && x.length >= 1) ? x : null), + debounceTime(150), + distinctUntilChanged(), + switchMap(x => (x === null) ? observableOf([]) : this.accountSer.autocomplete(x)) + ); + } + + listenToReceiptAccountChange(): void { + this.form.get('receiptAccount').valueChanges + .subscribe(x => this.router.navigate([], { + relativeTo: this.route, + queryParams: {a: x}, + replaceUrl: true + }) + ); + } + + displayAccount(account?: Account): string | undefined { + return account ? account.name : undefined; + } + + accountSelected(event: MatAutocompleteSelectedEvent): void { + this.account = event.option.value; + const date = moment(this.form.get('date').value).format('DD-MMM-YYYY'); + this.accountSer.balance(this.account.id, date).subscribe((v) => { + this.accBal = v; + }); + } + + zoomImage(file: DbFile) { + this.dialog.open(ImageDialogComponent, { + width: '750px', + data: file.resized + }); + } + + deleteImage(file: DbFile) { + const index = this.voucher.files.indexOf(file); + this.voucher.files.splice(index, 1); + } + + detectFiles(event) { + const files = event.target.files; + if (files) { + for (const file of files) { + const reader = new FileReader(); + reader.onload = (e: any) => { + zip(of(e.target.result), + this.resizeImage(e.target.result, 100, 150), + this.resizeImage(e.target.result, 825, 1170) + ).subscribe( + val => this.voucher.files.push({id: null, thumbnail: val[1], resized: val[2]}) + ); + }; + reader.readAsDataURL(file); + } + } + } + + resizeImage(image, MAX_WIDTH, MAX_HEIGHT) { + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d'); + const img = new Image(); + const ex = fromEvent(img, 'load').pipe( + map((e) => { + let width = img.naturalWidth, + height = img.naturalHeight; + const ratio = Math.min(1, MAX_WIDTH / width, MAX_HEIGHT / height); + + if (ratio === 1) { + return image; + } + + width *= ratio; + height *= ratio; + + canvas.width = width; + canvas.height = height; + ctx.drawImage(img, 0, 0, width, height); + return canvas.toDataURL('image/jpeg', 0.95); + }) + ); + img.src = image; + return ex; + } +} diff --git a/overlord/src/app/receipt/receipt.module.spec.ts b/overlord/src/app/receipt/receipt.module.spec.ts new file mode 100644 index 00000000..4980ee44 --- /dev/null +++ b/overlord/src/app/receipt/receipt.module.spec.ts @@ -0,0 +1,13 @@ +import {ReceiptModule} from './receipt.module'; + +describe('ReceiptModule', () => { + let receiptModule: ReceiptModule; + + beforeEach(() => { + receiptModule = new ReceiptModule(); + }); + + it('should create an instance', () => { + expect(receiptModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/receipt/receipt.module.ts b/overlord/src/app/receipt/receipt.module.ts new file mode 100644 index 00000000..49ae1842 --- /dev/null +++ b/overlord/src/app/receipt/receipt.module.ts @@ -0,0 +1,84 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {ReactiveFormsModule} from '@angular/forms'; +import {CdkTableModule} from '@angular/cdk/table'; +import {ReceiptRoutingModule} from './receipt-routing.module'; +import {ReceiptComponent} from './receipt.component'; +import {MomentDateAdapter} from '@angular/material-moment-adapter'; +import {A11yModule} from '@angular/cdk/a11y'; +import {ReceiptDialogComponent} from './receipt-dialog.component'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + ReceiptRoutingModule + ], + declarations: [ + ReceiptComponent, + ReceiptDialogComponent + ], + providers: [ + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, + ], + entryComponents: [ + ReceiptDialogComponent + ] +}) +export class ReceiptModule { +} diff --git a/overlord/src/app/receipt/receipt.service.spec.ts b/overlord/src/app/receipt/receipt.service.spec.ts new file mode 100644 index 00000000..32660431 --- /dev/null +++ b/overlord/src/app/receipt/receipt.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {VoucherService} from './receipt.service'; + +describe('ReceiptService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [VoucherService] + }); + }); + + it('should be created', inject([VoucherService], (service: VoucherService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/settings/lock-information-resolver.service.ts b/overlord/src/app/settings/lock-information-resolver.service.ts new file mode 100644 index 00000000..e1821603 --- /dev/null +++ b/overlord/src/app/settings/lock-information-resolver.service.ts @@ -0,0 +1,17 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {SettingsService} from './settings.service'; + +@Injectable({ + providedIn: 'root' +}) +export class LockInformationResolver implements Resolve { + + constructor(private ser: SettingsService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + return this.ser.getLockInformation(); + } +} diff --git a/overlord/src/app/settings/maintenance-resolver.service.ts b/overlord/src/app/settings/maintenance-resolver.service.ts new file mode 100644 index 00000000..fe38eaf9 --- /dev/null +++ b/overlord/src/app/settings/maintenance-resolver.service.ts @@ -0,0 +1,17 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {SettingsService} from './settings.service'; + +@Injectable({ + providedIn: 'root' +}) +export class MaintenanceResolver implements Resolve { + + constructor(private ser: SettingsService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + return this.ser.getMaintenance(); + } +} diff --git a/overlord/src/app/settings/settings-routing.module.ts b/overlord/src/app/settings/settings-routing.module.ts new file mode 100644 index 00000000..a49c1ccf --- /dev/null +++ b/overlord/src/app/settings/settings-routing.module.ts @@ -0,0 +1,36 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {SettingsComponent} from './settings.component'; +import {MaintenanceResolver} from './maintenance-resolver.service'; +import {LockInformationResolver} from './lock-information-resolver.service'; + +const settingsRoutes: Routes = [ + { + path: 'Settings', + component: SettingsComponent, + canActivate: [AuthGuard], + data: { + permission: 'Maintenance' // 'Lock Date' + }, + resolve: { + maintenance: MaintenanceResolver, + lockInformation: LockInformationResolver + }, + runGuardsAndResolvers: 'always' + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(settingsRoutes) + + ], + exports: [ + RouterModule + ] +}) +export class SettingsRoutingModule { +} diff --git a/overlord/src/app/settings/settings.component.css b/overlord/src/app/settings/settings.component.css new file mode 100644 index 00000000..a592a823 --- /dev/null +++ b/overlord/src/app/settings/settings.component.css @@ -0,0 +1,32 @@ +.right { + display: flex; + justify-content: flex-end; +} + +.selected { + background: #fff3cd +} + +.unposted { + background: #f8d7da +} + +.center { + display: flex; + justify-content: center; +} + +.img-container { + position: relative; +} + +.img-container .overlay { + display: none; +} + +.img-container:hover > .overlay { + display: inline-block; + position: absolute; + left: 60px; + top: 0; +} diff --git a/overlord/src/app/settings/settings.component.html b/overlord/src/app/settings/settings.component.html new file mode 100644 index 00000000..93ec1bc2 --- /dev/null +++ b/overlord/src/app/settings/settings.component.html @@ -0,0 +1,127 @@ + + + + +
    +
    + Lock Older + + Is Rolling + + + + + + + + + +
    +
    + Lock Newer + + Is Rolling + + + + + + + + + +
    +
    + + + + +
    +
    +
    + + + +
    +
    + + + + + + + +
    +
    +
    +
    +
    + + + +
    + + + + + + + + + + + + Product + + + {{product.name}} + + + + Quantity + + + + +
    +
    +
    +
    + + + + + + + + + + + + Maintenance mode is ENABLED by user {{maintenance.user}}. + + + Maintenance mode is DISABLED. + + + + + + +
    diff --git a/overlord/src/app/settings/settings.component.ts b/overlord/src/app/settings/settings.component.ts new file mode 100644 index 00000000..2e8f46ec --- /dev/null +++ b/overlord/src/app/settings/settings.component.ts @@ -0,0 +1,238 @@ +import {Component, OnInit} from '@angular/core'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MatAutocompleteSelectedEvent, MatDialog} from '@angular/material'; +import {ActivatedRoute, Router} from '@angular/router'; +import * as moment from 'moment'; +import {AuthService} from '../auth/auth.service'; +import {ToasterService} from '../core/toaster.service'; +import {SettingsService} from './settings.service'; +import {ConfirmDialogComponent} from '../shared/confirm-dialog/confirm-dialog.component'; +import {Product} from '../product/product'; +import {debounceTime, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators'; +import {Observable, of as observableOf} from 'rxjs'; +import {ProductService} from '../product/product.service'; + +@Component({ + selector: 'app-settings', + templateUrl: './settings.component.html', + styleUrls: ['./settings.component.css'] +}) +export class SettingsComponent implements OnInit { + lockDatesForm: FormGroup; + lockInformation: any; + + rebaseDataForm: FormGroup; + + resetStockForm: FormGroup; + product: Product; + products: Observable; + + maintenance: any; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder, + private dialog: MatDialog, + private toaster: ToasterService, + private auth: AuthService, + private ser: SettingsService, + private productSer: ProductService + ) { + this.createForm(); + this.listenToLockForm(); + this.lockInformation = { + lockOlder: false, olderRolling: false, + lockNewer: false, newerRolling: false + }; + this.listenToProductChanges(); + + this.maintenance = {enabled: false, user: ''}; + } + + ngOnInit() { + this.route.data + .subscribe((data: { maintenance: any, lockInformation: any }) => { + this.maintenance = data.maintenance; + this.lockInformation = data.lockInformation; + this.lockDatesForm.patchValue({ + lockOlder: this.lockInformation.lockOlder, + olderRolling: this.lockInformation.olderRolling, + olderDate: this.lockInformation.olderDate, + olderDays: this.lockInformation.olderDays, + lockNewer: this.lockInformation.lockNewer, + newerRolling: this.lockInformation.newerRolling, + newerDate: this.lockInformation.newerDate, + newerDays: this.lockInformation.newerDays + }); + }); + } + + createForm() { + const startDate = moment().date(1); + const finishDate = moment().date(startDate.daysInMonth()); + this.lockDatesForm = this.fb.group({ + lockOlder: null, + olderRolling: null, + olderDate: startDate, + olderDays: 0, + lockNewer: null, + newerRolling: null, + newerDate: finishDate, + newerDays: 0 + }); + + this.rebaseDataForm = this.fb.group({ + date: moment() + }); + + this.resetStockForm = this.fb.group({ + resetDate: moment(), + stockDate: moment(), + product: null, + quantity: 0 + }); + + } + + listenToLockForm() { + this.lockDatesForm.get('lockOlder').valueChanges + .subscribe(x => this.lockInformation.lockOlder = x); + this.lockDatesForm.get('lockNewer').valueChanges + .subscribe(x => this.lockInformation.lockNewer = x); + this.lockDatesForm.get('olderRolling').valueChanges + .subscribe(x => this.lockInformation.olderRolling = x); + this.lockDatesForm.get('newerRolling').valueChanges + .subscribe(x => this.lockInformation.newerRolling = x); + } + + clearLockDates() { + this.ser.deleteLockInformation() + .subscribe(x => this.lockInformation = x); + } + + setLockDates() { + if (this.lockInformation.lockOlder && this.lockInformation.olderRolling) { + this.lockInformation.olderDays = +this.lockDatesForm.get('olderDays').value; + } + if (this.lockInformation.lockOlder && !this.lockInformation.olderRolling) { + this.lockInformation.olderDate = moment(this.lockDatesForm.get('olderDate').value).format('DD-MMM-YYYY'); + } + if (this.lockInformation.lockNewer && this.lockInformation.newerRolling) { + this.lockInformation.newerDays = +this.lockDatesForm.get('newerDays').value; + } + if (this.lockInformation.lockOlder && !this.lockInformation.newerRolling) { + this.lockInformation.newerDate = moment(this.lockDatesForm.get('newerDate').value).format('DD-MMM-YYYY'); + } + this.ser.setLockInformation(this.lockInformation) + .subscribe( + (result) => { + this.lockInformation = result; + this.toaster.show('Success', 'Lock information Updated'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + confirmRebase(): void { + const rebaseDate = moment(this.rebaseDataForm.get('date').value).format('DD-MMM-YYYY'); + const dialogRef = this.dialog.open(ConfirmDialogComponent, { + width: '250px', + data: { + title: 'Rebase the database?', + content: 'Are you sure you want to rebase the database as on ' + rebaseDate + '? This action is destructive and cannot be undone.' + } + }); + + dialogRef.afterClosed().subscribe((result: boolean) => { + if (result) { + this.rebaseData(rebaseDate); + } + }); + } + + rebaseData(rebaseDate: string) { + this.ser.rebaseDatabase(rebaseDate) + .subscribe( + (result) => { + this.lockInformation = result; + this.toaster.show('Success', 'Data has been rebased!'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + listenToProductChanges() { + this.products = this.resetStockForm.get('product').valueChanges + .pipe( + startWith(null), + map(x => (x !== null && x.length >= 1) ? x : null), + debounceTime(150), + distinctUntilChanged(), + switchMap(x => (x === null) ? observableOf([]) : this.productSer.autocomplete(x)) + ); + + } + + displayProduct(product?: Product): string | undefined { + return product ? product.name : undefined; + } + + selectedProduct(event: MatAutocompleteSelectedEvent): void { + this.product = event.option.value; + } + + confirmResetStock(): void { + const resetDate = moment(this.resetStockForm.get('resetDate').value).format('DD-MMM-YYYY'); + const stockDate = moment(this.resetStockForm.get('stockDate').value).format('DD-MMM-YYYY'); + const quantity = +this.resetStockForm.get('quantity').value; + const dialogRef = this.dialog.open(ConfirmDialogComponent, { + width: '250px', + data: { + title: 'Reset the stock of?', + content: 'Are you sure you want to reset the stock of ' + this.product.name + '? This action is destructive and cannot be undone.' + } + }); + + dialogRef.afterClosed().subscribe((result: boolean) => { + if (result) { + this.resetStock(resetDate, stockDate, this.product, quantity); + } + }); + } + + resetStock(resetDate: string, stockDate: string, product: Product, quantity: number) { + this.ser.resetStock(resetDate, stockDate, product, quantity) + .subscribe( + (result) => { + this.toaster.show('Success', 'Stock has been reset!'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + + checkIntegrity() { + this.ser.checkDatabaseIntegrity() + .subscribe( + (result) => { + this.lockInformation = result; + this.toaster.show('Success', 'Database checked, it is fine!'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + toggleMaintenance() { + this.ser.setMaintenance(!this.maintenance.enabled) + .subscribe(x => this.maintenance = x); + } +} diff --git a/overlord/src/app/settings/settings.module.ts b/overlord/src/app/settings/settings.module.ts new file mode 100644 index 00000000..013a5cc3 --- /dev/null +++ b/overlord/src/app/settings/settings.module.ts @@ -0,0 +1,61 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule, + MatTabsModule +} from '@angular/material'; +import {ReactiveFormsModule} from '@angular/forms'; +import {CdkTableModule} from '@angular/cdk/table'; +import {A11yModule} from '@angular/cdk/a11y'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; +import {SharedModule} from '../shared/shared.module'; +import {SettingsComponent} from './settings.component'; +import {SettingsRoutingModule} from './settings-routing.module'; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatDialogModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSelectModule, + MatSortModule, + MatTableModule, + MatTabsModule, + ReactiveFormsModule, + SharedModule, + SettingsRoutingModule + ], + declarations: [ + SettingsComponent + ] +}) +export class SettingsModule { +} diff --git a/overlord/src/app/settings/settings.service.ts b/overlord/src/app/settings/settings.service.ts new file mode 100644 index 00000000..1122ea68 --- /dev/null +++ b/overlord/src/app/settings/settings.service.ts @@ -0,0 +1,87 @@ +import {Injectable} from '@angular/core'; +import {Observable} from 'rxjs/internal/Observable'; +import {catchError} from 'rxjs/operators'; +import {HttpClient, HttpHeaders} from '@angular/common/http'; +import {ErrorLoggerService} from '../core/error-logger.service'; +import {Product} from '../product/product'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; + +const serviceName = 'SettingsService'; + +@Injectable({providedIn: 'root'}) +export class SettingsService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + getLockInformation(): Observable { + const url = '/api/LockInformation'; + return >this.http.get(url) + .pipe( + catchError(this.log.handleError(serviceName, `getLockInformation`)) + ); + } + + setLockInformation(lockInformation: any): Observable { + const url = '/api/LockInformation'; + return >this.http.post(url, lockInformation) + .pipe( + catchError(this.log.handleError(serviceName, `setLockInformation`)) + ); + } + + deleteLockInformation(): Observable { + const url = '/api/LockInformation'; + return >this.http.delete(url) + .pipe( + catchError(this.log.handleError(serviceName, `deleteLockInformation`)) + ); + } + + resetStock(resetDate: string, stockDate: string, product: Product, quantity: number): Observable { + const url = '/api/ResetStock/'; + return >this.http.post(`${url}/${product.id}`, { + stockDate: stockDate, + resetDate: resetDate, + quantity: quantity + }) + .pipe( + catchError(this.log.handleError(serviceName, `resetStock`)) + ); + } + + rebaseDatabase(date: string): Observable { + const url = '/api/Rebase/'; + return >this.http.post(`${url}/${date}`, {}) + .pipe( + catchError(this.log.handleError(serviceName, `rebaseDatabase`)) + ); + } + + setMaintenance(enable: boolean): Observable { + const url = '/api/Maintenance'; + return >this.http.post(url, {enabled: enable}) + .pipe( + catchError(this.log.handleError(serviceName, `setMaintenance`)) + ); + } + + getMaintenance(): Observable { + const url = '/api/Maintenance'; + return >this.http.get(url) + .pipe( + catchError(this.log.handleError(serviceName, `getMaintenance`)) + ); + } + + checkDatabaseIntegrity(): Observable { + const url = '/api/DbIntegrity'; + return >this.http.post(url, {}) + .pipe( + catchError(this.log.handleError(serviceName, `checkDatabaseIntegrity`)) + ); + } +} diff --git a/overlord/src/app/shared/accounting.pipe.spec.ts b/overlord/src/app/shared/accounting.pipe.spec.ts new file mode 100644 index 00000000..731e66fd --- /dev/null +++ b/overlord/src/app/shared/accounting.pipe.spec.ts @@ -0,0 +1,8 @@ +import {AccountingPipe} from './accounting.pipe'; + +describe('AccountingPipe', () => { + it('create an instance', () => { + const pipe = new AccountingPipe(); + expect(pipe).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/shared/accounting.pipe.ts b/overlord/src/app/shared/accounting.pipe.ts new file mode 100644 index 00000000..33136c47 --- /dev/null +++ b/overlord/src/app/shared/accounting.pipe.ts @@ -0,0 +1,20 @@ +import {Pipe, PipeTransform} from '@angular/core'; + +@Pipe({ + name: 'accounting' +}) +export class AccountingPipe implements PipeTransform { + + constructor() { + + } + + transform(value: string): string { + if (value === null) { + return ''; + } + const amount = +(value.replace(new RegExp('(₹ )|(,)', 'g'), '')); + return value.replace('-', '') + ((amount < 0) ? '\u00A0Cr' : '\u00A0Dr'); + } + +} diff --git a/overlord/src/app/shared/clear.pipe.spec.ts b/overlord/src/app/shared/clear.pipe.spec.ts new file mode 100644 index 00000000..75558ced --- /dev/null +++ b/overlord/src/app/shared/clear.pipe.spec.ts @@ -0,0 +1,8 @@ +import {ClearPipe} from './clear.pipe'; + +describe('ClearPipe', () => { + it('create an instance', () => { + const pipe = new ClearPipe(); + expect(pipe).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/shared/clear.pipe.ts b/overlord/src/app/shared/clear.pipe.ts new file mode 100644 index 00000000..e6a9c436 --- /dev/null +++ b/overlord/src/app/shared/clear.pipe.ts @@ -0,0 +1,12 @@ +import {Pipe, PipeTransform} from '@angular/core'; + +@Pipe({ + name: 'clear' +}) +export class ClearPipe implements PipeTransform { + + transform(value: any, args?: any): any { + return value === '₹ 0.00' || value === '0.00' ? '' : value; + } + +} diff --git a/overlord/src/app/shared/confirm-dialog/confirm-dialog.component.css b/overlord/src/app/shared/confirm-dialog/confirm-dialog.component.css new file mode 100644 index 00000000..e69de29b diff --git a/overlord/src/app/shared/confirm-dialog/confirm-dialog.component.html b/overlord/src/app/shared/confirm-dialog/confirm-dialog.component.html new file mode 100644 index 00000000..1942c33e --- /dev/null +++ b/overlord/src/app/shared/confirm-dialog/confirm-dialog.component.html @@ -0,0 +1,8 @@ +

    {{data.title}}

    +
    + {{data.content}} +
    +
    + + +
    diff --git a/overlord/src/app/shared/confirm-dialog/confirm-dialog.component.spec.ts b/overlord/src/app/shared/confirm-dialog/confirm-dialog.component.spec.ts new file mode 100644 index 00000000..eaa04d96 --- /dev/null +++ b/overlord/src/app/shared/confirm-dialog/confirm-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {ConfirmDialogComponent} from './confirm-dialog.component'; + +describe('ConfirmDialogComponent', () => { + let component: ConfirmDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ConfirmDialogComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ConfirmDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/shared/confirm-dialog/confirm-dialog.component.ts b/overlord/src/app/shared/confirm-dialog/confirm-dialog.component.ts new file mode 100644 index 00000000..fc5eb4f9 --- /dev/null +++ b/overlord/src/app/shared/confirm-dialog/confirm-dialog.component.ts @@ -0,0 +1,16 @@ +import {Component, Inject} from '@angular/core'; +import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material'; + +@Component({ + selector: 'app-confirm-dialog', + templateUrl: './confirm-dialog.component.html', + styleUrls: ['./confirm-dialog.component.css'] +}) +export class ConfirmDialogComponent { + + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any) { + } + +} diff --git a/overlord/src/app/shared/cookie.service.spec.ts b/overlord/src/app/shared/cookie.service.spec.ts new file mode 100644 index 00000000..c751d00a --- /dev/null +++ b/overlord/src/app/shared/cookie.service.spec.ts @@ -0,0 +1,15 @@ +import { TestBed, inject } from '@angular/core/testing'; + +import { CookieService } from './cookie.service'; + +describe('CookieService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [CookieService] + }); + }); + + it('should be created', inject([CookieService], (service: CookieService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/shared/cookie.service.ts b/overlord/src/app/shared/cookie.service.ts new file mode 100644 index 00000000..ea308d70 --- /dev/null +++ b/overlord/src/app/shared/cookie.service.ts @@ -0,0 +1,36 @@ +import {Injectable} from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class CookieService { + + constructor() { + } + + public getCookie(name: string) { + const ca: Array = document.cookie.split(';'); + const caLen: number = ca.length; + const cookieName = `${name}=`; + let c: string; + + for (let i = 0; i < caLen; i += 1) { + c = ca[i].replace(/^\s+/g, ''); + if (c.indexOf(cookieName) === 0) { + return c.substring(cookieName.length, c.length); + } + } + return ''; + } + + public deleteCookie(name) { + this.setCookie(name, '', -1); + } + + public setCookie(name: string, value: string, expireDays: number, path: string = '') { + const d: Date = new Date(); + d.setTime(d.getTime() + expireDays * 24 * 60 * 60 * 1000); + const expires: string = 'expires=' + d.toUTCString(); + document.cookie = name + '=' + value + '; ' + expires + (path.length > 0 ? '; path=' + path : ''); + } +} diff --git a/overlord/src/app/shared/image-dialog/image-dialog.component.css b/overlord/src/app/shared/image-dialog/image-dialog.component.css new file mode 100644 index 00000000..e2718bac --- /dev/null +++ b/overlord/src/app/shared/image-dialog/image-dialog.component.css @@ -0,0 +1,3 @@ +img { + max-width: 100%; +} diff --git a/overlord/src/app/shared/image-dialog/image-dialog.component.html b/overlord/src/app/shared/image-dialog/image-dialog.component.html new file mode 100644 index 00000000..13434735 --- /dev/null +++ b/overlord/src/app/shared/image-dialog/image-dialog.component.html @@ -0,0 +1 @@ + diff --git a/overlord/src/app/shared/image-dialog/image-dialog.component.spec.ts b/overlord/src/app/shared/image-dialog/image-dialog.component.spec.ts new file mode 100644 index 00000000..d0a20e32 --- /dev/null +++ b/overlord/src/app/shared/image-dialog/image-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {ImageDialogComponent} from './image-dialog.component'; + +describe('ImageDialogComponent', () => { + let component: ImageDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ImageDialogComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ImageDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/shared/image-dialog/image-dialog.component.ts b/overlord/src/app/shared/image-dialog/image-dialog.component.ts new file mode 100644 index 00000000..0bdb8955 --- /dev/null +++ b/overlord/src/app/shared/image-dialog/image-dialog.component.ts @@ -0,0 +1,20 @@ +import {Component, Inject} from '@angular/core'; +import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material'; + +@Component({ + selector: 'app-image-dialog', + templateUrl: './image-dialog.component.html', + styleUrls: ['./image-dialog.component.css'] +}) +export class ImageDialogComponent { + + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any) { + } + + close(): void { + this.dialogRef.close(); + } + +} diff --git a/overlord/src/app/shared/local-time.pipe.spec.ts b/overlord/src/app/shared/local-time.pipe.spec.ts new file mode 100644 index 00000000..719bb9fe --- /dev/null +++ b/overlord/src/app/shared/local-time.pipe.spec.ts @@ -0,0 +1,8 @@ +import {LocalTimePipe} from './local-time.pipe'; + +describe('LocalTimePipe', () => { + it('create an instance', () => { + const pipe = new LocalTimePipe(); + expect(pipe).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/shared/local-time.pipe.ts b/overlord/src/app/shared/local-time.pipe.ts new file mode 100644 index 00000000..597c068b --- /dev/null +++ b/overlord/src/app/shared/local-time.pipe.ts @@ -0,0 +1,16 @@ +import {Pipe, PipeTransform} from '@angular/core'; +import * as moment from 'moment'; + +@Pipe({ + name: 'localTime' +}) +export class LocalTimePipe implements PipeTransform { + + transform(value: string): string { + if (value === undefined) { + return ''; + } + return moment(value, 'DD-MMM-YYYY HH:mm').subtract(new Date().getTimezoneOffset(), 'seconds').format('DD-MMM-YYYY HH:mm'); + } + +} diff --git a/overlord/src/app/shared/shared.module.spec.ts b/overlord/src/app/shared/shared.module.spec.ts new file mode 100644 index 00000000..efbcb8e9 --- /dev/null +++ b/overlord/src/app/shared/shared.module.spec.ts @@ -0,0 +1,13 @@ +import {SharedModule} from './shared.module'; + +describe('SharedModule', () => { + let sharedModule: SharedModule; + + beforeEach(() => { + sharedModule = new SharedModule(); + }); + + it('should create an instance', () => { + expect(sharedModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/shared/shared.module.ts b/overlord/src/app/shared/shared.module.ts new file mode 100644 index 00000000..4b6e4290 --- /dev/null +++ b/overlord/src/app/shared/shared.module.ts @@ -0,0 +1,34 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {ConfirmDialogComponent} from './confirm-dialog/confirm-dialog.component'; +import {MatButtonModule, MatDialogModule} from '@angular/material'; +import {LocalTimePipe} from './local-time.pipe'; +import {ClearPipe} from './clear.pipe'; +import {AccountingPipe} from './accounting.pipe'; +import {ImageDialogComponent} from './image-dialog/image-dialog.component'; + +@NgModule({ + imports: [ + CommonModule, + MatButtonModule, + MatDialogModule + ], + declarations: [ + ConfirmDialogComponent, + ImageDialogComponent, + AccountingPipe, + ClearPipe, + LocalTimePipe + ], + entryComponents: [ + ConfirmDialogComponent, + ImageDialogComponent + ], + exports: [ + AccountingPipe, + ClearPipe, + LocalTimePipe + ] +}) +export class SharedModule { +} diff --git a/overlord/src/app/shared/tokenizer.service.spec.ts b/overlord/src/app/shared/tokenizer.service.spec.ts new file mode 100644 index 00000000..4b6c27e6 --- /dev/null +++ b/overlord/src/app/shared/tokenizer.service.spec.ts @@ -0,0 +1,15 @@ +import { TestBed, inject } from '@angular/core/testing'; + +import { TokenizerService } from './tokenizer.service'; + +describe('TokenizerService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [TokenizerService] + }); + }); + + it('should be created', inject([TokenizerService], (service: TokenizerService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/shared/tokenizer.service.ts b/overlord/src/app/shared/tokenizer.service.ts new file mode 100644 index 00000000..1b72d5c0 --- /dev/null +++ b/overlord/src/app/shared/tokenizer.service.ts @@ -0,0 +1,50 @@ +import {Injectable} from '@angular/core'; + +const re = /((('[^']+'|"[^"]+"|[^\s]+)\s*:\s*('[^']+'|"[^"]+"|[^\s]+))|('[^']+'|"[^"]+"|[^\s]+))/g; + +@Injectable({ + providedIn: 'root' +}) +export class TokenizerService { + + constructor() { + } + + getMatches(input: string): string[] { + input = input ? input : ''; + return input.match(re); + } + + getPairs(input: string[]): any[] { + input = input ? input : []; + return input.reduce((accumulator, item) => { + let key, + value; + if (item.indexOf(':') === -1) { + key = ''; + value = item; + } else { + key = item.substr(0, item.indexOf(':')).trim(); + value = item.substr(item.indexOf(':') + 1, item.length).trim(); + } + if (key.indexOf('\'') !== -1 || key.indexOf('"') !== -1) { + key = key.substring(1, key.length - 1).trim(); + } + if (value.indexOf('\'') !== -1 || value.indexOf('"') !== -1) { + value = value.substring(1, value.length - 1).trim(); + } + if (value !== '') { + accumulator.push({Key: key, Value: value}); + } + return accumulator; + }, []); + } + + isSort(key: string, value: string, sorter?: any): boolean { + const isSort = (key === '' && value.length > 1 && '+-'.indexOf(value.charAt(0)) !== -1); + return sorter !== null ? (isSort && value.substr(1) in sorter) : isSort; + } + // getFilters(input: string[]) { + // input. + // } +} diff --git a/overlord/src/app/stock-movement/stock-movement-datasource.ts b/overlord/src/app/stock-movement/stock-movement-datasource.ts new file mode 100644 index 00000000..2c744137 --- /dev/null +++ b/overlord/src/app/stock-movement/stock-movement-datasource.ts @@ -0,0 +1,67 @@ +import {DataSource} from '@angular/cdk/collections'; +import {MatPaginator, MatSort} from '@angular/material'; +import {map} from 'rxjs/operators'; +import {merge, Observable, of as observableOf} from 'rxjs'; +import {StockMovementItem} from './stock-movement'; + + +export class StockMovementDataSource extends DataSource { + + constructor(private paginator: MatPaginator, private sort: MatSort, public data: StockMovementItem[]) { + super(); + } + + connect(): Observable { + const dataMutations = [ + observableOf(this.data), + this.paginator.page, + this.sort.sortChange + ]; + + // Set the paginators length + this.paginator.length = this.data.length; + + return merge(...dataMutations).pipe(map(() => { + return this.getPagedData(this.getSortedData([...this.data])); + })); + } + + disconnect() { + } + + private getPagedData(data: StockMovementItem[]) { + const startIndex = this.paginator.pageIndex * this.paginator.pageSize; + return data.splice(startIndex, this.paginator.pageSize); + } + + private getSortedData(data: StockMovementItem[]) { + if (!this.sort.active || this.sort.direction === '') { + return data; + } + + return data.sort((a, b) => { + const isAsc = this.sort.direction === 'asc'; + switch (this.sort.active) { + case 'group': + return compare(a.group, b.group, isAsc); + case 'name': + return compare(a.name, b.name, isAsc); + case 'opening': + return compare(+a.opening, +b.opening, isAsc); + case 'purchase': + return compare(+a.purchase, +b.purchase, isAsc); + case 'issue': + return compare(+a.issue, +b.issue, isAsc); + case 'closing': + return compare(+a.closing, +b.closing, isAsc); + default: + return 0; + } + }); + } +} + +/** Simple sort comparator for example ID/Name columns (for client-side sorting). */ +function compare(a, b, isAsc) { + return (a < b ? -1 : 1) * (isAsc ? 1 : -1); +} diff --git a/overlord/src/app/stock-movement/stock-movement-resolver.service.spec.ts b/overlord/src/app/stock-movement/stock-movement-resolver.service.spec.ts new file mode 100644 index 00000000..d6e1606e --- /dev/null +++ b/overlord/src/app/stock-movement/stock-movement-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {StockMovementResolver} from './stock-movement-resolver.service'; + +describe('StockMovementResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [StockMovementResolver] + }); + }); + + it('should be created', inject([StockMovementResolver], (service: StockMovementResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/stock-movement/stock-movement-resolver.service.ts b/overlord/src/app/stock-movement/stock-movement-resolver.service.ts new file mode 100644 index 00000000..92782a1a --- /dev/null +++ b/overlord/src/app/stock-movement/stock-movement-resolver.service.ts @@ -0,0 +1,20 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {StockMovement} from './stock-movement'; +import {StockMovementService} from './stock-movement.service'; + +@Injectable({ + providedIn: 'root' +}) +export class StockMovementResolver implements Resolve { + + constructor(private ser: StockMovementService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const startDate = route.queryParamMap.get('startDate') || null; + const finishDate = route.queryParamMap.get('finishDate') || null; + return this.ser.list(startDate, finishDate); + } +} diff --git a/overlord/src/app/stock-movement/stock-movement-routing.module.spec.ts b/overlord/src/app/stock-movement/stock-movement-routing.module.spec.ts new file mode 100644 index 00000000..4f4a7067 --- /dev/null +++ b/overlord/src/app/stock-movement/stock-movement-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {StockMovementRoutingModule} from './stock-movement-routing.module'; + +describe('StockMovementRoutingModule', () => { + let stockMovementRoutingModule: StockMovementRoutingModule; + + beforeEach(() => { + stockMovementRoutingModule = new StockMovementRoutingModule(); + }); + + it('should create an instance', () => { + expect(stockMovementRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/stock-movement/stock-movement-routing.module.ts b/overlord/src/app/stock-movement/stock-movement-routing.module.ts new file mode 100644 index 00000000..a36b3b5f --- /dev/null +++ b/overlord/src/app/stock-movement/stock-movement-routing.module.ts @@ -0,0 +1,37 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {StockMovementResolver} from './stock-movement-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {StockMovementComponent} from './stock-movement.component'; + +const stockMovementRoutes: Routes = [ + { + path: 'StockMovement', + component: StockMovementComponent, + canActivate: [AuthGuard], + data: { + permission: 'Stock Movement' + }, + resolve: { + info: StockMovementResolver + }, + runGuardsAndResolvers: 'always' + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(stockMovementRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + StockMovementResolver + ] +}) +export class StockMovementRoutingModule { +} diff --git a/overlord/src/app/stock-movement/stock-movement.component.css b/overlord/src/app/stock-movement/stock-movement.component.css new file mode 100644 index 00000000..ef3a3239 --- /dev/null +++ b/overlord/src/app/stock-movement/stock-movement.component.css @@ -0,0 +1,12 @@ +.right { + display: flex; + justify-content: flex-end; +} + +.selected{ + background: #fff3cd +} + +.unposted{ + background: #f8d7da +} diff --git a/overlord/src/app/stock-movement/stock-movement.component.html b/overlord/src/app/stock-movement/stock-movement.component.html new file mode 100644 index 00000000..e9a17783 --- /dev/null +++ b/overlord/src/app/stock-movement/stock-movement.component.html @@ -0,0 +1,73 @@ + + + Stock Movement + + +
    +
    + + + + + + + + + + + +
    +
    + + + + + Group + {{row.group}} + + + + + Name + {{row.name}} + + + + + Opening + {{row.opening | number:'1.2-2'}} + + + + + Purchase + {{row.purchase | number:'1.2-2'}} + + + + + Issue + {{row.issue | number:'1.2-2'}} + + + + + Closing + {{row.closing | number:'1.2-2'}} + + + + + + + + +
    +
    diff --git a/overlord/src/app/stock-movement/stock-movement.component.spec.ts b/overlord/src/app/stock-movement/stock-movement.component.spec.ts new file mode 100644 index 00000000..87afb174 --- /dev/null +++ b/overlord/src/app/stock-movement/stock-movement.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {StockMovementComponent} from './stock-movement.component'; + +describe('StockMovementComponent', () => { + let component: StockMovementComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [StockMovementComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(StockMovementComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/stock-movement/stock-movement.component.ts b/overlord/src/app/stock-movement/stock-movement.component.ts new file mode 100644 index 00000000..b9d452be --- /dev/null +++ b/overlord/src/app/stock-movement/stock-movement.component.ts @@ -0,0 +1,70 @@ +import {Component, OnInit, ViewChild} from '@angular/core'; +import {FormBuilder, FormGroup} from '@angular/forms'; +import {MatPaginator, MatSort} from '@angular/material'; +import {ActivatedRoute, Router} from '@angular/router'; +import * as moment from 'moment'; +import {StockMovementDataSource} from './stock-movement-datasource'; +import {StockMovement} from './stock-movement'; + +@Component({ + selector: 'app-stock-movement', + templateUrl: './stock-movement.component.html', + styleUrls: ['./stock-movement.component.css'] +}) +export class StockMovementComponent implements OnInit { + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + dataSource: StockMovementDataSource; + form: FormGroup; + info: StockMovement; + selectedRowId: string; + /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ + displayedColumns = ['group', 'name', 'opening', 'purchase', 'issue', 'closing']; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder + ) { + this.createForm(); + } + + ngOnInit() { + this.route.data + .subscribe((data: { info: StockMovement }) => { + this.info = data.info; + this.form.setValue({ + startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(), + finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate() + }); + this.dataSource = new StockMovementDataSource(this.paginator, this.sort, this.info.body); + }); + } + + show() { + const l = this.prepareSubmit(); + this.router.navigate(['StockMovement'], { + queryParams: { + startDate: l.startDate, + finishDate: l.finishDate + } + }); + } + + createForm() { + this.form = this.fb.group({ + startDate: '', + finishDate: '', + }); + } + + prepareSubmit(): StockMovement { + const formModel = this.form.value; + + return { + startDate: moment(formModel.startDate).format('DD-MMM-YYYY'), + finishDate: moment(formModel.finishDate).format('DD-MMM-YYYY'), + body: [] + }; + } +} diff --git a/overlord/src/app/stock-movement/stock-movement.module.spec.ts b/overlord/src/app/stock-movement/stock-movement.module.spec.ts new file mode 100644 index 00000000..ea61276e --- /dev/null +++ b/overlord/src/app/stock-movement/stock-movement.module.spec.ts @@ -0,0 +1,13 @@ +import {StockMovementModule} from './stock-movement.module'; + +describe('StockMovementModule', () => { + let stockMovementModule: StockMovementModule; + + beforeEach(() => { + stockMovementModule = new StockMovementModule(); + }); + + it('should create an instance', () => { + expect(stockMovementModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/stock-movement/stock-movement.module.ts b/overlord/src/app/stock-movement/stock-movement.module.ts new file mode 100644 index 00000000..801b440c --- /dev/null +++ b/overlord/src/app/stock-movement/stock-movement.module.ts @@ -0,0 +1,75 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {ReactiveFormsModule} from '@angular/forms'; +import {CdkTableModule} from '@angular/cdk/table'; +import {StockMovementRoutingModule} from './stock-movement-routing.module'; +import {StockMovementComponent} from './stock-movement.component'; +import {MomentDateAdapter} from '@angular/material-moment-adapter'; +import {A11yModule} from '@angular/cdk/a11y'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatAutocompleteModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + StockMovementRoutingModule + ], + declarations: [ + StockMovementComponent + ], + providers: [ + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, + ] +}) +export class StockMovementModule { +} diff --git a/overlord/src/app/stock-movement/stock-movement.service.spec.ts b/overlord/src/app/stock-movement/stock-movement.service.spec.ts new file mode 100644 index 00000000..59bc4519 --- /dev/null +++ b/overlord/src/app/stock-movement/stock-movement.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {StockMovementService} from './stock-movement.service'; + +describe('StockMovementService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [StockMovementService] + }); + }); + + it('should be created', inject([StockMovementService], (service: StockMovementService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/stock-movement/stock-movement.service.ts b/overlord/src/app/stock-movement/stock-movement.service.ts new file mode 100644 index 00000000..ae1843d3 --- /dev/null +++ b/overlord/src/app/stock-movement/stock-movement.service.ts @@ -0,0 +1,37 @@ +import {Injectable} from '@angular/core'; +import {catchError} from 'rxjs/operators'; +import {Observable} from 'rxjs/internal/Observable'; +import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http'; +import {StockMovement} from './stock-movement'; +import {ErrorLoggerService} from '../core/error-logger.service'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; + +const url = '/api/StockMovement'; +const serviceName = 'StockMovementService'; + +@Injectable({ + providedIn: 'root' +}) +export class StockMovementService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + list(startDate: string, finishDate): Observable { + const options = {params: new HttpParams()}; + if (startDate !== null) { + options.params = options.params.set('s', startDate); + } + if (finishDate !== null) { + options.params = options.params.set('f', finishDate); + } + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + +} diff --git a/overlord/src/app/stock-movement/stock-movement.ts b/overlord/src/app/stock-movement/stock-movement.ts new file mode 100644 index 00000000..25a3b8f9 --- /dev/null +++ b/overlord/src/app/stock-movement/stock-movement.ts @@ -0,0 +1,15 @@ + +export class StockMovementItem { + group: string; + name: string; + opening: number; + purchase: number; + issue: number; + closing: number; +} + +export class StockMovement { + startDate: string; + finishDate: string; + body: StockMovementItem[]; +} diff --git a/overlord/src/app/trial-balance/trial-balance-datasource.ts b/overlord/src/app/trial-balance/trial-balance-datasource.ts new file mode 100644 index 00000000..247bbaa1 --- /dev/null +++ b/overlord/src/app/trial-balance/trial-balance-datasource.ts @@ -0,0 +1,63 @@ +import {DataSource} from '@angular/cdk/collections'; +import {MatPaginator, MatSort} from '@angular/material'; +import {map} from 'rxjs/operators'; +import {merge, Observable, of as observableOf} from 'rxjs'; +import {TrialBalanceItem} from './trial-balance'; + + +export class TrialBalanceDataSource extends DataSource { + + constructor(private paginator: MatPaginator, private sort: MatSort, public data: TrialBalanceItem[]) { + super(); + } + + connect(): Observable { + const dataMutations = [ + observableOf(this.data), + this.paginator.page, + this.sort.sortChange + ]; + + // Set the paginators length + this.paginator.length = this.data.length; + + return merge(...dataMutations).pipe(map(() => { + return this.getPagedData(this.getSortedData([...this.data])); + })); + } + + disconnect() { + } + + private getPagedData(data: TrialBalanceItem[]) { + const startIndex = this.paginator.pageIndex * this.paginator.pageSize; + return data.splice(startIndex, this.paginator.pageSize); + } + + private getSortedData(data: TrialBalanceItem[]) { + if (!this.sort.active || this.sort.direction === '') { + return data; + } + + return data.sort((a: TrialBalanceItem, b: TrialBalanceItem) => { + const isAsc = this.sort.direction === 'asc'; + switch (this.sort.active) { + case 'type': + return compare(a.type, b.type, isAsc); + case 'name': + return compare(a.name, b.name, isAsc); + case 'debit': + return compare(+a.debit, +b.debit, isAsc); + case 'credit': + return compare(+a.credit, +b.credit, isAsc); + default: + return 0; + } + }); + } +} + +/** Simple sort comparator for example ID/Name columns (for client-side sorting). */ +function compare(a, b, isAsc) { + return (a < b ? -1 : 1) * (isAsc ? 1 : -1); +} diff --git a/overlord/src/app/trial-balance/trial-balance-resolver.service.spec.ts b/overlord/src/app/trial-balance/trial-balance-resolver.service.spec.ts new file mode 100644 index 00000000..f303eed6 --- /dev/null +++ b/overlord/src/app/trial-balance/trial-balance-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {TrialBalanceResolver} from './trial-balance-resolver.service'; + +describe('TrialBalanceResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [TrialBalanceResolver] + }); + }); + + it('should be created', inject([TrialBalanceResolver], (service: TrialBalanceResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/trial-balance/trial-balance-resolver.service.ts b/overlord/src/app/trial-balance/trial-balance-resolver.service.ts new file mode 100644 index 00000000..79ce16f2 --- /dev/null +++ b/overlord/src/app/trial-balance/trial-balance-resolver.service.ts @@ -0,0 +1,19 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {TrialBalance} from './trial-balance'; +import {TrialBalanceService} from './trial-balance.service'; + +@Injectable({ + providedIn: 'root' +}) +export class TrialBalanceResolver implements Resolve { + + constructor(private ser: TrialBalanceService) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const date = route.paramMap.get('date'); + return this.ser.list(date); + } +} diff --git a/overlord/src/app/trial-balance/trial-balance-routing.module.spec.ts b/overlord/src/app/trial-balance/trial-balance-routing.module.spec.ts new file mode 100644 index 00000000..ab0c36f5 --- /dev/null +++ b/overlord/src/app/trial-balance/trial-balance-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {TrialBalanceRoutingModule} from './trial-balance-routing.module'; + +describe('TrialBalanceRoutingModule', () => { + let trialBalanceRoutingModule: TrialBalanceRoutingModule; + + beforeEach(() => { + trialBalanceRoutingModule = new TrialBalanceRoutingModule(); + }); + + it('should create an instance', () => { + expect(trialBalanceRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/trial-balance/trial-balance-routing.module.ts b/overlord/src/app/trial-balance/trial-balance-routing.module.ts new file mode 100644 index 00000000..ab4e7058 --- /dev/null +++ b/overlord/src/app/trial-balance/trial-balance-routing.module.ts @@ -0,0 +1,47 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {TrialBalanceResolver} from './trial-balance-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {TrialBalanceComponent} from './trial-balance.component'; + +const trialBalanceRoutes: Routes = [ + { + path: 'TrialBalance', + component: TrialBalanceComponent, + canActivate: [AuthGuard], + data: { + permission: 'Trial Balance' + }, + resolve: { + info: TrialBalanceResolver + } + }, + { + path: 'TrialBalance/:date', + component: TrialBalanceComponent, + canActivate: [AuthGuard], + data: { + permission: 'Trial Balance' + }, + resolve: { + info: TrialBalanceResolver + } + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(trialBalanceRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + TrialBalanceResolver + ] +}) +export class TrialBalanceRoutingModule { +} diff --git a/overlord/src/app/trial-balance/trial-balance.component.css b/overlord/src/app/trial-balance/trial-balance.component.css new file mode 100644 index 00000000..a9626b3c --- /dev/null +++ b/overlord/src/app/trial-balance/trial-balance.component.css @@ -0,0 +1,4 @@ +.right { + display: flex; + justify-content: flex-end; +} diff --git a/overlord/src/app/trial-balance/trial-balance.component.html b/overlord/src/app/trial-balance/trial-balance.component.html new file mode 100644 index 00000000..aceeb104 --- /dev/null +++ b/overlord/src/app/trial-balance/trial-balance.component.html @@ -0,0 +1,55 @@ + + + Trial Balance + + +
    +
    + + + + + + +
    +
    + + + + + Type + {{row.type}} + + + + + Name + {{row.name}} + + + + + Debit + {{row.debit | currency:'INR' | accounting}} + + + + + Credit + {{row.credit | currency:'INR' | accounting}} + + + + + + + + +
    +
    diff --git a/overlord/src/app/trial-balance/trial-balance.component.spec.ts b/overlord/src/app/trial-balance/trial-balance.component.spec.ts new file mode 100644 index 00000000..992375ee --- /dev/null +++ b/overlord/src/app/trial-balance/trial-balance.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {TrialBalanceComponent} from './trial-balance.component'; + +describe('TrialBalanceComponent', () => { + let component: TrialBalanceComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [TrialBalanceComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TrialBalanceComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/trial-balance/trial-balance.component.ts b/overlord/src/app/trial-balance/trial-balance.component.ts new file mode 100644 index 00000000..7ef1ccd7 --- /dev/null +++ b/overlord/src/app/trial-balance/trial-balance.component.ts @@ -0,0 +1,56 @@ +import {Component, OnInit, ViewChild} from '@angular/core'; +import {MatPaginator, MatSort} from '@angular/material'; +import {TrialBalanceDataSource} from './trial-balance-datasource'; +import {TrialBalance} from './trial-balance'; +import {ActivatedRoute, Router} from '@angular/router'; +import * as moment from 'moment'; +import {FormBuilder, FormGroup} from '@angular/forms'; + +@Component({ + selector: 'app-trial-balance', + templateUrl: './trial-balance.component.html', + styleUrls: ['./trial-balance.component.css'] +}) +export class TrialBalanceComponent implements OnInit { + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + dataSource: TrialBalanceDataSource; + form: FormGroup; + info: TrialBalance; + /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ + displayedColumns = ['type', 'name', 'debit', 'credit']; + + constructor(private route: ActivatedRoute, private router: Router, private fb: FormBuilder) { + this.createForm(); + } + + createForm() { + this.form = this.fb.group({ + date: '' + }); + } + + ngOnInit() { + this.route.data + .subscribe((data: { info: TrialBalance }) => { + this.info = data.info; + this.form.setValue({ + date: moment(this.info.date, 'DD-MMM-YYYY').toDate() + }); + }); + this.dataSource = new TrialBalanceDataSource(this.paginator, this.sort, this.info.body); + } + + show() { + const info = this.getInfo(); + this.router.navigate(['TrialBalance', info.date]); + } + + getInfo(): TrialBalance { + const formModel = this.form.value; + + return { + date: moment(formModel.date).format('DD-MMM-YYYY') + }; + } +} diff --git a/overlord/src/app/trial-balance/trial-balance.module.spec.ts b/overlord/src/app/trial-balance/trial-balance.module.spec.ts new file mode 100644 index 00000000..af52910b --- /dev/null +++ b/overlord/src/app/trial-balance/trial-balance.module.spec.ts @@ -0,0 +1,13 @@ +import {TrialBalanceModule} from './trial-balance.module'; + +describe('TrialBalanceModule', () => { + let trialBalanceModule: TrialBalanceModule; + + beforeEach(() => { + trialBalanceModule = new TrialBalanceModule(); + }); + + it('should create an instance', () => { + expect(trialBalanceModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/trial-balance/trial-balance.module.ts b/overlord/src/app/trial-balance/trial-balance.module.ts new file mode 100644 index 00000000..a1510a47 --- /dev/null +++ b/overlord/src/app/trial-balance/trial-balance.module.ts @@ -0,0 +1,71 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + DateAdapter, + MAT_DATE_FORMATS, + MAT_DATE_LOCALE, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {CdkTableModule} from '@angular/cdk/table'; +import {TrialBalanceRoutingModule} from './trial-balance-routing.module'; +import {TrialBalanceComponent} from './trial-balance.component'; +import {MomentDateAdapter} from '@angular/material-moment-adapter'; +import {A11yModule} from '@angular/cdk/a11y'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; +import {ReactiveFormsModule} from '@angular/forms'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDatepickerModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + TrialBalanceRoutingModule + ], + declarations: [ + TrialBalanceComponent + ], + providers: [ + {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, + {provide: MAT_DATE_FORMATS, useValue: MY_FORMATS}, + ] +}) +export class TrialBalanceModule { +} diff --git a/overlord/src/app/trial-balance/trial-balance.service.spec.ts b/overlord/src/app/trial-balance/trial-balance.service.spec.ts new file mode 100644 index 00000000..b40a1ddc --- /dev/null +++ b/overlord/src/app/trial-balance/trial-balance.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {TrialBalanceService} from './trial-balance.service'; + +describe('TrialBalanceService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [TrialBalanceService] + }); + }); + + it('should be created', inject([TrialBalanceService], (service: TrialBalanceService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/trial-balance/trial-balance.service.ts b/overlord/src/app/trial-balance/trial-balance.service.ts new file mode 100644 index 00000000..16c49bd7 --- /dev/null +++ b/overlord/src/app/trial-balance/trial-balance.service.ts @@ -0,0 +1,31 @@ +import {Injectable} from '@angular/core'; +import {catchError} from 'rxjs/operators'; +import {Observable} from 'rxjs/internal/Observable'; +import {HttpClient, HttpHeaders} from '@angular/common/http'; +import {TrialBalance} from './trial-balance'; +import {ErrorLoggerService} from '../core/error-logger.service'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; + +const url = '/api/TrialBalance'; +const serviceName = 'AccountService'; + +@Injectable({ + providedIn: 'root' +}) +export class TrialBalanceService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + list(date: string): Observable { + const listUrl = (date === null) ? url : `${url}/${date}`; + return >this.http.get(listUrl) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + +} diff --git a/overlord/src/app/trial-balance/trial-balance.ts b/overlord/src/app/trial-balance/trial-balance.ts new file mode 100644 index 00000000..a1aad626 --- /dev/null +++ b/overlord/src/app/trial-balance/trial-balance.ts @@ -0,0 +1,11 @@ +export class TrialBalanceItem { + type: string; + name: string; + debit: number; + credit: number; +} + +export class TrialBalance { + date: string; + body?: TrialBalanceItem[]; +} diff --git a/overlord/src/app/unposted/unposted-datasource.ts b/overlord/src/app/unposted/unposted-datasource.ts new file mode 100644 index 00000000..8a69eba8 --- /dev/null +++ b/overlord/src/app/unposted/unposted-datasource.ts @@ -0,0 +1,63 @@ +import {DataSource} from '@angular/cdk/collections'; +import {MatPaginator, MatSort} from '@angular/material'; +import {map} from 'rxjs/operators'; +import {merge, Observable, of as observableOf} from 'rxjs'; +import {Unposted} from './unposted'; + + +export class UnpostedDataSource extends DataSource { + + constructor(private paginator: MatPaginator, private sort: MatSort, public data: Unposted[]) { + super(); + } + + connect(): Observable { + const dataMutations = [ + observableOf(this.data), + this.paginator.page, + this.sort.sortChange + ]; + + // Set the paginators length + this.paginator.length = this.data.length; + + return merge(...dataMutations).pipe(map(() => { + return this.getPagedData(this.getSortedData([...this.data])); + })); + } + + disconnect() { + } + + private getPagedData(data: Unposted[]) { + const startIndex = this.paginator.pageIndex * this.paginator.pageSize; + return data.splice(startIndex, this.paginator.pageSize); + } + + private getSortedData(data: Unposted[]) { + if (!this.sort.active || this.sort.direction === '') { + return data; + } + + return data.sort((a: Unposted, b: Unposted) => { + const isAsc = this.sort.direction === 'asc'; + switch (this.sort.active) { + case 'date': + return compare(a.date, b.date, isAsc); + case 'type': + return compare(a.voucherType, b.voucherType, isAsc); + case 'debitAmount': + return compare(+a.debitAmount, +b.debitAmount, isAsc); + case 'creditAmount': + return compare(+a.creditAmount, +b.creditAmount, isAsc); + default: + return 0; + } + }); + } +} + +/** Simple sort comparator for example ID/Name columns (for client-side sorting). */ +function compare(a, b, isAsc) { + return (a < b ? -1 : 1) * (isAsc ? 1 : -1); +} diff --git a/overlord/src/app/unposted/unposted-resolver.service.spec.ts b/overlord/src/app/unposted/unposted-resolver.service.spec.ts new file mode 100644 index 00000000..acff53df --- /dev/null +++ b/overlord/src/app/unposted/unposted-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {UnpostedResolver} from './unposted-resolver.service'; + +describe('UnpostedResolver', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [UnpostedResolver] + }); + }); + + it('should be created', inject([UnpostedResolver], (service: UnpostedResolver) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/unposted/unposted-resolver.service.ts b/overlord/src/app/unposted/unposted-resolver.service.ts new file mode 100644 index 00000000..5d538a4f --- /dev/null +++ b/overlord/src/app/unposted/unposted-resolver.service.ts @@ -0,0 +1,18 @@ +import {Injectable} from '@angular/core'; +import {Resolve} from '@angular/router'; +import {Observable} from 'rxjs/internal/Observable'; +import {Unposted} from './unposted'; +import {UnpostedService} from './unposted.service'; + +@Injectable({ + providedIn: 'root' +}) +export class UnpostedResolver implements Resolve { + + constructor(private ser: UnpostedService) { + } + + resolve(): Observable { + return this.ser.list(); + } +} diff --git a/overlord/src/app/unposted/unposted-routing.module.spec.ts b/overlord/src/app/unposted/unposted-routing.module.spec.ts new file mode 100644 index 00000000..e999d1ca --- /dev/null +++ b/overlord/src/app/unposted/unposted-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {UnpostedRoutingModule} from './unposted-routing.module'; + +describe('UnpostedRoutingModule', () => { + let unpostedRoutingModule: UnpostedRoutingModule; + + beforeEach(() => { + unpostedRoutingModule = new UnpostedRoutingModule(); + }); + + it('should create an instance', () => { + expect(unpostedRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/unposted/unposted-routing.module.ts b/overlord/src/app/unposted/unposted-routing.module.ts new file mode 100644 index 00000000..3b0bcb36 --- /dev/null +++ b/overlord/src/app/unposted/unposted-routing.module.ts @@ -0,0 +1,36 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {UnpostedResolver} from './unposted-resolver.service'; +import {AuthGuard} from '../auth/auth-guard.service'; +import {UnpostedComponent} from './unposted.component'; + +const unpostedRoutes: Routes = [ + { + path: 'Unposted', + component: UnpostedComponent, + canActivate: [AuthGuard], + data: { + permission: 'Post Vouchers' + }, + resolve: { + info: UnpostedResolver + } + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(unpostedRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + UnpostedResolver + ] +}) +export class UnpostedRoutingModule { +} diff --git a/overlord/src/app/unposted/unposted.component.css b/overlord/src/app/unposted/unposted.component.css new file mode 100644 index 00000000..a9626b3c --- /dev/null +++ b/overlord/src/app/unposted/unposted.component.css @@ -0,0 +1,4 @@ +.right { + display: flex; + justify-content: flex-end; +} diff --git a/overlord/src/app/unposted/unposted.component.html b/overlord/src/app/unposted/unposted.component.html new file mode 100644 index 00000000..65cb9ca7 --- /dev/null +++ b/overlord/src/app/unposted/unposted.component.html @@ -0,0 +1,65 @@ + + + Unposted + + refresh + Refresh + + + + + + + + Date + {{row.date}} + + + + + Type + {{row.voucherType}} + + + + + Narration + {{row.narration}} + + + + + Debit + {{row.debitName}} + + + + + Amount + {{row.debitAmount | currency:'INR' | accounting}} + + + + + Credit + {{row.creditName}} + + + + + Amount + {{row.creditAmount | currency:'INR' | accounting}} + + + + + + + + + + diff --git a/overlord/src/app/unposted/unposted.component.spec.ts b/overlord/src/app/unposted/unposted.component.spec.ts new file mode 100644 index 00000000..22d92ecf --- /dev/null +++ b/overlord/src/app/unposted/unposted.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {UnpostedComponent} from './unposted.component'; + +describe('UnpostedComponent', () => { + let component: UnpostedComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [UnpostedComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(UnpostedComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/unposted/unposted.component.ts b/overlord/src/app/unposted/unposted.component.ts new file mode 100644 index 00000000..9fd85cfe --- /dev/null +++ b/overlord/src/app/unposted/unposted.component.ts @@ -0,0 +1,36 @@ +import {Component, OnInit, ViewChild} from '@angular/core'; +import {MatPaginator, MatSort} from '@angular/material'; +import {UnpostedDataSource} from './unposted-datasource'; +import {Unposted} from './unposted'; +import {ActivatedRoute, Router} from '@angular/router'; +import {UnpostedService} from './unposted.service'; + +@Component({ + selector: 'app-unposted', + templateUrl: './unposted.component.html', + styleUrls: ['./unposted.component.css'] +}) +export class UnpostedComponent implements OnInit { + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + dataSource: UnpostedDataSource; + info: Unposted[]; + /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ + displayedColumns = ['date', 'voucherType', 'narration', 'debitName', 'debitAmount', 'creditName', 'creditAmount']; + private _date: Date; + + constructor(private route: ActivatedRoute, private router: Router, private ser: UnpostedService) { + } + + ngOnInit() { + this.route.data + .subscribe((data: { info: Unposted[] }) => { + this.info = data.info; + }); + this.dataSource = new UnpostedDataSource(this.paginator, this.sort, this.info); + } + + refresh() { + this.ser.list().subscribe((info: Unposted[]) => this.info = info); + } +} diff --git a/overlord/src/app/unposted/unposted.module.spec.ts b/overlord/src/app/unposted/unposted.module.spec.ts new file mode 100644 index 00000000..6dd4e409 --- /dev/null +++ b/overlord/src/app/unposted/unposted.module.spec.ts @@ -0,0 +1,13 @@ +import {UnpostedModule} from './unposted.module'; + +describe('UnpostedModule', () => { + let unpostedModule: UnpostedModule; + + beforeEach(() => { + unpostedModule = new UnpostedModule(); + }); + + it('should create an instance', () => { + expect(unpostedModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/unposted/unposted.module.ts b/overlord/src/app/unposted/unposted.module.ts new file mode 100644 index 00000000..3be2992b --- /dev/null +++ b/overlord/src/app/unposted/unposted.module.ts @@ -0,0 +1,56 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import { + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {SharedModule} from '../shared/shared.module'; +import {CdkTableModule} from '@angular/cdk/table'; +import {UnpostedRoutingModule} from './unposted-routing.module'; +import {UnpostedComponent} from './unposted.component'; +import {A11yModule} from '@angular/cdk/a11y'; + +export const MY_FORMATS = { + parse: { + dateInput: 'DD-MMM-YYYY', + }, + display: { + dateInput: 'DD-MMM-YYYY', + monthYearLabel: 'MMM YYYY', + dateA11yLabel: 'DD-MMM-YYYY', + monthYearA11yLabel: 'MMM YYYY', + }, +}; + +@NgModule({ + imports: [ + A11yModule, + CommonModule, + CdkTableModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule, + SharedModule, + UnpostedRoutingModule + ], + declarations: [ + UnpostedComponent + ] +}) +export class UnpostedModule { +} diff --git a/overlord/src/app/unposted/unposted.service.spec.ts b/overlord/src/app/unposted/unposted.service.spec.ts new file mode 100644 index 00000000..a24a11ba --- /dev/null +++ b/overlord/src/app/unposted/unposted.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {UnpostedService} from './unposted.service'; + +describe('UnpostedService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [UnpostedService] + }); + }); + + it('should be created', inject([UnpostedService], (service: UnpostedService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/unposted/unposted.service.ts b/overlord/src/app/unposted/unposted.service.ts new file mode 100644 index 00000000..85c1f4e6 --- /dev/null +++ b/overlord/src/app/unposted/unposted.service.ts @@ -0,0 +1,26 @@ +import {Injectable} from '@angular/core'; +import {catchError} from 'rxjs/operators'; +import {Observable} from 'rxjs/internal/Observable'; +import {HttpClient} from '@angular/common/http'; +import {Unposted} from './unposted'; +import {ErrorLoggerService} from '../core/error-logger.service'; + +const url = '/api/Unposted'; +const serviceName = 'UnpostedService'; + +@Injectable({ + providedIn: 'root' +}) +export class UnpostedService { + + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + list(): Observable { + return >this.http.get(url) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + +} diff --git a/overlord/src/app/unposted/unposted.ts b/overlord/src/app/unposted/unposted.ts new file mode 100644 index 00000000..2f5292d0 --- /dev/null +++ b/overlord/src/app/unposted/unposted.ts @@ -0,0 +1,11 @@ +export class Unposted { + id: string; + date: string; + voucherType: string; + narration: string; + isPosted: boolean; + debitName: string; + debitAmount: number; + creditName: string; + creditAmount: number; +} diff --git a/overlord/src/app/user/user-detail/user-detail.component.css b/overlord/src/app/user/user-detail/user-detail.component.css new file mode 100644 index 00000000..82c7afd6 --- /dev/null +++ b/overlord/src/app/user/user-detail/user-detail.component.css @@ -0,0 +1,3 @@ +.example-card { + max-width: 400px; +} diff --git a/overlord/src/app/user/user-detail/user-detail.component.html b/overlord/src/app/user/user-detail/user-detail.component.html new file mode 100644 index 00000000..61c05eb0 --- /dev/null +++ b/overlord/src/app/user/user-detail/user-detail.component.html @@ -0,0 +1,42 @@ +
    + + + User + + +
    +
    + + Name + + +
    +
    + + Password + + {{hide ? 'visibility' : 'visibility_off'}} + +
    +
    + Is Locked Out? +
    + +
    +
    + {{g.name}} +
    +
    +
    +
    + + + + +
    +
    diff --git a/overlord/src/app/user/user-detail/user-detail.component.spec.ts b/overlord/src/app/user/user-detail/user-detail.component.spec.ts new file mode 100644 index 00000000..4fb876e9 --- /dev/null +++ b/overlord/src/app/user/user-detail/user-detail.component.spec.ts @@ -0,0 +1,25 @@ +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; + +import {UserDetailComponent} from './user-detail.component'; + +describe('UserDetailComponent', () => { + let component: UserDetailComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [UserDetailComponent] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(UserDetailComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/user/user-detail/user-detail.component.ts b/overlord/src/app/user/user-detail/user-detail.component.ts new file mode 100644 index 00000000..ce262b70 --- /dev/null +++ b/overlord/src/app/user/user-detail/user-detail.component.ts @@ -0,0 +1,114 @@ +import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; +import {ActivatedRoute, Router} from '@angular/router'; + +import {UserService} from '../user.service'; +import {User} from '../user'; +import {ToasterService} from '../../core/toaster.service'; +import {ConfirmDialogComponent} from '../../shared/confirm-dialog/confirm-dialog.component'; +import {MatDialog} from '@angular/material'; +import {FormArray, FormBuilder, FormGroup} from '@angular/forms'; + +@Component({ + selector: 'app-user-detail', + templateUrl: './user-detail.component.html', + styleUrls: ['./user-detail.component.css'] +}) +export class UserDetailComponent implements OnInit, AfterViewInit { + @ViewChild('nameElement') nameElement: ElementRef; + form: FormGroup; + item: User; + hide: boolean; + + constructor( + private route: ActivatedRoute, + private router: Router, + private fb: FormBuilder, + private toaster: ToasterService, + private dialog: MatDialog, + private ser: UserService + ) { + this.hide = true; + this.createForm(); + } + + createForm() { + this.form = this.fb.group({ + name: '', + password: '', + lockedOut: '', + groups: this.fb.array([]) + }); + } + + ngOnInit() { + this.route.data + .subscribe((data: { item: User }) => { + this.item = data.item; + this.form.get('name').setValue(this.item.name); + this.form.setControl('groups', this.fb.array( + this.item.groups.map( + x => this.fb.group({ + group: x.enabled + }) + ) + )); + }); + } + + ngAfterViewInit() { + setTimeout(() => { + this.nameElement.nativeElement.focus(); + }, 0); + } + + save() { + this.ser.saveOrUpdate(this.getItem()) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigateByUrl('/Users'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + delete() { + this.ser.delete(this.item.id) + .subscribe( + (result) => { + this.toaster.show('Success', ''); + this.router.navigateByUrl('/Users'); + }, + (error) => { + this.toaster.show('Danger', error.error); + } + ); + } + + confirmDelete(): void { + const dialogRef = this.dialog.open(ConfirmDialogComponent, { + width: '250px', + data: {title: 'Delete User?', content: 'Are you sure? This cannot be undone.'} + }); + + dialogRef.afterClosed().subscribe((result: boolean) => { + if (result) { + this.delete(); + } + }); + } + + getItem(): User { + const formModel = this.form.value; + this.item.name = formModel.name; + this.item.password = formModel.password``; + this.item.lockedOut = formModel.lockedOut; + const array = this.form.get('groups') as FormArray; + this.item.groups.forEach((item, index) => { + item.enabled = array.controls[index].value.group; + }); + return this.item; + } +} diff --git a/overlord/src/app/user/user-list-resolver.service.spec.ts b/overlord/src/app/user/user-list-resolver.service.spec.ts new file mode 100644 index 00000000..be1a824d --- /dev/null +++ b/overlord/src/app/user/user-list-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {ClientListResolverService} from './user-list-resolver.service'; + +describe('ClientListResolverService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ClientListResolverService] + }); + }); + + it('should be created', inject([ClientListResolverService], (service: ClientListResolverService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/user/user-list-resolver.service.ts b/overlord/src/app/user/user-list-resolver.service.ts new file mode 100644 index 00000000..44ddc1ad --- /dev/null +++ b/overlord/src/app/user/user-list-resolver.service.ts @@ -0,0 +1,18 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot} from '@angular/router'; +import {User} from './user'; +import {Observable} from 'rxjs/internal/Observable'; +import {UserService} from './user.service'; + +@Injectable({ + providedIn: 'root' +}) +export class UserListResolver implements Resolve { + + constructor(private ser: UserService, private router: Router) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + return this.ser.list(); + } +} diff --git a/overlord/src/app/user/user-list/user-list-datasource.ts b/overlord/src/app/user/user-list/user-list-datasource.ts new file mode 100644 index 00000000..f225fc4c --- /dev/null +++ b/overlord/src/app/user/user-list/user-list-datasource.ts @@ -0,0 +1,58 @@ +import {DataSource} from '@angular/cdk/collections'; +import {MatPaginator, MatSort} from '@angular/material'; +import {map} from 'rxjs/operators'; +import {merge, Observable, of as observableOf} from 'rxjs'; +import {User} from '../user'; + +export class UserListDataSource extends DataSource { + + constructor(private paginator: MatPaginator, private sort: MatSort, public data: User[]) { + super(); + } + + connect(): Observable { + const dataMutations = [ + observableOf(this.data), + this.paginator.page, + this.sort.sortChange + ]; + + // Set the paginators length + this.paginator.length = this.data.length; + + return merge(...dataMutations).pipe(map(() => { + return this.getPagedData(this.getSortedData([...this.data])); + })); + } + + disconnect() { + } + + private getPagedData(data: User[]) { + const startIndex = this.paginator.pageIndex * this.paginator.pageSize; + return data.splice(startIndex, this.paginator.pageSize); + } + + private getSortedData(data: User[]) { + if (!this.sort.active || this.sort.direction === '') { + return data; + } + + return data.sort((a, b) => { + const isAsc = this.sort.direction === 'asc'; + switch (this.sort.active) { + case 'name': + return compare(a.name, b.name, isAsc); + case 'id': + return compare(+a.id, +b.id, isAsc); + default: + return 0; + } + }); + } +} + +/** Simple sort comparator for example ID/Name columns (for user-side sorting). */ +function compare(a, b, isAsc) { + return (a < b ? -1 : 1) * (isAsc ? 1 : -1); +} diff --git a/overlord/src/app/user/user-list/user-list.component.css b/overlord/src/app/user/user-list/user-list.component.css new file mode 100644 index 00000000..e69de29b diff --git a/overlord/src/app/user/user-list/user-list.component.html b/overlord/src/app/user/user-list/user-list.component.html new file mode 100644 index 00000000..af3bab9b --- /dev/null +++ b/overlord/src/app/user/user-list/user-list.component.html @@ -0,0 +1,41 @@ + + + Users + + + + + + + Name + {{row.name}} + + + + + Is Locked Out? + {{row.lockedOut}} + + + + + Groups + +
      +
    • {{group}}
    • +
    +
    +
    + + + +
    + + + +
    +
    diff --git a/overlord/src/app/user/user-list/user-list.component.spec.ts b/overlord/src/app/user/user-list/user-list.component.spec.ts new file mode 100644 index 00000000..e33ae834 --- /dev/null +++ b/overlord/src/app/user/user-list/user-list.component.spec.ts @@ -0,0 +1,23 @@ +import {ComponentFixture, fakeAsync, TestBed} from '@angular/core/testing'; + +import {UserListComponent} from './user-list.component'; + +describe('UserListComponent', () => { + let component: UserListComponent; + let fixture: ComponentFixture; + + beforeEach(fakeAsync(() => { + TestBed.configureTestingModule({ + declarations: [UserListComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(UserListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should compile', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/user/user-list/user-list.component.ts b/overlord/src/app/user/user-list/user-list.component.ts new file mode 100644 index 00000000..c076cbe6 --- /dev/null +++ b/overlord/src/app/user/user-list/user-list.component.ts @@ -0,0 +1,30 @@ +import {Component, OnInit, ViewChild} from '@angular/core'; +import {MatPaginator, MatSort} from '@angular/material'; +import {UserListDataSource} from './user-list-datasource'; +import {User} from '../user'; +import {ActivatedRoute} from '@angular/router'; + +@Component({ + selector: 'app-user-list', + templateUrl: './user-list.component.html', + styleUrls: ['./user-list.component.css'] +}) +export class UserListComponent implements OnInit { + @ViewChild(MatPaginator) paginator: MatPaginator; + @ViewChild(MatSort) sort: MatSort; + dataSource: UserListDataSource; + list: User[]; + /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */ + displayedColumns = ['name', 'lockedOut', 'groups']; + + constructor(private route: ActivatedRoute) { + } + + ngOnInit() { + this.route.data + .subscribe((data: { list: User[] }) => { + this.list = data.list; + }); + this.dataSource = new UserListDataSource(this.paginator, this.sort, this.list); + } +} diff --git a/overlord/src/app/user/user-resolver.service.spec.ts b/overlord/src/app/user/user-resolver.service.spec.ts new file mode 100644 index 00000000..07524dbe --- /dev/null +++ b/overlord/src/app/user/user-resolver.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {UserResolverService} from './user-resolver.service'; + +describe('UserResolverService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [UserDetailResolverService] + }); + }); + + it('should be created', inject([UserDetailResolverService], (service: UserDetailResolverService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/user/user-resolver.service.ts b/overlord/src/app/user/user-resolver.service.ts new file mode 100644 index 00000000..e9dbbacc --- /dev/null +++ b/overlord/src/app/user/user-resolver.service.ts @@ -0,0 +1,19 @@ +import {Injectable} from '@angular/core'; +import {ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot} from '@angular/router'; +import {User} from './user'; +import {Observable} from 'rxjs/internal/Observable'; +import {UserService} from './user.service'; + +@Injectable({ + providedIn: 'root' +}) +export class UserResolver implements Resolve { + + constructor(private ser: UserService, private router: Router) { + } + + resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { + const id = route.paramMap.get('id'); + return this.ser.get(id); + } +} diff --git a/overlord/src/app/user/user-routing.module.spec.ts b/overlord/src/app/user/user-routing.module.spec.ts new file mode 100644 index 00000000..ed6b29b7 --- /dev/null +++ b/overlord/src/app/user/user-routing.module.spec.ts @@ -0,0 +1,13 @@ +import {UserRoutingModule} from './user-routing.module'; + +describe('UserRoutingModule', () => { + let userRoutingModule: UserRoutingModule; + + beforeEach(() => { + userRoutingModule = new UserRoutingModule(); + }); + + it('should create an instance', () => { + expect(userRoutingModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/user/user-routing.module.ts b/overlord/src/app/user/user-routing.module.ts new file mode 100644 index 00000000..8e9e8300 --- /dev/null +++ b/overlord/src/app/user/user-routing.module.ts @@ -0,0 +1,58 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {RouterModule, Routes} from '@angular/router'; +import {UserListResolver} from './user-list-resolver.service'; +import {UserResolver} from './user-resolver.service'; +import {UserListComponent} from './user-list/user-list.component'; +import {UserDetailComponent} from './user-detail/user-detail.component'; +import {AuthGuard} from '../auth/auth-guard.service'; + +const userRoutes: Routes = [ + { + path: 'Users', + component: UserListComponent, + canActivate: [AuthGuard], + data: { + permission: 'Users' + }, + resolve: { + list: UserListResolver + } + }, + { + path: 'User', + component: UserDetailComponent, + canActivate: [AuthGuard], + data: { + permission: 'Users' + }, + resolve: { + item: UserResolver, + } + }, + { + path: 'User/:id', + component: UserDetailComponent, + canActivate: [AuthGuard], + resolve: { + item: UserResolver + } + } +]; + +@NgModule({ + imports: [ + CommonModule, + RouterModule.forChild(userRoutes) + + ], + exports: [ + RouterModule + ], + providers: [ + UserListResolver, + UserResolver + ] +}) +export class UserRoutingModule { +} diff --git a/overlord/src/app/user/user.module.spec.ts b/overlord/src/app/user/user.module.spec.ts new file mode 100644 index 00000000..6eeb8177 --- /dev/null +++ b/overlord/src/app/user/user.module.spec.ts @@ -0,0 +1,13 @@ +import {UserModule} from './user.module'; + +describe('UserModule', () => { + let userModule: UserModule; + + beforeEach(() => { + userModule = new UserModule(); + }); + + it('should create an instance', () => { + expect(userModule).toBeTruthy(); + }); +}); diff --git a/overlord/src/app/user/user.module.ts b/overlord/src/app/user/user.module.ts new file mode 100644 index 00000000..7fe11a60 --- /dev/null +++ b/overlord/src/app/user/user.module.ts @@ -0,0 +1,50 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; + +import {UserListComponent} from './user-list/user-list.component'; +import {UserDetailComponent} from './user-detail/user-detail.component'; +import {UserRoutingModule} from './user-routing.module'; +import { + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDividerModule, + MatIconModule, + MatInputModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule +} from '@angular/material'; +import {CdkTableModule} from '@angular/cdk/table'; +import {ReactiveFormsModule} from '@angular/forms'; +import {SharedModule} from '../shared/shared.module'; +import {FlexLayoutModule, FlexModule} from '@angular/flex-layout'; + +@NgModule({ + imports: [ + CommonModule, + CdkTableModule, + FlexModule, + FlexLayoutModule, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatDividerModule, + MatIconModule, + MatInputModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatSortModule, + MatTableModule, + ReactiveFormsModule, + SharedModule, + UserRoutingModule + ], + declarations: [ + UserListComponent, + UserDetailComponent + ] +}) +export class UserModule { +} diff --git a/overlord/src/app/user/user.service.spec.ts b/overlord/src/app/user/user.service.spec.ts new file mode 100644 index 00000000..1727f7f4 --- /dev/null +++ b/overlord/src/app/user/user.service.spec.ts @@ -0,0 +1,15 @@ +import {inject, TestBed} from '@angular/core/testing'; + +import {UserService} from './user.service'; + +describe('UserService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [UserService] + }); + }); + + it('should be created', inject([UserService], (service: UserService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/overlord/src/app/user/user.service.ts b/overlord/src/app/user/user.service.ts new file mode 100644 index 00000000..7a5d9267 --- /dev/null +++ b/overlord/src/app/user/user.service.ts @@ -0,0 +1,74 @@ +import {Injectable} from '@angular/core'; +import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http'; +import {ErrorLoggerService} from '../core/error-logger.service'; +import {catchError} from 'rxjs/operators'; +import {Observable} from 'rxjs/internal/Observable'; +import {User} from './user'; +import {Group} from '../group/group'; + +const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}) +}; +const url = '/api/User'; +const serviceName = 'UserService'; + +@Injectable({ + providedIn: 'root' +}) +export class UserService { + constructor(private http: HttpClient, private log: ErrorLoggerService) { + } + + get(id: string): Observable { + const getUrl: string = (id === null) ? url : `${url}/${id}`; + return >this.http.get(getUrl) + .pipe( + catchError(this.log.handleError(serviceName, `get id=${id}`)) + ); + } + + list(): Observable { + const options = {params: new HttpParams().set('l', '')}; + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + + listOfNames(): Observable { + const options = {params: new HttpParams().set('n', '')}; + return >this.http.get(url, options) + .pipe( + catchError(this.log.handleError(serviceName, 'list')) + ); + } + + save(user: User): Observable { + return >this.http.post(url, user, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'save')) + ); + } + + update(user: User): Observable { + return >this.http.put(`${url}/${user.id}`, user, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'update')) + ); + } + + saveOrUpdate(user: User): Observable { + if (!user.id) { + return this.save(user); + } else { + return this.update(user); + } + } + + delete(id: string): Observable { + return >this.http.delete(`${url}/${id}`, httpOptions) + .pipe( + catchError(this.log.handleError(serviceName, 'delete')) + ); + } +} diff --git a/overlord/src/app/user/user.ts b/overlord/src/app/user/user.ts new file mode 100644 index 00000000..2dd641fd --- /dev/null +++ b/overlord/src/app/user/user.ts @@ -0,0 +1,19 @@ +export class User { + id: string; + name: string; + password: string; + lockedOut: boolean; + groups: UserGroup[]; + perms: string[]; + isAuthenticated: boolean; + + public constructor(init?: Partial) { + Object.assign(this, init); + } +} + +export class UserGroup { + id: string; + name: string; + enabled: boolean; +} diff --git a/overlord/src/assets/.gitkeep b/overlord/src/assets/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/overlord/src/browserslist b/overlord/src/browserslist new file mode 100644 index 00000000..8e09ab49 --- /dev/null +++ b/overlord/src/browserslist @@ -0,0 +1,9 @@ +# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers +# For additional information regarding the format and rule options, please see: +# https://github.com/browserslist/browserslist#queries +# For IE 9-11 support, please uncomment the last line of the file and adjust as needed +> 0.5% +last 2 versions +Firefox ESR +not dead +# IE 9-11 \ No newline at end of file diff --git a/overlord/src/environments/environment.prod.ts b/overlord/src/environments/environment.prod.ts new file mode 100644 index 00000000..3612073b --- /dev/null +++ b/overlord/src/environments/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true +}; diff --git a/overlord/src/environments/environment.ts b/overlord/src/environments/environment.ts new file mode 100644 index 00000000..012182ef --- /dev/null +++ b/overlord/src/environments/environment.ts @@ -0,0 +1,15 @@ +// This file can be replaced during build by using the `fileReplacements` array. +// `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`. +// The list of file replacements can be found in `angular.json`. + +export const environment = { + production: false +}; + +/* + * In development mode, to ignore zone related error stack frames such as + * `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can + * import the following file, but please comment it out in production mode + * because it will have performance impact when throw error + */ +// import 'zone.js/dist/zone-error'; // Included with Angular CLI. diff --git a/overlord/src/favicon.ico b/overlord/src/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..8081c7ceaf2be08bf59010158c586170d9d2d517 GIT binary patch literal 5430 zcmc(je{54#6vvCoAI3i*G5%$U7!sA3wtMZ$fH6V9C`=eXGJb@R1%(I_{vnZtpD{6n z5Pl{DmxzBDbrB>}`90e12m8T*36WoeDLA&SD_hw{H^wM!cl_RWcVA!I+x87ee975; z@4kD^=bYPn&pmG@(+JZ`rqQEKxW<}RzhW}I!|ulN=fmjVi@x{p$cC`)5$a!)X&U+blKNvN5tg=uLvuLnuqRM;Yc*swiexsoh#XPNu{9F#c`G zQLe{yWA(Y6(;>y|-efAy11k<09(@Oo1B2@0`PtZSkqK&${ zgEY}`W@t{%?9u5rF?}Y7OL{338l*JY#P!%MVQY@oqnItpZ}?s z!r?*kwuR{A@jg2Chlf0^{q*>8n5Ir~YWf*wmsh7B5&EpHfd5@xVaj&gqsdui^spyL zB|kUoblGoO7G(MuKTfa9?pGH0@QP^b#!lM1yHWLh*2iq#`C1TdrnO-d#?Oh@XV2HK zKA{`eo{--^K&MW66Lgsktfvn#cCAc*(}qsfhrvOjMGLE?`dHVipu1J3Kgr%g?cNa8 z)pkmC8DGH~fG+dlrp(5^-QBeEvkOvv#q7MBVLtm2oD^$lJZx--_=K&Ttd=-krx(Bb zcEoKJda@S!%%@`P-##$>*u%T*mh+QjV@)Qa=Mk1?#zLk+M4tIt%}wagT{5J%!tXAE;r{@=bb%nNVxvI+C+$t?!VJ@0d@HIyMJTI{vEw0Ul ze(ha!e&qANbTL1ZneNl45t=#Ot??C0MHjjgY8%*mGisN|S6%g3;Hlx#fMNcL<87MW zZ>6moo1YD?P!fJ#Jb(4)_cc50X5n0KoDYfdPoL^iV`k&o{LPyaoqMqk92wVM#_O0l z09$(A-D+gVIlq4TA&{1T@BsUH`Bm=r#l$Z51J-U&F32+hfUP-iLo=jg7Xmy+WLq6_tWv&`wDlz#`&)Jp~iQf zZP)tu>}pIIJKuw+$&t}GQuqMd%Z>0?t%&BM&Wo^4P^Y z)c6h^f2R>X8*}q|bblAF?@;%?2>$y+cMQbN{X$)^R>vtNq_5AB|0N5U*d^T?X9{xQnJYeU{ zoZL#obI;~Pp95f1`%X3D$Mh*4^?O?IT~7HqlWguezmg?Ybq|7>qQ(@pPHbE9V?f|( z+0xo!#m@Np9PljsyxBY-UA*{U*la#8Wz2sO|48_-5t8%_!n?S$zlGe+NA%?vmxjS- zHE5O3ZarU=X}$7>;Okp(UWXJxI%G_J-@IH;%5#Rt$(WUX?6*Ux!IRd$dLP6+SmPn= z8zjm4jGjN772R{FGkXwcNv8GBcZI#@Y2m{RNF_w8(Z%^A*!bS*!}s6sh*NnURytky humW;*g7R+&|Ledvc- + + + + + + Overlord + + + + + + + + + diff --git a/overlord/src/karma.conf.js b/overlord/src/karma.conf.js new file mode 100644 index 00000000..b6e00421 --- /dev/null +++ b/overlord/src/karma.conf.js @@ -0,0 +1,31 @@ +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine', '@angular-devkit/build-angular'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage-istanbul-reporter'), + require('@angular-devkit/build-angular/plugins/karma') + ], + client: { + clearContext: false // leave Jasmine Spec Runner output visible in browser + }, + coverageIstanbulReporter: { + dir: require('path').join(__dirname, '../coverage'), + reports: ['html', 'lcovonly'], + fixWebpackSourcePaths: true + }, + reporters: ['progress', 'kjhtml'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + singleRun: false + }); +}; \ No newline at end of file diff --git a/overlord/src/main.ts b/overlord/src/main.ts new file mode 100644 index 00000000..91ec6da5 --- /dev/null +++ b/overlord/src/main.ts @@ -0,0 +1,12 @@ +import { enableProdMode } from '@angular/core'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + +import { AppModule } from './app/app.module'; +import { environment } from './environments/environment'; + +if (environment.production) { + enableProdMode(); +} + +platformBrowserDynamic().bootstrapModule(AppModule) + .catch(err => console.log(err)); diff --git a/overlord/src/polyfills.ts b/overlord/src/polyfills.ts new file mode 100644 index 00000000..d310405a --- /dev/null +++ b/overlord/src/polyfills.ts @@ -0,0 +1,80 @@ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +/** IE9, IE10 and IE11 requires all of the following polyfills. **/ +// import 'core-js/es6/symbol'; +// import 'core-js/es6/object'; +// import 'core-js/es6/function'; +// import 'core-js/es6/parse-int'; +// import 'core-js/es6/parse-float'; +// import 'core-js/es6/number'; +// import 'core-js/es6/math'; +// import 'core-js/es6/string'; +// import 'core-js/es6/date'; +// import 'core-js/es6/array'; +// import 'core-js/es6/regexp'; +// import 'core-js/es6/map'; +// import 'core-js/es6/weak-map'; +// import 'core-js/es6/set'; + +/** IE10 and IE11 requires the following for NgClass support on SVG elements */ +// import 'classlist.js'; // Run `npm install --save classlist.js`. + +/** IE10 and IE11 requires the following for the Reflect API. */ +// import 'core-js/es6/reflect'; + + +/** Evergreen browsers require these. **/ +// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. +import 'core-js/es7/reflect'; + + +/** + * Web Animations `@angular/platform-browser/animations` + * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. + * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). + **/ +// import 'web-animations-js'; // Run `npm install --save web-animations-js`. + +/** + * By default, zone.js will patch all possible macroTask and DomEvents + * user can disable parts of macroTask/DomEvents patch by setting following flags + */ + + // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame + // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick + // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames + + /* + * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js + * with the following flag, it will bypass `zone.js` patch for IE/Edge + */ +// (window as any).__Zone_enable_cross_context_check = true; + +/*************************************************************************************************** + * Zone JS is required by default for Angular itself. + */ +import 'zone.js/dist/zone'; // Included with Angular CLI. + + + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ diff --git a/overlord/src/styles.css b/overlord/src/styles.css new file mode 100644 index 00000000..d53753af --- /dev/null +++ b/overlord/src/styles.css @@ -0,0 +1,3 @@ +/* You can add global styles to this file, and also import other style files */ + +body { margin: 0; } diff --git a/overlord/src/test.ts b/overlord/src/test.ts new file mode 100644 index 00000000..16317897 --- /dev/null +++ b/overlord/src/test.ts @@ -0,0 +1,20 @@ +// This file is required by karma.conf.js and loads recursively all the .spec and framework files + +import 'zone.js/dist/zone-testing'; +import { getTestBed } from '@angular/core/testing'; +import { + BrowserDynamicTestingModule, + platformBrowserDynamicTesting +} from '@angular/platform-browser-dynamic/testing'; + +declare const require: any; + +// First, initialize the Angular testing environment. +getTestBed().initTestEnvironment( + BrowserDynamicTestingModule, + platformBrowserDynamicTesting() +); +// Then we find all the tests. +const context = require.context('./', true, /\.spec\.ts$/); +// And load the modules. +context.keys().map(context); diff --git a/brewman/static/src/tsconfig.app.json b/overlord/src/tsconfig.app.json similarity index 81% rename from brewman/static/src/tsconfig.app.json rename to overlord/src/tsconfig.app.json index 08e8fce2..cfc3f9d8 100644 --- a/brewman/static/src/tsconfig.app.json +++ b/overlord/src/tsconfig.app.json @@ -1,7 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { -// "outDir": "../out-tsc/app", + "outDir": "../../brewman/static", "module": "es2015", "types": [] }, diff --git a/overlord/src/tsconfig.spec.json b/overlord/src/tsconfig.spec.json new file mode 100644 index 00000000..8f7cedec --- /dev/null +++ b/overlord/src/tsconfig.spec.json @@ -0,0 +1,19 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/spec", + "module": "commonjs", + "types": [ + "jasmine", + "node" + ] + }, + "files": [ + "test.ts", + "polyfills.ts" + ], + "include": [ + "**/*.spec.ts", + "**/*.d.ts" + ] +} diff --git a/overlord/src/tslint.json b/overlord/src/tslint.json new file mode 100644 index 00000000..52e2c1a5 --- /dev/null +++ b/overlord/src/tslint.json @@ -0,0 +1,17 @@ +{ + "extends": "../tslint.json", + "rules": { + "directive-selector": [ + true, + "attribute", + "app", + "camelCase" + ], + "component-selector": [ + true, + "element", + "app", + "kebab-case" + ] + } +} diff --git a/brewman/static/tsconfig.json b/overlord/tsconfig.json similarity index 90% rename from brewman/static/tsconfig.json rename to overlord/tsconfig.json index 60a42dae..4b2a5bec 100644 --- a/brewman/static/tsconfig.json +++ b/overlord/tsconfig.json @@ -2,7 +2,7 @@ "compileOnSave": false, "compilerOptions": { "baseUrl": "./", -// "outDir": "./dist/out-tsc", + "outDir": "../brewman/static", "sourceMap": true, "declaration": false, "moduleResolution": "node", diff --git a/overlord/tslint.json b/overlord/tslint.json new file mode 100644 index 00000000..3ea984c7 --- /dev/null +++ b/overlord/tslint.json @@ -0,0 +1,130 @@ +{ + "rulesDirectory": [ + "node_modules/codelyzer" + ], + "rules": { + "arrow-return-shorthand": true, + "callable-types": true, + "class-name": true, + "comment-format": [ + true, + "check-space" + ], + "curly": true, + "deprecation": { + "severity": "warn" + }, + "eofline": true, + "forin": true, + "import-blacklist": [ + true, + "rxjs/Rx" + ], + "import-spacing": true, + "indent": [ + true, + "spaces" + ], + "interface-over-type-literal": true, + "label-position": true, + "max-line-length": [ + true, + 140 + ], + "member-access": false, + "member-ordering": [ + true, + { + "order": [ + "static-field", + "instance-field", + "static-method", + "instance-method" + ] + } + ], + "no-arg": true, + "no-bitwise": true, + "no-console": [ + true, + "debug", + "info", + "time", + "timeEnd", + "trace" + ], + "no-construct": true, + "no-debugger": true, + "no-duplicate-super": true, + "no-empty": false, + "no-empty-interface": true, + "no-eval": true, + "no-inferrable-types": [ + true, + "ignore-params" + ], + "no-misused-new": true, + "no-non-null-assertion": true, + "no-shadowed-variable": true, + "no-string-literal": false, + "no-string-throw": true, + "no-switch-case-fall-through": true, + "no-trailing-whitespace": true, + "no-unnecessary-initializer": true, + "no-unused-expression": true, + "no-use-before-declare": true, + "no-var-keyword": true, + "object-literal-sort-keys": false, + "one-line": [ + true, + "check-open-brace", + "check-catch", + "check-else", + "check-whitespace" + ], + "prefer-const": true, + "quotemark": [ + true, + "single" + ], + "radix": true, + "semicolon": [ + true, + "always" + ], + "triple-equals": [ + true, + "allow-null-check" + ], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + } + ], + "unified-signatures": true, + "variable-name": false, + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type" + ], + "no-output-on-prefix": true, + "use-input-property-decorator": true, + "use-output-property-decorator": true, + "use-host-property-decorator": true, + "no-input-rename": true, + "no-output-rename": true, + "use-life-cycle-interface": true, + "use-pipe-transform-interface": true, + "component-class-suffix": true, + "directive-class-suffix": true + } +} diff --git a/setup.py b/setup.py index 7103b476..c336ca72 100644 --- a/setup.py +++ b/setup.py @@ -19,12 +19,12 @@ requires = [ ] setup(name='brewman', - version='5.0', + version='6.0', description='brewman', long_description=README + '\n\n' + CHANGES, classifiers=[ "Programming Language :: Python", - "Framework :: Pylons", + "Framework :: Pyramid", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", ],