Service - CommerceAccounting Sale: Difference between revisions
Jump to navigation
Jump to search
(Created page with "= Overview = Handle sales in one service, and some Accounting entries include the full amount, some break up according to saleLineItems. = Repository = ... = Object Schemas = ; Additional Information: Per Service Schemas <syntaxhighlight lang="JavaScript"> { objectType: "comAccSaleLink", canDelete: false, belongTo: { serviceTag: "User", objectType: "user" }, addOnDataStructure: [], storageResources: { "dynamo": { "storageType": "dynamoDB", "tab...") |
|||
| (8 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
= Overview = | = Overview = | ||
Handle sales in one service, | Handle sales in one service, because some Accounting entries include the full amount, some break up according to saleLineItems. | ||
= Repository = | = Repository = | ||
| Line 15: | Line 15: | ||
canDelete: false, | canDelete: false, | ||
belongTo: { | belongTo: { | ||
serviceTag: " | serviceTag: "ComAccLink", | ||
objectType: " | objectType: "comAccLink" | ||
}, | }, | ||
addOnDataStructure: [], | addOnDataStructure: [], | ||
| Line 38: | Line 38: | ||
* one saleId may link to multiple journalIds, sale value and inventory adjustment entries | * one saleId may link to multiple journalIds, sale value and inventory adjustment entries | ||
* maintains a link between saleId and journalIds, so can adjust if changes made to | * maintains a link between saleId and journalIds, so can adjust if changes made to sale | ||
== Relationships == | == Relationships == | ||
| Line 46: | Line 46: | ||
= flowSchemas = | = flowSchemas = | ||
== | == saleCommitted == | ||
* when creating a sale, iterate saleLineItems to decide which journal entries are created | * when creating a sale, iterate saleLineItems to decide which journal entries are created | ||
* accountsReceivable accountId will need to come from [[Service - CommerceAccounting Customer]] | |||
=== Sale Value === | === Sale Value === | ||
| Line 55: | Line 56: | ||
*# (debit)accountsReceivable(Asset) | *# (debit)accountsReceivable(Asset) | ||
* The other side (credit) is broken up depending on goods or assets | * The other side (credit) is broken up depending on goods/service or assets | ||
* For goods value an entry is entered into the below | * For goods value an entry is entered into the below | ||
*# (credit) | *# (credit)goodsSale/serviceSale(Revenue) | ||
* Assets have: | * Assets have: | ||
| Line 65: | Line 66: | ||
*# (debit or credit)creditGainOnSale(Renenue)/debitLossOnSale(Expense) | *# (debit or credit)creditGainOnSale(Renenue)/debitLossOnSale(Expense) | ||
* | * Intangible Assets have: | ||
*# (credit)inventoryIntangibleAsset(Asset) | |||
*# (debit)accumulatedAmortization(Asset) | |||
*# (debit or credit)creditGainOnSale(Renenue)/debitLossOnSale(Expense) | |||
* all credit side may have: | |||
*# (credit)salesTaxPayable(Liability) | *# (credit)salesTaxPayable(Liability) | ||
*# (credit)vatPayable(liability) | |||
=== Goods Sold === | === Goods Sold === | ||
| Line 87: | Line 94: | ||
* may need to query ComAcc Inventory service to find link between Commerce Asset and Accounting Asset, so can find depreciation | * may need to query ComAcc Inventory service to find link between Commerce Asset and Accounting Asset, so can find depreciation | ||
== | === Services Sold === | ||
* no additional entries required | |||
=== Intangible Goods Sold === | |||
* no additional entries required | |||
* entries same as physical Goods | |||
=== Intangible Assets === | |||
* same as an Asset, except use the term Amortization instead of Depreciation, which are functionally the same | |||
== saleChange == | |||
* make adjustment to journal entries when saleLineItemId changes | * make adjustment to journal entries when saleLineItemId changes | ||
Latest revision as of 15:22, 21 January 2026
Overview
Handle sales in one service, because some Accounting entries include the full amount, some break up according to saleLineItems.
Repository
...
Object Schemas
- Additional Information
- Per Service Schemas
{
objectType: "comAccSaleLink",
canDelete: false,
belongTo: {
serviceTag: "ComAccLink",
objectType: "comAccLink"
},
addOnDataStructure: [],
storageResources: {
"dynamo": {
"storageType": "dynamoDB",
"tableName": "comAccSaleLink",
}
},
fieldNames: {
// probably have two dynamo tables, one identified by saleId, one by journalId
},
identifiers: [
{
// see above note
}
]
}
- one saleId may link to multiple journalIds, sale value and inventory adjustment entries
- maintains a link between saleId and journalIds, so can adjust if changes made to sale
Relationships
...
flowSchemas
saleCommitted
- when creating a sale, iterate saleLineItems to decide which journal entries are created
- accountsReceivable accountId will need to come from Service - CommerceAccounting Customer
Sale Value
- the total sale value has journal entry for all the below:
- (debit)accountsReceivable(Asset)
- The other side (credit) is broken up depending on goods/service or assets
- For goods value an entry is entered into the below
- (credit)goodsSale/serviceSale(Revenue)
- Assets have:
- (credit)inventoryAsset(Asset)
- (debit)accumulatedDepreciation(Asset)
- (debit or credit)creditGainOnSale(Renenue)/debitLossOnSale(Expense)
- Intangible Assets have:
- (credit)inventoryIntangibleAsset(Asset)
- (debit)accumulatedAmortization(Asset)
- (debit or credit)creditGainOnSale(Renenue)/debitLossOnSale(Expense)
- all credit side may have:
- (credit)salesTaxPayable(Liability)
- (credit)vatPayable(liability)
Goods Sold
- the total saleLineItem value for Inventory Goods has a journal entry for:
- (debit)cogsGoods(Expense)
- (credit)inventoryGoods(Asset)
Raw Material Sold
- the total saleLineItem value for Inventory Raw Materials has a journal entry for:
- (debit)cogsRawMaterial(Expense)
- (credit)inventoryRawMaterial(Asset)
Assets Sold
- might not have accumulatedDepreciation applied yet
- if sold for same amount as original value then not have creditGainOnSale/debitLossOnSale
- will need to query Accounting Assets service for depreciation amount
- may need to query ComAcc Inventory service to find link between Commerce Asset and Accounting Asset, so can find depreciation
Services Sold
- no additional entries required
Intangible Goods Sold
- no additional entries required
- entries same as physical Goods
Intangible Assets
- same as an Asset, except use the term Amortization instead of Depreciation, which are functionally the same
saleChange
- make adjustment to journal entries when saleLineItemId changes
- perhaps handling removal of sale/journal entries, or creation of new entries
- basically re-calculate all entries and check against existing