Service - CommerceAccounting Purchase: Difference between revisions
Jump to navigation
Jump to search
(Created page with "= Overview = Handle purchases in one service, becuase some Accounting entries include the full amount, some break up according to purchaseLineItems. = Repository = ... = Object Schemas = ; Additional Information: Per Service Schemas <syntaxhighlight lang="JavaScript"> { objectType: "comAccPurchaseLink", canDelete: false, belongTo: { serviceTag: "User", objectType: "user" }, addOnDataStructure: [], storageResources: { "dynamo": { "storageType": "dy...") |
|||
| Line 15: | Line 15: | ||
canDelete: false, | canDelete: false, | ||
belongTo: { | belongTo: { | ||
serviceTag: " | serviceTag: "ComAccLink", | ||
objectType: " | objectType: "comAccLink" | ||
}, | }, | ||
addOnDataStructure: [], | addOnDataStructure: [], | ||
Revision as of 15:22, 21 January 2026
Overview
Handle purchases in one service, becuase some Accounting entries include the full amount, some break up according to purchaseLineItems.
Repository
...
Object Schemas
- Additional Information
- Per Service Schemas
{
objectType: "comAccPurchaseLink",
canDelete: false,
belongTo: {
serviceTag: "ComAccLink",
objectType: "comAccLink"
},
addOnDataStructure: [],
storageResources: {
"dynamo": {
"storageType": "dynamoDB",
"tableName": "comAccPurchaseLink",
}
},
fieldNames: {
// probably have two dynamo tables, one identified by purchaseId, one by journalId
},
identifiers: [
{
// see above note
}
]
}
- one purchaseId may link to multiple journalIds, purchase value and inventory adjustment entries
- maintains a link between purchaseId and journalIds, so can adjust if changes made to purchase
Relationships
...
flowSchemas
purchaseCreated
- when creating a purchase, iterate purchaseLineItems to decide which journal entries are created
- accountsPayable accountId will need to come from Service - CommerceAccounting Vendor
Purchase Value
- the total purchase value has journal entry for all the below:
- (credit)accountsPayable(Liability)
- The other side (debit) is broken up depending on lineItem type
- For expenses value an entry is entered into the below
- Maybe classify expenses and have different accounts depending on classification
- (debit)expense(Expense)
- Goods:
- (debit)inventory(Asset)
- Intangible Goods:
- (debit)expense(Expense)
- Services:
- (debit)expense(Expense)
- Assets:
- (debit)inventoryAsset(Asset)
- Intangible Assets have:
- (debit)inventoryIntangibleAsset(Asset)
- all debit side may have:
- (debit)vatReceivable(Asset)
purchaseChange
- make adjustment to journal entries when purchaseLineItemId changes
- perhaps handling removal of purchase/journal entries, or creation of new entries
- basically re-calculate all entries and check against existing