├── .devcontainer
└── devcontainer.json
├── .gitattributes
├── .github
└── workflows
│ ├── good-books_api.yml
│ ├── good-books_mvc.yml.disable
│ ├── good-books_mvc_tar.yml
│ └── good-books_react.yml.disable
├── .gitignore
├── Directory.Build.props
├── Directory.Build.targets
├── LICENSE
├── accountgo.sln
├── azure-pipelines.yml
├── db
└── scripts
│ ├── foreign_keys
│ ├── 2_FK_Account.sql
│ ├── 2_FK_AspNetRoleClaims.sql
│ ├── 2_FK_AspNetUserClaims.sql
│ ├── 2_FK_AspNetUserLogins.sql
│ ├── 2_FK_AspNetUserRoles.sql
│ ├── 2_FK_AuditableAttribute.sql
│ ├── 2_FK_Bank.sql
│ ├── 2_FK_CompanySetting.sql
│ ├── 2_FK_Contact.sql
│ ├── 2_FK_Customer.sql
│ ├── 2_FK_CustomerAllocation.sql
│ ├── 2_FK_CustomerContact.sql
│ ├── 2_FK_GeneralLedgerLine.sql
│ ├── 2_FK_GeneralLedgerSetting.sql
│ ├── 2_FK_InventoryControlJournal.sql
│ ├── 2_FK_Item.sql
│ ├── 2_FK_ItemCategory.sql
│ ├── 2_FK_ItemTaxGroupTax.sql
│ ├── 2_FK_JournalEntryHeader.sql
│ ├── 2_FK_JournalEntryLine.sql
│ ├── 2_FK_MainContraAccount.sql
│ ├── 2_FK_PurchaseInvoiceHeader.sql
│ ├── 2_FK_PurchaseInvoiceLine.sql
│ ├── 2_FK_PurchaseOrderHeader.sql
│ ├── 2_FK_PurchaseOrderLine.sql
│ ├── 2_FK_PurchaseReceiptHeader.sql
│ ├── 2_FK_PurchaseReceiptLine.sql
│ ├── 2_FK_SalesDeliveryHeader.sql
│ ├── 2_FK_SalesDeliveryLine.sql
│ ├── 2_FK_SalesInvoiceHeader.sql
│ ├── 2_FK_SalesInvoiceLine.sql
│ ├── 2_FK_SalesOrderHeader.sql
│ ├── 2_FK_SalesOrderLine.sql
│ ├── 2_FK_SalesQuoteHeader.sql
│ ├── 2_FK_SalesQuoteLine.sql
│ ├── 2_FK_SalesReceiptHeader.sql
│ ├── 2_FK_SalesReceiptLine.sql
│ ├── 2_FK_SecurityPermission.sql
│ ├── 2_FK_SecurityRolePermission.sql
│ ├── 2_FK_SecurityUserRole.sql
│ ├── 2_FK_Tax.sql
│ ├── 2_FK_TaxGroupTax.sql
│ ├── 2_FK_Vendor.sql
│ ├── 2_FK_VendorContact.sql
│ └── 2_FK_VendorPayment.sql
│ ├── initial_data
│ └── 3_InitialData-0001-Security.sql
│ └── tables
│ ├── 1_Account.sql
│ ├── 1_AccountClass.sql
│ ├── 1_Address.sql
│ ├── 1_AspNetRoleClaims.sql
│ ├── 1_AspNetRoles.sql
│ ├── 1_AspNetUserClaims.sql
│ ├── 1_AspNetUserLogins.sql
│ ├── 1_AspNetUserRoles.sql
│ ├── 1_AspNetUserTokens.sql
│ ├── 1_AspNetUsers.sql
│ ├── 1_AuditLog.sql
│ ├── 1_AuditableAttribute.sql
│ ├── 1_AuditableEntity.sql
│ ├── 1_Bank.sql
│ ├── 1_Company.sql
│ ├── 1_CompanySetting.sql
│ ├── 1_Contact.sql
│ ├── 1_Customer.sql
│ ├── 1_CustomerAllocation.sql
│ ├── 1_CustomerContact.sql
│ ├── 1_FinancialYear.sql
│ ├── 1_GeneralLedgerHeader.sql
│ ├── 1_GeneralLedgerLine.sql
│ ├── 1_GeneralLedgerSetting.sql
│ ├── 1_InventoryControlJournal.sql
│ ├── 1_Item.sql
│ ├── 1_ItemCategory.sql
│ ├── 1_ItemTaxGroup.sql
│ ├── 1_ItemTaxGroupTax.sql
│ ├── 1_JournalEntryHeader.sql
│ ├── 1_JournalEntryLine.sql
│ ├── 1_Log.sql
│ ├── 1_MainContraAccount.sql
│ ├── 1_Measurement.sql
│ ├── 1_Party.sql
│ ├── 1_PaymentTerm.sql
│ ├── 1_PurchaseInvoiceHeader.sql
│ ├── 1_PurchaseInvoiceLine.sql
│ ├── 1_PurchaseOrderHeader.sql
│ ├── 1_PurchaseOrderLine.sql
│ ├── 1_PurchaseReceiptHeader.sql
│ ├── 1_PurchaseReceiptLine.sql
│ ├── 1_SalesDeliveryHeader.sql
│ ├── 1_SalesDeliveryLine.sql
│ ├── 1_SalesInvoiceHeader.sql
│ ├── 1_SalesInvoiceLine.sql
│ ├── 1_SalesOrderHeader.sql
│ ├── 1_SalesOrderLine.sql
│ ├── 1_SalesQuoteHeader.sql
│ ├── 1_SalesQuoteLine.sql
│ ├── 1_SalesReceiptHeader.sql
│ ├── 1_SalesReceiptLine.sql
│ ├── 1_SecurityGroup.sql
│ ├── 1_SecurityPermission.sql
│ ├── 1_SecurityRole.sql
│ ├── 1_SecurityRolePermission.sql
│ ├── 1_SecurityUserRole.sql
│ ├── 1_SequenceNumber.sql
│ ├── 1_Tax.sql
│ ├── 1_TaxGroup.sql
│ ├── 1_TaxGroupTax.sql
│ ├── 1_User.sql
│ ├── 1_Vendor.sql
│ ├── 1_VendorContact.sql
│ └── 1_VendorPayment.sql
├── docker-compose.yml
├── docs
├── AdminLTE_Setup.md
├── GoodDeedBooks.docx
├── README.md
├── azure.txt
├── background.txt
├── expand-chart-of-accounts.docx
├── medhat.txt
├── open-source.txt
└── react.txt
├── src
├── AccountGoWeb
│ ├── .vscode
│ │ ├── launch.json
│ │ └── tasks.json
│ ├── AccountGoWeb.csproj
│ ├── AccountGoWeb.sln
│ ├── Components
│ │ ├── App.razor
│ │ ├── Pages
│ │ │ ├── Counter.razor
│ │ │ └── Students.razor
│ │ ├── Routes.razor
│ │ └── _Imports.razor
│ ├── Controllers
│ │ ├── AccountController.cs
│ │ ├── AdministrationController.cs
│ │ ├── BaseController.cs
│ │ ├── ContactController.cs
│ │ ├── DashboardController.cs
│ │ ├── FinancialsController.cs
│ │ ├── GoodController.cs
│ │ ├── HomeController.cs
│ │ ├── InventoryController.cs
│ │ ├── PurchasingController.cs
│ │ ├── QuotationsController.cs
│ │ ├── SPAProxyController.cs
│ │ ├── SalesController.cs
│ │ └── TaxController.cs
│ ├── Dockerfile
│ ├── Models
│ │ ├── Account
│ │ │ ├── LoginViewModel.cs
│ │ │ └── RegisterViewModel.cs
│ │ ├── Bogus
│ │ │ └── Student.cs
│ │ ├── Financial
│ │ │ └── GeneralLedgerSetting.cs
│ │ ├── FinancialReports.cs
│ │ ├── ObjectExtensions.cs
│ │ ├── Purchasing
│ │ │ └── Payment.cs
│ │ ├── Sales
│ │ │ ├── AddSalesReceipt.cs
│ │ │ ├── Allocate.cs
│ │ │ └── SalesQuotation.cs
│ │ ├── SelectListItemHelper.cs
│ │ └── TaxSystem
│ │ │ └── TaxSystemViewModel.cs
│ ├── ModulesReferences.targets
│ ├── Program.cs
│ ├── Properties
│ │ └── launchSettings.json
│ ├── Resource.Designer.cs
│ ├── Scss
│ │ ├── _dark-custom.scss
│ │ ├── _dark-variables.scss
│ │ ├── _light-custom.scss
│ │ ├── _light-variables.scss
│ │ ├── _shared-custom.scss
│ │ ├── _shared-variables.scss
│ │ ├── _temp.scss
│ │ ├── dark.scss
│ │ ├── light.scss
│ │ └── vendors
│ │ │ ├── _variables.scss
│ │ │ └── pace-progress
│ │ │ └── pace.scss
│ ├── Views
│ │ ├── Account
│ │ │ ├── Register.cshtml
│ │ │ ├── SignIn.cshtml
│ │ │ └── Unauthorize.cshtml
│ │ ├── Administration
│ │ │ ├── AuditLogs.cshtml
│ │ │ ├── Company.cshtml
│ │ │ ├── Groups.cshtml
│ │ │ ├── Roles.cshtml
│ │ │ ├── Settings.cshtml
│ │ │ ├── User.cshtml
│ │ │ └── Users.cshtml
│ │ ├── Contact
│ │ │ ├── Contact.cshtml
│ │ │ └── Contacts.cshtml
│ │ ├── Dashboard
│ │ │ ├── MonthlySales.cshtml
│ │ │ └── _MonthlySales.cshtml
│ │ ├── Financials
│ │ │ ├── Account.cshtml
│ │ │ ├── Accounts.cshtml
│ │ │ ├── AddJournalEntry.cshtml
│ │ │ ├── BalanceSheet.cshtml
│ │ │ ├── Banks.cshtml
│ │ │ ├── GeneralLedger.cshtml
│ │ │ ├── IncomeStatement.cshtml
│ │ │ ├── JournalEntries.cshtml
│ │ │ ├── JournalEntry.cshtml
│ │ │ └── TrialBalance.cshtml
│ │ ├── Home
│ │ │ └── Index.cshtml
│ │ ├── Inventory
│ │ │ ├── ICJ.cshtml
│ │ │ ├── Index.cshtml
│ │ │ ├── Item.cshtml
│ │ │ └── addItem.cshtml
│ │ ├── Purchasing
│ │ │ ├── AddPurchaseInvoice.cshtml
│ │ │ ├── AddPurchaseOrder.cshtml
│ │ │ ├── Payment.cshtml
│ │ │ ├── PurchaseInvoice.cshtml
│ │ │ ├── PurchaseInvoices.cshtml
│ │ │ ├── PurchaseOrder.cshtml
│ │ │ ├── PurchaseOrders.cshtml
│ │ │ ├── Vendor.cshtml
│ │ │ └── Vendors.cshtml
│ │ ├── Quotations
│ │ │ ├── AddSalesQuotation.cshtml
│ │ │ ├── Quotation.cshtml
│ │ │ └── Quotations.cshtml
│ │ ├── Sales
│ │ │ ├── AddReceipt.cshtml
│ │ │ ├── AddSalesInvoice.cshtml
│ │ │ ├── AddSalesOrder.cshtml
│ │ │ ├── Allocate.cshtml
│ │ │ ├── Customer.cshtml
│ │ │ ├── CustomerAllocations.cshtml
│ │ │ ├── Customers.cshtml
│ │ │ ├── DonationInvoice.cshtml
│ │ │ ├── DonationInvoices.cshtml
│ │ │ ├── Index.cshtml
│ │ │ ├── SalesInvoice.cshtml
│ │ │ ├── SalesInvoicePdf.cshtml
│ │ │ ├── SalesInvoices.cshtml
│ │ │ ├── SalesOrder.cshtml
│ │ │ ├── SalesReceipt.cshtml
│ │ │ ├── SalesReceipts.cshtml
│ │ │ └── salesorders.cshtml
│ │ ├── Shared
│ │ │ ├── _Layout.cshtml
│ │ │ ├── _LayoutPrev.cshtml
│ │ │ └── _Layout_bootstrap.cshtml
│ │ ├── Tax
│ │ │ └── Taxes.cshtml
│ │ ├── _ViewImports.cshtml
│ │ └── _ViewStart.cshtml
│ ├── appsettings.Development.json
│ ├── appsettings.Production.json
│ ├── appsettings.json
│ ├── package-lock.json
│ ├── package.json
│ └── wwwroot
│ │ ├── css
│ │ ├── dark.css
│ │ ├── dark.css.map
│ │ ├── light.css
│ │ ├── light.css.map
│ │ └── vendors
│ │ │ └── pace-progress
│ │ │ ├── pace.css
│ │ │ └── pace.css.map
│ │ ├── images
│ │ ├── Dark-Logo.svg
│ │ ├── avatars
│ │ │ ├── 1.jpg
│ │ │ ├── 2.jpg
│ │ │ ├── 3.jpg
│ │ │ ├── 4.jpg
│ │ │ ├── 5.jpg
│ │ │ ├── 6.jpg
│ │ │ ├── 7.jpg
│ │ │ ├── 8.jpg
│ │ │ └── user2-160x160.png
│ │ ├── banner1.svg
│ │ ├── banner2.svg
│ │ ├── banner3.svg
│ │ ├── brand
│ │ │ ├── logo.svg
│ │ │ └── sygnet.svg
│ │ ├── favicon.ico
│ │ └── gbd
│ │ │ ├── logo1.png
│ │ │ ├── logo1_trans.png
│ │ │ ├── logo2.png
│ │ │ ├── logo2_trans.png
│ │ │ └── logo3_trans.png
│ │ └── js
│ │ ├── charts.js
│ │ ├── charts.js.map
│ │ ├── colors.js
│ │ ├── colors.js.map
│ │ ├── custom.js
│ │ ├── main.js
│ │ ├── main.js.map
│ │ ├── popovers.js
│ │ ├── popovers.js.map
│ │ ├── site.js
│ │ ├── site.min.js
│ │ ├── src
│ │ ├── charts.js
│ │ ├── colors.js
│ │ ├── main.js
│ │ ├── popovers.js
│ │ ├── tooltips.js
│ │ └── widgets.js
│ │ ├── tooltips.js
│ │ ├── tooltips.js.map
│ │ ├── widgets.js
│ │ └── widgets.js.map
├── Api
│ ├── .vscode
│ │ ├── launch.json
│ │ └── tasks.json
│ ├── Api.csproj
│ ├── Api.csproj.20240429.bak
│ ├── Api.sln
│ ├── Controllers
│ │ ├── AccountController.cs
│ │ ├── AdministrationController.cs
│ │ ├── BaseController.cs
│ │ ├── CommonController.cs
│ │ ├── ContactController.cs
│ │ ├── FinancialsController.cs
│ │ ├── InventoryController.cs
│ │ ├── PurchasingController.cs
│ │ ├── SalesController.cs
│ │ └── TaxController.cs
│ ├── Data
│ │ ├── ApiDbContext.cs
│ │ ├── ApplicationIdentityDbContext.cs
│ │ ├── ApplicationUser.cs
│ │ ├── AuditLogHelper.cs
│ │ ├── ChartOfAccounts.csv
│ │ ├── Initializer.cs
│ │ ├── Repositories
│ │ │ ├── EfRepository.cs
│ │ │ ├── PurchaseOrderRepository.cs
│ │ │ ├── SalesOrderRepository.cs
│ │ │ └── SecurityRepository.cs
│ │ ├── Seed
│ │ │ └── SeeData.cs
│ │ └── coa.csv
│ ├── Dockerfile
│ ├── Helpers
│ │ └── CollectionHelper.cs
│ ├── Program.cs
│ ├── Properties
│ │ └── launchSettings.json
│ ├── appsettings.Development.json
│ ├── appsettings.Production.json
│ └── appsettings.json
├── Core
│ ├── Core.csproj
│ ├── Data
│ │ ├── IPurchaseOrderRepository.cs
│ │ ├── IRepository.cs
│ │ ├── ISalesOrderRepository.cs
│ │ └── ISecurityRepository.cs
│ ├── Domain
│ │ ├── Address.cs
│ │ ├── Auditing
│ │ │ ├── AuditLog.cs
│ │ │ ├── AuditableAttribute.cs
│ │ │ └── AuditableEntity.cs
│ │ ├── BaseEntity.cs
│ │ ├── Company.cs
│ │ ├── CompanySetting.cs
│ │ ├── Contact.cs
│ │ ├── CustomerContact.cs
│ │ ├── EnumTypes.cs
│ │ ├── Financials
│ │ │ ├── Account.cs
│ │ │ ├── AccountClass.cs
│ │ │ ├── Bank.cs
│ │ │ ├── Financial accounting principles
│ │ │ │ └── DebitCreditRules.txt
│ │ │ ├── FiscalYear.cs
│ │ │ ├── GeneralLedgerHeader.cs
│ │ │ ├── GeneralLedgerLine.cs
│ │ │ ├── GeneralLedgerSetting.cs
│ │ │ ├── JournalEntryHeader.cs
│ │ │ ├── JournalEntryLine.cs
│ │ │ └── MainContraAccount.cs
│ │ ├── ItemTaxGroup.cs
│ │ ├── Items
│ │ │ ├── InventoryControlJournal.cs
│ │ │ ├── Item.cs
│ │ │ ├── ItemCategory.cs
│ │ │ └── Measurement.cs
│ │ ├── Log.cs
│ │ ├── Party.cs
│ │ ├── PaymentTerm.cs
│ │ ├── Purchases
│ │ │ ├── PurchaseInvoiceHeader.cs
│ │ │ ├── PurchaseInvoiceLine.cs
│ │ │ ├── PurchaseOrderHeader.cs
│ │ │ ├── PurchaseOrderLine.cs
│ │ │ ├── PurchaseReceiptHeader.cs
│ │ │ ├── PurchaseReceiptLine.cs
│ │ │ ├── Vendor.cs
│ │ │ └── VendorPayment.cs
│ │ ├── Sales
│ │ │ ├── Customer.cs
│ │ │ ├── CustomerAllocation.cs
│ │ │ ├── SalesDeliveryHeader.cs
│ │ │ ├── SalesDeliveryLine.cs
│ │ │ ├── SalesInvoiceHeader.cs
│ │ │ ├── SalesInvoiceLine.cs
│ │ │ ├── SalesOrderHeader.cs
│ │ │ ├── SalesOrderLine.cs
│ │ │ ├── SalesQuoteHeader.cs
│ │ │ ├── SalesQuoteLine.cs
│ │ │ ├── SalesReceiptHeader.cs
│ │ │ └── SalesReceiptLine.cs
│ │ ├── Security
│ │ │ ├── SecurityGroup.cs
│ │ │ ├── SecurityPermission.cs
│ │ │ ├── SecurityRole.cs
│ │ │ ├── SecurityRolePermission.cs
│ │ │ ├── SecurityUserRole.cs
│ │ │ └── User.cs
│ │ ├── SequenceNumber.cs
│ │ ├── Tax.cs
│ │ ├── TaxGroup.cs
│ │ ├── TaxSystem
│ │ │ ├── ItemTaxGroup.cs
│ │ │ ├── Tax.cs
│ │ │ └── TaxGroup.cs
│ │ └── VendorContact.cs
│ ├── MessageSource.cs
│ └── Properties
│ │ └── launchSettings.json
├── Dto
│ ├── Administration
│ │ ├── AuditLog.cs
│ │ ├── Company.cs
│ │ └── GeneralLedgerSetting.cs
│ ├── BaseModel.cs
│ ├── Common
│ │ ├── Address.cs
│ │ ├── Contact.cs
│ │ ├── Party.cs
│ │ ├── PaymentTerm.cs
│ │ └── Status.cs
│ ├── Dto.csproj
│ ├── Financial
│ │ ├── Account.cs
│ │ ├── AccountClass.cs
│ │ ├── Bank.cs
│ │ ├── FiscalYear.cs
│ │ ├── GeneralLedger.cs
│ │ ├── JournalEntry.cs
│ │ ├── MasterGeneralLedger.cs
│ │ ├── PaymentTerm.cs
│ │ └── TreeViewAccounts.cs
│ ├── Inventory
│ │ ├── InventoryControlJournal.cs
│ │ ├── Item.cs
│ │ ├── ItemCategory.cs
│ │ └── Measurement.cs
│ ├── Properties
│ │ └── launchSettings.json
│ ├── Purchasing
│ │ ├── PurchaseInvoice.cs
│ │ ├── PurchaseOrder.cs
│ │ ├── PurchaseReceipt.cs
│ │ └── Vendor.cs
│ ├── Sales
│ │ ├── CreateCustomer.cs
│ │ ├── Customer.cs
│ │ ├── MonthlySales.cs
│ │ ├── SalesDelivery.cs
│ │ ├── SalesInvoice.cs
│ │ ├── SalesOrder.cs
│ │ ├── SalesQuotation.cs
│ │ └── SalesReceipt.cs
│ ├── Security
│ │ ├── Group.cs
│ │ ├── Permission.cs
│ │ ├── Role.cs
│ │ └── User.cs
│ └── TaxSystem
│ │ ├── ItemTaxGroup.cs
│ │ ├── ItemTaxGroupTax.cs
│ │ ├── Tax.cs
│ │ ├── TaxGroup.cs
│ │ └── TaxGroupTax.cs
├── GoodBooksReact
│ ├── .babelec.json
│ ├── .eslintrc.cjs
│ ├── .gitignore
│ ├── README.md
│ ├── errors.txt
│ ├── index.html
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ ├── staticwebapp.config.json
│ │ └── vite.svg
│ ├── src
│ │ ├── App.tsx
│ │ ├── assets
│ │ │ └── react.svg
│ │ ├── components
│ │ │ ├── Counter.tsx
│ │ │ ├── Financials
│ │ │ │ └── JournalEntry.tsx
│ │ │ ├── Heading.tsx
│ │ │ ├── Home
│ │ │ │ └── Index.tsx
│ │ │ ├── List.tsx
│ │ │ ├── Purchasing
│ │ │ │ ├── PurchaseInvoice.tsx
│ │ │ │ └── PurchaseOrder.tsx
│ │ │ ├── Sales
│ │ │ │ ├── SalesInvoice.tsx
│ │ │ │ └── SalesOrder.tsx
│ │ │ ├── Section.tsx
│ │ │ ├── Shared
│ │ │ │ ├── Components
│ │ │ │ │ ├── SelectAccount.tsx
│ │ │ │ │ ├── SelectCustomer.tsx
│ │ │ │ │ ├── SelectDebitCredit.tsx
│ │ │ │ │ ├── SelectLineItem.tsx
│ │ │ │ │ ├── SelectLineMeasurement.tsx
│ │ │ │ │ ├── SelectPaymentTerm.tsx
│ │ │ │ │ ├── SelectQuotationStatus.tsx
│ │ │ │ │ ├── SelectVendor.tsx
│ │ │ │ │ └── SelectVoucherType.tsx
│ │ │ │ ├── Config
│ │ │ │ │ └── index.tsx
│ │ │ │ └── Stores
│ │ │ │ │ ├── AppState.tsx
│ │ │ │ │ ├── Common
│ │ │ │ │ └── CommonStore.tsx
│ │ │ │ │ ├── Financials
│ │ │ │ │ ├── JournalEntry.tsx
│ │ │ │ │ ├── JournalEntryLine.tsx
│ │ │ │ │ ├── JournalEntryStore.tsx
│ │ │ │ │ └── JournalEntryUIStore.tsx
│ │ │ │ │ ├── Purchasing
│ │ │ │ │ ├── PurchaseInvoice.tsx
│ │ │ │ │ ├── PurchaseInvoiceLine.tsx
│ │ │ │ │ ├── PurchaseInvoiceStore.tsx
│ │ │ │ │ ├── PurchaseOrder.tsx
│ │ │ │ │ ├── PurchaseOrderLine.tsx
│ │ │ │ │ └── PurchaseOrderStore.tsx
│ │ │ │ │ ├── Quotations
│ │ │ │ │ ├── SalesQuotation.tsx
│ │ │ │ │ ├── SalesQuotationLine.tsx
│ │ │ │ │ └── SalesQuotationStore.tsx
│ │ │ │ │ ├── Sales
│ │ │ │ │ ├── SalesInvoice.tsx
│ │ │ │ │ ├── SalesInvoiceLine.tsx
│ │ │ │ │ ├── SalesInvoiceStore.tsx
│ │ │ │ │ ├── SalesOrder.tsx
│ │ │ │ │ ├── SalesOrderLine.tsx
│ │ │ │ │ └── SalesOrderStore.tsx
│ │ │ │ │ └── TaxSystem
│ │ │ │ │ ├── Tax.tsx
│ │ │ │ │ └── TaxConfigStore.tsx
│ │ │ ├── Test
│ │ │ │ └── Hello.tsx
│ │ │ └── src
│ │ │ │ └── @types
│ │ │ │ └── index.d.ts.delete
│ │ ├── index.css
│ │ ├── main.tsx
│ │ ├── routes
│ │ │ └── Routes.tsx
│ │ └── vite-env.d.ts
│ ├── tsconfig.json
│ ├── tsconfig.node.json
│ ├── vite.config.ts
│ └── webpack.config.js
├── Infrastructure
│ ├── AssemblyLoader
│ │ ├── AssemblyInfo.cs
│ │ ├── AssemblyLoaderManager.cs
│ │ ├── Constants.cs
│ │ ├── CustomAssemblyLoadContext.cs
│ │ └── IAssemblyInfo.cs
│ ├── Extensions
│ │ └── ServiceCollectionExtensions.cs
│ ├── IStartup.cs
│ ├── Infrastructure.csproj
│ ├── Module
│ │ ├── ModuleConfig.cs
│ │ ├── ModuleDescriptor.cs
│ │ ├── ModuleLoader.cs
│ │ └── ModuleManager.cs
│ └── Plugin
│ │ └── PluginDescriptor.cs
├── Modules
│ └── SampleModule
│ │ ├── Controllers
│ │ └── SampleModuleController.cs
│ │ ├── Models
│ │ └── ErrorViewModel.cs
│ │ ├── SampleModule.csproj
│ │ ├── Views
│ │ └── SampleModule
│ │ │ └── Index.cshtml
│ │ └── wwwroot
│ │ ├── css
│ │ ├── site.css
│ │ └── site.min.css
│ │ └── js
│ │ ├── site.js
│ │ └── site.min.js
└── Services
│ ├── Administration
│ ├── AdministrationService.cs
│ └── IAdministrationService.cs
│ ├── BaseService.cs
│ ├── Financial
│ ├── FinancialHelper.cs
│ ├── FinancialReports.cs
│ ├── FinancialService.cs
│ └── IFinancialService.cs
│ ├── Inventory
│ ├── IInventoryService.cs
│ └── InventoryService.cs
│ ├── Properties
│ └── launchSettings.json
│ ├── Purchasing
│ ├── IPurchasingService.cs
│ └── PurchasingService.cs
│ ├── Sales
│ ├── ISalesService.cs
│ └── SalesService.cs
│ ├── Security
│ ├── ISecurityService.cs
│ └── SecurityService.cs
│ ├── Services.csproj
│ └── TaxSystem
│ ├── ITaxService.cs
│ └── TaxService.cs
└── test
├── Module.Tests
├── BasicModuleLoaderTests.cs
├── Module.Tests.csproj
├── SampleModulesRefs.targets
└── modules.json
└── SampleModules
└── SampleNetStandard20
├── Class1.cs
├── SampleNetStandard20.csproj
└── module.json
/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Marvin Perez
5 | AccountGo
6 | Copyright © AccountGo
7 | en-US
8 | false
9 | $(MSBuildThisFileDirectory)
10 | https://opensource.org/licenses/MIT
11 | https://github.com/AccountGo/accountgo
12 | https://github.com/AccountGo/accountgo.git
13 | git
14 | embedded
15 | false
16 | $(NoWarn);NU5105
17 |
18 | false
19 | true
20 | $(MSBuildThisFileDirectory).build\obj\$(MSBuildProjectName)\
21 | $(MSBuildThisFileDirectory).build\bin\$(MSBuildProjectName)\
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Directory.Build.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Marvin Perez
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/azure-pipelines.yml:
--------------------------------------------------------------------------------
1 | # ASP.NET Core
2 | # Build and test ASP.NET Core web applications targeting .NET Core.
3 | # Add steps that run tests, create a NuGet package, deploy, and more:
4 | # https://docs.microsoft.com/vsts/pipelines/languages/dotnet-core
5 |
6 | pool:
7 | vmImage: 'Ubuntu 16.04'
8 |
9 | variables:
10 | buildConfiguration: 'Release'
11 |
12 | steps:
13 | - script: npm install
14 | displayName: 'npm install'
15 | workingDirectory: './src/AccountGoWeb'
16 |
17 | - script: dotnet build --configuration $(buildConfiguration)
18 | displayName: 'dotnet build $(buildConfiguration)'
19 |
20 | # - task: gulp@0
21 | # inputs:
22 | # gulpFile: './src/AccountGoWeb/gulpfile.js'
23 | # workingDirectory: './src/AccountGoWeb'
24 | # gulpjs: '/node_modules/gulp/bin/gulp.js'
25 |
26 | # - task: Bash@3
27 | # inputs:
28 | # script: /node_modules/typescript/bin/tsc --build 'tsconfig.json'
29 | # displayName: 'run tsc'
30 | # workingDirectory: './src/AccountGoWeb'
31 |
32 | # - task: Bash@3
33 | # inputs:
34 | # script: /node_modules/webpack/bin/webpack.js
35 | # displayName: 'run webpack'
36 | # workingDirectory: './src/AccountGoWeb'
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_Account.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[Account] WITH CHECK ADD CONSTRAINT [FK_Account_AccountClassId_AccountClass_AccountClassId]
2 | FOREIGN KEY([AccountClassId]) REFERENCES [dbo].[AccountClass] ([Id])
3 | ON DELETE CASCADE
4 |
5 | GO
6 | ALTER TABLE [dbo].[Account] WITH CHECK ADD CONSTRAINT [FK_Account_CompanyId_Company_CompanyId]
7 | FOREIGN KEY([CompanyId]) REFERENCES [dbo].[Company] ([Id])
8 |
9 | GO
10 | ALTER TABLE [dbo].[Account] WITH CHECK ADD CONSTRAINT [FK_Account_ParentAccountId_Account_AccountId]
11 | FOREIGN KEY([ParentAccountId]) REFERENCES [dbo].[Account] ([Id])
12 |
13 | GO
14 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_AspNetRoleClaims.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[AspNetRoleClaims] WITH CHECK ADD CONSTRAINT [FK_AspNetRoleClaims_AspNetRoles_RoleId]
2 | FOREIGN KEY([RoleId]) REFERENCES [dbo].[AspNetRoles] ([Id])
3 | ON DELETE CASCADE
4 |
5 | GO
6 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_AspNetUserClaims.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[AspNetUserClaims] WITH CHECK ADD CONSTRAINT [FK_AspNetUserClaims_AspNetUsers_UserId]
2 | FOREIGN KEY([UserId]) REFERENCES [dbo].[AspNetUsers] ([Id])
3 | ON DELETE CASCADE
4 |
5 | GO
6 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_AspNetUserLogins.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[AspNetUserLogins] WITH CHECK ADD CONSTRAINT [FK_AspNetUserLogins_AspNetUsers_UserId]
2 | FOREIGN KEY([UserId]) REFERENCES [dbo].[AspNetUsers] ([Id])
3 | ON DELETE CASCADE
4 |
5 | GO
6 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_AspNetUserRoles.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[AspNetUserRoles] WITH CHECK ADD CONSTRAINT [FK_AspNetUserRoles_AspNetRoles_RoleId]
2 | FOREIGN KEY([RoleId]) REFERENCES [dbo].[AspNetRoles] ([Id])
3 | ON DELETE CASCADE
4 |
5 | GO
6 | ALTER TABLE [dbo].[AspNetUserRoles] WITH CHECK ADD CONSTRAINT [FK_AspNetUserRoles_AspNetUsers_UserId]
7 | FOREIGN KEY([UserId]) REFERENCES [dbo].[AspNetUsers] ([Id])
8 | ON DELETE CASCADE
9 |
10 | GO
11 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_AuditableAttribute.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[AuditableAttribute] WITH CHECK ADD CONSTRAINT [FK_AuditableAttribute_AuditableEntity]
2 | FOREIGN KEY([AuditableEntityId]) REFERENCES [dbo].[AuditableEntity] ([Id])
3 |
4 | GO
5 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_Bank.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[Bank] WITH CHECK ADD CONSTRAINT [FK_dbo.Bank_dbo.Account_AccountId]
2 | FOREIGN KEY([AccountId]) REFERENCES [dbo].[Account] ([Id])
3 |
4 | GO
5 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_CompanySetting.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[CompanySetting] WITH CHECK ADD CONSTRAINT [FK_dbo.CompanySetting_dbo.Company_CompanyId]
2 | FOREIGN KEY([CompanyId]) REFERENCES [dbo].[Company] ([Id])
3 | ON DELETE CASCADE
4 |
5 | GO
6 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_Contact.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[Contact] WITH CHECK ADD CONSTRAINT [FK_dbo.Contact_dbo.Party_PartyId]
2 | FOREIGN KEY([PartyId]) REFERENCES [dbo].[Party] ([Id])
3 |
4 | GO
5 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_CustomerAllocation.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[CustomerAllocation] WITH CHECK ADD CONSTRAINT [FK_dbo.CustomerAllocation_dbo.Customer_CustomerId]
2 | FOREIGN KEY([CustomerId]) REFERENCES [dbo].[Customer] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[CustomerAllocation] WITH CHECK ADD CONSTRAINT [FK_dbo.CustomerAllocation_dbo.SalesInvoiceHeader_SalesInvoiceHeaderId]
6 | FOREIGN KEY([SalesInvoiceHeaderId]) REFERENCES [dbo].[SalesInvoiceHeader] ([Id])
7 | ON DELETE CASCADE
8 |
9 | GO
10 | ALTER TABLE [dbo].[CustomerAllocation] WITH CHECK ADD CONSTRAINT [FK_dbo.CustomerAllocation_dbo.SalesReceiptHeader_SalesReceiptHeaderId]
11 | FOREIGN KEY([SalesReceiptHeaderId]) REFERENCES [dbo].[SalesReceiptHeader] ([Id])
12 | ON DELETE CASCADE
13 |
14 | GO
15 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_CustomerContact.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[CustomerContact] WITH CHECK ADD CONSTRAINT [FK_dbo.CustomerContact_dbo.Customer_Id]
2 | FOREIGN KEY([CustomerId]) REFERENCES [dbo].[Customer] ([Id])
3 |
4 | GO
5 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_GeneralLedgerLine.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[GeneralLedgerLine] WITH CHECK ADD CONSTRAINT [FK_dbo.GeneralLedgerLine_dbo.Account_AccountId]
2 | FOREIGN KEY([AccountId]) REFERENCES [dbo].[Account] ([Id])
3 | ON DELETE CASCADE
4 |
5 | GO
6 | ALTER TABLE [dbo].[GeneralLedgerLine] WITH CHECK ADD CONSTRAINT [FK_dbo.GeneralLedgerLine_dbo.GeneralLedgerHeader_GeneralLedgerHeaderId]
7 | FOREIGN KEY([GeneralLedgerHeaderId]) REFERENCES [dbo].[GeneralLedgerHeader] ([Id])
8 | ON DELETE CASCADE
9 |
10 | GO
11 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_InventoryControlJournal.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[InventoryControlJournal] WITH CHECK ADD CONSTRAINT [FK_dbo.InventoryControlJournal_dbo.Item_ItemId]
2 | FOREIGN KEY([ItemId]) REFERENCES [dbo].[Item] ([Id])
3 | ON DELETE CASCADE
4 |
5 | GO
6 | ALTER TABLE [dbo].[InventoryControlJournal] WITH CHECK ADD CONSTRAINT [FK_dbo.InventoryControlJournal_dbo.Measurement_MeasurementId]
7 | FOREIGN KEY([MeasurementId]) REFERENCES [dbo].[Measurement] ([Id])
8 | ON DELETE CASCADE
9 |
10 | GO
11 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_ItemCategory.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[ItemCategory] WITH CHECK ADD CONSTRAINT [FK_dbo.ItemCategory_dbo.Account_AdjustmentAccountId]
2 | FOREIGN KEY([AdjustmentAccountId]) REFERENCES [dbo].[Account] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[ItemCategory] WITH CHECK ADD CONSTRAINT [FK_dbo.ItemCategory_dbo.Account_AssemblyAccountId]
6 | FOREIGN KEY([AssemblyAccountId]) REFERENCES [dbo].[Account] ([Id])
7 |
8 | GO
9 | ALTER TABLE [dbo].[ItemCategory] WITH CHECK ADD CONSTRAINT [FK_dbo.ItemCategory_dbo.Account_CostOfGoodsSoldAccountId]
10 | FOREIGN KEY([CostOfGoodsSoldAccountId]) REFERENCES [dbo].[Account] ([Id])
11 |
12 | GO
13 | ALTER TABLE [dbo].[ItemCategory] WITH CHECK ADD CONSTRAINT [FK_dbo.ItemCategory_dbo.Account_InventoryAccountId]
14 | FOREIGN KEY([InventoryAccountId]) REFERENCES [dbo].[Account] ([Id])
15 |
16 | GO
17 | ALTER TABLE [dbo].[ItemCategory] WITH CHECK ADD CONSTRAINT [FK_dbo.ItemCategory_dbo.Measurement_MeasurementId]
18 | FOREIGN KEY([MeasurementId]) REFERENCES [dbo].[Measurement] ([Id])
19 |
20 | GO
21 | ALTER TABLE [dbo].[ItemCategory] WITH CHECK ADD CONSTRAINT [FK_dbo.ItemCategory_dbo.Account_SalesAccountId]
22 | FOREIGN KEY([SalesAccountId]) REFERENCES [dbo].[Account] ([Id])
23 |
24 | GO
25 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_ItemTaxGroupTax.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[ItemTaxGroupTax] WITH CHECK ADD CONSTRAINT [FK_dbo.ItemTaxGroupTax_dbo.ItemTaxGroup_ItemTaxGroupId]
2 | FOREIGN KEY([ItemTaxGroupId]) REFERENCES [dbo].[ItemTaxGroup] ([Id])
3 | ON DELETE CASCADE
4 |
5 | GO
6 | ALTER TABLE [dbo].[ItemTaxGroupTax] WITH CHECK ADD CONSTRAINT [FK_dbo.ItemTaxGroupTax_dbo.Tax_TaxId]
7 | FOREIGN KEY([TaxId]) REFERENCES [dbo].[Tax] ([Id])
8 | ON DELETE CASCADE
9 |
10 | GO
11 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_JournalEntryHeader.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[JournalEntryHeader] WITH CHECK ADD CONSTRAINT [FK_dbo.JournalEntryHeader_dbo.GeneralLedgerHeader_GeneralLedgerHeaderId]
2 | FOREIGN KEY([GeneralLedgerHeaderId]) REFERENCES [dbo].[GeneralLedgerHeader] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[JournalEntryHeader] WITH CHECK ADD CONSTRAINT [FK_dbo.JournalEntryHeader_dbo.Party_PartyId]
6 | FOREIGN KEY([PartyId]) REFERENCES [dbo].[Party] ([Id])
7 |
8 | GO
9 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_JournalEntryLine.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[JournalEntryLine] WITH CHECK ADD CONSTRAINT [FK_dbo.JournalEntryLine_dbo.Account_AccountId]
2 | FOREIGN KEY([AccountId]) REFERENCES [dbo].[Account] ([Id])
3 | ON DELETE CASCADE
4 |
5 | GO
6 | ALTER TABLE [dbo].[JournalEntryLine] WITH CHECK ADD CONSTRAINT [FK_dbo.JournalEntryLine_dbo.JournalEntryHeader_JournalEntryHeaderId]
7 | FOREIGN KEY([JournalEntryHeaderId]) REFERENCES [dbo].[JournalEntryHeader] ([Id])
8 | ON DELETE CASCADE
9 |
10 | GO
11 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_MainContraAccount.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[MainContraAccount] WITH CHECK ADD CONSTRAINT [FK_MainContraAccount_MainAccountId_Account_AccountId]
2 | FOREIGN KEY([MainAccountId]) REFERENCES [dbo].[Account] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[MainContraAccount] WITH CHECK ADD CONSTRAINT [FK_MainContraAccount_RelatedContraAccountId_Account_AccountId]
6 | FOREIGN KEY([RelatedContraAccountId]) REFERENCES [dbo].[Account] ([Id])
7 |
8 | GO
9 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_PurchaseInvoiceHeader.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[PurchaseInvoiceHeader] WITH CHECK ADD CONSTRAINT [FK_dbo.PurchaseInvoiceHeader_dbo.GeneralLedgerHeader_GeneralLedgerHeaderId]
2 | FOREIGN KEY([GeneralLedgerHeaderId]) REFERENCES [dbo].[GeneralLedgerHeader] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[PurchaseInvoiceHeader] WITH CHECK ADD CONSTRAINT [FK_dbo.PurchaseInvoiceHeader_dbo.PaymentTerm_PaymentTermId]
6 | FOREIGN KEY([PaymentTermId]) REFERENCES [dbo].[PaymentTerm] ([Id])
7 |
8 | GO
9 | ALTER TABLE [dbo].[PurchaseInvoiceHeader] WITH CHECK ADD CONSTRAINT [FK_dbo.PurchaseInvoiceHeader_dbo.Vendor_VendorId]
10 | FOREIGN KEY([VendorId]) REFERENCES [dbo].[Vendor] ([Id])
11 |
12 | GO
13 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_PurchaseInvoiceLine.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[PurchaseInvoiceLine] WITH CHECK ADD CONSTRAINT [FK_dbo.PurchaseInvoiceLine_dbo.InventoryControlJournal_InventoryControlJournalId]
2 | FOREIGN KEY([InventoryControlJournalId]) REFERENCES [dbo].[InventoryControlJournal] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[PurchaseInvoiceLine] WITH CHECK ADD CONSTRAINT [FK_dbo.PurchaseInvoiceLine_dbo.Item_ItemId]
6 | FOREIGN KEY([ItemId]) REFERENCES [dbo].[Item] ([Id])
7 |
8 | GO
9 | ALTER TABLE [dbo].[PurchaseInvoiceLine] WITH CHECK ADD CONSTRAINT [FK_dbo.PurchaseInvoiceLine_dbo.Measurement_MeasurementId]
10 | FOREIGN KEY([MeasurementId]) REFERENCES [dbo].[Measurement] ([Id])
11 |
12 | GO
13 | ALTER TABLE [dbo].[PurchaseInvoiceLine] WITH CHECK ADD CONSTRAINT [FK_dbo.PurchaseInvoiceLine_dbo.PurchaseInvoiceHeader_PurchaseInvoiceHeaderId]
14 | FOREIGN KEY([PurchaseInvoiceHeaderId]) REFERENCES [dbo].[PurchaseInvoiceHeader] ([Id])
15 | ON DELETE CASCADE
16 |
17 | GO
18 | ALTER TABLE [dbo].[PurchaseInvoiceLine] WITH CHECK ADD CONSTRAINT [FK_dbo.PurchaseInvoiceLine_dbo.PurchaseOrderLine_PurchaseOrderLineId]
19 | FOREIGN KEY([PurchaseOrderLineId]) REFERENCES [dbo].[PurchaseOrderLine] ([Id])
20 |
21 | GO
22 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_PurchaseOrderHeader.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[PurchaseOrderHeader] WITH CHECK ADD CONSTRAINT [FK_dbo.PurchaseOrderHeader_dbo.PaymentTerm_PaymentTermId]
2 | FOREIGN KEY([PaymentTermId]) REFERENCES [dbo].[PaymentTerm] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[PurchaseOrderHeader] WITH CHECK ADD CONSTRAINT [FK_dbo.PurchaseOrderHeader_dbo.Vendor_VendorId]
6 | FOREIGN KEY([VendorId]) REFERENCES [dbo].[Vendor] ([Id])
7 |
8 | GO
9 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_PurchaseOrderLine.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[PurchaseOrderLine] WITH CHECK ADD CONSTRAINT [FK_dbo.PurchaseOrderLine_dbo.Item_ItemId]
2 | FOREIGN KEY([ItemId]) REFERENCES [dbo].[Item] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[PurchaseOrderLine] WITH CHECK ADD CONSTRAINT [FK_dbo.PurchaseOrderLine_dbo.Measurement_MeasurementId]
6 | FOREIGN KEY([MeasurementId]) REFERENCES [dbo].[Measurement] ([Id])
7 |
8 | GO
9 | ALTER TABLE [dbo].[PurchaseOrderLine] WITH CHECK ADD CONSTRAINT [FK_dbo.PurchaseOrderLine_dbo.PurchaseOrderHeader_PurchaseOrderHeaderId]
10 | FOREIGN KEY([PurchaseOrderHeaderId]) REFERENCES [dbo].[PurchaseOrderHeader] ([Id])
11 | ON DELETE CASCADE
12 |
13 | GO
14 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_PurchaseReceiptHeader.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[PurchaseReceiptHeader] WITH CHECK ADD CONSTRAINT [FK_dbo.PurchaseReceiptHeader_dbo.GeneralLedgerHeader_GeneralLedgerHeaderId]
2 | FOREIGN KEY([GeneralLedgerHeaderId]) REFERENCES [dbo].[GeneralLedgerHeader] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[PurchaseReceiptHeader] WITH CHECK ADD CONSTRAINT [FK_dbo.PurchaseReceiptHeader_dbo.Vendor_VendorId]
6 | FOREIGN KEY([VendorId]) REFERENCES [dbo].[Vendor] ([Id])
7 |
8 | GO
9 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_PurchaseReceiptLine.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[PurchaseReceiptLine] WITH CHECK ADD CONSTRAINT [FK_dbo.PurchaseReceiptLine_dbo.InventoryControlJournal_InventoryControlJournalId]
2 | FOREIGN KEY([InventoryControlJournalId]) REFERENCES [dbo].[InventoryControlJournal] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[PurchaseReceiptLine] WITH CHECK ADD CONSTRAINT [FK_dbo.PurchaseReceiptLine_dbo.Item_ItemId]
6 | FOREIGN KEY([ItemId]) REFERENCES [dbo].[Item] ([Id])
7 |
8 | GO
9 | ALTER TABLE [dbo].[PurchaseReceiptLine] WITH CHECK ADD CONSTRAINT [FK_dbo.PurchaseReceiptLine_dbo.Measurement_MeasurementId]
10 | FOREIGN KEY([MeasurementId]) REFERENCES [dbo].[Measurement] ([Id])
11 |
12 | GO
13 | ALTER TABLE [dbo].[PurchaseReceiptLine] WITH CHECK ADD CONSTRAINT [FK_dbo.PurchaseReceiptLine_dbo.PurchaseInvoiceLine_PurchaseInvoiceLineId]
14 | FOREIGN KEY([PurchaseInvoiceLineId]) REFERENCES [dbo].[PurchaseInvoiceLine] ([Id])
15 |
16 | GO
17 | ALTER TABLE [dbo].[PurchaseReceiptLine] WITH CHECK ADD CONSTRAINT [FK_dbo.PurchaseReceiptLine_dbo.PurchaseReceiptHeader_PurchaseReceiptHeaderId]
18 | FOREIGN KEY([PurchaseReceiptHeaderId]) REFERENCES [dbo].[PurchaseReceiptHeader] ([Id])
19 | ON DELETE CASCADE
20 |
21 | GO
22 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_SalesDeliveryHeader.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[SalesDeliveryHeader] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesDeliveryHeader_dbo.Customer_CustomerId]
2 | FOREIGN KEY([CustomerId]) REFERENCES [dbo].[Customer] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[SalesDeliveryHeader] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesDeliveryHeader_dbo.GeneralLedgerHeader_GeneralLedgerHeaderId]
6 | FOREIGN KEY([GeneralLedgerHeaderId]) REFERENCES [dbo].[GeneralLedgerHeader] ([Id])
7 |
8 | GO
9 | ALTER TABLE [dbo].[SalesDeliveryHeader] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesDeliveryHeader_dbo.PaymentTerm_PaymentTermId]
10 | FOREIGN KEY([PaymentTermId]) REFERENCES [dbo].[PaymentTerm] ([Id])
11 |
12 | GO
13 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_SalesDeliveryLine.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[SalesDeliveryLine] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesDeliveryLine_dbo.Item_ItemId]
2 | FOREIGN KEY([ItemId]) REFERENCES [dbo].[Item] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[SalesDeliveryLine] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesDeliveryLine_dbo.Measurement_MeasurementId]
6 | FOREIGN KEY([MeasurementId]) REFERENCES [dbo].[Measurement] ([Id])
7 |
8 | GO
9 | ALTER TABLE [dbo].[SalesDeliveryLine] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesDeliveryLine_dbo.SalesDeliveryHeader_SalesDeliveryHeaderId]
10 | FOREIGN KEY([SalesDeliveryHeaderId]) REFERENCES [dbo].[SalesDeliveryHeader] ([Id])
11 | ON DELETE CASCADE
12 |
13 | GO
14 | ALTER TABLE [dbo].[SalesDeliveryLine] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesDeliveryLine_dbo.SalesInvoiceLine_SalesInvoiceLineId]
15 | FOREIGN KEY([SalesInvoiceLineId]) REFERENCES [dbo].[SalesInvoiceLine] ([Id])
16 |
17 | GO
18 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_SalesInvoiceHeader.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[SalesInvoiceHeader] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesInvoiceHeader_dbo.Customer_CustomerId]
2 | FOREIGN KEY([CustomerId]) REFERENCES [dbo].[Customer] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[SalesInvoiceHeader] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesInvoiceHeader_dbo.GeneralLedgerHeader_GeneralLedgerHeaderId]
6 | FOREIGN KEY([GeneralLedgerHeaderId]) REFERENCES [dbo].[GeneralLedgerHeader] ([Id])
7 |
8 | GO
9 | ALTER TABLE [dbo].[SalesInvoiceHeader] WITH CHECK ADD CONSTRAINT [FK_SalesInvoiceHeader_PaymentTerm]
10 | FOREIGN KEY([PaymentTermId]) REFERENCES [dbo].[PaymentTerm] ([Id])
11 |
12 | GO
13 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_SalesInvoiceLine.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[SalesInvoiceLine] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesInvoiceLine_dbo.InventoryControlJournal_InventoryControlJournalId]
2 | FOREIGN KEY([InventoryControlJournalId]) REFERENCES [dbo].[InventoryControlJournal] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[SalesInvoiceLine] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesInvoiceLine_dbo.Item_ItemId]
6 | FOREIGN KEY([ItemId]) REFERENCES [dbo].[Item] ([Id])
7 |
8 | GO
9 | ALTER TABLE [dbo].[SalesInvoiceLine] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesInvoiceLine_dbo.Measurement_MeasurementId]
10 | FOREIGN KEY([MeasurementId]) REFERENCES [dbo].[Measurement] ([Id])
11 |
12 | GO
13 | ALTER TABLE [dbo].[SalesInvoiceLine] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesInvoiceLine_dbo.SalesInvoiceHeader_SalesInvoiceHeaderId]
14 | FOREIGN KEY([SalesInvoiceHeaderId]) REFERENCES [dbo].[SalesInvoiceHeader] ([Id])
15 | ON DELETE CASCADE
16 |
17 | GO
18 | ALTER TABLE [dbo].[SalesInvoiceLine] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesInvoiceLine_dbo.SalesOrderLine_SalesOrderLineId]
19 | FOREIGN KEY([SalesOrderLineId]) REFERENCES [dbo].[SalesOrderLine] ([Id])
20 |
21 | GO
22 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_SalesOrderHeader.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[SalesOrderHeader] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesOrderHeader_dbo.Customer_CustomerId]
2 | FOREIGN KEY([CustomerId]) REFERENCES [dbo].[Customer] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[SalesOrderHeader] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesOrderHeader_dbo.PaymentTerm_PaymentTermId]
6 | FOREIGN KEY([PaymentTermId]) REFERENCES [dbo].[PaymentTerm] ([Id])
7 |
8 | GO
9 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_SalesOrderLine.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[SalesOrderLine] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesOrderLine_dbo.Item_ItemId]
2 | FOREIGN KEY([ItemId]) REFERENCES [dbo].[Item] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[SalesOrderLine] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesOrderLine_dbo.Measurement_MeasurementId]
6 | FOREIGN KEY([MeasurementId]) REFERENCES [dbo].[Measurement] ([Id])
7 |
8 | GO
9 | ALTER TABLE [dbo].[SalesOrderLine] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesOrderLine_dbo.SalesOrderHeader_SalesOrderHeaderId]
10 | FOREIGN KEY([SalesOrderHeaderId]) REFERENCES [dbo].[SalesOrderHeader] ([Id])
11 | ON DELETE CASCADE
12 |
13 | GO
14 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_SalesQuoteHeader.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[SalesQuoteHeader] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesQuoteHeader_dbo.Customer_CustomerId]
2 | FOREIGN KEY([CustomerId]) REFERENCES [dbo].[Customer] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[SalesQuoteHeader] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesQuoteHeader_dbo.PaymentTerm_PaymentTermId]
6 | FOREIGN KEY([PaymentTermId]) REFERENCES [dbo].[PaymentTerm] ([Id])
7 |
8 | GO
9 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_SalesQuoteLine.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[SalesQuoteLine] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesQuoteLine_dbo.Item_ItemId]
2 | FOREIGN KEY([ItemId]) REFERENCES [dbo].[Item] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[SalesQuoteLine] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesQuoteLine_dbo.Measurement_MeasurementId]
6 | FOREIGN KEY([MeasurementId]) REFERENCES [dbo].[Measurement] ([Id])
7 | ON DELETE CASCADE
8 |
9 | GO
10 | ALTER TABLE [dbo].[SalesQuoteLine] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesQuoteLine_dbo.SalesQuoteHeader_SalesQuoteHeaderId]
11 | FOREIGN KEY([SalesQuoteHeaderId]) REFERENCES [dbo].[SalesQuoteHeader] ([Id])
12 |
13 | GO
14 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_SalesReceiptHeader.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[SalesReceiptHeader] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesReceiptHeader_dbo.Account_AccountToDebitId]
2 | FOREIGN KEY([AccountToDebitId]) REFERENCES [dbo].[Account] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[SalesReceiptHeader] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesReceiptHeader_dbo.Customer_CustomerId]
6 | FOREIGN KEY([CustomerId]) REFERENCES [dbo].[Customer] ([Id])
7 |
8 | GO
9 | ALTER TABLE [dbo].[SalesReceiptHeader] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesReceiptHeader_dbo.GeneralLedgerHeader_GeneralLedgerHeaderId]
10 | FOREIGN KEY([GeneralLedgerHeaderId]) REFERENCES [dbo].[GeneralLedgerHeader] ([Id])
11 |
12 | GO
13 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_SalesReceiptLine.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[SalesReceiptLine] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesReceiptLine_dbo.Account_AccountToCreditId]
2 | FOREIGN KEY([AccountToCreditId]) REFERENCES [dbo].[Account] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[SalesReceiptLine] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesReceiptLine_dbo.SalesInvoiceLine_SalesInvoiceLineId]
6 | FOREIGN KEY([SalesInvoiceLineId]) REFERENCES [dbo].[SalesInvoiceLine] ([Id])
7 |
8 | GO
9 | ALTER TABLE [dbo].[SalesReceiptLine] WITH CHECK ADD CONSTRAINT [FK_dbo.SalesReceiptLine_dbo.SalesReceiptHeader_SalesReceiptHeaderId]
10 | FOREIGN KEY([SalesReceiptHeaderId]) REFERENCES [dbo].[SalesReceiptHeader] ([Id])
11 | ON DELETE CASCADE
12 |
13 | GO
14 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_SecurityPermission.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[SecurityPermission] WITH CHECK ADD CONSTRAINT [FK_SecurityPermission_SecurityGroup]
2 | FOREIGN KEY([SecurityGroupId]) REFERENCES [dbo].[SecurityGroup] ([Id])
3 |
4 | GO
5 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_SecurityRolePermission.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[SecurityRolePermission] WITH CHECK ADD CONSTRAINT [FK_SecurityRolePermission_SecurityPermission]
2 | FOREIGN KEY([SecurityPermissionId]) REFERENCES [dbo].[SecurityPermission] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[SecurityRolePermission] WITH CHECK ADD CONSTRAINT [FK_SecurityRolePermission_SecurityRole]
6 | FOREIGN KEY([SecurityRoleId]) REFERENCES [dbo].[SecurityRole] ([Id])
7 |
8 | GO
9 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_SecurityUserRole.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[SecurityUserRole] WITH CHECK ADD CONSTRAINT [FK_SecurityUserRole_SecurityRole]
2 | FOREIGN KEY([SecurityRoleId]) REFERENCES [dbo].[SecurityRole] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[SecurityUserRole] WITH CHECK ADD CONSTRAINT [FK_SecurityUserRole_User]
6 | FOREIGN KEY([UserId]) REFERENCES [dbo].[User] ([Id])
7 |
8 | GO
9 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_Tax.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[Tax] WITH CHECK ADD CONSTRAINT [FK_dbo.Tax_dbo.Account_PurchasingAccountId]
2 | FOREIGN KEY([PurchasingAccountId]) REFERENCES [dbo].[Account] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[Tax] WITH CHECK ADD CONSTRAINT [FK_dbo.Tax_dbo.Account_SalesAccountId]
6 | FOREIGN KEY([SalesAccountId]) REFERENCES [dbo].[Account] ([Id])
7 |
8 | GO
9 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_TaxGroupTax.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[TaxGroupTax] WITH CHECK ADD CONSTRAINT [FK_dbo.TaxGroupTax_dbo.TaxGroup_TaxGroupId]
2 | FOREIGN KEY([TaxGroupId]) REFERENCES [dbo].[TaxGroup] ([Id])
3 | ON DELETE CASCADE
4 |
5 | GO
6 | ALTER TABLE [dbo].[TaxGroupTax] WITH CHECK ADD CONSTRAINT [FK_dbo.TaxGroupTax_dbo.Tax_TaxId]
7 | FOREIGN KEY([TaxId]) REFERENCES [dbo].[Tax] ([Id])
8 | ON DELETE CASCADE
9 |
10 | GO
11 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_VendorContact.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[VendorContact] WITH CHECK ADD CONSTRAINT [FK_dbo.VendorContact_dbo.Vendor_Id]
2 | FOREIGN KEY([VendorId]) REFERENCES [dbo].[Account] ([Id])
3 |
4 | GO
5 |
--------------------------------------------------------------------------------
/db/scripts/foreign_keys/2_FK_VendorPayment.sql:
--------------------------------------------------------------------------------
1 | ALTER TABLE [dbo].[VendorPayment] WITH CHECK ADD CONSTRAINT [FK_dbo.VendorPayment_dbo.GeneralLedgerHeader_GeneralLedgerHeaderId]
2 | FOREIGN KEY([GeneralLedgerHeaderId]) REFERENCES [dbo].[GeneralLedgerHeader] ([Id])
3 |
4 | GO
5 | ALTER TABLE [dbo].[VendorPayment] WITH CHECK ADD CONSTRAINT [FK_dbo.VendorPayment_dbo.PurchaseInvoiceHeader_PurchaseInvoiceHeaderId]
6 | FOREIGN KEY([PurchaseInvoiceHeaderId]) REFERENCES [dbo].[PurchaseInvoiceHeader] ([Id])
7 |
8 | GO
9 | ALTER TABLE [dbo].[VendorPayment] WITH CHECK ADD CONSTRAINT [FK_dbo.VendorPayment_dbo.Vendor_VendorId]
10 | FOREIGN KEY([VendorId]) REFERENCES [dbo].[Vendor] ([Id])
11 |
12 | GO
13 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_Account.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[Account] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [CompanyId] [int] NULL,
5 | [AccountClassId] [int] NOT NULL,
6 | [ParentAccountId] [int] NULL,
7 | [DrOrCrSide] [int] NOT NULL,
8 | [AccountCode] [nvarchar](50) NOT NULL,
9 | [AccountName] [nvarchar](200) NOT NULL,
10 | [Description] [nvarchar](200) NULL,
11 | [IsCash] [bit] NOT NULL,
12 | [IsContraAccount] [bit] NOT NULL
13 | DEFAULT ((0)),
14 | [RowVersion] [timestamp] NOT NULL
15 |
16 | ,CONSTRAINT [PK_Account] PRIMARY KEY CLUSTERED ([Id])
17 | ,CONSTRAINT [UQ__Account__38D0C56A397A42BB] UNIQUE NONCLUSTERED ([AccountCode])
18 | )
19 |
20 | CREATE NONCLUSTERED INDEX [IX_AccountClassId] ON [dbo].[Account] ([AccountClassId])
21 | CREATE NONCLUSTERED INDEX [IX_ParentAccountId] ON [dbo].[Account] ([ParentAccountId])
22 |
23 | GO
24 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_AccountClass.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[AccountClass] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [Name] [nvarchar](max) NULL,
5 | [NormalBalance] [nvarchar](max) NULL
6 |
7 | ,CONSTRAINT [PK_dbo.AccountClass] PRIMARY KEY CLUSTERED ([Id])
8 | )
9 |
10 |
11 | GO
12 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_Address.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[Address] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [No] [nvarchar](10) NULL,
5 | [Street] [nvarchar](255) NULL,
6 | [City] [nvarchar](255) NULL
7 |
8 | ,CONSTRAINT [PK_dbo.Address] PRIMARY KEY CLUSTERED ([Id])
9 | )
10 |
11 |
12 | GO
13 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_AspNetRoleClaims.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[AspNetRoleClaims] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [ClaimType] [nvarchar](max) NULL,
5 | [ClaimValue] [nvarchar](max) NULL,
6 | [RoleId] [nvarchar](450) NOT NULL
7 |
8 | ,CONSTRAINT [PK_AspNetRoleClaims] PRIMARY KEY CLUSTERED ([Id])
9 | )
10 |
11 |
12 | GO
13 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_AspNetRoles.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[AspNetRoles] (
2 | [Id] [nvarchar](450) NOT NULL,
3 | [ConcurrencyStamp] [nvarchar](max) NULL,
4 | [Name] [nvarchar](256) NULL,
5 | [NormalizedName] [nvarchar](256) NULL
6 |
7 | ,CONSTRAINT [PK_AspNetRoles] PRIMARY KEY CLUSTERED ([Id])
8 | )
9 |
10 | CREATE UNIQUE NONCLUSTERED INDEX [RoleNameIndex] ON [dbo].[AspNetRoles] ([Name])
11 |
12 | GO
13 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_AspNetUserClaims.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[AspNetUserClaims] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [ClaimType] [nvarchar](max) NULL,
5 | [ClaimValue] [nvarchar](max) NULL,
6 | [UserId] [nvarchar](450) NOT NULL
7 |
8 | ,CONSTRAINT [PK_AspNetUserClaims] PRIMARY KEY CLUSTERED ([Id])
9 | )
10 |
11 |
12 | GO
13 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_AspNetUserLogins.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[AspNetUserLogins] (
2 | [LoginProvider] [nvarchar](450) NOT NULL,
3 | [ProviderKey] [nvarchar](450) NOT NULL,
4 | [ProviderDisplayName] [nvarchar](max) NULL,
5 | [UserId] [nvarchar](450) NOT NULL
6 |
7 | ,CONSTRAINT [PK_AspNetUserLogins] PRIMARY KEY CLUSTERED ([LoginProvider], [ProviderKey])
8 | )
9 |
10 |
11 | GO
12 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_AspNetUserRoles.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[AspNetUserRoles] (
2 | [UserId] [nvarchar](450) NOT NULL,
3 | [RoleId] [nvarchar](450) NOT NULL
4 |
5 | ,CONSTRAINT [PK_AspNetUserRoles] PRIMARY KEY CLUSTERED ([UserId], [RoleId])
6 | )
7 |
8 |
9 | GO
10 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_AspNetUserTokens.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[AspNetUserTokens] (
2 | [UserId] [nvarchar](450) NOT NULL,
3 | [LoginProvider] [nvarchar](450) NOT NULL,
4 | [Name] [nvarchar](450) NOT NULL,
5 | [Value] [nvarchar](max) NULL
6 |
7 | ,CONSTRAINT [PK_AspNetUserTokens] PRIMARY KEY CLUSTERED ([UserId], [LoginProvider], [Name])
8 | )
9 |
10 |
11 | GO
12 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_AspNetUsers.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[AspNetUsers] (
2 | [Id] [nvarchar](450) NOT NULL,
3 | [AccessFailedCount] [int] NOT NULL,
4 | [ConcurrencyStamp] [nvarchar](max) NULL,
5 | [Email] [nvarchar](256) NULL,
6 | [EmailConfirmed] [bit] NOT NULL,
7 | [LockoutEnabled] [bit] NOT NULL,
8 | [LockoutEnd] [datetimeoffset] NULL,
9 | [NormalizedEmail] [nvarchar](256) NULL,
10 | [NormalizedUserName] [nvarchar](256) NULL,
11 | [PasswordHash] [nvarchar](max) NULL,
12 | [PhoneNumber] [nvarchar](max) NULL,
13 | [PhoneNumberConfirmed] [bit] NOT NULL,
14 | [SecurityStamp] [nvarchar](max) NULL,
15 | [TwoFactorEnabled] [bit] NOT NULL,
16 | [UserName] [nvarchar](256) NULL
17 |
18 | ,CONSTRAINT [PK_AspNetUsers] PRIMARY KEY CLUSTERED ([Id])
19 | )
20 |
21 | CREATE UNIQUE NONCLUSTERED INDEX [UserNameIndex] ON [dbo].[AspNetUsers] ([UserName])
22 |
23 | GO
24 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_AuditLog.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[AuditLog] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [Username] [nvarchar](50) NOT NULL,
5 | [AuditEventDateUTC] [datetime2] NOT NULL,
6 | [AuditEventType] [int] NOT NULL,
7 | [TableName] [nvarchar](100) NOT NULL,
8 | [RecordId] [nvarchar](100) NOT NULL,
9 | [FieldName] [nvarchar](100) NOT NULL,
10 | [OriginalValue] [nvarchar](max) NULL,
11 | [NewValue] [nvarchar](max) NULL
12 |
13 | ,CONSTRAINT [PK_AuditLog] PRIMARY KEY CLUSTERED ([Id])
14 | )
15 |
16 |
17 | GO
18 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_AuditableAttribute.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[AuditableAttribute] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [AuditableEntityId] [int] NOT NULL,
5 | [AttributeName] [nvarchar](50) NOT NULL,
6 | [EnableAudit] [bit] NOT NULL
7 | DEFAULT ((1))
8 |
9 | ,CONSTRAINT [PK_AuditableAttribute] PRIMARY KEY CLUSTERED ([Id])
10 | )
11 |
12 |
13 | GO
14 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_AuditableEntity.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[AuditableEntity] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [EntityName] [nvarchar](50) NOT NULL,
5 | [EnableAudit] [bit] NOT NULL
6 | DEFAULT ((1))
7 |
8 | ,CONSTRAINT [PK_AuditableEntity] PRIMARY KEY CLUSTERED ([Id])
9 | )
10 |
11 |
12 | GO
13 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_Bank.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[Bank] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [Type] [int] NOT NULL,
5 | [Name] [nvarchar](max) NULL,
6 | [AccountId] [int] NULL,
7 | [BankName] [nvarchar](max) NULL,
8 | [Number] [nvarchar](max) NULL,
9 | [Address] [nvarchar](max) NULL,
10 | [IsDefault] [bit] NOT NULL,
11 | [IsActive] [bit] NOT NULL
12 |
13 | ,CONSTRAINT [PK_dbo.Bank] PRIMARY KEY CLUSTERED ([Id])
14 | )
15 |
16 | CREATE NONCLUSTERED INDEX [IX_AccountId] ON [dbo].[Bank] ([AccountId])
17 |
18 | GO
19 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_Company.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[Company] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [CompanyCode] [nvarchar](20) NULL,
5 | [Name] [nvarchar](max) NULL,
6 | [ShortName] [nvarchar](max) NULL,
7 | [Logo] [image] NULL
8 |
9 | ,CONSTRAINT [PK_dbo.Company] PRIMARY KEY CLUSTERED ([Id])
10 | )
11 |
12 |
13 | GO
14 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_CompanySetting.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[CompanySetting] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [CompanyId] [int] NOT NULL
5 |
6 | ,CONSTRAINT [PK_dbo.CompanySetting] PRIMARY KEY CLUSTERED ([Id])
7 | )
8 |
9 | CREATE NONCLUSTERED INDEX [IX_CompanyId] ON [dbo].[CompanySetting] ([CompanyId])
10 |
11 | GO
12 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_Contact.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[Contact] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [ContactType] [int] NOT NULL,
5 | [PartyId] [int] NULL,
6 | [FirstName] [nvarchar](max) NULL,
7 | [LastName] [nvarchar](max) NULL,
8 | [MiddleName] [nvarchar](max) NULL
9 |
10 | ,CONSTRAINT [PK_dbo.Contact] PRIMARY KEY CLUSTERED ([Id])
11 | )
12 |
13 | CREATE NONCLUSTERED INDEX [IX_Id] ON [dbo].[Contact] ([Id])
14 |
15 | GO
16 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_CustomerAllocation.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[CustomerAllocation] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [CustomerId] [int] NOT NULL,
5 | [SalesInvoiceHeaderId] [int] NOT NULL,
6 | [SalesReceiptHeaderId] [int] NOT NULL,
7 | [Date] [datetime] NOT NULL,
8 | [Amount] [decimal](18,2) NOT NULL
9 |
10 | ,CONSTRAINT [PK_dbo.CustomerAllocation] PRIMARY KEY CLUSTERED ([Id])
11 | )
12 |
13 | CREATE NONCLUSTERED INDEX [IX_CustomerId] ON [dbo].[CustomerAllocation] ([CustomerId])
14 | CREATE NONCLUSTERED INDEX [IX_SalesInvoiceHeaderId] ON [dbo].[CustomerAllocation] ([SalesInvoiceHeaderId])
15 | CREATE NONCLUSTERED INDEX [IX_SalesReceiptHeaderId] ON [dbo].[CustomerAllocation] ([SalesReceiptHeaderId])
16 |
17 | GO
18 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_CustomerContact.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[CustomerContact] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [ContactId] [int] NULL,
5 | [CustomerId] [int] NULL
6 |
7 | ,CONSTRAINT [PK__Customer__3214EC07671C33E8] PRIMARY KEY CLUSTERED ([Id])
8 | )
9 |
10 |
11 | GO
12 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_FinancialYear.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[FinancialYear] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [FiscalYearCode] [nvarchar](10) NOT NULL,
5 | [FiscalYearName] [nvarchar](100) NOT NULL,
6 | [StartDate] [datetime] NOT NULL,
7 | [EndDate] [datetime] NOT NULL,
8 | [IsActive] [bit] NOT NULL
9 |
10 | ,CONSTRAINT [PK_dbo.FinancialYear] PRIMARY KEY CLUSTERED ([Id])
11 | )
12 |
13 |
14 | GO
15 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_GeneralLedgerHeader.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[GeneralLedgerHeader] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [Date] [datetime] NOT NULL,
5 | [DocumentType] [int] NOT NULL,
6 | [Description] [nvarchar](max) NULL
7 |
8 | ,CONSTRAINT [PK_dbo.GeneralLedgerHeader] PRIMARY KEY CLUSTERED ([Id])
9 | )
10 |
11 |
12 | GO
13 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_GeneralLedgerLine.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[GeneralLedgerLine] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [GeneralLedgerHeaderId] [int] NOT NULL,
5 | [AccountId] [int] NOT NULL,
6 | [DrCr] [int] NOT NULL,
7 | [Amount] [decimal](18,2) NOT NULL
8 |
9 | ,CONSTRAINT [PK_dbo.GeneralLedgerLine] PRIMARY KEY CLUSTERED ([Id])
10 | )
11 |
12 | CREATE NONCLUSTERED INDEX [IX_AccountId] ON [dbo].[GeneralLedgerLine] ([AccountId])
13 | CREATE NONCLUSTERED INDEX [IX_GeneralLedgerHeaderId] ON [dbo].[GeneralLedgerLine] ([GeneralLedgerHeaderId])
14 |
15 | GO
16 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_GeneralLedgerSetting.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[GeneralLedgerSetting] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [CompanyId] [int] NULL,
5 | [PayableAccountId] [int] NULL,
6 | [PurchaseDiscountAccountId] [int] NULL,
7 | [GoodsReceiptNoteClearingAccountId] [int] NULL,
8 | [SalesDiscountAccountId] [int] NULL,
9 | [ShippingChargeAccountId] [int] NULL,
10 | [PermanentAccountId] [int] NULL,
11 | [IncomeSummaryAccountId] [int] NULL
12 |
13 | ,CONSTRAINT [PK_dbo.GeneralLedgerSetting] PRIMARY KEY CLUSTERED ([Id])
14 | )
15 |
16 | CREATE NONCLUSTERED INDEX [IX_CompanyId] ON [dbo].[GeneralLedgerSetting] ([CompanyId])
17 | CREATE NONCLUSTERED INDEX [IX_GoodsReceiptNoteClearingAccountId] ON [dbo].[GeneralLedgerSetting] ([GoodsReceiptNoteClearingAccountId])
18 | CREATE NONCLUSTERED INDEX [IX_PayableAccountId] ON [dbo].[GeneralLedgerSetting] ([PayableAccountId])
19 | CREATE NONCLUSTERED INDEX [IX_PurchaseDiscountAccountId] ON [dbo].[GeneralLedgerSetting] ([PurchaseDiscountAccountId])
20 | CREATE NONCLUSTERED INDEX [IX_SalesDiscountAccountId] ON [dbo].[GeneralLedgerSetting] ([SalesDiscountAccountId])
21 | CREATE NONCLUSTERED INDEX [IX_ShippingChargeAccountId] ON [dbo].[GeneralLedgerSetting] ([ShippingChargeAccountId])
22 |
23 | GO
24 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_InventoryControlJournal.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[InventoryControlJournal] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [ItemId] [int] NOT NULL,
5 | [MeasurementId] [int] NOT NULL,
6 | [DocumentType] [int] NOT NULL,
7 | [INQty] [decimal](18,2) NULL,
8 | [OUTQty] [decimal](18,2) NULL,
9 | [Date] [datetime] NOT NULL,
10 | [TotalCost] [decimal](18,2) NULL,
11 | [TotalAmount] [decimal](18,2) NULL,
12 | [IsReverse] [bit] NOT NULL
13 |
14 | ,CONSTRAINT [PK_dbo.InventoryControlJournal] PRIMARY KEY CLUSTERED ([Id])
15 | )
16 |
17 | CREATE NONCLUSTERED INDEX [IX_ItemId] ON [dbo].[InventoryControlJournal] ([ItemId])
18 | CREATE NONCLUSTERED INDEX [IX_MeasurementId] ON [dbo].[InventoryControlJournal] ([MeasurementId])
19 |
20 | GO
21 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_ItemCategory.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[ItemCategory] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [ItemType] [int] NOT NULL,
5 | [MeasurementId] [int] NULL,
6 | [SalesAccountId] [int] NULL,
7 | [InventoryAccountId] [int] NULL,
8 | [CostOfGoodsSoldAccountId] [int] NULL,
9 | [AdjustmentAccountId] [int] NULL,
10 | [AssemblyAccountId] [int] NULL,
11 | [Name] [nvarchar](max) NULL
12 |
13 | ,CONSTRAINT [PK_dbo.ItemCategory] PRIMARY KEY CLUSTERED ([Id])
14 | )
15 |
16 | CREATE NONCLUSTERED INDEX [IX_AdjustmentAccountId] ON [dbo].[ItemCategory] ([AdjustmentAccountId])
17 | CREATE NONCLUSTERED INDEX [IX_AssemblyAccountId] ON [dbo].[ItemCategory] ([AssemblyAccountId])
18 | CREATE NONCLUSTERED INDEX [IX_CostOfGoodsSoldAccountId] ON [dbo].[ItemCategory] ([CostOfGoodsSoldAccountId])
19 | CREATE NONCLUSTERED INDEX [IX_InventoryAccountId] ON [dbo].[ItemCategory] ([InventoryAccountId])
20 | CREATE NONCLUSTERED INDEX [IX_MeasurementId] ON [dbo].[ItemCategory] ([MeasurementId])
21 | CREATE NONCLUSTERED INDEX [IX_SalesAccountId] ON [dbo].[ItemCategory] ([SalesAccountId])
22 |
23 | GO
24 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_ItemTaxGroup.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[ItemTaxGroup] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [Name] [nvarchar](max) NULL,
5 | [IsFullyExempt] [bit] NOT NULL
6 |
7 | ,CONSTRAINT [PK_dbo.ItemTaxGroup] PRIMARY KEY CLUSTERED ([Id])
8 | )
9 |
10 |
11 | GO
12 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_ItemTaxGroupTax.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[ItemTaxGroupTax] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [TaxId] [int] NOT NULL,
5 | [ItemTaxGroupId] [int] NOT NULL,
6 | [IsExempt] [bit] NOT NULL
7 |
8 | ,CONSTRAINT [PK_dbo.ItemTaxGroupTax] PRIMARY KEY CLUSTERED ([Id])
9 | )
10 |
11 | CREATE NONCLUSTERED INDEX [IX_ItemTaxGroupId] ON [dbo].[ItemTaxGroupTax] ([ItemTaxGroupId])
12 | CREATE NONCLUSTERED INDEX [IX_TaxId] ON [dbo].[ItemTaxGroupTax] ([TaxId])
13 |
14 | GO
15 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_JournalEntryHeader.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[JournalEntryHeader] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [GeneralLedgerHeaderId] [int] NULL,
5 | [PartyId] [int] NULL,
6 | [VoucherType] [int] NULL,
7 | [Date] [datetime] NOT NULL,
8 | [Memo] [nvarchar](max) NULL,
9 | [ReferenceNo] [nvarchar](max) NULL,
10 | [Posted] [bit] NULL
11 |
12 | ,CONSTRAINT [PK_dbo.JournalEntryHeader] PRIMARY KEY CLUSTERED ([Id])
13 | )
14 |
15 | CREATE NONCLUSTERED INDEX [IX_GeneralLedgerHeaderId] ON [dbo].[JournalEntryHeader] ([GeneralLedgerHeaderId])
16 | CREATE NONCLUSTERED INDEX [IX_PartyId] ON [dbo].[JournalEntryHeader] ([PartyId])
17 |
18 | GO
19 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_JournalEntryLine.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[JournalEntryLine] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [JournalEntryHeaderId] [int] NOT NULL,
5 | [AccountId] [int] NOT NULL,
6 | [DrCr] [int] NOT NULL,
7 | [Amount] [decimal](18,2) NOT NULL,
8 | [Memo] [nvarchar](max) NULL
9 |
10 | ,CONSTRAINT [PK_dbo.JournalEntryLine] PRIMARY KEY CLUSTERED ([Id])
11 | )
12 |
13 | CREATE NONCLUSTERED INDEX [IX_AccountId] ON [dbo].[JournalEntryLine] ([AccountId])
14 | CREATE NONCLUSTERED INDEX [IX_JournalEntryHeaderId] ON [dbo].[JournalEntryLine] ([JournalEntryHeaderId])
15 |
16 | GO
17 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_Log.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[Log] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [TimeStamp] [datetime2] NULL,
5 | [Level] [nvarchar](100) NULL,
6 | [Logger] [nvarchar](max) NULL,
7 | [Message] [nvarchar](max) NULL,
8 | [Username] [nvarchar](max) NULL,
9 | [CallSite] [nvarchar](max) NULL,
10 | [Thread] [nvarchar](max) NULL,
11 | [Exception] [nvarchar](max) NULL,
12 | [StackTrace] [nvarchar](max) NULL
13 |
14 | ,CONSTRAINT [PK_Log] PRIMARY KEY CLUSTERED ([Id])
15 | )
16 |
17 |
18 | GO
19 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_MainContraAccount.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[MainContraAccount] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [MainAccountId] [int] NOT NULL,
5 | [RelatedContraAccountId] [int] NOT NULL
6 |
7 | ,CONSTRAINT [PK__MainCont__3214EC078F29005D] PRIMARY KEY CLUSTERED ([Id])
8 | )
9 |
10 |
11 | GO
12 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_Measurement.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[Measurement] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [Code] [nvarchar](max) NULL,
5 | [Description] [nvarchar](max) NULL
6 |
7 | ,CONSTRAINT [PK_dbo.Measurement] PRIMARY KEY CLUSTERED ([Id])
8 | )
9 |
10 |
11 | GO
12 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_Party.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[Party] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [PartyType] [int] NOT NULL,
5 | [Name] [nvarchar](max) NULL,
6 | [Email] [nvarchar](max) NULL,
7 | [Website] [nvarchar](max) NULL,
8 | [Phone] [nvarchar](max) NULL,
9 | [Fax] [nvarchar](max) NULL,
10 | [IsActive] [bit] NOT NULL
11 |
12 | ,CONSTRAINT [PK_dbo.Party] PRIMARY KEY CLUSTERED ([Id])
13 | )
14 |
15 |
16 | GO
17 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_PaymentTerm.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[PaymentTerm] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [Description] [nvarchar](max) NULL,
5 | [PaymentType] [int] NOT NULL,
6 | [DueAfterDays] [int] NULL,
7 | [IsActive] [bit] NOT NULL
8 |
9 | ,CONSTRAINT [PK_dbo.PaymentTerm] PRIMARY KEY CLUSTERED ([Id])
10 | )
11 |
12 |
13 | GO
14 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_PurchaseInvoiceHeader.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[PurchaseInvoiceHeader] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [VendorId] [int] NULL,
5 | [GeneralLedgerHeaderId] [int] NULL,
6 | [Date] [datetime] NOT NULL,
7 | [No] [nvarchar](max) NULL,
8 | [VendorInvoiceNo] [nvarchar](max) NOT NULL,
9 | [Description] [nvarchar](max) NULL,
10 | [PaymentTermId] [int] NULL,
11 | [ReferenceNo] [nvarchar](max) NULL,
12 | [Status] [int] NULL
13 |
14 | ,CONSTRAINT [PK_dbo.PurchaseInvoiceHeader] PRIMARY KEY CLUSTERED ([Id])
15 | )
16 |
17 | CREATE NONCLUSTERED INDEX [IX_GeneralLedgerHeaderId] ON [dbo].[PurchaseInvoiceHeader] ([GeneralLedgerHeaderId])
18 | CREATE NONCLUSTERED INDEX [IX_VendorId] ON [dbo].[PurchaseInvoiceHeader] ([VendorId])
19 |
20 | GO
21 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_PurchaseInvoiceLine.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[PurchaseInvoiceLine] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [PurchaseInvoiceHeaderId] [int] NOT NULL,
5 | [ItemId] [int] NOT NULL,
6 | [MeasurementId] [int] NOT NULL,
7 | [InventoryControlJournalId] [int] NULL,
8 | [Quantity] [decimal](18,2) NOT NULL,
9 | [ReceivedQuantity] [decimal](18,2) NULL,
10 | [Cost] [decimal](18,2) NULL,
11 | [Discount] [decimal](18,2) NULL,
12 | [Amount] [decimal](18,2) NOT NULL,
13 | [PurchaseOrderLineId] [int] NULL
14 |
15 | ,CONSTRAINT [PK_dbo.PurchaseInvoiceLine] PRIMARY KEY CLUSTERED ([Id])
16 | )
17 |
18 | CREATE NONCLUSTERED INDEX [IX_InventoryControlJournalId] ON [dbo].[PurchaseInvoiceLine] ([InventoryControlJournalId])
19 | CREATE NONCLUSTERED INDEX [IX_ItemId] ON [dbo].[PurchaseInvoiceLine] ([ItemId])
20 | CREATE NONCLUSTERED INDEX [IX_MeasurementId] ON [dbo].[PurchaseInvoiceLine] ([MeasurementId])
21 | CREATE NONCLUSTERED INDEX [IX_PurchaseInvoiceHeaderId] ON [dbo].[PurchaseInvoiceLine] ([PurchaseInvoiceHeaderId])
22 |
23 | GO
24 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_PurchaseOrderHeader.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[PurchaseOrderHeader] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [VendorId] [int] NOT NULL,
5 | [No] [nvarchar](max) NULL,
6 | [Date] [datetime] NOT NULL,
7 | [Description] [nvarchar](max) NULL,
8 | [PurchaseInvoiceHeaderId] [int] NULL,
9 | [PaymentTermId] [int] NULL,
10 | [ReferenceNo] [nvarchar](max) NULL,
11 | [Status] [int] NULL
12 |
13 | ,CONSTRAINT [PK_dbo.PurchaseOrderHeader] PRIMARY KEY CLUSTERED ([Id])
14 | )
15 |
16 |
17 | GO
18 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_PurchaseOrderLine.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[PurchaseOrderLine] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [PurchaseOrderHeaderId] [int] NOT NULL,
5 | [ItemId] [int] NOT NULL,
6 | [MeasurementId] [int] NOT NULL,
7 | [Quantity] [decimal](18,2) NOT NULL,
8 | [Cost] [decimal](18,2) NOT NULL,
9 | [Discount] [decimal](18,2) NOT NULL,
10 | [Amount] [decimal](18,2) NOT NULL
11 |
12 | ,CONSTRAINT [PK_dbo.PurchaseOrderLine] PRIMARY KEY CLUSTERED ([Id])
13 | )
14 |
15 | CREATE NONCLUSTERED INDEX [IX_ItemId] ON [dbo].[PurchaseOrderLine] ([ItemId])
16 | CREATE NONCLUSTERED INDEX [IX_MeasurementId] ON [dbo].[PurchaseOrderLine] ([MeasurementId])
17 | CREATE NONCLUSTERED INDEX [IX_PurchaseOrderHeaderId] ON [dbo].[PurchaseOrderLine] ([PurchaseOrderHeaderId])
18 |
19 | GO
20 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_PurchaseReceiptHeader.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[PurchaseReceiptHeader] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [VendorId] [int] NOT NULL,
5 | [GeneralLedgerHeaderId] [int] NULL,
6 | [Date] [datetime] NOT NULL,
7 | [No] [nvarchar](max) NULL,
8 | [Status] [int] NULL
9 |
10 | ,CONSTRAINT [PK_dbo.PurchaseReceiptHeader] PRIMARY KEY CLUSTERED ([Id])
11 | )
12 |
13 | CREATE NONCLUSTERED INDEX [IX_GeneralLedgerHeaderId] ON [dbo].[PurchaseReceiptHeader] ([GeneralLedgerHeaderId])
14 | CREATE NONCLUSTERED INDEX [IX_VendorId] ON [dbo].[PurchaseReceiptHeader] ([VendorId])
15 |
16 | GO
17 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_PurchaseReceiptLine.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[PurchaseReceiptLine] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [PurchaseReceiptHeaderId] [int] NOT NULL,
5 | [ItemId] [int] NOT NULL,
6 | [InventoryControlJournalId] [int] NULL,
7 | [PurchaseInvoiceLineId] [int] NULL,
8 | [MeasurementId] [int] NOT NULL,
9 | [Quantity] [decimal](18,2) NOT NULL,
10 | [ReceivedQuantity] [decimal](18,2) NOT NULL,
11 | [Cost] [decimal](18,2) NOT NULL,
12 | [Discount] [decimal](18,2) NOT NULL,
13 | [Amount] [decimal](18,2) NOT NULL
14 |
15 | ,CONSTRAINT [PK_dbo.PurchaseReceiptLine] PRIMARY KEY CLUSTERED ([Id])
16 | )
17 |
18 | CREATE NONCLUSTERED INDEX [IX_InventoryControlJournalId] ON [dbo].[PurchaseReceiptLine] ([InventoryControlJournalId])
19 | CREATE NONCLUSTERED INDEX [IX_ItemId] ON [dbo].[PurchaseReceiptLine] ([ItemId])
20 | CREATE NONCLUSTERED INDEX [IX_MeasurementId] ON [dbo].[PurchaseReceiptLine] ([MeasurementId])
21 | CREATE NONCLUSTERED INDEX [IX_PurchaseOrderLineId] ON [dbo].[PurchaseReceiptLine] ([PurchaseInvoiceLineId])
22 | CREATE NONCLUSTERED INDEX [IX_PurchaseReceiptHeaderId] ON [dbo].[PurchaseReceiptLine] ([PurchaseReceiptHeaderId])
23 |
24 | GO
25 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_SalesDeliveryHeader.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[SalesDeliveryHeader] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [PaymentTermId] [int] NULL,
5 | [CustomerId] [int] NULL,
6 | [GeneralLedgerHeaderId] [int] NULL,
7 | [No] [nvarchar](max) NULL,
8 | [Date] [datetime] NOT NULL,
9 | [Status] [int] NULL
10 |
11 | ,CONSTRAINT [PK_dbo.SalesDeliveryHeader] PRIMARY KEY CLUSTERED ([Id])
12 | )
13 |
14 | CREATE NONCLUSTERED INDEX [IX_CustomerId] ON [dbo].[SalesDeliveryHeader] ([CustomerId])
15 | CREATE NONCLUSTERED INDEX [IX_GeneralLedgerHeaderId] ON [dbo].[SalesDeliveryHeader] ([GeneralLedgerHeaderId])
16 | CREATE NONCLUSTERED INDEX [IX_PaymentTermId] ON [dbo].[SalesDeliveryHeader] ([PaymentTermId])
17 |
18 | GO
19 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_SalesDeliveryLine.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[SalesDeliveryLine] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [SalesDeliveryHeaderId] [int] NOT NULL,
5 | [ItemId] [int] NULL,
6 | [MeasurementId] [int] NULL,
7 | [Quantity] [decimal](18,2) NOT NULL,
8 | [Price] [decimal](18,2) NOT NULL,
9 | [Discount] [decimal](18,2) NOT NULL,
10 | [SalesInvoiceLineId] [int] NULL
11 |
12 | ,CONSTRAINT [PK_dbo.SalesDeliveryLine] PRIMARY KEY CLUSTERED ([Id])
13 | )
14 |
15 | CREATE NONCLUSTERED INDEX [IX_ItemId] ON [dbo].[SalesDeliveryLine] ([ItemId])
16 | CREATE NONCLUSTERED INDEX [IX_MeasurementId] ON [dbo].[SalesDeliveryLine] ([MeasurementId])
17 | CREATE NONCLUSTERED INDEX [IX_SalesDeliveryHeaderId] ON [dbo].[SalesDeliveryLine] ([SalesDeliveryHeaderId])
18 |
19 | GO
20 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_SalesInvoiceHeader.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[SalesInvoiceHeader] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [CustomerId] [int] NOT NULL,
5 | [GeneralLedgerHeaderId] [int] NULL,
6 | [No] [nvarchar](max) NULL,
7 | [Date] [datetime] NOT NULL,
8 | [ShippingHandlingCharge] [decimal](18,2) NOT NULL,
9 | [Status] [int] NULL,
10 | [PaymentTermId] [int] NULL,
11 | [ReferenceNo] [nvarchar](max) NULL
12 |
13 | ,CONSTRAINT [PK_dbo.SalesInvoiceHeader] PRIMARY KEY CLUSTERED ([Id])
14 | )
15 |
16 | CREATE NONCLUSTERED INDEX [IX_CustomerId] ON [dbo].[SalesInvoiceHeader] ([CustomerId])
17 | CREATE NONCLUSTERED INDEX [IX_GeneralLedgerHeaderId] ON [dbo].[SalesInvoiceHeader] ([GeneralLedgerHeaderId])
18 |
19 | GO
20 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_SalesInvoiceLine.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[SalesInvoiceLine] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [SalesInvoiceHeaderId] [int] NOT NULL,
5 | [ItemId] [int] NOT NULL,
6 | [MeasurementId] [int] NOT NULL,
7 | [InventoryControlJournalId] [int] NULL,
8 | [Quantity] [decimal](18,2) NOT NULL,
9 | [Discount] [decimal](18,2) NOT NULL,
10 | [Amount] [decimal](18,2) NOT NULL,
11 | [SalesOrderLineId] [int] NULL
12 |
13 | ,CONSTRAINT [PK_dbo.SalesInvoiceLine] PRIMARY KEY CLUSTERED ([Id])
14 | )
15 |
16 | CREATE NONCLUSTERED INDEX [IX_InventoryControlJournalId] ON [dbo].[SalesInvoiceLine] ([InventoryControlJournalId])
17 | CREATE NONCLUSTERED INDEX [IX_ItemId] ON [dbo].[SalesInvoiceLine] ([ItemId])
18 | CREATE NONCLUSTERED INDEX [IX_MeasurementId] ON [dbo].[SalesInvoiceLine] ([MeasurementId])
19 | CREATE NONCLUSTERED INDEX [IX_SalesInvoiceHeaderId] ON [dbo].[SalesInvoiceLine] ([SalesInvoiceHeaderId])
20 |
21 | GO
22 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_SalesOrderHeader.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[SalesOrderHeader] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [CustomerId] [int] NULL,
5 | [PaymentTermId] [int] NULL,
6 | [No] [nvarchar](max) NULL,
7 | [ReferenceNo] [nvarchar](max) NULL,
8 | [Date] [datetime] NOT NULL,
9 | [Status] [int] NULL
10 |
11 | ,CONSTRAINT [PK_dbo.SalesOrderHeader] PRIMARY KEY CLUSTERED ([Id])
12 | )
13 |
14 | CREATE NONCLUSTERED INDEX [IX_CustomerId] ON [dbo].[SalesOrderHeader] ([CustomerId])
15 | CREATE NONCLUSTERED INDEX [IX_PaymentTermId] ON [dbo].[SalesOrderHeader] ([PaymentTermId])
16 |
17 | GO
18 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_SalesOrderLine.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[SalesOrderLine] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [SalesOrderHeaderId] [int] NOT NULL,
5 | [ItemId] [int] NOT NULL,
6 | [MeasurementId] [int] NOT NULL,
7 | [Quantity] [decimal](18,2) NOT NULL,
8 | [Discount] [decimal](18,2) NOT NULL,
9 | [Amount] [decimal](18,2) NOT NULL
10 |
11 | ,CONSTRAINT [PK_dbo.SalesOrderLine] PRIMARY KEY CLUSTERED ([Id])
12 | )
13 |
14 | CREATE NONCLUSTERED INDEX [IX_ItemId] ON [dbo].[SalesOrderLine] ([ItemId])
15 | CREATE NONCLUSTERED INDEX [IX_MeasurementId] ON [dbo].[SalesOrderLine] ([MeasurementId])
16 | CREATE NONCLUSTERED INDEX [IX_SalesOrderHeaderId] ON [dbo].[SalesOrderLine] ([SalesOrderHeaderId])
17 |
18 | GO
19 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_SalesQuoteHeader.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[SalesQuoteHeader] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [CustomerId] [int] NOT NULL,
5 | [Date] [datetime] NOT NULL,
6 | [PaymentTermId] [int] NULL,
7 | [ReferenceNo] [nvarchar](max) NULL,
8 | [No] [nvarchar](max) NULL,
9 | [Status] [int] NULL
10 |
11 | ,CONSTRAINT [PK_dbo.SalesQuoteHeader] PRIMARY KEY CLUSTERED ([Id])
12 | )
13 |
14 | CREATE NONCLUSTERED INDEX [IX_CustomerId] ON [dbo].[SalesQuoteHeader] ([CustomerId])
15 |
16 | GO
17 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_SalesQuoteLine.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[SalesQuoteLine] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [SalesQuoteHeaderId] [int] NOT NULL,
5 | [ItemId] [int] NOT NULL,
6 | [MeasurementId] [int] NOT NULL,
7 | [Quantity] [decimal](18,2) NOT NULL,
8 | [Discount] [decimal](18,2) NOT NULL,
9 | [Amount] [decimal](18,2) NOT NULL
10 |
11 | ,CONSTRAINT [PK_dbo.SalesQuoteLine] PRIMARY KEY CLUSTERED ([Id])
12 | )
13 |
14 | CREATE NONCLUSTERED INDEX [IX_SalesQuoteHeaderId] ON [dbo].[SalesQuoteLine] ([SalesQuoteHeaderId])
15 |
16 | GO
17 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_SalesReceiptHeader.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[SalesReceiptHeader] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [CustomerId] [int] NOT NULL,
5 | [GeneralLedgerHeaderId] [int] NULL,
6 | [AccountToDebitId] [int] NULL,
7 | [No] [nvarchar](max) NULL,
8 | [Date] [datetime] NOT NULL,
9 | [Amount] [decimal](18,2) NOT NULL,
10 | [Status] [int] NULL
11 |
12 | ,CONSTRAINT [PK_dbo.SalesReceiptHeader] PRIMARY KEY CLUSTERED ([Id])
13 | )
14 |
15 | CREATE NONCLUSTERED INDEX [IX_AccountToDebitId] ON [dbo].[SalesReceiptHeader] ([AccountToDebitId])
16 | CREATE NONCLUSTERED INDEX [IX_CustomerId] ON [dbo].[SalesReceiptHeader] ([CustomerId])
17 | CREATE NONCLUSTERED INDEX [IX_GeneralLedgerHeaderId] ON [dbo].[SalesReceiptHeader] ([GeneralLedgerHeaderId])
18 |
19 | GO
20 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_SalesReceiptLine.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[SalesReceiptLine] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [SalesReceiptHeaderId] [int] NOT NULL,
5 | [SalesInvoiceLineId] [int] NULL,
6 | [ItemId] [int] NULL,
7 | [AccountToCreditId] [int] NULL,
8 | [MeasurementId] [int] NULL,
9 | [Quantity] [decimal](18,2) NULL,
10 | [Discount] [decimal](18,2) NULL,
11 | [Amount] [decimal](18,2) NULL,
12 | [AmountPaid] [decimal](18,2) NOT NULL
13 |
14 | ,CONSTRAINT [PK_dbo.SalesReceiptLine] PRIMARY KEY CLUSTERED ([Id])
15 | )
16 |
17 | CREATE NONCLUSTERED INDEX [IX_AccountToCreditId] ON [dbo].[SalesReceiptLine] ([AccountToCreditId])
18 | CREATE NONCLUSTERED INDEX [IX_SalesInvoiceLineId] ON [dbo].[SalesReceiptLine] ([SalesInvoiceLineId])
19 | CREATE NONCLUSTERED INDEX [IX_SalesReceiptHeaderId] ON [dbo].[SalesReceiptLine] ([SalesReceiptHeaderId])
20 |
21 | GO
22 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_SecurityGroup.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[SecurityGroup] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [Name] [nvarchar](50) NOT NULL,
5 | [DisplayName] [nvarchar](50) NULL
6 |
7 | ,CONSTRAINT [PK_SecurityGroup] PRIMARY KEY CLUSTERED ([Id])
8 | )
9 |
10 |
11 | GO
12 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_SecurityPermission.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[SecurityPermission] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [Name] [nvarchar](100) NULL,
5 | [DisplayName] [nvarchar](100) NULL,
6 | [SecurityGroupId] [int] NULL
7 |
8 | ,CONSTRAINT [PK_SecurityPermission] PRIMARY KEY CLUSTERED ([Id])
9 | )
10 |
11 |
12 | GO
13 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_SecurityRole.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[SecurityRole] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [Name] [nvarchar](50) NOT NULL,
5 | [DisplayName] [nvarchar](50) NULL,
6 | [SysAdmin] [bit] NOT NULL
7 | DEFAULT ((0)),
8 | [System] [bit] NOT NULL
9 | DEFAULT ((0))
10 |
11 | ,CONSTRAINT [PK_SecurityRole] PRIMARY KEY CLUSTERED ([Id])
12 | )
13 |
14 |
15 | GO
16 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_SecurityRolePermission.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[SecurityRolePermission] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [SecurityRoleId] [int] NULL,
5 | [SecurityPermissionId] [int] NULL
6 |
7 | ,CONSTRAINT [PK_SecurityRolePermission] PRIMARY KEY CLUSTERED ([Id])
8 | )
9 |
10 |
11 | GO
12 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_SecurityUserRole.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[SecurityUserRole] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [SecurityRoleId] [int] NULL,
5 | [UserId] [int] NULL
6 |
7 | ,CONSTRAINT [PK_SecurityUserRole] PRIMARY KEY CLUSTERED ([Id])
8 | )
9 |
10 |
11 | GO
12 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_SequenceNumber.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[SequenceNumber] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [SequenceNumberType] [int] NOT NULL,
5 | [Description] [nvarchar](max) NULL,
6 | [Prefix] [nvarchar](max) NULL,
7 | [NextNumber] [int] NOT NULL,
8 | [UsePrefix] [bit] NOT NULL
9 |
10 | ,CONSTRAINT [PK_dbo.SequenceNumber] PRIMARY KEY CLUSTERED ([Id])
11 | )
12 |
13 |
14 | GO
15 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_Tax.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[Tax] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [SalesAccountId] [int] NULL,
5 | [PurchasingAccountId] [int] NULL,
6 | [TaxName] [nvarchar](50) NOT NULL,
7 | [TaxCode] [nvarchar](16) NOT NULL,
8 | [Rate] [decimal](18,2) NOT NULL,
9 | [IsActive] [bit] NOT NULL
10 |
11 | ,CONSTRAINT [PK_dbo.Tax] PRIMARY KEY CLUSTERED ([Id])
12 | )
13 |
14 | CREATE NONCLUSTERED INDEX [IX_PurchasingAccountId] ON [dbo].[Tax] ([PurchasingAccountId])
15 | CREATE NONCLUSTERED INDEX [IX_SalesAccountId] ON [dbo].[Tax] ([SalesAccountId])
16 |
17 | GO
18 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_TaxGroup.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[TaxGroup] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [Description] [nvarchar](max) NULL,
5 | [TaxAppliedToShipping] [bit] NOT NULL,
6 | [IsActive] [bit] NOT NULL
7 |
8 | ,CONSTRAINT [PK_dbo.TaxGroup] PRIMARY KEY CLUSTERED ([Id])
9 | )
10 |
11 |
12 | GO
13 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_TaxGroupTax.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[TaxGroupTax] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [TaxId] [int] NOT NULL,
5 | [TaxGroupId] [int] NOT NULL
6 |
7 | ,CONSTRAINT [PK_dbo.TaxGroupTax] PRIMARY KEY CLUSTERED ([Id])
8 | )
9 |
10 | CREATE NONCLUSTERED INDEX [IX_TaxGroupId] ON [dbo].[TaxGroupTax] ([TaxGroupId])
11 | CREATE NONCLUSTERED INDEX [IX_TaxId] ON [dbo].[TaxGroupTax] ([TaxId])
12 |
13 | GO
14 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_User.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[User] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [Lastname] [nvarchar](50) NULL,
5 | [Firstname] [nvarchar](50) NULL,
6 | [UserName] [nvarchar](50) NULL,
7 | [EmailAddress] [nvarchar](50) NULL
8 | DEFAULT ((0))
9 |
10 | ,CONSTRAINT [PK_User] PRIMARY KEY CLUSTERED ([Id])
11 | )
12 |
13 |
14 | GO
15 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_Vendor.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[Vendor] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [PartyId] [int] NULL,
5 | [No] [nvarchar](max) NULL,
6 | [AccountsPayableAccountId] [int] NULL,
7 | [PurchaseAccountId] [int] NULL,
8 | [PurchaseDiscountAccountId] [int] NULL,
9 | [PrimaryContactId] [int] NULL,
10 | [PaymentTermId] [int] NULL,
11 | [TaxGroupId] [int] NULL
12 |
13 | ,CONSTRAINT [PK_dbo.Vendor] PRIMARY KEY CLUSTERED ([Id])
14 | )
15 |
16 | CREATE NONCLUSTERED INDEX [IX_AccountsPayableAccountId] ON [dbo].[Vendor] ([AccountsPayableAccountId])
17 | CREATE NONCLUSTERED INDEX [IX_Id] ON [dbo].[Vendor] ([Id])
18 | CREATE NONCLUSTERED INDEX [IX_PaymentTermId] ON [dbo].[Vendor] ([PaymentTermId])
19 | CREATE NONCLUSTERED INDEX [IX_PrimaryContactId] ON [dbo].[Vendor] ([PrimaryContactId])
20 | CREATE NONCLUSTERED INDEX [IX_PurchaseAccountId] ON [dbo].[Vendor] ([PurchaseAccountId])
21 | CREATE NONCLUSTERED INDEX [IX_PurchaseDiscountAccountId] ON [dbo].[Vendor] ([PurchaseDiscountAccountId])
22 |
23 | GO
24 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_VendorContact.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[VendorContact] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [ContactId] [int] NULL,
5 | [VendorId] [int] NULL
6 |
7 | ,CONSTRAINT [PK__VendorCo__3214EC0788E4511D] PRIMARY KEY CLUSTERED ([Id])
8 | )
9 |
10 |
11 | GO
12 |
--------------------------------------------------------------------------------
/db/scripts/tables/1_VendorPayment.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE [dbo].[VendorPayment] (
2 | [Id] [int] NOT NULL
3 | IDENTITY (1,1),
4 | [VendorId] [int] NOT NULL,
5 | [PurchaseInvoiceHeaderId] [int] NULL,
6 | [GeneralLedgerHeaderId] [int] NULL,
7 | [No] [nvarchar](max) NULL,
8 | [Date] [datetime] NOT NULL,
9 | [Amount] [decimal](18,2) NOT NULL
10 |
11 | ,CONSTRAINT [PK_dbo.VendorPayment] PRIMARY KEY CLUSTERED ([Id])
12 | )
13 |
14 | CREATE NONCLUSTERED INDEX [IX_GeneralLedgerHeaderId] ON [dbo].[VendorPayment] ([GeneralLedgerHeaderId])
15 | CREATE NONCLUSTERED INDEX [IX_PurchaseInvoiceHeaderId] ON [dbo].[VendorPayment] ([PurchaseInvoiceHeaderId])
16 | CREATE NONCLUSTERED INDEX [IX_VendorId] ON [dbo].[VendorPayment] ([VendorId])
17 |
18 | GO
19 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: "3"
2 | services:
3 | api:
4 | image: accountgo/accountgoapi
5 | build:
6 | dockerfile: ./src/Api/Dockerfile
7 | context: .
8 | ports:
9 | - "8001:8001"
10 | environment:
11 | - ASPNETCORE_URLS=http://+:8001
12 | web:
13 | image: accountgo/accountgoweb
14 | build:
15 | dockerfile: ./src/AccountGoWeb/Dockerfile
16 | context: .
17 | ports:
18 | - "8000:8000"
19 | environment:
20 | - ASPNETCORE_URLS=http://+:8000
21 | - APIHOST=api
22 |
--------------------------------------------------------------------------------
/docs/GoodDeedBooks.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AccountGo/accountgo/4d97beda9473fc9b6a4a3ea0a8b1a8579bfc93f0/docs/GoodDeedBooks.docx
--------------------------------------------------------------------------------
/docs/azure.txt:
--------------------------------------------------------------------------------
1 | API:
2 | https://goodbooksapi.azurewebsites.net
3 |
4 | MVC:
5 | https://good-books.azurewebsites.net
6 |
7 | React:
8 | https://mango-glacier-0edfec41e.5.azurestaticapps.net
9 |
--------------------------------------------------------------------------------
/docs/expand-chart-of-accounts.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AccountGo/accountgo/4d97beda9473fc9b6a4a3ea0a8b1a8579bfc93f0/docs/expand-chart-of-accounts.docx
--------------------------------------------------------------------------------
/docs/open-source.txt:
--------------------------------------------------------------------------------
1 | Open Source Accounting System
2 |
3 | https://github.com/AccountGo/accountgo
4 |
--------------------------------------------------------------------------------
/docs/react.txt:
--------------------------------------------------------------------------------
1 | https://www.youtube.com/watch?v=ElgfQdq-Htk
2 |
3 | https://www.youtube.com/watch?v=oN9W0Tkn8hg
4 |
5 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "label": "build",
6 | "command": "dotnet",
7 | "type": "process",
8 | "args": [
9 | "build",
10 | "${workspaceFolder}/AccountGoWeb.csproj"
11 | ],
12 | "problemMatcher": "$msCompile"
13 | }
14 | ]
15 | }
--------------------------------------------------------------------------------
/src/AccountGoWeb/AccountGoWeb.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.5.002.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AccountGoWeb", "AccountGoWeb.csproj", "{4C091631-8C3D-4598-81DD-9FCEC8D73932}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {4C091631-8C3D-4598-81DD-9FCEC8D73932}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {4C091631-8C3D-4598-81DD-9FCEC8D73932}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {4C091631-8C3D-4598-81DD-9FCEC8D73932}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {4C091631-8C3D-4598-81DD-9FCEC8D73932}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {C712AB6F-6F2F-45E4-B7A9-C75F41A4755A}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Components/App.razor:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Components/Pages/Counter.razor:
--------------------------------------------------------------------------------
1 | @page "/counter"
2 | @rendermode InteractiveServer
3 |
4 | Counter
5 |
6 | Counter
7 |
8 | Current count: @currentCount
9 |
10 |
11 |
12 | @code {
13 | private int currentCount = 0;
14 |
15 | private void IncrementCount()
16 | {
17 | currentCount++;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Components/Pages/Students.razor:
--------------------------------------------------------------------------------
1 | @page "/students"
2 | @rendermode InteractiveServer
3 | Students
4 | Students
5 |
6 |
7 |
8 |
9 |
10 | @context.FirstName @context.LastName
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | @code {
19 | IQueryable students = Student.GetStudents();
20 | PaginationState pagination = new PaginationState { ItemsPerPage = 10 };
21 | GridSort sortByName = GridSort
22 | .ByAscending(_ => _.FirstName).ThenAscending(_ => _.LastName);
23 | }
--------------------------------------------------------------------------------
/src/AccountGoWeb/Components/Routes.razor:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Components/_Imports.razor:
--------------------------------------------------------------------------------
1 | @using System.Net.Http
2 | @using System.Net.Http.Json
3 | @using Microsoft.AspNetCore.Components.Forms
4 | @using Microsoft.AspNetCore.Components.Routing
5 | @using Microsoft.AspNetCore.Components.Web
6 | @using static Microsoft.AspNetCore.Components.Web.RenderMode
7 | @using Microsoft.AspNetCore.Components.Web.Virtualization
8 | @using Microsoft.JSInterop
9 | @using Microsoft.AspNetCore.Components.QuickGrid
10 | @using AccountGoWeb
11 | @using AccountGoWeb.Components
12 | @using AccountGoWeb.Models
13 | @using AccountGoWeb.Models.Account
14 | @using AccountGoWeb.Models.Bogus
15 | @using AccountGoWeb.Models.Financial
16 | @using AccountGoWeb.Models.Purchasing
17 | @using AccountGoWeb.Models.Sales
18 | @using AccountGoWeb.Models.TaxSystem
19 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Controllers/DashboardController.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc;
2 |
3 | namespace AccountGoWeb.Controllers
4 | {
5 | //[Microsoft.AspNetCore.Authorization.Authorize]
6 | public class DashboardController : BaseController
7 | {
8 | public DashboardController(IConfiguration config)
9 | {
10 | _baseConfig = config;
11 | Models.SelectListItemHelper._config = config;
12 | }
13 | // GET: //
14 | public IActionResult Index()
15 | {
16 | return View();
17 | }
18 |
19 | public IActionResult MonthlySales()
20 | {
21 | ViewBag.ApiMontlySales = _baseConfig!["ApiUrl"] + "sales/getmonthlysales";
22 | return View();
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Controllers/HomeController.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc;
2 |
3 | namespace AccountGoWeb.Controllers
4 | {
5 | //[Microsoft.AspNetCore.Authorization.Authorize]
6 | public class HomeController : BaseController
7 | {
8 | public HomeController(IConfiguration config)
9 | {
10 | _baseConfig = config;
11 | Models.SelectListItemHelper._config = config;
12 | }
13 | public IActionResult Index()
14 | {
15 | ViewBag.PageContentHeader = "Dashboard";
16 | ViewBag.ApiMontlySales = _baseConfig!["ApiUrl"] + "sales/getmonthlysales";
17 | return View();
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Models/Account/LoginViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace AccountGoWeb.Models.Account;
4 |
5 | public class LoginViewModel
6 | {
7 | [Required]
8 | [EmailAddress]
9 | public string? Email { get; set; }
10 |
11 | [Required]
12 | [DataType(DataType.Password)]
13 | public string? Password { get; set; }
14 |
15 | [Display(Name = "Remember me?")]
16 | public bool RememberMe { get; set; }
17 | }
18 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Models/Account/RegisterViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace AccountGoWeb.Models.Account;
4 |
5 | public class RegisterViewModel
6 | {
7 | [Required]
8 | [EmailAddress]
9 | [Display(Name = "Email")]
10 | public string? Email { get; set; }
11 |
12 | [Required]
13 | [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
14 | [DataType(DataType.Password)]
15 | [Display(Name = "Password")]
16 | public string? Password { get; set; }
17 |
18 | [DataType(DataType.Password)]
19 | [Display(Name = "Confirm password")]
20 | [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
21 | public string? ConfirmPassword { get; set; }
22 |
23 | [Display(Name = "First Name")]
24 | public string? FirstName { get; set; }
25 |
26 | [Display(Name = "Last Name")]
27 | public string? LastName { get; set; }
28 | }
29 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Models/Financial/GeneralLedgerSetting.cs:
--------------------------------------------------------------------------------
1 | namespace AccountGoWeb.Models.Financial;
2 |
3 | public class GeneralLedgerSetting
4 | {
5 | public int Id { get; set; }
6 | public int? CompanyId { get; set; }
7 | public string? CompanyCode { get; set; }
8 | public int? PayableAccountId { get; set; }
9 | public int? PurchaseDiscountAccountId { get; set; }
10 | public int? GoodsReceiptNoteClearingAccountId { get; set; }
11 | public int? SalesDiscountAccountId { get; set; }
12 | public int? ShippingChargeAccountId { get; set; }
13 | }
14 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Models/ObjectExtensions.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 |
3 | namespace AccountGoWeb.Models;
4 |
5 | public static class ObjectExtensions
6 | {
7 | public static string ToJson(this object obj)
8 | {
9 | JsonSerializer js = JsonSerializer.Create(new JsonSerializerSettings());
10 | var jw = new StringWriter();
11 | js.Serialize(jw, obj);
12 | return jw.ToString();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Models/Purchasing/Payment.cs:
--------------------------------------------------------------------------------
1 | namespace AccountGoWeb.Models.Purchasing;
2 |
3 | public class Payment
4 | {
5 | public int InvoiceId { get; set; }
6 | public string? InvoiceNo { get; set; }
7 | public int VendorId { get; set; }
8 | public string? VendorName { get; set; }
9 | public decimal InvoiceAmount { get; set; }
10 | public decimal AmountPaid { get; set; }
11 | public decimal Balance { get { return InvoiceAmount - AmountPaid; } }
12 | [ExpressiveAnnotations.Attributes.AssertThat("AmountToPay <= Balance", ErrorMessage = "Amount to pay cannot be greater than remaining amount to pay.")]
13 | [ExpressiveAnnotations.Attributes.AssertThat("AmountToPay > 0", ErrorMessage = "Amount to pay cannot be zero.")]
14 | public decimal AmountToPay { get; set; }
15 | [System.ComponentModel.DataAnnotations.Required]
16 | public int? AccountId { get; set; }
17 | public System.DateTime Date { get; set; }
18 | }
19 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Models/Sales/AddSalesReceipt.cs:
--------------------------------------------------------------------------------
1 | namespace AccountGoWeb.Models.Sales;
2 |
3 | public class AddReceipt
4 | {
5 | [System.ComponentModel.DataAnnotations.Required]
6 | public int? AccountToDebitId { get; set; }
7 | [System.ComponentModel.DataAnnotations.Required]
8 | public int? AccountToCreditId { get; set; }
9 | [System.ComponentModel.DataAnnotations.Required]
10 | public int? CustomerId { get; set; }
11 | public System.DateTime ReceiptDate {get;set;}
12 | [ExpressiveAnnotations.Attributes.AssertThat("Amount > 0", ErrorMessage = "Amount cannot be zero.")]
13 | public decimal Amount { get; set; }
14 |
15 | public AddReceipt()
16 | {
17 | ReceiptDate = System.DateTime.Now;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Models/Sales/SalesQuotation.cs:
--------------------------------------------------------------------------------
1 | namespace AccountGoWeb.Models.Sales;
2 | public class SalesQuotations {
3 | [System.ComponentModel.DataAnnotations.Required]
4 | public int CustomerId { get; set; }
5 | [System.ComponentModel.DataAnnotations.Required]
6 | public int PaymentTermId { get; set; }
7 | [System.ComponentModel.DataAnnotations.Required]
8 | public int ItemId { get; set; }
9 | [System.ComponentModel.DataAnnotations.Required]
10 | public int Quantity { get; set; }
11 | [ExpressiveAnnotations.Attributes.AssertThat("Amount > 0", ErrorMessage = "Amount cannot be zero.")]
12 | public decimal Amount { get; set; }
13 | public System.DateTime Date { get; set; }
14 | public decimal Discount { get; set; }
15 |
16 | public SalesQuotations()
17 | {
18 | Date = System.DateTime.Now;
19 | }
20 |
21 | }
--------------------------------------------------------------------------------
/src/AccountGoWeb/Models/TaxSystem/TaxSystemViewModel.cs:
--------------------------------------------------------------------------------
1 | using Dto.TaxSystem;
2 |
3 | namespace AccountGoWeb.Models.TaxSystem;
4 | public class TaxSystemViewModel
5 | {
6 | public System.Collections.Generic.IEnumerable? Taxes { get; set; }
7 | public System.Collections.Generic.IEnumerable? TaxGroups { get; set; }
8 | public System.Collections.Generic.IEnumerable? ItemTaxGroups { get; set; }
9 | }
10 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/ModulesReferences.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:8000",
7 | "sslPort": 0
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | }
17 | },
18 | "AccountGoWeb": {
19 | "commandName": "Project",
20 | "launchBrowser": true,
21 | "environmentVariables": {
22 | "ASPNETCORE_ENVIRONMENT": "Development"
23 | },
24 | "applicationUrl": "http://localhost:8000"
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/src/AccountGoWeb/Scss/_dark-custom.scss:
--------------------------------------------------------------------------------
1 | // Here you can add other styles for dark theme
2 |
3 | .nav-tabs {
4 | .nav-link {
5 | &.active {
6 | color: $gray-300;
7 | background: #252525;
8 | &:focus {
9 | background: #8d8b8b;
10 | color: black;
11 | }
12 | }
13 | }
14 | }
15 |
16 | .tab-content {
17 | background: #252525; // my override => default #fff
18 | }
19 |
20 | .switch-slider {
21 | background-color: #252525; // my override => default white
22 | }
--------------------------------------------------------------------------------
/src/AccountGoWeb/Scss/_light-custom.scss:
--------------------------------------------------------------------------------
1 | // Here you can add other styles for light theme
2 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Scss/_light-variables.scss:
--------------------------------------------------------------------------------
1 | // Variable overrides for light theme
2 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Scss/_shared-custom.scss:
--------------------------------------------------------------------------------
1 | // Here you can add other styles applicable to all themes
2 | .inactiveLink {
3 | pointer-events: none;
4 | opacity: 0.65;
5 | filter: alpha(opacity=65);
6 | color:#cabfbf;
7 | }
8 |
9 | .disabledControl {
10 | pointer-events: none;
11 | opacity: 0.95;
12 | filter: alpha(opacity=65);
13 | }
--------------------------------------------------------------------------------
/src/AccountGoWeb/Scss/_shared-variables.scss:
--------------------------------------------------------------------------------
1 | // Variable overrides for all themes
2 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Scss/dark.scss:
--------------------------------------------------------------------------------
1 | // If you want to override variables applicable to all themes, do it here
2 | @import "shared-variables";
3 |
4 | // If you want to override variables applicable only to dark theme, do it here
5 | @import "dark-variables";
6 |
7 | // Import styles
8 | @import "node_modules/@coreui/coreui/scss/coreui";
9 |
10 | // If you want to add something that applies to all themes, do it here
11 | @import "shared-custom";
12 |
13 | // If you want to add something that applies only to dark theme, do it here
14 | @import "dark-custom";
15 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Scss/light.scss:
--------------------------------------------------------------------------------
1 | // If you want to override variables applicable to all themes, do it here
2 | @import "shared-variables";
3 |
4 | // If you want to override variables applicable only to light theme, do it here
5 | @import "light-variables";
6 |
7 | // Import styles
8 | @import "node_modules/@coreui/coreui/scss/coreui";
9 |
10 | // If you want to add something that applies to all themes, do it here
11 | @import "shared-custom";
12 |
13 | // If you want to add something that applies only to light theme, do it here
14 | @import "light-custom";
--------------------------------------------------------------------------------
/src/AccountGoWeb/Scss/vendors/_variables.scss:
--------------------------------------------------------------------------------
1 | // Override Boostrap variables
2 | @import "../shared-variables";
3 | @import "node_modules/bootstrap/scss/mixins";
4 | @import "node_modules/@coreui/coreui/scss/variables";
5 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Views/Account/Unauthorize.cshtml:
--------------------------------------------------------------------------------
1 | You do not have sufficient rights to access this page.
--------------------------------------------------------------------------------
/src/AccountGoWeb/Views/Financials/AddJournalEntry.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Views/Financials/JournalEntry.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Views/Home/Index.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |

4 |
5 |
6 |
12 |
13 |
14 | @* *@
15 | @* *@
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Views/Inventory/ICJ.cshtml:
--------------------------------------------------------------------------------
1 | @model string
2 |
3 |
4 |
5 |
8 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Views/Sales/Index.cshtml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Views/Sales/SalesReceipt.cshtml:
--------------------------------------------------------------------------------
1 | @model Dto.Sales.SalesReceipt
2 |
3 |
12 |
13 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Views/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @using AccountGoWeb
2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
3 | @using AccountGoWeb.Components
4 | @using AccountGoWeb.Components.Pages
5 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "_Layout_bootstrap";
3 | }
4 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information"
7 | }
8 | },
9 | "AllowedHosts": "*",
10 | "ApiUrl": "http://{0}:{1}/api/"
11 | }
--------------------------------------------------------------------------------
/src/AccountGoWeb/appsettings.Production.json:
--------------------------------------------------------------------------------
1 | {
2 | "ApiUrl": "http://{0}:{1}/api/"
3 | }
--------------------------------------------------------------------------------
/src/AccountGoWeb/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information"
7 | }
8 | },
9 | "AllowedHosts": "*",
10 | "ApiUrl": "http://{0}:{1}/api/"
11 | }
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/images/avatars/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AccountGo/accountgo/4d97beda9473fc9b6a4a3ea0a8b1a8579bfc93f0/src/AccountGoWeb/wwwroot/images/avatars/1.jpg
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/images/avatars/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AccountGo/accountgo/4d97beda9473fc9b6a4a3ea0a8b1a8579bfc93f0/src/AccountGoWeb/wwwroot/images/avatars/2.jpg
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/images/avatars/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AccountGo/accountgo/4d97beda9473fc9b6a4a3ea0a8b1a8579bfc93f0/src/AccountGoWeb/wwwroot/images/avatars/3.jpg
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/images/avatars/4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AccountGo/accountgo/4d97beda9473fc9b6a4a3ea0a8b1a8579bfc93f0/src/AccountGoWeb/wwwroot/images/avatars/4.jpg
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/images/avatars/5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AccountGo/accountgo/4d97beda9473fc9b6a4a3ea0a8b1a8579bfc93f0/src/AccountGoWeb/wwwroot/images/avatars/5.jpg
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/images/avatars/6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AccountGo/accountgo/4d97beda9473fc9b6a4a3ea0a8b1a8579bfc93f0/src/AccountGoWeb/wwwroot/images/avatars/6.jpg
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/images/avatars/7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AccountGo/accountgo/4d97beda9473fc9b6a4a3ea0a8b1a8579bfc93f0/src/AccountGoWeb/wwwroot/images/avatars/7.jpg
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/images/avatars/8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AccountGo/accountgo/4d97beda9473fc9b6a4a3ea0a8b1a8579bfc93f0/src/AccountGoWeb/wwwroot/images/avatars/8.jpg
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/images/avatars/user2-160x160.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AccountGo/accountgo/4d97beda9473fc9b6a4a3ea0a8b1a8579bfc93f0/src/AccountGoWeb/wwwroot/images/avatars/user2-160x160.png
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/images/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AccountGo/accountgo/4d97beda9473fc9b6a4a3ea0a8b1a8579bfc93f0/src/AccountGoWeb/wwwroot/images/favicon.ico
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/images/gbd/logo1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AccountGo/accountgo/4d97beda9473fc9b6a4a3ea0a8b1a8579bfc93f0/src/AccountGoWeb/wwwroot/images/gbd/logo1.png
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/images/gbd/logo1_trans.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AccountGo/accountgo/4d97beda9473fc9b6a4a3ea0a8b1a8579bfc93f0/src/AccountGoWeb/wwwroot/images/gbd/logo1_trans.png
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/images/gbd/logo2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AccountGo/accountgo/4d97beda9473fc9b6a4a3ea0a8b1a8579bfc93f0/src/AccountGoWeb/wwwroot/images/gbd/logo2.png
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/images/gbd/logo2_trans.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AccountGo/accountgo/4d97beda9473fc9b6a4a3ea0a8b1a8579bfc93f0/src/AccountGoWeb/wwwroot/images/gbd/logo2_trans.png
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/images/gbd/logo3_trans.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AccountGo/accountgo/4d97beda9473fc9b6a4a3ea0a8b1a8579bfc93f0/src/AccountGoWeb/wwwroot/images/gbd/logo3_trans.png
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/js/colors.js:
--------------------------------------------------------------------------------
1 | /* global rgbToHex */
2 |
3 | /**
4 | * --------------------------------------------------------------------------
5 | * CoreUI Free Boostrap Admin Template (v2.0.0): colors.js
6 | * Licensed under MIT (https://coreui.io/license)
7 | * --------------------------------------------------------------------------
8 | */
9 | $('.theme-color').each(function () {
10 | var Color = $(this).css('backgroundColor');
11 | $(this).parent().append("\n \n \n HEX: | \n " + rgbToHex(Color) + " | \n
\n \n RGB: | \n " + Color + " | \n
\n
\n ");
12 | });
13 | //# sourceMappingURL=colors.js.map
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/js/colors.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["src/colors.js"],"names":["$","each","Color","css","parent","append","rgbToHex"],"mappings":"AAAA;;AAGA;;;;;;AAOAA,EAAE,cAAF,EAAkBC,IAAlB,CAAuB,YAAY;AACjC,MAAMC,QAAQF,EAAE,IAAF,EAAQG,GAAR,CAAY,iBAAZ,CAAd;AACAH,IAAE,IAAF,EAAQI,MAAR,GAAiBC,MAAjB,oIAIqCC,SAASJ,KAAT,CAJrC,2HAQqCA,KARrC;AAYD,CAdD","sourcesContent":["/* global rgbToHex */\nimport $ from 'jquery'\n\n/**\n * --------------------------------------------------------------------------\n * CoreUI Free Boostrap Admin Template (v2.0.0): colors.js\n * Licensed under MIT (https://coreui.io/license)\n * --------------------------------------------------------------------------\n */\n\n$('.theme-color').each(function () {\n const Color = $(this).css('backgroundColor')\n $(this).parent().append(`\n \n \n HEX: | \n ${rgbToHex(Color)} | \n
\n \n RGB: | \n ${Color} | \n
\n
\n `)\n})\n"],"file":"colors.js"}
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/js/custom.js:
--------------------------------------------------------------------------------
1 | function getParameterByName(name, url) {
2 | if (!url) url = window.location.href;
3 | name = name.replace(/[\[\]]/g, "\\$&");
4 | var regex = new RegExp("[?&]" + name + "(=([^]*)|&|#|$)"),
5 | results = regex.exec(url);
6 | if (!results) return null;
7 | if (!results[2]) return '';
8 | return decodeURIComponent(results[2].replace(/\+/g, " "));
9 | }
10 |
11 | function setFormDisabled(divId) {
12 | var nodes = document.getElementById(divId).getElementsByTagName('*');
13 | for (var i = 0; i < nodes.length; i++) {
14 | nodes[i].className = nodes[i].className + " disabledControl";
15 | }
16 | }
17 |
18 | function setFormEnabled(divId) {
19 | // Remove " disabledControl" from current className
20 | var nodes = document.getElementById(divId).getElementsByTagName('*');
21 | for (var i = 0; i < nodes.length; i++) {
22 | var subStringLength = nodes[i].className.length - " disabledControl".length;
23 | nodes[i].className = nodes[i].className.substring(0, subStringLength);
24 | }
25 | }
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/js/popovers.js:
--------------------------------------------------------------------------------
1 | /**
2 | * --------------------------------------------------------------------------
3 | * CoreUI Free Boostrap Admin Template (v2.0.0): popovers.js
4 | * Licensed under MIT (https://coreui.io/license)
5 | * --------------------------------------------------------------------------
6 | */
7 | $('[data-toggle="popover"]').popover();
8 | $('.popover-dismiss').popover({
9 | trigger: 'focus'
10 | });
11 | //# sourceMappingURL=popovers.js.map
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/js/popovers.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["src/popovers.js"],"names":["$","popover","trigger"],"mappings":"AAEA;;;;;;AAOAA,EAAE,yBAAF,EAA6BC,OAA7B;AACAD,EAAE,kBAAF,EAAsBC,OAAtB,CAA8B;AAC5BC,WAAS;AADmB,CAA9B","sourcesContent":["import $ from 'jquery'\n\n/**\n * --------------------------------------------------------------------------\n * CoreUI Free Boostrap Admin Template (v2.0.0): popovers.js\n * Licensed under MIT (https://coreui.io/license)\n * --------------------------------------------------------------------------\n */\n\n$('[data-toggle=\"popover\"]').popover()\n$('.popover-dismiss').popover({\n trigger: 'focus'\n})\n"],"file":"popovers.js"}
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/js/site.js:
--------------------------------------------------------------------------------
1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
2 | // for details on configuring this project to bundle and minify static web assets.
3 |
4 | // Write your JavaScript code.
5 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/js/site.min.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AccountGo/accountgo/4d97beda9473fc9b6a4a3ea0a8b1a8579bfc93f0/src/AccountGoWeb/wwwroot/js/site.min.js
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/js/src/colors.js:
--------------------------------------------------------------------------------
1 | /* global rgbToHex */
2 | import $ from 'jquery'
3 |
4 | /**
5 | * --------------------------------------------------------------------------
6 | * CoreUI Free Boostrap Admin Template (v2.0.0): colors.js
7 | * Licensed under MIT (https://coreui.io/license)
8 | * --------------------------------------------------------------------------
9 | */
10 |
11 | $('.theme-color').each(function () {
12 | const Color = $(this).css('backgroundColor')
13 | $(this).parent().append(`
14 |
15 |
16 | HEX: |
17 | ${rgbToHex(Color)} |
18 |
19 |
20 | RGB: |
21 | ${Color} |
22 |
23 |
24 | `)
25 | })
26 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/js/src/popovers.js:
--------------------------------------------------------------------------------
1 | import $ from 'jquery'
2 |
3 | /**
4 | * --------------------------------------------------------------------------
5 | * CoreUI Free Boostrap Admin Template (v2.0.0): popovers.js
6 | * Licensed under MIT (https://coreui.io/license)
7 | * --------------------------------------------------------------------------
8 | */
9 |
10 | $('[data-toggle="popover"]').popover()
11 | $('.popover-dismiss').popover({
12 | trigger: 'focus'
13 | })
14 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/js/src/tooltips.js:
--------------------------------------------------------------------------------
1 | import $ from 'jquery'
2 |
3 | /**
4 | * --------------------------------------------------------------------------
5 | * CoreUI Free Boostrap Admin Template (v2.0.0): tooltips.js
6 | * Licensed under MIT (https://coreui.io/license)
7 | * --------------------------------------------------------------------------
8 | */
9 |
10 | $('[data-toggle="tooltip"]').tooltip()
11 |
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/js/tooltips.js:
--------------------------------------------------------------------------------
1 | /**
2 | * --------------------------------------------------------------------------
3 | * CoreUI Free Boostrap Admin Template (v2.0.0): tooltips.js
4 | * Licensed under MIT (https://coreui.io/license)
5 | * --------------------------------------------------------------------------
6 | */
7 | $('[data-toggle="tooltip"]').tooltip();
8 | //# sourceMappingURL=tooltips.js.map
--------------------------------------------------------------------------------
/src/AccountGoWeb/wwwroot/js/tooltips.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["src/tooltips.js"],"names":["$","tooltip"],"mappings":"AAEA;;;;;;AAOAA,EAAE,yBAAF,EAA6BC,OAA7B","sourcesContent":["import $ from 'jquery'\n\n/**\n * --------------------------------------------------------------------------\n * CoreUI Free Boostrap Admin Template (v2.0.0): tooltips.js\n * Licensed under MIT (https://coreui.io/license)\n * --------------------------------------------------------------------------\n */\n\n$('[data-toggle=\"tooltip\"]').tooltip()\n"],"file":"tooltips.js"}
--------------------------------------------------------------------------------
/src/Api/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "label": "build",
6 | "command": "dotnet",
7 | "type": "process",
8 | "args": [
9 | "build",
10 | "${workspaceFolder}/Api.csproj"
11 | ],
12 | "problemMatcher": "$msCompile"
13 | }
14 | ]
15 | }
--------------------------------------------------------------------------------
/src/Api/Api.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.5.002.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Api", "Api.csproj", "{A49E3D27-70EF-4CC8-9F7D-2D2563000319}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {A49E3D27-70EF-4CC8-9F7D-2D2563000319}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {A49E3D27-70EF-4CC8-9F7D-2D2563000319}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {A49E3D27-70EF-4CC8-9F7D-2D2563000319}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {A49E3D27-70EF-4CC8-9F7D-2D2563000319}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {C260199A-8446-4BDC-819B-5D5171FBACE6}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/src/Api/Controllers/BaseController.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc;
2 |
3 | namespace Api.Controllers
4 | {
5 | public class BaseController : Controller
6 | {
7 | protected string GetUserNameFromRequestHeader()
8 | {
9 | string username = string.Empty;
10 | Microsoft.Extensions.Primitives.StringValues val = new Microsoft.Extensions.Primitives.StringValues();
11 |
12 | if (HttpContext.Request.Headers.TryGetValue("UserName", out val))
13 | username = val[0].ToString();
14 |
15 | return username;
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Api/Data/ApplicationIdentityDbContext.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
2 | using Microsoft.EntityFrameworkCore;
3 |
4 | namespace Api.Data
5 | {
6 | public class ApplicationIdentityDbContext : IdentityDbContext
7 | {
8 | public ApplicationIdentityDbContext(DbContextOptions options)
9 | : base(options)
10 | {
11 | }
12 |
13 | protected override void OnModelCreating(ModelBuilder builder)
14 | {
15 | base.OnModelCreating(builder);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Api/Data/ApplicationUser.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Identity;
2 |
3 | namespace Api.Data
4 | {
5 | public class ApplicationUser : IdentityUser
6 | {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Api/Data/Repositories/PurchaseOrderRepository.cs:
--------------------------------------------------------------------------------
1 | using Core.Data;
2 | using Core.Domain.Purchases;
3 | using Microsoft.EntityFrameworkCore;
4 | using Microsoft.Extensions.Logging;
5 | using Microsoft.IdentityModel.Logging;
6 | using System.Linq;
7 |
8 | namespace Api.Data
9 | {
10 | public class PurchaseOrderRepository : EfRepository, IPurchaseOrderRepository
11 | {
12 | public PurchaseOrderRepository(ILogger logger, ApiDbContext context) : base(logger, context)
13 | {
14 | }
15 |
16 | public IQueryable GetAllPurchaseOrders()
17 | {
18 | IQueryable queryable = base.Entities;
19 |
20 | var purchaseOrders = queryable
21 | .Include(po => po.PurchaseOrderLines)
22 | .ThenInclude(line => line.PurchaseInvoiceLines)
23 | .Include(po => po.Vendor)
24 | .Include(po => po.Vendor.Party);
25 |
26 | return purchaseOrders;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/Api/Data/Repositories/SalesOrderRepository.cs:
--------------------------------------------------------------------------------
1 | using Core.Data;
2 | using Core.Domain.Purchases;
3 | using Core.Domain.Sales;
4 | using Microsoft.EntityFrameworkCore;
5 | using Microsoft.Extensions.Logging;
6 | using Microsoft.IdentityModel.Logging;
7 | using System.Linq;
8 |
9 | namespace Api.Data
10 | {
11 | public class SalesOrderRepository : EfRepository, ISalesOrderRepository
12 | {
13 | public SalesOrderRepository(ILogger logger, ApiDbContext context) : base(logger,context)
14 | {
15 | }
16 |
17 | public IQueryable GetAllSalesOrders()
18 | {
19 | IQueryable queryable = base.Entities;
20 |
21 | var salesOrders = queryable
22 | .Include(so => so.SalesOrderLines)
23 | .ThenInclude(line => line.SalesInvoiceLines)
24 | .Include(so => so.Customer)
25 | .Include(so => so.Customer.Party);
26 |
27 | return salesOrders;
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Api/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:8.0-bullseye-slim-amd64 AS build-env
2 |
3 | WORKDIR /app
4 |
5 | COPY ./src/Api Api
6 | COPY ./src/Core Core
7 | COPY ./src/Services Services
8 | COPY ./src/Dto Dto
9 |
10 | RUN ls -a
11 |
12 | RUN dotnet restore ./Api/*.csproj
13 | RUN dotnet publish ./Api/*.csproj -c Release -o out
14 |
15 | FROM mcr.microsoft.com/dotnet/aspnet:8.0-bullseye-slim-amd64
16 |
17 | ARG DBSERVER localhost
18 | ARG DBUSERID dbuser
19 | ARG DBPASSWORD Str0ngPassword
20 | ARG DBNAME accountgodb
21 |
22 | ENV DBSERVER ${DBSERVER}
23 | ENV DBUSERID ${DBUSERID}
24 | ENV DBPASSWORD ${DBPASSWORD}
25 | ENV DBNAME ${DBNAME}
26 |
27 | WORKDIR /app
28 |
29 | COPY --from=build-env /app/out ./
30 |
31 | EXPOSE 8001
32 |
33 | CMD ["dotnet", "Api.dll"]
--------------------------------------------------------------------------------
/src/Api/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:8001/",
7 | "sslPort": 0
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | }
17 | },
18 | "Api": {
19 | "commandName": "Project",
20 | "launchBrowser": true,
21 | "environmentVariables": {
22 | "ASPNETCORE_ENVIRONMENT": "Development",
23 | "DBSERVER": "localhost,1444",
24 | "DBUSERID": "sa",
25 | "DBPASSWORD": "SqlPassword!"
26 | },
27 | "applicationUrl": "http://localhost:8001/"
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/src/Api/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information"
7 | }
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Api/appsettings.Production.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Warning"
5 | }
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Api/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Debug",
6 | "System": "Information",
7 | "Microsoft": "Information"
8 | }
9 | },
10 | "ConnectionStrings": {
11 | "DefaultConnection": "Data Source={0};User ID={1};Password={2};Initial Catalog={3};TrustServerCertificate=yes;MultipleActiveResultSets=true;"
12 | }
13 | }
--------------------------------------------------------------------------------
/src/Core/Core.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | Library
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/Core/Data/IPurchaseOrderRepository.cs:
--------------------------------------------------------------------------------
1 | using Core.Domain.Purchases;
2 | using System.Linq;
3 |
4 | namespace Core.Data
5 | {
6 | public interface IPurchaseOrderRepository : IRepository
7 | {
8 | IQueryable GetAllPurchaseOrders();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Core/Data/IRepository.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) AccountGo. All rights reserved.
4 | // Marvin Perez
5 | // 1/11/2015 9:48:38 AM
6 | //
7 | //-----------------------------------------------------------------------
8 |
9 | namespace Core.Data
10 | {
11 | using Domain;
12 | using System;
13 | using System.Linq;
14 | ///
15 | /// Repository
16 | ///
17 | public partial interface IRepository where T : BaseEntity
18 | {
19 | T GetById(object id);
20 | void Insert(T entity);
21 | void Update(T entity);
22 | void Delete(T entity);
23 | IQueryable Table { get; }
24 |
25 | IQueryable GetAllIncluding(params System.Linq.Expressions.Expression>[] includeProperties);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Core/Data/ISalesOrderRepository.cs:
--------------------------------------------------------------------------------
1 | using Core.Domain.Sales;
2 | using System.Linq;
3 |
4 | namespace Core.Data
5 | {
6 | public interface ISalesOrderRepository : IRepository
7 | {
8 | IQueryable GetAllSalesOrders();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Core/Data/ISecurityRepository.cs:
--------------------------------------------------------------------------------
1 | using Core.Domain.Security;
2 | using System.Collections.Generic;
3 |
4 | namespace Core.Data
5 | {
6 | public interface ISecurityRepository : IUserRepository, IRoleRepository, IGroupRepository
7 | {
8 |
9 | }
10 | public interface IUserRepository
11 | {
12 | void AddUser(User user);
13 | User GetUser(string username);
14 | IEnumerable GetAllUsers();
15 | }
16 |
17 | public interface IRoleRepository
18 | {
19 | void AddRole(SecurityRole role);
20 | SecurityRole GetRole(string roleName);
21 | IEnumerable GetAllRoles();
22 | }
23 |
24 | public interface IGroupRepository
25 | {
26 | IEnumerable GetAllGroups();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Core/Domain/Address.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) AccountGo. All rights reserved.
4 | // Marvin Perez
5 | // 1/11/2015 9:48:38 AM
6 | //
7 | //-----------------------------------------------------------------------
8 |
9 | using System.ComponentModel.DataAnnotations.Schema;
10 |
11 | namespace Core.Domain
12 | {
13 | [Table("Address")]
14 | public partial class Address : BaseEntity
15 | {
16 | public string No { get; set; }
17 | public string Street { get; set; }
18 | public string City { get; set; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Core/Domain/Auditing/AuditLog.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.DataAnnotations.Schema;
3 |
4 | namespace Core.Domain.Auditing
5 | {
6 | public enum AuditEventTypes
7 | {
8 | Added = 1,
9 | Deleted = 2,
10 | Modified = 3
11 | }
12 |
13 | [Table("AuditLog", Schema = "dbo")]
14 | public class AuditLog : BaseEntity
15 | {
16 | ////[Key]
17 | //public int AuditLogId { get; set; }
18 | public string UserName { get; set; }
19 | public DateTime AuditEventDateUTC { get; set; }
20 | public int AuditEventType { get; set; }
21 | public string TableName { get; set; }
22 | public string RecordId { get; set; }
23 | public string FieldName { get; set; }
24 | public string OriginalValue { get; set; }
25 | public string NewValue { get; set; }
26 | //public override int Id
27 | //{
28 | // get { return AuditLogId; }
29 | // set { AuditLogId = value; }
30 | //}
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Core/Domain/Auditing/AuditableAttribute.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.ComponentModel.DataAnnotations;
3 | using System.ComponentModel.DataAnnotations.Schema;
4 |
5 | namespace Core.Domain.Auditing
6 | {
7 | [Table("AuditableAttribute", Schema = "dbo")]
8 | public class AuditableAttribute : BaseEntity
9 | {
10 | //[NotMapped]
11 | //public int AuditableAttributeId { get; set; }
12 | public int AuditableEntityId { get; set; }
13 | public string AttributeName { get; set; }
14 | public bool EnableAudit { get; set; }
15 | //public override int Id
16 | //{
17 | // get { return AuditableAttributeId; }
18 | // set { AuditableAttributeId = value; }
19 | //}
20 | public virtual AuditableEntity AuditableEntity { get; set; }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Core/Domain/Auditing/AuditableEntity.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.ComponentModel.DataAnnotations;
3 | using System.ComponentModel.DataAnnotations.Schema;
4 | using System.Linq;
5 |
6 | namespace Core.Domain.Auditing
7 | {
8 | [Table("AuditableEntity", Schema = "dbo")]
9 | public class AuditableEntity : BaseEntity
10 | {
11 | //[NotMapped]
12 | //public int AuditableEntityId { get; set; }
13 | public string EntityName { get; set; }
14 | public bool EnableAudit { get; set; }
15 | //public override int Id
16 | //{
17 | // get { return AuditableEntityId; }
18 | // set { AuditableEntityId = value; }
19 | //}
20 | public virtual ICollection AuditableAttributes { get; set; }
21 |
22 | public AuditableEntity()
23 | {
24 | AuditableAttributes = new HashSet();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Core/Domain/BaseEntity.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) AccountGo. All rights reserved.
4 | // Marvin Perez
5 | // 1/11/2015 9:48:38 AM
6 | //
7 | //-----------------------------------------------------------------------
8 |
9 | namespace Core.Domain
10 | {
11 | public abstract partial class BaseEntity
12 | {
13 | //[System.ComponentModel.DataAnnotations.Schema.NotMapped]
14 | [System.ComponentModel.DataAnnotations.Key]
15 | ///
16 | /// Gets or sets the entity identifier
17 | ///
18 | public virtual int Id { get; set; }
19 |
20 | //public virtual System.DateTime? CreatedOn { get; set; }
21 | //public virtual string CreatedBy { get; set; }
22 | //public virtual System.DateTime? ModifiedOn { get; set; }
23 | [System.ComponentModel.DataAnnotations.Schema.NotMapped]
24 | public virtual string ModifiedBy { get; set; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/Core/Domain/Company.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) AccountGo. All rights reserved.
4 | // Marvin Perez
5 | // 1/11/2015 9:48:38 AM
6 | //
7 | //-----------------------------------------------------------------------
8 |
9 | using System;
10 | using System.ComponentModel.DataAnnotations.Schema;
11 |
12 | namespace Core.Domain
13 | {
14 | [Table("Company")]
15 | public partial class Company : BaseEntity
16 | {
17 | public string Name { get; set; }
18 | public string ShortName { get; set; }
19 | public string CompanyCode { get; set; }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Core/Domain/CompanySetting.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) AccountGo. All rights reserved.
4 | // Marvin Perez
5 | // 1/11/2015 9:48:38 AM
6 | //
7 | //-----------------------------------------------------------------------
8 |
9 | using System;
10 | using System.ComponentModel.DataAnnotations.Schema;
11 |
12 | namespace Core.Domain
13 | {
14 | [Table("CompanySetting")]
15 | public partial class CompanySetting : BaseEntity
16 | {
17 | public int CompanyId { get; set; }
18 | public Company Company { get; set; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Core/Domain/Contact.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) AccountGo. All rights reserved.
4 | // Marvin Perez
5 | // 1/11/2015 9:48:38 AM
6 | //
7 | //-----------------------------------------------------------------------
8 |
9 | using System;
10 | using System.ComponentModel.DataAnnotations.Schema;
11 |
12 | namespace Core.Domain
13 | {
14 | [Table("Contact")]
15 | public partial class Contact : BaseEntity
16 | {
17 | public Contact()
18 | {
19 | }
20 | ///
21 | /// Check ContactyType to determine whether CompanyNo is Customer No or Vendor No
22 | ///
23 | public ContactTypes ContactType { get; set; }
24 | public string FirstName { get; set; }
25 | public string LastName { get; set; }
26 | public string MiddleName { get; set; }
27 | public int PartyId { get; set; }
28 | public virtual Party Party { get; set; }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Core/Domain/CustomerContact.cs:
--------------------------------------------------------------------------------
1 | using Core.Domain.Sales;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel.DataAnnotations.Schema;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace Core.Domain
10 | {
11 | [Table("CustomerContact")]
12 | public class CustomerContact : BaseEntity
13 | {
14 |
15 | public int ContactId { get; set; }
16 | public int CustomerId { get; set; }
17 |
18 | public virtual Customer Customer {get; set;}
19 |
20 | public virtual Contact Contact { get; set; }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Core/Domain/Financials/AccountClass.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) AccountGo. All rights reserved.
4 | // Marvin Perez
5 | // 1/11/2015 9:48:38 AM
6 | //
7 | //-----------------------------------------------------------------------
8 |
9 | using Core.Domain.Financials;
10 | using System.Collections.Generic;
11 | using System.ComponentModel.DataAnnotations.Schema;
12 |
13 | namespace Core.Domain.Financials
14 | {
15 | [Table("AccountClass")]
16 | public class AccountClass : BaseEntity
17 | {
18 | public AccountClass()
19 | {
20 | Accounts = new HashSet();
21 | }
22 |
23 | public string Name { get; set; }
24 | public string NormalBalance { get; set; }
25 | public virtual ICollection Accounts { get; set; }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Core/Domain/Financials/Bank.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) AccountGo. All rights reserved.
4 | // Marvin Perez
5 | // 1/11/2015 9:48:38 AM
6 | //
7 | //-----------------------------------------------------------------------
8 |
9 | using System.ComponentModel.DataAnnotations.Schema;
10 |
11 | namespace Core.Domain.Financials
12 | {
13 | [Table("Bank")]
14 | public partial class Bank : BaseEntity
15 | {
16 | public BankTypes Type { get; set; }
17 | public string Name { get; set; }
18 | public int? AccountId { get; set; }
19 | public string BankName { get; set; }
20 | public string Number { get; set; }
21 | public string Address { get; set; }
22 | public bool IsDefault { get; set; }
23 | public bool IsActive { get; set; }
24 | public virtual Account Account { get; set; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/Core/Domain/Financials/FiscalYear.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) AccountGo. All rights reserved.
4 | // Marvin Perez
5 | // 1/11/2015 9:48:38 AM
6 | //
7 | //-----------------------------------------------------------------------
8 |
9 | using System;
10 | using System.ComponentModel.DataAnnotations;
11 | using System.ComponentModel.DataAnnotations.Schema;
12 |
13 | namespace Core.Domain.Financials
14 | {
15 | [Table("FinancialYear")]
16 | public partial class FinancialYear : BaseEntity
17 | {
18 | [Required]
19 | [StringLength(10)]
20 | public string FiscalYearCode { get; set; }
21 |
22 | [Required]
23 | [StringLength(100)]
24 | public string FiscalYearName { get; set; }
25 |
26 | public DateTime StartDate { get; set; }
27 |
28 | public DateTime EndDate { get; set; }
29 |
30 | public bool IsActive { get; set; }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Core/Domain/Financials/GeneralLedgerLine.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) AccountGo. All rights reserved.
4 | // Marvin Perez
5 | // 1/11/2015 9:48:38 AM
6 | //
7 | //-----------------------------------------------------------------------
8 |
9 | using System;
10 | using System.ComponentModel.DataAnnotations;
11 | using System.ComponentModel.DataAnnotations.Schema;
12 |
13 | namespace Core.Domain.Financials
14 | {
15 | [Table("GeneralLedgerLine")]
16 | public partial class GeneralLedgerLine : BaseEntity
17 | {
18 | public GeneralLedgerLine()
19 | {
20 | }
21 |
22 | public int GeneralLedgerHeaderId { get; set; }
23 | public int AccountId { get; set; }
24 | public DrOrCrSide DrCr { get; set; }
25 | public decimal Amount { get; set; }
26 | public virtual Account Account { get; set; }
27 | public virtual GeneralLedgerHeader GeneralLedgerHeader { get; set; }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/Core/Domain/Financials/JournalEntryLine.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) AccountGo. All rights reserved.
4 | // Marvin Perez
5 | // 1/11/2015 9:48:38 AM
6 | //
7 | //-----------------------------------------------------------------------
8 |
9 | using System.ComponentModel.DataAnnotations.Schema;
10 |
11 | namespace Core.Domain.Financials
12 | {
13 | [Table("JournalEntryLine")]
14 | public partial class JournalEntryLine : BaseEntity
15 | {
16 | public int JournalEntryHeaderId { get; set; }
17 | public int AccountId { get; set; }
18 | public DrOrCrSide DrCr { get; set; }
19 | public decimal Amount { get; set; }
20 | public string Memo { get; set; }
21 |
22 | public virtual JournalEntryHeader JournalEntryHeader { get; set; }
23 | public virtual Account Account { get; set; }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/Core/Domain/Financials/MainContraAccount.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations.Schema;
2 |
3 | namespace Core.Domain.Financials
4 | {
5 | [Table("MainContraAccount")]
6 | public class MainContraAccount : BaseEntity
7 | {
8 | public int MainAccountId { get; set; }
9 | public int RelatedContraAccountId { get; set; }
10 |
11 | [ForeignKey("MainAccountId")]
12 | [InverseProperty("ContraAccounts")]
13 | public virtual Account MainAccount { get; set; }
14 | [ForeignKey("RelatedContraAccountId")]
15 | public virtual Account RelatedContraAccount { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Core/Domain/Items/InventoryControlJournal.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) AccountGo. All rights reserved.
4 | // Marvin Perez
5 | // 1/11/2015 9:48:38 AM
6 | //
7 | //-----------------------------------------------------------------------
8 |
9 | using System;
10 | using System.ComponentModel.DataAnnotations.Schema;
11 |
12 | namespace Core.Domain.Items
13 | {
14 | [Table("InventoryControlJournal")]
15 | public partial class InventoryControlJournal : BaseEntity
16 | {
17 | public int ItemId { get; set; }
18 | public int MeasurementId { get; set; }
19 | public DocumentTypes DocumentType { get; set; }
20 | public decimal? INQty { get; set; }
21 | public decimal? OUTQty { get; set; }
22 | public DateTime Date { get; set; }
23 | public decimal? TotalCost { get; set; }
24 | public decimal? TotalAmount { get; set; }
25 | public bool IsReverse { get; set; }
26 |
27 | public virtual Item Item { get; set; }
28 | public virtual Measurement Measurement { get; set; }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Core/Domain/Items/Measurement.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) AccountGo. All rights reserved.
4 | // Marvin Perez
5 | // 1/11/2015 9:48:38 AM
6 | //
7 | //-----------------------------------------------------------------------
8 |
9 | using System.ComponentModel.DataAnnotations.Schema;
10 |
11 | namespace Core.Domain.Items
12 | {
13 | [Table("Measurement")]
14 | public partial class Measurement : BaseEntity
15 | {
16 | public string Code { get; set; }
17 | public string Description { get; set; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Core/Domain/Log.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.DataAnnotations.Schema;
3 |
4 | namespace Core.Domain
5 | {
6 | [Table("Log")]
7 | public class Log : BaseEntity
8 | {
9 | public DateTime TimeStamp { get; set; }
10 | public string Level { get; set; }
11 | public string Logger { get; set; }
12 | public string Message { get; set; }
13 | public string Username { get; set; }
14 | public string CallSite { get; set; }
15 | public string Thread { get; set; }
16 | public string Exception { get; set; }
17 | public string StackTrace { get; set; }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Core/Domain/Party.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) AccountGo. All rights reserved.
4 | // Marvin Perez
5 | // 1/11/2015 9:48:38 AM
6 | //
7 | //-----------------------------------------------------------------------
8 |
9 | using System;
10 | using System.Collections.Generic;
11 | using System.ComponentModel.DataAnnotations.Schema;
12 |
13 | namespace Core.Domain
14 | {
15 | [Table("Party")]
16 | public partial class Party : BaseEntity
17 | {
18 | public Party()
19 | {
20 | Contacts = new HashSet();
21 | }
22 |
23 | public PartyTypes PartyType { get; set; }
24 | public string Name { get; set; }
25 | public string Email { get; set; }
26 | public string Website { get; set; }
27 | public string Phone { get; set; }
28 | public string Fax { get; set; }
29 | public bool IsActive { get; set; }
30 |
31 | public virtual ICollection Contacts { get; set; }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/Core/Domain/PaymentTerm.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) AccountGo. All rights reserved.
4 | // Marvin Perez
5 | // 1/11/2015 9:48:38 AM
6 | //
7 | //-----------------------------------------------------------------------
8 |
9 | using System;
10 | using System.ComponentModel.DataAnnotations.Schema;
11 |
12 | namespace Core.Domain
13 | {
14 | [Table("PaymentTerm")]
15 | public partial class PaymentTerm : BaseEntity
16 | {
17 | public string Description { get; set; }
18 | public PaymentTypes PaymentType { get; set; }
19 | public int? DueAfterDays { get; set; }
20 | public bool IsActive { get; set; }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Core/Domain/Purchases/VendorPayment.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) AccountGo. All rights reserved.
4 | // Marvin Perez
5 | // 1/11/2015 9:48:38 AM
6 | //
7 | //-----------------------------------------------------------------------
8 |
9 | using Core.Domain.Financials;
10 | using System;
11 | using System.ComponentModel.DataAnnotations.Schema;
12 |
13 | namespace Core.Domain.Purchases
14 | {
15 |
16 | [Table("VendorPayment")]
17 | public partial class VendorPayment : BaseEntity
18 | {
19 | public VendorPayment()
20 | { }
21 |
22 | public int VendorId { get; set; }
23 | public int? PurchaseInvoiceHeaderId { get; set; }
24 | public int? GeneralLedgerHeaderId { get; set; }
25 | public string No { get; set; }
26 | public DateTime Date { get; set; }
27 | public decimal Amount { get; set; }
28 | public virtual Vendor Vendor { get; set; }
29 | public virtual GeneralLedgerHeader GeneralLedgerHeader { get; set; }
30 | public virtual PurchaseInvoiceHeader PurchaseInvoiceHeader { get; set; }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Core/Domain/Sales/CustomerAllocation.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) AccountGo. All rights reserved.
4 | // Marvin Perez
5 | // 1/11/2015 9:48:38 AM
6 | //
7 | //-----------------------------------------------------------------------
8 |
9 | using System;
10 | using System.Collections.Generic;
11 | using System.ComponentModel.DataAnnotations.Schema;
12 |
13 | namespace Core.Domain.Sales
14 | {
15 | [Table("CustomerAllocation")]
16 | public partial class CustomerAllocation : BaseEntity
17 | {
18 | public CustomerAllocation()
19 | {
20 | }
21 |
22 | public int CustomerId { get; set; }
23 | public int SalesInvoiceHeaderId { get; set; }
24 | public int SalesReceiptHeaderId { get; set; }
25 | public DateTime Date { get; set; }
26 | public decimal Amount { get; set; }
27 |
28 | public virtual Customer Customer { get; set; }
29 | public virtual SalesInvoiceHeader SalesInvoiceHeader { get; set; }
30 | public virtual SalesReceiptHeader SalesReceiptHeader { get; set; }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Core/Domain/Sales/SalesQuoteHeader.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) AccountGo. All rights reserved.
4 | // Marvin Perez
5 | // 1/11/2015 9:48:38 AM
6 | //
7 | //-----------------------------------------------------------------------
8 |
9 | using System;
10 | using System.Collections.Generic;
11 | using System.ComponentModel.DataAnnotations.Schema;
12 |
13 | namespace Core.Domain.Sales
14 | {
15 | [Table("SalesQuoteHeader")]
16 | public partial class SalesQuoteHeader : BaseEntity
17 | {
18 | public int CustomerId { get; set; }
19 | public int? PaymentTermId { get; set; }
20 | public string ReferenceNo { get; set; }
21 | public string No { get; set; }
22 | public SalesQuoteStatus? Status { get; set; }
23 | public DateTime Date { get; set; }
24 | public virtual Customer Customer { get; set; }
25 | public virtual ICollection SalesQuoteLines { get; set; }
26 |
27 | public SalesQuoteHeader()
28 | {
29 | SalesQuoteLines = new HashSet();
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Core/Domain/Sales/SalesQuoteLine.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) AccountGo. All rights reserved.
4 | // Marvin Perez
5 | // 1/11/2015 9:48:38 AM
6 | //
7 | //-----------------------------------------------------------------------
8 |
9 | using Core.Domain.Items;
10 | using System.ComponentModel.DataAnnotations.Schema;
11 |
12 | namespace Core.Domain.Sales
13 | {
14 | [Table("SalesQuoteLine")]
15 | public partial class SalesQuoteLine : BaseEntity
16 | {
17 | public int SalesQuoteHeaderId { get; set; }
18 | public int ItemId { get; set; }
19 | public int MeasurementId { get; set; }
20 | public decimal Quantity { get; set; }
21 | public decimal Discount { get; set; }
22 | public decimal Amount { get; set; }
23 | public SalesQuoteHeader SalesQuoteHeader { get; set; }
24 | public virtual Item Item { get; set; }
25 | public virtual Measurement Measurement { get; set; }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Core/Domain/Security/SecurityGroup.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.ComponentModel.DataAnnotations;
3 | using System.ComponentModel.DataAnnotations.Schema;
4 |
5 | namespace Core.Domain.Security
6 | {
7 | [Table("SecurityGroup", Schema = "dbo")]
8 | public class SecurityGroup : BaseEntity
9 | {
10 | //[Key]
11 | //public int SecurityGroupId { get; set; }
12 | public string Name { get; set; }
13 | public string DisplayName { get; set; }
14 | public virtual ICollection Permissions { get; set; }
15 |
16 | public SecurityGroup()
17 | {
18 | Permissions = new HashSet();
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Core/Domain/Security/SecurityPermission.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.ComponentModel.DataAnnotations.Schema;
3 |
4 | namespace Core.Domain.Security
5 | {
6 | [Table("SecurityPermission", Schema = "dbo")]
7 | public class SecurityPermission : BaseEntity
8 | {
9 | //[Key]
10 | //public int SecurityPermissionId { get; set; }
11 | public string Name { get; set; }
12 | public string DisplayName { get; set; }
13 | public int SecurityGroupId { get; set; }
14 |
15 | public virtual SecurityGroup Group { get; set; }
16 | public virtual ICollection RolePermissions { get; set; }
17 |
18 | public SecurityPermission()
19 | {
20 | RolePermissions = new HashSet();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/Core/Domain/Security/SecurityRole.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.ComponentModel.DataAnnotations;
3 | using System.ComponentModel.DataAnnotations.Schema;
4 |
5 | namespace Core.Domain.Security
6 | {
7 | [Table("SecurityRole", Schema = "dbo")]
8 | public class SecurityRole : BaseEntity
9 | {
10 | //[Key]
11 | //public int SecurityRoleId { get; set; }
12 | public string Name { get; set; }
13 | public string DisplayName { get; set; }
14 | public bool SysAdmin { get; set; }
15 | public bool System { get; set; }
16 | public virtual ICollection Users { get; set; }
17 | public virtual ICollection Permissions { get; set; }
18 | public SecurityRole()
19 | {
20 | Users = new HashSet();
21 | Permissions = new HashSet();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/Core/Domain/Security/SecurityRolePermission.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 | using System.ComponentModel.DataAnnotations.Schema;
3 |
4 | namespace Core.Domain.Security
5 | {
6 | [Table("SecurityRolePermission", Schema = "dbo")]
7 | public class SecurityRolePermission : BaseEntity
8 | {
9 | //[Key]
10 | //public int SecurityRolePermissionId { get; set; }
11 | public int SecurityRoleId { get; set; }
12 | public int SecurityPermissionId { get; set; }
13 |
14 | public virtual SecurityRole SecurityRole { get; set; }
15 | public virtual SecurityPermission SecurityPermission { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Core/Domain/Security/SecurityUserRole.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations.Schema;
2 |
3 | namespace Core.Domain.Security
4 | {
5 | [Table("SecurityUserRole", Schema = "dbo")]
6 | public class SecurityUserRole : BaseEntity
7 | {
8 | //[Key]
9 | //public int SecurityUserRoleId { get; set; }
10 | public int UserId { get; set; }
11 | public int SecurityRoleId { get; set; }
12 |
13 | public virtual User User { get; set; }
14 | public virtual SecurityRole SecurityRole { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/Core/Domain/SequenceNumber.cs:
--------------------------------------------------------------------------------
1 | //-----------------------------------------------------------------------
2 | //
3 | // Copyright (c) AccountGo. All rights reserved.
4 | // Marvin Perez
5 | // 1/11/2015 9:48:38 AM
6 | //
7 | //-----------------------------------------------------------------------
8 |
9 | using System.ComponentModel.DataAnnotations.Schema;
10 |
11 | namespace Core.Domain
12 | {
13 | [Table("SequenceNumber")]
14 | public partial class SequenceNumber : BaseEntity
15 | {
16 | public SequenceNumberTypes SequenceNumberType { get; set; }
17 | public string Description { get; set; }
18 | public string Prefix { get; set; }
19 | public int NextNumber { get; set; }
20 | public bool UsePrefix { get; set; }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Core/Domain/VendorContact.cs:
--------------------------------------------------------------------------------
1 | using Core.Domain.Purchases;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel.DataAnnotations.Schema;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace Core.Domain
10 | {
11 | [Table("VendorContact")]
12 | public class VendorContact : BaseEntity
13 | {
14 | //public int Id { get; set; }
15 | public int ContactId { get; set; }
16 |
17 | public int VendorId { get; set; }
18 |
19 | public virtual Vendor Vendor { get; set; }
20 |
21 | public virtual Contact Contact { get; set; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/Core/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:51393/",
7 | "sslPort": 0
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | }
17 | },
18 | "Core": {
19 | "commandName": "Project",
20 | "launchBrowser": true,
21 | "environmentVariables": {
22 | "ASPNETCORE_ENVIRONMENT": "Development"
23 | },
24 | "applicationUrl": "http://localhost:51394/"
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/src/Dto/Administration/AuditLog.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Dto.Administration
4 | {
5 | public class AuditLog : BaseDto
6 | {
7 | public string UserName { get; set; }
8 | public DateTime AuditEventDateUTC { get; set; }
9 | public int AuditEventType { get; set; }
10 | public string TableName { get; set; }
11 | public string RecordId { get; set; }
12 | public string FieldName { get; set; }
13 | public string OriginalValue { get; set; }
14 | public string NewValue { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/Dto/Administration/Company.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace Dto.Administration
4 | {
5 | public class Company : BaseDto
6 | {
7 | [Required]
8 | [Display(Name = "Company Code")]
9 | public string CompanyCode { get; set; }
10 |
11 | [Required]
12 | [Display(Name = "Name")]
13 | public string Name { get; set; }
14 |
15 | [Required]
16 | [Display(Name = "Short Name")]
17 | public string ShortName { get; set; }
18 |
19 | [Display(Name = "Logo")]
20 | public byte[] Logo { get; set; }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Dto/Administration/GeneralLedgerSetting.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace Dto.Administration
4 | {
5 | public class GeneralLedgerSetting : BaseDto
6 | {
7 | [Display(Name = "Company")]
8 | public int? CompanyId { get; set; }
9 | [Display(Name = "Payable Account")]
10 | public int? PayableAccountId { get; set; }
11 | [Display(Name = "Purchase Discount Account")]
12 | public int? PurchaseDiscountAccountId { get; set; }
13 | [Display(Name = "Goods Receipt Note Clearing Account")]
14 | public int? GoodsReceiptNoteClearingAccountId { get; set; }
15 | [Display(Name = "Sales Discount Account")]
16 | public int? SalesDiscountAccountId { get; set; }
17 | [Display(Name = "Shipping Charge Account")]
18 | public int? ShippingChargeAccountId { get; set; }
19 | [Display(Name = "Permanent Account")]
20 | public int? PermanentAccountId { get; set; }
21 | [Display(Name = "Income Summary Account")]
22 | public int? IncomeSummaryAccountId { get; set; }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/Dto/BaseModel.cs:
--------------------------------------------------------------------------------
1 | namespace Dto
2 | {
3 | public abstract class BaseDto
4 | {
5 | public virtual int Id { get; set; }
6 | public string ModifiedBy { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Dto/Common/Address.cs:
--------------------------------------------------------------------------------
1 | namespace Dto.Common
2 | {
3 | public class Address : BaseDto
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/Dto/Common/Contact.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace Dto.Common
4 | {
5 | public class Contact : BaseDto
6 | {
7 | public int CompanyId { get; set; }
8 | [Display(Name = "First Name")]
9 | [Required]
10 | [StringLength(100)]
11 | public string FirstName { get; set; }
12 | [Display(Name = "Last Name")]
13 | [Required]
14 | [StringLength(100)]
15 | public string LastName { get; set; }
16 | public Party Party { get; set; }
17 |
18 | public string MiddleName { get; set; }
19 |
20 | public int CustomerId { get; set; }
21 | public int VendorId { get; set; }
22 | public int HoldingPartyType { get; set; } //this is 1 or 2 Customer = 1,Vendor = 2,
23 | public int HoldingPartyId { get; set; } // id for customerId or VendorId
24 |
25 | public Contact() {
26 | Party = new Party();
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/Dto/Common/Party.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace Dto.Common
4 | {
5 | public class Party : BaseDto
6 | {
7 | public string Name { get; set; }
8 | public string Email { get; set; }
9 | public string Website { get; set; }
10 | public string Phone { get; set; }
11 | public string Fax { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Dto/Common/PaymentTerm.cs:
--------------------------------------------------------------------------------
1 | namespace Dto.Common
2 | {
3 | public class PaymentTerm : BaseDto
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/Dto/Common/Status.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Dto.Common
8 | {
9 | public class Status
10 | {
11 | public int Id { get; set; }
12 | public string Description { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Dto/Dto.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | Library
6 | true
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/Dto/Financial/AccountClass.cs:
--------------------------------------------------------------------------------
1 | namespace Dto.Financial
2 | {
3 | public class AccountClass : BaseDto
4 | {
5 | public string Name { get; set; }
6 | public string NormalBalance { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Dto/Financial/Bank.cs:
--------------------------------------------------------------------------------
1 | namespace Dto.Financial
2 | {
3 | public class Bank : BaseDto
4 | {
5 | public string Name { get; set; }
6 | public string AccountNo {get;set;}
7 | public string BankName { get; set; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Dto/Financial/FiscalYear.cs:
--------------------------------------------------------------------------------
1 | namespace Dto.Financial
2 | {
3 | public class FiscalYear
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/Dto/Financial/GeneralLedger.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Dto.Financial
4 | {
5 | public class GeneralLedger : BaseDto
6 | {
7 |
8 | public int GeneralLedgerHeaderId { get; set; }
9 | public int AccountId { get; set; }
10 | public DrOrCrSide DrCr { get; set; }
11 | public decimal Amount { get; set; }
12 |
13 |
14 | public IList ChildGeneralLedger { get; set; }
15 |
16 | public GeneralLedger()
17 | {
18 | ChildGeneralLedger = new List();
19 | }
20 | public enum DrOrCrSide
21 | {
22 | NA = 0,
23 | Dr = 1,
24 | Cr = 2
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Dto/Financial/MasterGeneralLedger.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Dto.Financial
8 | {
9 | public class MasterGeneralLedger : BaseDto
10 | {
11 | public new int? Id { get; set; }
12 | public int AccountId { get; set; }
13 | public int CurrencyId { get; set; }
14 | public string DocumentType { get; set; }
15 | public int? TransactionNo { get; set; }
16 | public string AccountCode { get; set; }
17 | public string AccountName { get; set; }
18 | public DateTime? Date { get; set; }
19 | public decimal? Debit { get; set; }
20 | public decimal? Credit { get; set; }
21 |
22 | public IList ChildMasterGeneralLedger { get; set; }
23 | public MasterGeneralLedger()
24 | {
25 | ChildMasterGeneralLedger = new List();
26 | }
27 |
28 | public int? GroupId { get; set; }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Dto/Financial/PaymentTerm.cs:
--------------------------------------------------------------------------------
1 | namespace Dto.Financial
2 | {
3 | public class PaymentTerm : BaseDto
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/Dto/Financial/TreeViewAccounts.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Dto.Financial
4 | {
5 | public class TreeViewAccounts
6 | {
7 | public IList Groups { get; set; }
8 | }
9 |
10 | public class Group {
11 | public string Name { get; set; }
12 | public IList Groups { get; set; }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Dto/Inventory/InventoryControlJournal.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Dto.Inventory
4 | {
5 | public class InventoryControlJournal : BaseDto
6 | {
7 | public decimal? In { get; set; }
8 | public decimal? Out { get; set; }
9 | public string Item { get; set; }
10 | public string Measurement { get; set; }
11 | public DateTime Date { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Dto/Inventory/ItemCategory.cs:
--------------------------------------------------------------------------------
1 | namespace Dto.Inventory
2 | {
3 | public class ItemCategory : BaseDto
4 | {
5 | public string Name { get; set; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Dto/Inventory/Measurement.cs:
--------------------------------------------------------------------------------
1 | namespace Dto.Inventory
2 | {
3 | public class Measurement:BaseDto
4 | {
5 | public string Code { get; set; }
6 | public string Description { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Dto/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:51396/",
7 | "sslPort": 0
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | }
17 | },
18 | "Dto": {
19 | "commandName": "Project",
20 | "launchBrowser": true,
21 | "environmentVariables": {
22 | "ASPNETCORE_ENVIRONMENT": "Development"
23 | },
24 | "applicationUrl": "http://localhost:51400/"
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/src/Dto/Purchasing/PurchaseReceipt.cs:
--------------------------------------------------------------------------------
1 | namespace Dto.Purchasing
2 | {
3 | public class PurchaseReceipt : BaseDto
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/Dto/Purchasing/Vendor.cs:
--------------------------------------------------------------------------------
1 | using Dto.Common;
2 | using System.ComponentModel.DataAnnotations;
3 | using System;
4 |
5 | namespace Dto.Purchasing
6 | {
7 | public class Vendor : BaseDto
8 | {
9 | public string No { get; set; }
10 | [Required]
11 | public string Name { get; set; }
12 | public string Email { get; set; }
13 | public string Website { get; set; }
14 | public string Phone { get; set; }
15 | public string Fax { get; set; }
16 | public int? AccountsPayableAccountId { get; set; }
17 | public int? PurchaseAccountId { get; set; }
18 | public int? PurchaseDiscountAccountId { get; set; }
19 | public int? PaymentTermId { get; set; }
20 | public int? TaxGroupId { get; set; }
21 | public decimal Balance { get; set; }
22 | public string Contact { get; set; }
23 | public string TaxGroup { get; set; }
24 | public Contact PrimaryContact { get; set; }
25 |
26 | public Vendor()
27 | {
28 | PrimaryContact = new Contact();
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/Dto/Sales/CreateCustomer.cs:
--------------------------------------------------------------------------------
1 | namespace Dto.Sales
2 | {
3 | public class CreateCustomer
4 | {
5 | public string Name { get; set; }
6 | public string Phone { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Dto/Sales/Customer.cs:
--------------------------------------------------------------------------------
1 | using Dto.Common;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.DataAnnotations;
4 |
5 | namespace Dto.Sales
6 | {
7 | public class Customer : BaseDto
8 | {
9 | public string No { get; set; }
10 | [Required]
11 | public string Name { get; set; }
12 | public string Email { get; set; }
13 | public string Website { get; set; }
14 | public string Phone { get; set; }
15 | public string Fax { get; set; }
16 |
17 | public int? AccountsReceivableId { get; set; }
18 | public int? SalesAccountId { get; set; }
19 | public int? PrepaymentAccountId { get; set; }
20 | public int? SalesDiscountAccountId { get; set; }
21 | public int? TaxGroupId { get; set; }
22 | public int? PaymentTermId { get; set; }
23 | public decimal Balance { get; set; }
24 | public string Contact { get; set; }
25 | public string TaxGroup { get; set; }
26 | public Contact PrimaryContact { get; set; }
27 | public IEnumerable Invoices { get; set; }
28 |
29 | public Customer() {
30 | PrimaryContact = new Contact();
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/Dto/Sales/MonthlySales.cs:
--------------------------------------------------------------------------------
1 | namespace Dto.Sales
2 | {
3 | public class MonthlySales
4 | {
5 | public string Month { get; set; }
6 | public decimal Amount { get; set; }
7 |
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Dto/Sales/SalesDelivery.cs:
--------------------------------------------------------------------------------
1 | namespace Dto.Sales
2 | {
3 | public class SalesDelivery
4 | {
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/Dto/Sales/SalesReceipt.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Dto.Sales
4 | {
5 | public class SalesReceipt : BaseDto
6 | {
7 | public string ReceiptNo { get; set; }
8 | public int CustomerId { get; set; }
9 | public string CustomerName { get; set; }
10 | public decimal Amount { get; set; }
11 | public decimal RemainingAmountToAllocate { get; set; }
12 | public int AccountToDebitId { get; set; }
13 | public string AccountToDebit { get; set; }
14 | public int GeneralLedgerHederId { get; set; }
15 | public DateTime ReceiptDate { get; set; }
16 | public string ReferenceNo { get; set; }
17 | }
18 |
19 | public class SalesReceiptLine : BaseDto
20 | {
21 | public int AccountToCreditId { get; set; }
22 | public string AccountToCredit { get; set; }
23 | public decimal Amount { get; set; }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/Dto/Security/Group.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Dto.Security
4 | {
5 | public class Group : BaseDto
6 | {
7 | public string Name { get; set; }
8 | public string DisplayName { get; set; }
9 | public IList Permissions { get; set; }
10 |
11 | public Group()
12 | {
13 | Permissions = new List();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/Dto/Security/Permission.cs:
--------------------------------------------------------------------------------
1 | namespace Dto.Security
2 | {
3 | public class Permission : BaseDto
4 | {
5 | public string Name { get; set; }
6 | public string DisplayName { get; set; }
7 | public Group Group { get; set; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Dto/Security/Role.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Dto.Security
4 | {
5 | public class Role : BaseDto
6 | {
7 | public string Name { get; set; }
8 | public string DisplayName { get; set; }
9 | public bool SysAdmin { get; set; }
10 | public IList Users { get; set; }
11 | public IList Permissions { get; set; }
12 |
13 | public Role()
14 | {
15 | Permissions = new List();
16 | Users = new List();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Dto/Security/User.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Dto.Security
4 | {
5 | public class User : BaseDto
6 | {
7 | public string FirstName { get; set; }
8 | public string LastName { get; set; }
9 | public string UserName { get; set; }
10 | public string Email { get; set; }
11 | public IList Roles { get; set; }
12 | public bool SysAdmin { get { return IsSystemAdministrators(); } }
13 |
14 | public User()
15 | {
16 | Roles = new List();
17 | }
18 |
19 | private bool IsSystemAdministrators()
20 | {
21 | foreach (var role in Roles)
22 | if (role.SysAdmin)
23 | return true;
24 | return false;
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Dto/TaxSystem/ItemTaxGroup.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Dto.TaxSystem
4 | {
5 | public class ItemTaxGroup : BaseDto
6 | {
7 | public string Name { get; set; }
8 | public bool IsFullyExempt { get; set; }
9 | public IList Taxes { get; set; }
10 |
11 | public ItemTaxGroup() {
12 | Taxes = new List();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Dto/TaxSystem/ItemTaxGroupTax.cs:
--------------------------------------------------------------------------------
1 | namespace Dto.TaxSystem
2 | {
3 | public class ItemTaxGroupTax : BaseDto
4 | {
5 | public int TaxId { get; set; }
6 | public int ItemTaxGroupId { get; set; }
7 | public bool IsExempt { get; set; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Dto/TaxSystem/Tax.cs:
--------------------------------------------------------------------------------
1 | namespace Dto.TaxSystem
2 | {
3 | public class Tax : BaseDto
4 | {
5 | public string TaxName { get; set; }
6 | public string TaxCode { get; set; }
7 | public decimal Rate { get; set; }
8 | public bool IsActive { get; set; }
9 | }
10 |
11 | public class TaxSystemDto {
12 | public System.Collections.Generic.IEnumerable Taxes { get; set; }
13 | public System.Collections.Generic.IEnumerable TaxGroups { get; set; }
14 | public System.Collections.Generic.IEnumerable ItemTaxGroups { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/Dto/TaxSystem/TaxGroup.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Dto.TaxSystem
4 | {
5 | public class TaxGroup : BaseDto
6 | {
7 | public string Description { get; set; }
8 | public bool TaxAppliedToShipping { get; set; }
9 | public bool IsActive { get; set; }
10 | public IList Taxes { get; set; }
11 |
12 | public TaxGroup() {
13 | Taxes = new List();
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/Dto/TaxSystem/TaxGroupTax.cs:
--------------------------------------------------------------------------------
1 | namespace Dto.TaxSystem
2 | {
3 | public class TaxGroupTax : BaseDto
4 | {
5 | public int TaxId { get; set; }
6 | public int TaxGroupId { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/GoodBooksReact/.babelec.json:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | "@babel/preset-env",
4 | "@babel/preset-react",
5 | "@babel/preset-env",
6 | "@babel/preset-react"
7 | ],
8 | "plugins": [
9 | "@babel/plugin-transform-runtime",
10 | "@babel/plugin-transform-object-assign",
11 | [
12 | "@babel/plugin-proposal-decorators",
13 | {
14 | "legacy": true
15 | }
16 | ],
17 | ["@babel/plugin-proposal-class-properties", { "loose": true }]
18 | ]
19 | }
--------------------------------------------------------------------------------
/src/GoodBooksReact/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: { browser: true, es2020: true },
4 | extends: [
5 | 'eslint:recommended',
6 | 'plugin:@typescript-eslint/recommended',
7 | 'plugin:react-hooks/recommended',
8 | ],
9 | ignorePatterns: ['dist', '.eslintrc.cjs'],
10 | parser: '@typescript-eslint/parser',
11 | plugins: ['react-refresh'],
12 | rules: {
13 | 'react-refresh/only-export-components': [
14 | 'warn',
15 | { allowConstantExport: true },
16 | ],
17 | "@typescript-eslint/no-explicit-any": "error"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/GoodBooksReact/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
--------------------------------------------------------------------------------
/src/GoodBooksReact/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite + React + TS
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/GoodBooksReact/public/staticwebapp.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationFallback": {
3 | "rewrite": "index.html",
4 | "exclude": ["/static/media/*.{png,jpg,jpeg,gif,bmp}", "/static/css/*"]
5 | },
6 | "mimeTypes": {
7 | ".json": "text/json"
8 | }
9 | }
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/App.tsx:
--------------------------------------------------------------------------------
1 | // import Heading from "./components/Heading"
2 | // import Section from "./components/Section"
3 | // import Counter from "./components/Counter"
4 | // import List from "./components/List"
5 | // import Home from "./components/Home/Index"
6 | import { Outlet } from "react-router"
7 | import Home from "./components/Home/Index"
8 |
9 | // https://www.youtube.com/watch?v=G7UzhrNX60o
10 |
11 | function App() {
12 |
13 | return (
14 | <>
15 |
16 |
17 | >
18 | )
19 | }
20 |
21 | export default App
22 |
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Counter.tsx:
--------------------------------------------------------------------------------
1 | import { useState } from "react"
2 |
3 | const Counter = () => {
4 | const [count, setCount] = useState(1)
5 | return(
6 | <>
7 | Count is {count}
8 |
9 |
10 |
11 | >
12 | )
13 | }
14 |
15 | export default Counter
16 |
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Heading.tsx:
--------------------------------------------------------------------------------
1 | import { ReactElement } from "react"
2 |
3 | type HeadingProps = {title: string}
4 |
5 | const Heading = ({title}: HeadingProps): ReactElement => {
6 | return(
7 |
8 |
{title}
9 |
10 | )
11 | }
12 |
13 | export default Heading
14 |
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/List.tsx:
--------------------------------------------------------------------------------
1 | import { ReactNode } from "react"
2 |
3 | interface ListProps {
4 | items: T[],
5 | render: (item: T) => ReactNode
6 | }
7 |
8 | const List = ({items, render}: ListProps) => {
9 | return(
10 |
11 |
12 | {items.map((item, index) => (
13 | -
14 | {render(item)}
15 |
16 | ))}
17 |
18 |
19 | )
20 | }
21 |
22 | export default List
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Section.tsx:
--------------------------------------------------------------------------------
1 | import { ReactNode } from "react"
2 |
3 | type SectionProps = {
4 | title?: string,
5 | children: ReactNode
6 | }
7 |
8 | const Section = ({title = "My subheading", children}: SectionProps) => {
9 | return(
10 |
11 |
{title}
12 |
{children}
13 |
14 | )
15 | }
16 |
17 | export default Section
18 |
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Shared/Components/SelectAccount.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import {observer} from "mobx-react";
3 |
4 | class SelectVoucherType extends React.Component{
5 | onChangeAccount(e: any) {
6 | if (this.props.row !== undefined)
7 | this.props.store.updateLineItem(this.props.row, "accountId", e.target.value);
8 | }
9 | render() {
10 | const options: JSX.Element[] = [];
11 | this.props.store.commonStore.accounts.map(function (account: any) {
12 | return (
13 | options.push()
14 | );
15 | });
16 |
17 | return (
18 |
22 | );
23 | }
24 | }
25 | const ObservedSelectVoucherType = observer(SelectVoucherType);
26 |
27 | export default ObservedSelectVoucherType;
28 |
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Shared/Components/SelectDebitCredit.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import {observer} from "mobx-react";
3 |
4 | class SelectDebiCredit extends React.Component{
5 | onChangeDebitCredit(e: any) {
6 | if (this.props.row !== undefined)
7 | this.props.store.updateLineItem(this.props.row, "drcr", e.target.value);
8 | }
9 | render() {
10 | const options: JSX.Element[] = [];
11 | options.push();
12 | options.push();
13 |
14 | return (
15 |
19 | );
20 | }
21 | }
22 | const ObservedSelectDebiCredit = observer(SelectDebiCredit);
23 |
24 | export default ObservedSelectDebiCredit;
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Shared/Components/SelectLineMeasurement.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import {observer} from "mobx-react";
3 |
4 | class SelectLineMeasurement extends React.Component{
5 | onChangeMeasurement(e: any) {
6 | if (this.props.row !== undefined)
7 | this.props.store.updateLineItem(this.props.row, "measurementId", e.target.value);
8 | }
9 | render() {
10 | const options: JSX.Element[] = [];
11 | this.props.store.commonStore.measurements.map(function (measurement: any) {
12 | return (
13 | options.push()
14 | );
15 | });
16 |
17 | return (
18 |
22 | );
23 | }
24 | }
25 | const ObservedSelectLineMeasurement = observer(SelectLineMeasurement);
26 |
27 | export default ObservedSelectLineMeasurement;
28 |
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Shared/Components/SelectPaymentTerm.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import {observer} from "mobx-react";
3 |
4 | class SelectPaymentTerm extends React.Component{
5 | onChangePaymentTerm(e: any) {
6 | this.props.store.changedPaymentTerm(e.target.value);
7 | }
8 |
9 | render() {
10 | const options: JSX.Element[] = [];
11 | this.props.store.commonStore.paymentTerms.map(function (term: any) {
12 | return (
13 | options.push()
14 | );
15 | });
16 |
17 | return (
18 |
22 | );
23 | }
24 | }
25 | const ObservedSelectPaymentTerm = observer(SelectPaymentTerm);
26 |
27 | export default ObservedSelectPaymentTerm;
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Shared/Components/SelectQuotationStatus.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import {observer} from "mobx-react";
3 |
4 | class SelectQuotationStatus extends React.Component {
5 | onChangeQuoteStatus(e: any) {
6 | this.props.store.changedQuoteStatus(e.target.value);
7 | }
8 |
9 | render() {
10 | const options: React.ReactNode[] = [];
11 | this.props.store.commonStore.salesQuotationStatus.map(function (item: any) {
12 | return (
13 | options.push()
14 | );
15 | });
16 |
17 | return (
18 |
19 |
23 | );
24 |
25 | }
26 | }
27 | const ObservedSelectQuotationStatus = observer(SelectQuotationStatus);
28 |
29 | export default ObservedSelectQuotationStatus;
30 |
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Shared/Config/index.tsx:
--------------------------------------------------------------------------------
1 | const Config = {
2 | API_URL: `http://localhost:8001/api/`,
3 | };
4 |
5 | export default Config;
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Shared/Stores/AppState.tsx:
--------------------------------------------------------------------------------
1 | export default class AppState {
2 | }
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Shared/Stores/Financials/JournalEntry.tsx:
--------------------------------------------------------------------------------
1 | import JournalEntryLine from "./JournalEntryLine";
2 |
3 | export default class JournalEntry {
4 | id: number;
5 | voucherType: number = 0;
6 | journalDate: Date = new Date();
7 | referenceNo: string = "";
8 | memo: string = "";
9 | posted: boolean;
10 | readyForPosting: boolean;
11 | journalEntryLines: JournalEntryLine[] = [];
12 |
13 | constructor() {
14 | this.id = 0;
15 | this.posted = false;
16 | this.readyForPosting = false;
17 | }
18 | }
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Shared/Stores/Financials/JournalEntryLine.tsx:
--------------------------------------------------------------------------------
1 | export default class JournalEntryLine {
2 | id: number = 0;
3 | accountId: number = 0;
4 | drcr: number = 0;
5 | amount: number = 0;
6 | memo: string = "";
7 |
8 | constructor(id: number, accountId: number, drcr: number, amount: number, memo: string) {
9 | this.id = id;
10 | this.accountId = accountId;
11 | this.drcr = drcr;
12 | this.amount = amount;
13 | this.memo = memo;
14 | }
15 | }
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Shared/Stores/Financials/JournalEntryUIStore.tsx:
--------------------------------------------------------------------------------
1 | import JournalEntryStore from "./JournalEntryStore";
2 |
3 | export default class JournalEntryUIStore {
4 | store;
5 |
6 | constructor(store: JournalEntryStore) {
7 | this.store = store;
8 | }
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Shared/Stores/Purchasing/PurchaseInvoice.tsx:
--------------------------------------------------------------------------------
1 | import PurchaseInvoiceLine from "./PurchaseInvoiceLine";
2 |
3 | export default class PurchaseInvoice {
4 | id: number = 0;
5 | fromPurchaseOrderId: number = 0;
6 | vendorId: number = 0;
7 | invoiceDate: Date = new Date();
8 | paymentTermId: number = 0;
9 | referenceNo: string = "";
10 | posted: boolean = false;
11 | readyForPosting: boolean = false;
12 | purchaseInvoiceLines: PurchaseInvoiceLine[] = [];
13 | statusId: number = 0;
14 |
15 | constructor() {
16 | this.id = 0;
17 | this.posted = false;
18 | this.readyForPosting = false;
19 |
20 | }
21 | }
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Shared/Stores/Purchasing/PurchaseInvoiceLine.tsx:
--------------------------------------------------------------------------------
1 | export default class PurchaseInvoiceLine {
2 | id: number = 0;
3 | itemId: number;
4 | measurementId: number;
5 | quantity: number;
6 | amount: number;
7 | discount: number;
8 | remainingQtyToInvoice: number;
9 | code: string;
10 |
11 | constructor(id: number, itemId: number, measurementId: number,
12 | quantity: number, amount: number, discount: number, code: string) {
13 | this.id = id;
14 | this.itemId = itemId;
15 | this.measurementId = measurementId;
16 | this.quantity = quantity;
17 | this.amount = amount;
18 | this.discount = discount;
19 | this.remainingQtyToInvoice = quantity;
20 | this.code = code;
21 | }
22 | }
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Shared/Stores/Purchasing/PurchaseOrder.tsx:
--------------------------------------------------------------------------------
1 | import PurchaseOrderLine from "./PurchaseOrderLine";
2 |
3 | export default class PurchaseOrder {
4 | id: number = 0;
5 | vendorId: number = 0;
6 | orderDate: Date = new Date();
7 | paymentTermId: number = 0;
8 | referenceNo: string = "";
9 | statusId: number = 0;
10 | purchaseOrderLines: PurchaseOrderLine[] = [];
11 | }
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Shared/Stores/Purchasing/PurchaseOrderLine.tsx:
--------------------------------------------------------------------------------
1 | export default class PurchaseOrderLine {
2 | id = 0;
3 | itemId: number;
4 | measurementId: number;
5 | quantity: number;
6 | amount: number;
7 | discount: number;
8 | code: string;
9 |
10 | constructor(id: number, itemId: number, measurementId: number, quantity: number, amount: number, discount: number, code: string) {
11 | this.id = id;
12 | this.itemId = itemId;
13 | this.measurementId = measurementId;
14 | this.quantity = quantity;
15 | this.amount = amount;
16 | this.discount = discount;
17 | this.code = code;
18 | }
19 | }
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Shared/Stores/Quotations/SalesQuotation.tsx:
--------------------------------------------------------------------------------
1 | import SalesQuotationLine from "./SalesQuotationLine";
2 |
3 | export default class SalesQuotation {
4 | id: number = 0;
5 | customerId: number = 0;
6 | quotationDate: Date = new Date();
7 | paymentTermId: number = 0;
8 | referenceNo: string = "";
9 | statusId: number = 0;
10 | salesQuotationLines: SalesQuotationLine[] = [];
11 | }
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Shared/Stores/Quotations/SalesQuotationLine.tsx:
--------------------------------------------------------------------------------
1 | export default class SalesQuotationLine {
2 | id: number = 0;
3 | itemId: number = 0;
4 | measurementId: number = 0;
5 | quantity: number = 0;
6 | amount: number = 0;
7 | discount: number = 0;
8 | code: number = 0;
9 |
10 | constructor(id: number, itemId: number, measurementId: number,
11 | quantity: number, amount: number, discount: number, code: number) {
12 |
13 | this.id = id;
14 | this.itemId = itemId;
15 | this.measurementId = measurementId;
16 | this.quantity = quantity;
17 | this.amount = amount;
18 | this.discount = discount;
19 | this.code = code;
20 | }
21 | }
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Shared/Stores/Sales/SalesInvoice.tsx:
--------------------------------------------------------------------------------
1 | import SalesInvoiceLine from "./SalesInvoiceLine";
2 |
3 | export default class SalesInvoice {
4 | id: number;
5 | fromSalesOrderId: number = 0;
6 | customerId: number = 0;
7 | invoiceDate: Date = new Date();
8 | paymentTermId: number = 0;
9 | referenceNo: string= "";
10 | posted: boolean;
11 | readyForPosting: boolean;
12 | salesInvoiceLines: SalesInvoiceLine[] = [];
13 |
14 | constructor() {
15 | this.id = 0;
16 | this.posted = false;
17 | this.readyForPosting = false;
18 |
19 | }
20 | }
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Shared/Stores/Sales/SalesInvoiceLine.tsx:
--------------------------------------------------------------------------------
1 | export default class SalesInvoiceLine {
2 | id: number = 0;
3 | itemId: number = 0;
4 | measurementId: number = 0;
5 | quantity: number = 0;
6 | amount: number = 0;
7 | discount: number = 0;
8 | remainingQtyToInvoice: number = 0;
9 | code: string = "";
10 |
11 | constructor(id: number, itemId: number, measurementId: number, quantity: number, amount: number, discount: number, code: string) {
12 | this.id = id;
13 | this.itemId = itemId;
14 | this.measurementId = measurementId;
15 | this.quantity = quantity;
16 | this.amount = amount;
17 | this.discount = discount;
18 | this.remainingQtyToInvoice = quantity;
19 | this.code = code;
20 | }
21 | }
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Shared/Stores/Sales/SalesOrder.tsx:
--------------------------------------------------------------------------------
1 | import SalesOrderLine from "./SalesOrderLine";
2 |
3 | export default class SalesOrder {
4 | id: number = 0;
5 | customerId: number = 0;
6 | orderDate: Date = new Date();
7 | paymentTermId: number = 0;
8 | referenceNo: string = "";
9 | statusId: number = 0;
10 | quotationId: number = 0;
11 | salesOrderLines: SalesOrderLine[] = [];
12 | }
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Shared/Stores/Sales/SalesOrderLine.tsx:
--------------------------------------------------------------------------------
1 | export default class SalesOrderLine {
2 | id: number = 0;
3 | itemId: number = 0;
4 | measurementId: number = 0;
5 | quantity: number = 0;
6 | amount: number = 0;
7 | discount: number = 0;
8 | code: string = "";
9 |
10 | constructor(id: number, itemId: number, measurementId: number, quantity: number, amount: number, discount: number, code: string) {
11 | this.id = id;
12 | this.itemId = itemId;
13 | this.measurementId = measurementId;
14 | this.quantity = quantity;
15 | this.amount = amount;
16 | this.discount = discount;
17 | this.code = code;
18 | }
19 | }
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Shared/Stores/TaxSystem/Tax.tsx:
--------------------------------------------------------------------------------
1 | export default class SalesOrder {
2 | id: number = 0;
3 | code: string = '';
4 | name: string = '';
5 | rate: number = 0;
6 | }
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Shared/Stores/TaxSystem/TaxConfigStore.tsx:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/Test/Hello.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 | import * as ReactDOM from "react-dom";
3 |
4 | interface HelloProps {
5 | name: string;
6 | }
7 |
8 | class Hello extends React.Component> {
9 | render() {
10 | return Hello, {this.props.name}. If you can see this message means you have successfully configured reactjs+typescript+webpack+babel-loader.
;
11 | }
12 | }
13 |
14 | ReactDOM.render(
15 | ,
16 | document.getElementById("greeting")
17 | );
18 |
19 | export default Hello;
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/components/src/@types/index.d.ts.delete:
--------------------------------------------------------------------------------
1 | // Fixes TS2694
2 | declare global {
3 | namespace React {
4 | /** Fixes React 18 compatibility issues with formik: https://github.com/jaredpalmer/formik/issues/3546#issuecomment-1127014775 */
5 | type StatelessComponent = React.FunctionComponent
;
6 | }
7 | }
8 |
9 | // Fixes TS2669
10 | export {};
11 |
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/main.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom/client'
3 | // import App from './App.tsx'
4 | import './index.css'
5 | import { RouterProvider } from 'react-router'
6 | import {router} from './routes/Routes'
7 | import "bootstrap/dist/css/bootstrap.min.css";
8 | import "bootstrap/dist/js/bootstrap.min.js";
9 |
10 | ReactDOM.createRoot(document.getElementById('root')!).render(
11 |
12 |
13 | ,
14 | )
15 |
--------------------------------------------------------------------------------
/src/GoodBooksReact/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/src/GoodBooksReact/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "useDefineForClassFields": true,
5 | "lib": ["ES2020", "DOM", "DOM.Iterable"],
6 | "module": "ESNext",
7 | "skipLibCheck": true,
8 |
9 | /* Bundler mode */
10 | "moduleResolution": "bundler",
11 | "allowImportingTsExtensions": true,
12 | "resolveJsonModule": true,
13 | "isolatedModules": true,
14 | "noEmit": true,
15 | "jsx": "react-jsx",
16 |
17 | /* Linting */
18 | "strict": true,
19 | "noUnusedLocals": true,
20 | "noUnusedParameters": true,
21 | "noFallthroughCasesInSwitch": true
22 | },
23 | "include": ["src"],
24 | "references": [{ "path": "./tsconfig.node.json" }],
25 | "exclude": [
26 | "node_modules"
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/src/GoodBooksReact/tsconfig.node.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "composite": true,
4 | "skipLibCheck": true,
5 | "module": "ESNext",
6 | "moduleResolution": "bundler",
7 | "allowSyntheticDefaultImports": true
8 | },
9 | "include": ["vite.config.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/src/GoodBooksReact/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite'
2 | import react from '@vitejs/plugin-react'
3 |
4 | // https://vitejs.dev/config/
5 | export default defineConfig({
6 | plugins: [react()],
7 | })
8 |
--------------------------------------------------------------------------------
/src/Infrastructure/AssemblyLoader/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 |
4 | namespace Infrastructure.AssemblyLoader
5 | {
6 | public abstract class AssemblyInfo : IAssemblyInfo
7 | {
8 | #region Private member variables
9 | private readonly string _name;
10 | private readonly Version _version;
11 | private readonly Assembly _assembly;
12 | #endregion
13 |
14 | #region Public properties
15 | public string Name => this._name;
16 | public Version Version => this._version;
17 | public Assembly Assembly => this._assembly;
18 | #endregion
19 |
20 | #region Ctor
21 | public AssemblyInfo(string name, Version version, Assembly assembly = null)
22 | {
23 | this._name = name;
24 | this._version = version;
25 | this._assembly = assembly;
26 | }
27 |
28 | public abstract AssemblyInfo SetAssembly(Assembly assembly);
29 | #endregion
30 | }
31 | }
--------------------------------------------------------------------------------
/src/Infrastructure/AssemblyLoader/Constants.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 |
3 | namespace Infrastructure.AssemblyLoader
4 | {
5 | public static class Constants
6 | {
7 | public static string CodeBaseRootPath;
8 | public static string ModuleManifestFile => "module.json";
9 | public static string ModulesFolder => Path.Combine(Constants.CodeBaseRootPath, "modules");
10 | public static string HostModulesManifestFile => Path.Combine(Constants.CodeBaseRootPath, ModulesJsonFile);
11 | public static string ModulesJsonFile => "modules.json";
12 | public static string PluginsJsonFile => "plugins.json";
13 | }
14 | }
--------------------------------------------------------------------------------
/src/Infrastructure/AssemblyLoader/CustomAssemblyLoadContext.cs:
--------------------------------------------------------------------------------
1 |
2 | using System.Reflection;
3 | using System.Runtime.Loader;
4 |
5 | namespace Infrastructure.AssemblyLoader
6 | {
7 | public class CustomAssemblyLoadContext : AssemblyLoadContext
8 | {
9 | protected override Assembly Load(AssemblyName assemblyName)
10 | {
11 | return Assembly.Load(assemblyName);
12 | }
13 | public static (CustomAssemblyLoadContext, Assembly) CreateContext(string assemblyPath)
14 | {
15 | var context = new CustomAssemblyLoadContext();
16 | var assembly = context.LoadFromAssemblyPath(assemblyPath);
17 | return (context, assembly);
18 | }
19 |
20 | public static (CustomAssemblyLoadContext, Assembly, T) CreateContext(string assemblyPath, string typeName)
21 | {
22 | var (customAssemblyLoadContext, assembly) = CreateContext(assemblyPath);
23 | T obj = (T)assembly.CreateInstance(typeName);
24 | return (customAssemblyLoadContext, assembly, obj);
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/src/Infrastructure/AssemblyLoader/IAssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 |
4 | namespace Infrastructure.AssemblyLoader
5 | {
6 | public interface IAssemblyInfo
7 | {
8 | string Name { get; }
9 | Version Version { get; }
10 | Assembly Assembly { get; }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/Infrastructure/IStartup.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Builder;
2 | using Microsoft.Extensions.Configuration;
3 | using Microsoft.Extensions.DependencyInjection;
4 |
5 | namespace Infrastructure
6 | {
7 | ///
8 | /// Abstraction to use by modules and plugins.
9 | ///
10 | public interface IStartup
11 | {
12 | void ConfigureServices(IServiceCollection services, IConfiguration configuration = null);
13 | void Configure(IApplicationBuilder application);
14 | }
15 | }
--------------------------------------------------------------------------------
/src/Infrastructure/Infrastructure.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.1
5 | Library
6 | true
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/Infrastructure/Module/ModuleConfig.cs:
--------------------------------------------------------------------------------
1 | namespace Infrastructure.Module
2 | {
3 | public class ModuleConfig
4 | {
5 |
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Infrastructure/Module/ModuleDescriptor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using Infrastructure.AssemblyLoader;
4 |
5 | namespace Infrastructure.Module
6 | {
7 | public sealed class ModuleDescriptor : AssemblyInfo
8 | {
9 | #region Ctor
10 | public ModuleDescriptor(string name, Version version, Assembly assembly = null) : base (name, version, assembly)
11 | {
12 | }
13 |
14 | public override AssemblyInfo SetAssembly(Assembly assembly)
15 | {
16 | return new ModuleDescriptor(this.Name, this.Version, assembly);
17 | }
18 | #endregion
19 | }
20 | }
--------------------------------------------------------------------------------
/src/Infrastructure/Module/ModuleLoader.cs:
--------------------------------------------------------------------------------
1 | namespace Infrastructure.Module
2 | {
3 | public class ModuleLoader
4 | {
5 |
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Infrastructure/Module/ModuleManager.cs:
--------------------------------------------------------------------------------
1 | namespace Infrastructure.Module
2 | {
3 | public class ModuleManager
4 | {
5 |
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Infrastructure/Plugin/PluginDescriptor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Reflection;
3 | using Infrastructure.AssemblyLoader;
4 |
5 | namespace Infrastructure.Plugin
6 | {
7 | public sealed class PluginDescriptor : AssemblyInfo
8 | {
9 | #region Ctor
10 | public PluginDescriptor(string name, Version version, Assembly assembly = null) : base (name, version, assembly)
11 | {
12 | }
13 |
14 | public override AssemblyInfo SetAssembly(Assembly assembly)
15 | {
16 | return new PluginDescriptor(this.Name, this.Version, assembly);
17 | }
18 | #endregion
19 | }
20 | }
--------------------------------------------------------------------------------
/src/Modules/SampleModule/Controllers/SampleModuleController.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc;
2 |
3 | namespace SampleModule.Controllers
4 | {
5 | [Microsoft.AspNetCore.Authorization.Authorize]
6 | public class SampleModuleController : Controller
7 | {
8 | public IActionResult Index() => View();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Modules/SampleModule/Models/ErrorViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace SampleModule.Models
4 | {
5 | public class ErrorViewModel
6 | {
7 | public string RequestId { get; set; }
8 |
9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Modules/SampleModule/SampleModule.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/Modules/SampleModule/Views/SampleModule/Index.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Sample Module";
3 | }
4 |
5 | Hello Sample Module!
6 |
--------------------------------------------------------------------------------
/src/Modules/SampleModule/wwwroot/css/site.css:
--------------------------------------------------------------------------------
1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification\
2 | for details on configuring this project to bundle and minify static web assets. */
3 | body {
4 | padding-top: 50px;
5 | padding-bottom: 20px;
6 | }
7 |
8 | /* Wrapping element */
9 | /* Set some basic padding to keep content from hitting the edges */
10 | .body-content {
11 | padding-left: 15px;
12 | padding-right: 15px;
13 | }
14 |
15 | /* Carousel */
16 | .carousel-caption p {
17 | font-size: 20px;
18 | line-height: 1.4;
19 | }
20 |
21 | /* Make .svg files in the carousel display properly in older browsers */
22 | .carousel-inner .item img[src$=".svg"] {
23 | width: 100%;
24 | }
25 |
26 | /* QR code generator */
27 | #qrCode {
28 | margin: 15px;
29 | }
30 |
31 | /* Hide/rearrange for smaller screens */
32 | @media screen and (max-width: 767px) {
33 | /* Hide captions */
34 | .carousel-caption {
35 | display: none;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/Modules/SampleModule/wwwroot/css/site.min.css:
--------------------------------------------------------------------------------
1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}}
--------------------------------------------------------------------------------
/src/Modules/SampleModule/wwwroot/js/site.js:
--------------------------------------------------------------------------------
1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
2 | // for details on configuring this project to bundle and minify static web assets.
3 |
4 | // Write your JavaScript code.
5 |
--------------------------------------------------------------------------------
/src/Modules/SampleModule/wwwroot/js/site.min.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AccountGo/accountgo/4d97beda9473fc9b6a4a3ea0a8b1a8579bfc93f0/src/Modules/SampleModule/wwwroot/js/site.min.js
--------------------------------------------------------------------------------
/src/Services/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:51395/",
7 | "sslPort": 0
8 | }
9 | },
10 | "profiles": {
11 | "IIS Express": {
12 | "commandName": "IISExpress",
13 | "launchBrowser": true,
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | }
17 | },
18 | "Services": {
19 | "commandName": "Project",
20 | "launchBrowser": true,
21 | "environmentVariables": {
22 | "ASPNETCORE_ENVIRONMENT": "Development"
23 | },
24 | "applicationUrl": "http://localhost:51397/"
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/src/Services/Services.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | Library
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/test/Module.Tests/Module.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.1
5 | false
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/test/Module.Tests/SampleModulesRefs.targets:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
15 |
16 |
--------------------------------------------------------------------------------
/test/Module.Tests/modules.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name": "SampleNetStandard20",
4 | "version": "0.0.1"
5 | }
6 | ]
--------------------------------------------------------------------------------
/test/SampleModules/SampleNetStandard20/Class1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Infrastructure;
3 | using Microsoft.AspNetCore.Builder;
4 | using Microsoft.Extensions.Configuration;
5 | using Microsoft.Extensions.DependencyInjection;
6 |
7 |
8 | namespace SampleNetStandard20
9 | {
10 | public class Class1 : IStartup
11 | {
12 | public static string GetString() => "Hello, World!";
13 |
14 | public void ConfigureServices(IServiceCollection services, IConfiguration configuration = null)
15 | {
16 | }
17 |
18 | public void Configure(IApplicationBuilder application)
19 | {
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/test/SampleModules/SampleNetStandard20/SampleNetStandard20.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.1
5 | Library
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/test/SampleModules/SampleNetStandard20/module.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "SampleNetStandard20",
3 | "version": "0.0.1"
4 | }
--------------------------------------------------------------------------------